diff --git a/common.mk b/common.mk index 09c259c4d57ed641e16ebe03617f48487df4b91f..46e0e765507753ff067ab62581990b44bb54a33f 100644 --- a/common.mk +++ b/common.mk @@ -339,6 +339,10 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \ frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml +# Tethering +PRODUCT_PACKAGES += \ + TetheringConfigOverlay + # TextClassifier PRODUCT_PACKAGES += \ textclassifier.bundle1 diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index cfe806ea7633fd9c5c14ddb5f1f14682136146b7..1fd56f22981a4fef4ed87dd05b4ffb42260e9431 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -30,62 +30,6 @@ <!-- MMS user agent prolfile url --> <string name="config_mms_user_agent_profile_url">http://www.google.com/oha/rdf/ua-profile-kila.xml</string> - <!-- List of regexpressions describing the interface (if any) that represent tetherable - USB interfaces. If the device doesn't want to support tething over USB this should - be empty. An example would be "usb.*" --> - <string-array name="config_tether_usb_regexs"> - <item>"usb\\d"</item> - <item>"rndis\\d"</item> - </string-array> - - <!-- List of regexpressions describing the interface (if any) that represent tetherable - Wifi interfaces. If the device doesn't want to support tethering over Wifi this - should be empty. An example would be "softap.*" --> - <string-array name="config_tether_wifi_regexs"> - <item>"softap0"</item> - <item>"wlan0"</item> - </string-array> - - <!-- List of regexpressions describing the interface (if any) that represent tetherable - bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this - should be empty. --> - <string-array name="config_tether_bluetooth_regexs"> - <item>"bnep\\d"</item> - <item>"bt-pan"</item> - </string-array> - - <!-- Dhcp range (min, max) to use for tethering purposes --> - <!-- USB is 192.168.42.1 and 255.255.255.0 - Wifi is 192.168.43.1 and 255.255.255.0 - BT is limited to max default of 5 connections. 192.168.44.1 to 192.168.48.1 - with 255.255.255.0 - P2P is 192.168.49.1 and 255.255.255.0 - Wigig is 192.168.50.1 and 255.255.255.0 - Wigig P2P is 192.168.51.1 and 255.255.255.0 - --> - <string-array name="config_tether_dhcp_range"> - <item>192.168.42.2</item> - <item>192.168.42.254</item> - <item>192.168.43.2</item> - <item>192.168.43.254</item> - <item>192.168.44.2</item> - <item>192.168.44.254</item> - <item>192.168.45.2</item> - <item>192.168.45.254</item> - <item>192.168.46.2</item> - <item>192.168.46.254</item> - <item>192.168.47.2</item> - <item>192.168.47.254</item> - <item>192.168.48.2</item> - <item>192.168.48.254</item> - <item>192.168.49.2</item> - <item>192.168.49.254</item> - <item>192.168.50.2</item> - <item>192.168.50.254</item> - <item>192.168.51.2</item> - <item>192.168.51.254</item> - </string-array> - <!-- This string array should be overridden by the device to present a list of network attributes. This is used by the connectivity manager to decide which networks can coexist based on the hardware --> diff --git a/rro_overlays/TetheringOverlay/Android.bp b/rro_overlays/TetheringOverlay/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..17796eef65e5d54ebfda66558b78c556a4beb03a --- /dev/null +++ b/rro_overlays/TetheringOverlay/Android.bp @@ -0,0 +1,22 @@ +// +// Copyright (C) 2020 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. +// + +runtime_resource_overlay { + name: "TetheringConfigOverlay", + resource_dirs: ["res"], + product_specific: true, + sdk_version: "current", +} diff --git a/rro_overlays/TetheringOverlay/AndroidManifest.xml b/rro_overlays/TetheringOverlay/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b220b64b6726603c5e737b1f27ffe78a9b5b080 --- /dev/null +++ b/rro_overlays/TetheringOverlay/AndroidManifest.xml @@ -0,0 +1,11 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.networkstack.tethering.xiaomi_sm6250" + android:versionCode="1" + android:versionName="1.0"> + <application android:hasCode="false" /> + <overlay + android:targetPackage="com.android.networkstack.tethering" + android:targetName="TetheringConfig" + android:isStatic="true" + android:priority="0"/> +</manifest> diff --git a/rro_overlays/TetheringOverlay/res/values/config.xml b/rro_overlays/TetheringOverlay/res/values/config.xml new file mode 100644 index 0000000000000000000000000000000000000000..a04a22da24c3d05b7bf1fdca396b4e5c77a13f14 --- /dev/null +++ b/rro_overlays/TetheringOverlay/res/values/config.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2020, 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:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- List of regexpressions describing the interface (if any) that represent tetherable + USB interfaces. If the device doesn't want to support tething over USB this should + be empty. An example would be "usb.*" --> + <string-array name="config_tether_usb_regexs"> + <item>"usb\\d"</item> + <item>"rndis\\d"</item> + </string-array> + + <!-- List of regexpressions describing the interface (if any) that represent tetherable + Wifi interfaces. If the device doesn't want to support tethering over Wifi this + should be empty. An example would be "softap.*" --> + <string-array name="config_tether_wifi_regexs"> + <item>"softap0"</item> + <item>"wlan0"</item> + </string-array> + + <!-- List of regexpressions describing the interface (if any) that represent tetherable + bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this + should be empty. --> + <string-array name="config_tether_bluetooth_regexs"> + <item>"bnep\\d"</item> + <item>"bt-pan"</item> + </string-array> + + <!-- Dhcp range (min, max) to use for tethering purposes --> + <!-- USB is 192.168.42.1 and 255.255.255.0 + Wifi is 192.168.43.1 and 255.255.255.0 + BT is limited to max default of 5 connections. 192.168.44.1 to 192.168.48.1 + with 255.255.255.0 + P2P is 192.168.49.1 and 255.255.255.0 + Wigig is 192.168.50.1 and 255.255.255.0 + Wigig P2P is 192.168.51.1 and 255.255.255.0 + --> + <string-array name="config_tether_dhcp_range"> + <item>192.168.42.2</item> + <item>192.168.42.254</item> + <item>192.168.43.2</item> + <item>192.168.43.254</item> + <item>192.168.44.2</item> + <item>192.168.44.254</item> + <item>192.168.45.2</item> + <item>192.168.45.254</item> + <item>192.168.46.2</item> + <item>192.168.46.254</item> + <item>192.168.47.2</item> + <item>192.168.47.254</item> + <item>192.168.48.2</item> + <item>192.168.48.254</item> + <item>192.168.49.2</item> + <item>192.168.49.254</item> + <item>192.168.50.2</item> + <item>192.168.50.254</item> + <item>192.168.51.2</item> + <item>192.168.51.254</item> + </string-array> +</resources>