Commit graph android_packages_modules_Co.../Tethering/AndroidManifest.xml
Message SHA1
Use MANAGE_USERS permission to check for admin user
The current implementation uses MANAGE_USERS, CREATE_USERS, or
QUERY_USERS to check if the user is an admin. However,
QUERY_USERS is not a privileged permission until Android U.
This can cause issues on devices running older Android versions
(e.g., T) where the tethering module requires this check but
doesn't have the necessary permission, leading to crashes.

This change updates the code to use MANAGE_USERS, a privileged
permission since 2015, to reliably determine if the user is
an admin across different Android versions.

Test: Manual on T device:
      1. Mock entitlement and enable hotspot
      2. Check granted permissions of android.uid.networkstack
Fix: 366816004
Change-Id: Iee060f0225d23c62d836f0211c63b649e539f77b

Junyu Lai   commited 2024-10-28 17:31:22 +08:00
f014ae2f2a
Improved Entitlement UI Launch for multiple admin users
This change addresses the launch of entitlement UI activities
in Headless System User Mode (HSUM) on multi-user devices.

HSUM is a configuration where the system user (user 0) does
not represent a human user and primarily runs system services.
In this mode, the first user set up on the device is not user 0.

Modified the EntitlementManager logic to handle the
launch of the entitlement UI in multi-user environments,
specifically addressing scenarios where HSUM is enabled, which
includes:
  1. Always launch the UI to the foreground current user.
  2. Check whether the current user is allowed to show the UI.
This ensures the UI is presented to the appropriate user.

Test: Manual
  1. Mock requires entitlement
  2. adb shell cmd user set-system-user-mode-emulation headless
  3. enable hotspot
Test: atest TetheringTests:EntitlementManagerTest
Fix: 363972541

Change-Id: I950d678741a3f1714f347206fa161bcd7538b402

Junyu Lai   commited 2024-10-21 10:22:42 +08:00
b4a92ff791
Update design to fix non-protected broadcast from system issue
ActivityManager checks if there is any non-protected broadcast
sent from the system to prevent malwares sending the fake intent.
This could be fixed with declaring it as a protected broadcast
which is the current implementation. However, the uid in the
AndroidManifest for tethering is networkstack uid. Though system
only check whether the intent is defined as protected broadcast
or not regardless of where the protected intent is defined, it
is confusing to define the protected intent in tethering
AndroidManifest. Thus, update to alternative way to fulfill
the protection in ActivityManager to declare the required
permission in the broadcast filter and specify the expected
package name of the intent.

Bug: 269383522
Bug: 259000745
Test: atest FrameworksNetTests
Test: manually check no am_wtf log complains sending non-protected
      broadcast from system
Change-Id: I04986aed4fb92f85adcbac8a61665f3f465e2eab

chiachangwang   commited 2023-02-20 02:33:35 +00:00
378fd10aa7
[DK2]Add new SocketKeepalive.start to dynamically control keepalive
Add SocketKeepalive.start with parameter to enable dynamic
keepalive mode based on the existence of TCP connections.

This supports IPSec mode to notify KeepaliveTracker to disable
keepalive when keepalive is unnecessary to improve battery life.

Keepalive is controlled by periodically TCP socket status check
for both enable and disable. This is a transition commit and
is expected to be updated based on the socket creation or
destroy.

Bug: 259000745
Test: m ; atest FrameworksNetTests
Change-Id: Ie4d598d69a73c4931c7d0b6dfde0e459e5dca6b4

chiachangwang   authored and   Chalard Jean   commited 2023-01-20 13:51:20 +09:00
9ef4ffe8d4
Merge "add post_notification permission to manifest"
Steve Elliott   authored and   Android (Google) Code Review   commited 2022-01-27 16:13:17 +00:00
226fbb2559
add post_notification permission to manifest
This will allow the package to continue sending notifications on T+

Ignore-AOSP-First: Permission is not yet publicly announced

Bug: 194833441
Test: build, flash, and boot
Change-Id: I24e28b384bd8f7bd9925e8eb67bf66c7b45fc916

Steve Elliott   commited 2022-01-26 17:50:24 +00:00
677e3d158a
Bump tethering target sdk version to 31
Also add BLUETOOTH_CONNECT permission which is needed for access
PanService if target sdk 31+. The permission would be granted to
privilege application without prompt.

Also remove the min_sdk_version 29 from AndroidManifest because it is
useless that the Android.bp already define min_sdk_version 30.

$aapt dump xmltree TetheringNext.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=19)
    A: android:sharedUserId(0x0101000b)="android.uid.networkstack" (Raw: "android.uid.networkstack")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1f
    A: android:versionName(0x0101021c)="Tiramisu" (Raw: "Tiramisu")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
    A: android:compileSdkVersionCodename(0x01010573)="Tiramisu" (Raw: "Tiramisu")
    A: package="com.android.networkstack.tethering" (Raw: "com.android.networkstack.tethering")
    A: platformBuildVersionCode=(type 0x10)0x1f
    A: platformBuildVersionName="Tiramisu" (Raw: "Tiramisu")
    E: uses-sdk (line=23)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1e
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
    ....
    E: uses-permission (line=35)
      A: android:name(0x01010003)="android.permission.BLUETOOTH_CONNECT" (Raw: "android.permission.BLUETOOTH_CONNECT")

