Create ServiceConnectivityResources
Create the ServiceConnectivityResources package, which contains resources Connectivity unbundled from platform resources. Migrate the first few resources from ConnectivityService that have no RRO in AOSP. To avoid boot time impact, avoid loading the resources in the ConnectivityService constructor. Bug: 182125649 Test: atest FrameworksNetTests Change-Id: I77ac6f4303c54acc96f16e18ef02add30298ff3d
This commit is contained in:
@@ -61,6 +61,7 @@ java_library {
|
|||||||
"services.core",
|
"services.core",
|
||||||
"services.net",
|
"services.net",
|
||||||
"unsupportedappusage",
|
"unsupportedappusage",
|
||||||
|
"ServiceConnectivityResources",
|
||||||
],
|
],
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"modules-utils-os",
|
"modules-utils-os",
|
||||||
|
|||||||
35
service/ServiceConnectivityResources/Android.bp
Normal file
35
service/ServiceConnectivityResources/Android.bp
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
//
|
||||||
|
// Copyright (C) 2021 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
|
||||||
|
// APK to hold all the wifi overlayable resources.
|
||||||
|
package {
|
||||||
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||||
|
}
|
||||||
|
|
||||||
|
android_app {
|
||||||
|
name: "ServiceConnectivityResources",
|
||||||
|
sdk_version: "system_current",
|
||||||
|
resource_dirs: [
|
||||||
|
"res",
|
||||||
|
],
|
||||||
|
privileged: true,
|
||||||
|
export_package_resources: true,
|
||||||
|
apex_available: [
|
||||||
|
"com.android.tethering",
|
||||||
|
],
|
||||||
|
// TODO: use a dedicated cert once generated
|
||||||
|
certificate: "platform",
|
||||||
|
}
|
||||||
37
service/ServiceConnectivityResources/AndroidManifest.xml
Normal file
37
service/ServiceConnectivityResources/AndroidManifest.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<!-- Manifest for connectivity resources APK -->
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.android.connectivity.resources"
|
||||||
|
coreApp="true"
|
||||||
|
android:versionCode="1"
|
||||||
|
android:versionName="S-initial">
|
||||||
|
<application
|
||||||
|
android:label="@string/connectivityResourcesAppLabel"
|
||||||
|
android:defaultToDeviceProtectedStorage="true"
|
||||||
|
android:directBootAware="true">
|
||||||
|
<!-- This is only used to identify this app by resolving the action.
|
||||||
|
The activity is never actually triggered. -->
|
||||||
|
<activity android:name="android.app.Activity" android:exported="true" android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.android.server.connectivity.intent.action.SERVICE_CONNECTIVITY_RESOURCES_APK" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
</manifest>
|
||||||
45
service/ServiceConnectivityResources/res/values/config.xml
Normal file
45
service/ServiceConnectivityResources/res/values/config.xml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 The Android Open Source Project
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Configuration values for ConnectivityService
|
||||||
|
DO NOT EDIT THIS FILE for specific device configuration; instead, use a Runtime Resources
|
||||||
|
Overlay package following the overlayable.xml configuration in the same directory:
|
||||||
|
https://source.android.com/devices/architecture/rros -->
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Configuration hook for the URL returned by ConnectivityManager#getCaptivePortalServerUrl.
|
||||||
|
If empty, the returned value is controlled by Settings.Global.CAPTIVE_PORTAL_HTTP_URL,
|
||||||
|
and if that value is empty, the framework will use a hard-coded default.
|
||||||
|
This is *NOT* a URL that will always be used by the system network validation to detect
|
||||||
|
captive portals: NetworkMonitor may use different strategies and will not necessarily use
|
||||||
|
this URL. NetworkMonitor behaviour should be configured with NetworkStack resource overlays
|
||||||
|
instead. -->
|
||||||
|
<!--suppress CheckTagEmptyBody -->
|
||||||
|
<string translatable="false" name="config_networkCaptivePortalServerUrl"></string>
|
||||||
|
|
||||||
|
<!-- The maximum duration (in milliseconds) we expect a network transition to take -->
|
||||||
|
<integer name="config_networkTransitionTimeout">60000</integer>
|
||||||
|
|
||||||
|
<!-- Configuration of network interfaces that support WakeOnLAN -->
|
||||||
|
<string-array translatable="false" name="config_wakeonlan_supported_interfaces">
|
||||||
|
<!--
|
||||||
|
<item>wlan0</item>
|
||||||
|
<item>eth0</item>
|
||||||
|
-->
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<overlayable name="ServiceConnectivityResourcesConfig">
|
||||||
|
<policy type="product|system|vendor">
|
||||||
|
<!-- Configuration values for ConnectivityService -->
|
||||||
|
<item type="string" name="config_networkCaptivePortalServerUrl"/>
|
||||||
|
<item type="integer" name="config_networkTransitionTimeout"/>
|
||||||
|
<item type="array" name="config_wakeonlan_supported_interfaces"/>
|
||||||
|
|
||||||
|
|
||||||
|
</policy>
|
||||||
|
</overlayable>
|
||||||
|
</resources>
|
||||||
22
service/ServiceConnectivityResources/res/values/strings.xml
Normal file
22
service/ServiceConnectivityResources/res/values/strings.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 The Android Open Source Project
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<!-- The System Connectivity Resources package is an internal system package that provides
|
||||||
|
configuration values for system networking that were pre-configured in the device. This
|
||||||
|
is the name of the package to display in the list of system apps. [CHAR LIMIT=40] -->
|
||||||
|
<string name="connectivityResourcesAppLabel">System Connectivity Resources</string>
|
||||||
|
</resources>
|
||||||
Reference in New Issue
Block a user