Bug: 204265450
Test: manual testing bluetooth tethering and TH
Change-Id: I6f821020679b9379cada29f6f0816187545a24fb

markchien   authored and   Mark Chien   commited 2022-01-12 07:24:16 +00:00
bf62258f8c
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code
for reference.

Test: m ; atest TetheringTests
Bug: 161896447
Change-Id: Idc58697c72fb00896bee00185fefc50c1a24dd35

Chiachang Wang   commited 2020-07-29 12:05:04 +08:00
14aaefcb12
[TNU05] Add no upstream notification
Reminder user of unavailable tethering status if there is no
internet access.

Bug: 147818698
Test: atest TetheringTests
Change-Id: Ic6557f9f7703337596100cd6a477fd7239217166

paulhu   commited 2020-04-15 01:25:37 +08:00
648fc2c8ea
Change tethering file structure to respect its package name
Bug: 145099347
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: I7401c550fbafd17a5ed2d925b5d0e17e358af467

markchien   authored and   Mark Chien   commited 2020-04-14 02:09:51 +00:00
d995566700
Tethering: Add an exported flag in manifest
With b/150232615, we will need an explicit value set for the exported
flag when intent filters are present, as the default behavior is
changing for S+. This change adds the value reflecting the previous
default to the manifest.

Bug: 150232615
Test: TH
Change-Id: I25b55378df393cd4fb8932b7ae64f97eb9f1aa8e
Merged-In: I25b55378df393cd4fb8932b7ae64f97eb9f1aa8e
(cherry picked from commit dc03d15189)

Ashwini Oruganti   authored and   markchien   commited 2020-04-14 00:08:24 +08:00
910a0b44dd
Give tethering bluetooth privilege permission
Permisssion of PanService#setBluetoothTethering is change from
BLUETOOTH_ADMIN to BLUETOOTH_PRIVILEGED.
Tethering service need bluetooth privilege permission to enable
bluetooth tethering.

Bug: 146045934
Test: on/off bluetooth tethering
Change-Id: Ib87a5d5a5bb49390aa55e52713bb3539d4a52348

markchien   authored and   Mark Chien   commited 2020-03-13 07:06:58 +00:00
db2a16b8c4
[SP06.1] Add UPDATE_DEVICE_STATS permission to Tethering
Add corresponding permission to allow tether offload to update
network usage through new API that requires UPDATE_DEVICE_STATS
permission.

This is the minimum permission that required to update network
usage with the new system api.

Test: atest FrameworksNetTests OffloadControllerTest TetheringTest
Bug: 130855321
Change-Id: I9c0c86e20d4797ea3570feed741be3a07f839c7d

junyulai   authored and   markchien   commited 2020-01-14 20:14:47 +08:00
15d8bb03fe
Migrate legacy dhcp server config to DeviceConfig
Legacy dhcp server can also be enabled by resource config.

Bug: 144814607
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I8ae5fa3d5bbd88129bd0890f71be6f8a1bfec0eb

markchien   authored and   Mark Chien   commited 2020-01-13 15:07:03 +00:00
9a0b95d294
Give tethering TETHER_PRIVILEGED permission
This fix the crash when perform "Reset Wi-Fi,mobile & Bluetooth"

Bug: 146900199
Test: -build, flash, boot
      -atest TetheringTests
      -atest CtsTetheringTest
      -manual perform "Reset Wi-Fi,mobile & Bluetooth"

Change-Id: I036409358ed15a797bdb751bb66513425350d066

markchien   commited 2020-01-10 14:49:24 +08:00
373e5639aa
[Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e

markchien   commited 2019-12-19 20:53:06 +08:00
9d3538260b
Change Tethering package name
".apex" is easy to confuse.
Rename as below:
apex: com.android.tethering.apex -> com.android.tethering
apk: com.android.tethering -> com.android.networkstack.tethering

Bug: 146471733
Test: build

Change-Id: I2c7647abb996539a3af6cfe0e0214a5e8927c0d6
Merged-In: I2c7647abb996539a3af6cfe0e0214a5e8927c0d6

markchien   commited 2019-12-19 13:06:50 +08:00
8f831c09e5
[Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3

markchien   authored and   Mark Chien   commited 2019-11-30 10:03:08 +00:00
ee6ad37837
[Tether01] Add Tethering App
This is initial patch that don't contain any service for now.

Bug: 136040414
Test: -build, flash, boot
Change-Id: I0b49d7e9c3fcba5af3025163f9cc9eafb0778116

markchien   commited 2019-10-24 13:35:41 +08:00
932da868a5