Commit Graph

2765 Commits

Author SHA1 Message Date
markchien
dfd8d235a1 Replace ConnectivityManager as TetheringManager
Tethering APIs are all move to TetheringManager from Android R.
1. Replace ConnectivityManager tethering API usage as TetheringManager.
2. Use TetheringManager#stopTethering to disable usb tethering instead
of using deprecated ConnectivityService#setUsbTethering
3. Use TetheringManager#stopTethering to disable bluetooth tethering
instead of directly use BluetoothPan#setBlueoothTethering. So bluetooth
getProfileProxy is not needed in TetherService because tethering would
do that when calling #stopTethering.
4. Also support TETHERING_ETHERNET entitlement check that
TETHERING_ETHERNET is new added from Android R.

Bug: 146918263
Test: atest TetherServiceTest
Change-Id: Id969f29d7210f2ee32719c76439049bbc86cd4f6
Merged-In: Id969f29d7210f2ee32719c76439049bbc86cd4f6
2020-06-19 23:05:27 +08:00
markchien
500ce1d4c8 Remove schedule recheck logic from TetherService
This change just remove unused code.
Tethering no longer ask TetherService to schedule recheck
(use #EXTRA_SET_ALARM) from Android Q. Intead Tethering
(EntitlementManager) would schedule the recheck by itself.

This change is necessary in order to move the resourcesout
of the framework because TetherService needs to know when
it need to re-run entitlement recheck from framework res
(config_mobile_hotspot_provision_check_period).

Bug: 146918263
Test: atest TetherSerivceTest
Change-Id: Ie45859c19b96d0689c45dd610501fae0506742ff
Merged-In: Ie45859c19b96d0689c45dd610501fae0506742ff
2020-06-19 23:04:43 +08:00
Mark Chien
cf18d506fe Merge "Remove unused resource from TetherServiceTest" into rvc-dev am: 45a953b56c am: 5f643bb4db am: e35a89ef62 am: 211a604243
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11908542

Change-Id: I8ca3430f4bf89107b8a5b4a92f1bbd96023bf78d
2020-06-19 06:46:58 +00:00
markchien
efb029c067 Remove unused resource from TetherServiceTest
TetherService is no longer query resource by itself after ag/11524847.
That CL miss to remove unused getResources code.
Now remove unused resource in this change.

Bug: 146918263
Test: atest TetherServiceTest
Change-Id: I3b0da2672246997aee16b11576ce5ae9bfe596dc
2020-06-19 03:37:38 +00:00
Mark Chien
b727c6d9af Merge "Get entitlement configuration from intent extra" into rvc-dev am: 481816a97d am: 9b626fce11 am: 56b98ca21e am: 7248e67343
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11524847

Change-Id: Ie8a8cd56a93b19313f87377bf5ba600e66cd6b4e
2020-06-17 07:02:13 +00:00
markchien
e22bd7a2e8 Get entitlement configuration from intent extra
Tethering resource configuration is move from framwork to tethering
module. The resource would not be accessible from outside of tethering
module.
List the replacements of framework resources usage and intent extra:
1. R.string.config_mobile_hotspot_provision_response
    --> android.net.extra.TETHER_PROVISIONING_RESPONSE.
2. R.string.config_mobile_hotspot_provision_app_no_ui
    --> android.net.extra.TETHER_UI_PROVISIONING_APP_NAME
3. R.array.config_mobile_hotspot_provision_app
    --> android.net.extra.TETHER_SILENT_PROVISIONING_ACTION
Besides, the current active subId would put in
android.net.extra.TETHER_SUBID

Note: They are not APIs because of API freeze. Now both tethering module
and Settings define these strings independently. Will replace hard code
string as tethering module-lib APIs in b/159085857.

Also move the entitlement response intent registeration from onCreated
to onStartCommand, this can avoid wrong intent registeration if subId
changed between onCreate and when the intent arrived.

Bug: 146918263
Test: atest TetherServiceTest
      atest TetherProvisioningActivityTest

Change-Id: I3d06df01302a9c1f0893712d9250fe394dc66588
2020-06-17 05:47:17 +00:00
Automerger Merge Worker
b312f2af4b Merge "Merge "Merge "Replace ConnectivityManager as TetheringManager" into rvc-dev am: 2aa2b0a2f8 am: 52a3551a7a" into rvc-d1-dev-plus-aosp am: ac3266b1be" into rvc-qpr-dev-plus-aosp am: 8152e9d40f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11770823

Change-Id: I145def075a545a397ce7e631175a5f4e9ada9330
2020-06-15 07:20:58 +00:00
Mark Chien
75b2a75ccd Merge "Remove schedule recheck logic from TetherService" into rvc-dev am: 49b74e24d6 am: 10ef08d80f am: 78b4bc6020 am: 1912ee3e9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11524846

Change-Id: I78a0a2d461fd96f2af1850c74d78cd34060e66cc
2020-06-15 07:20:22 +00:00
Mark Chien
2aa2b0a2f8 Merge "Replace ConnectivityManager as TetheringManager" into rvc-dev 2020-06-15 06:23:28 +00:00
Mark Chien
49b74e24d6 Merge "Remove schedule recheck logic from TetherService" into rvc-dev 2020-06-15 06:23:11 +00:00
TreeHugger Robot
f3c20305fb Merge "Don't pass channel info for the bubble app page" into rvc-dev am: d6081039c6 am: 4327cd65cc am: 38aaa31584 am: 54f86cfc61
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11636410

Change-Id: I9e1c1df385b75ad0469b23de904db23ef3298aa1
2020-06-11 18:43:25 +00:00
markchien
17feecffae Replace ConnectivityManager as TetheringManager
Tethering APIs are all move to TetheringManager from Android R.
1. Replace ConnectivityManager tethering API usage as TetheringManager.
2. Use TetheringManager#stopTethering to disable usb tethering instead
of using deprecated ConnectivityService#setUsbTethering
3. Use TetheringManager#stopTethering to disable bluetooth tethering
instead of directly use BluetoothPan#setBlueoothTethering. So bluetooth
getProfileProxy is not needed in TetherService because tethering would
do that when calling #stopTethering.
4. Also support TETHERING_ETHERNET entitlement check that
TETHERING_ETHERNET is new added from Android R.

Bug: 146918263
Test: atest TetherServiceTest
Change-Id: Id969f29d7210f2ee32719c76439049bbc86cd4f6
2020-06-11 23:36:59 +08:00
Mady Mellor
87e16f416f Don't pass channel info for the bubble app page
Fixes: 157485149
Test: make SettingsUnitTests; adb shell am instrument etc
Change-Id: If8d9b446ed056996cda91fcc5e92c7077ff3ea5d
2020-06-11 08:33:45 -07:00
markchien
257b9bcdfa Remove schedule recheck logic from TetherService
This change just remove unused code.
Tethering no longer ask TetherService to schedule recheck
(use #EXTRA_SET_ALARM) from Android Q. Intead Tethering
(EntitlementManager) would schedule the recheck by itself.

This change is necessary in order to move the resourcesout
of the framework because TetherService needs to know when
it need to re-run entitlement recheck from framework res
(config_mobile_hotspot_provision_check_period).

Bug: 146918263
Test: atest TetherSerivceTest
Change-Id: Ie45859c19b96d0689c45dd610501fae0506742ff
2020-06-11 23:28:49 +08:00
paulhu
a788a3190c Forward the ResultReceiver to Tethering Entitlement app
Bug: 156336264
Test: atest TetherProvisioningActivityTest
Change-Id: I37fcaddd5569223146ff9d6316d97f33312d8d24
Merged-In: I37fcaddd5569223146ff9d6316d97f33312d8d24
2020-05-29 00:06:52 +08:00
Paul Hu
49176ee31e Merge "Forward the ResultReceiver to Tethering Entitlement app" into rvc-dev am: 37318d03a4 am: 9821b664b7 am: a4f7f62dd1 am: d98423fd22
Change-Id: I90966dc78e7efcf90af89443bc206d1b79e0f2ef
2020-05-26 06:46:39 +00:00
paulhu
2efe482d95 Forward the ResultReceiver to Tethering Entitlement app
Bug: 156336264
Test: atest TetherProvisioningActivityTest
Change-Id: I37fcaddd5569223146ff9d6316d97f33312d8d24
2020-05-21 02:33:15 +00:00
Ashwini Oruganti
fd9721f1af 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.

These changes were made using an automated tool, the xml file may be
reformatted slightly creating a larger diff. The only "real" change is
the addition of "android:exported" to activities, services, and
receivers that have one or more intent-filters.

Bug: 150232615
Test: TH
Exempt-From-Owner-Approval: mechanical refactoring
Change-Id: I878adb9108c95f06ddd059b23a542b61210edfa4
2020-05-20 15:08:34 -07:00
Arc Wang
41f23de712 [Wi-Fi] Replace WifiTracker with WifiPickerTracker in WifiSettings
WifiSettings uses WifiTracker in SettingsLib while WifiSettings2
uses WifiPickerTracker in WifiSettingsLib.

1. Remove WifiSettings.
2. Rename WifiSettings2 to WifiSettings.
3. Remove the files only used in the removed WifiSettings.
   (Saved networks files are not included)

Bug: 152571756
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
      atest WifiSettingsUiTest
Change-Id: I800b434c8049121db115cff87d51e164e4529999
2020-05-14 21:24:57 +08:00
Arc Wang
e46081819d [Wi-Fi] Apply WifiTrackerLib objects in wifi/dpp/WifiNetworkListFragment
Bug: 152571756
Bug: 145100890
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiNetworkListFragmentTest
Change-Id: I2136b452da4a3008f493c46c8ed14b311cfc9fdd
2020-05-07 22:36:41 +08:00
Peter_Liang
cfe3e454ac Tutorial improvement for Accessibility shortcut (1/n).
Because can't save the value into setting keys for the service before version R, and in order to let tutorial dialog can get the consistent value, using alternative that each fragment with shortcut to must implement the new abstract method.

Bug: 148989018
Test: manual test
Change-Id: Iba2a7daa70eb00f0bba37317c9355531fbb77628
2020-04-23 12:18:23 +08:00
menghanli
a8b9f30d11 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (2/n)
Bug: 142529032
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceControllerTest
Change-Id: Ic55d4fd8db0678b8fccbbb6ef1d217b47a5094bd
2020-02-13 15:44:11 +08:00
David Su
68913c5a8b Migrate to getNetworkSelectionStatus()
isNetworkEnabled() & isNetworkPermanentlyDisabled()
should not be formal APIs. Instead,
getNetworkSelectionStatus() with a set of constants
is sufficient as an API surface, and will be more
maintainable in the future.

Bug: 146046526
Test: atest SettingsUnitTests
Change-Id: If599ce88f68a87fa7186ef96156c2bb1fdc1c2c3
2020-01-30 20:36:53 -08:00
David Su
c267acd0ef SettingsUnitTests: migrate to @SystemApi Builders for WifiInfo & NetworkSelectionStatus
Use the newly created Builder classes to construct
WifiInfo & NetworkSelectionStatus with the
appropriate fields set, so that they can be
parceled/unparceled.

Bug: 138801922
Test: atest SettingsUnitTests
Change-Id: I8dd6bc5d51d1a41ff4b8b2760faaa00b633fc2f7
2020-01-11 18:44:14 -08:00
Philip P. Moltmann
00d42d0737 (Cherry-pick from internal) Adapt test to change internal API SubscriptionController#getActiveSubscriptionInfoList
Test: atest SettingsUnitTests
Bug: 136595429
Change-Id: I2320cd8405ab42fe725f698ca844341785dcd9f9
2020-01-07 16:09:16 -08:00
Philip P. Moltmann
c996edf265 Adapt test to change internal API SubscriptionController#getActiveSubscriptionInfoList
Test: atest SettingsUnitTests
Bug: 136595429
Change-Id: I2320cd8405ab42fe725f698ca844341785dcd9f9
2019-11-14 13:31:10 -08:00
Bonian Chen
38701ed7ea Merge "[Settings] Hidden API remove - WFC mode settings" 2019-11-06 06:05:21 +00:00
Bonian Chen
c3b94292ea [Settings] Hidden API remove - WFC mode settings
Change API from getWfcMode/setWfcMode into APIs within ImsMmTelManager.

Bug: 140542283
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingPreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingSettingsForSubTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingSliceHelperTest
atest WifiCallingSettingUiTest

Change-Id: I2ee01852cb4ee90fe9db256d3333f461cc070da5
2019-11-06 12:17:09 +08:00
Raff Tsai
c5e1fc677c Integrated SearchIndexableResources interface in Settings
- New SearchIndexableResources interface returns SearchIndexableBundle,
we don't need reflection to get SearchIndexableProvider

Bug: 135053028
Test: robolectric, check database search_index.db items
Change-Id: I5ed3416ccf72ef3d38db817fcb4aff7502649ed4
2019-11-05 17:38:32 +08:00
Ryan Mitchell
dc67778100 Merge "Remove config_show_regulatory_info tests" 2019-10-14 16:14:30 +00:00
Rubin Xu
010116a173 Introduce LockscreenCredential
Bug: 65239740
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.password
Change-Id: Icb73d639291d6d2eda8015e18e93d0906f916bb2
2019-10-13 21:20:02 +01:00
Ryan Mitchell
4de772fddb Remove config_show_regulatory_info tests
Runtime Resource Overlays (RROs) can no longer change the value of
resources in manifest when read during PackagerParser.

Remove usage of config_show_regulatory_info and rely on OEMs
configuring the component using <component-override>.

Bug: 135048762
Test: adb shell pm resolve-activity
com.android.settings/com.android.settings.RegulatoryInfoDisplayActivity
Change-Id: If48f40eb261a9c90e183d4ef9bcafb0fbda38f22
2019-10-10 18:06:57 +00:00
Paul Hu
77226593e0 Merge "[Settings] Replace CONNECTIVITY_INTERNAL to TETHER_PRIVILEGED" am: a67ca4cfd7 am: 3a728ae13b am: a6dadc465b
am: 67fe04814d

Change-Id: I27e85d6780025122b5b56c0f8f827a0a8060e955
2019-10-01 03:21:27 -07:00
Paul Hu
3a728ae13b Merge "[Settings] Replace CONNECTIVITY_INTERNAL to TETHER_PRIVILEGED"
am: a67ca4cfd7

Change-Id: I7a2a4d76d1e0092188121d390c75c12eac20cdab
2019-10-01 03:03:36 -07:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
paulhu
52d24750a4 [Settings] Replace CONNECTIVITY_INTERNAL to TETHER_PRIVILEGED
Settings is using CONNECTIVITY_INTERNAL to restrict launching
tether provisoning activity by provioning apps only. However,
CONNECTIVITY_INTERNAL will be deprecated from Android R, replace
the permission to TETHER_PRIVILEGED.

Bug: 32963470
Test: atest TetherServiceTest
Change-Id: I4c8312b92de8d5d9c9090c572e54622dc4fcf9d4
2019-09-12 17:21:43 +08:00
Arc Wang
a12b372dd2 [Wi-Fi DPP] Refine code
Remove unused code.
Rename some variables and methods for better readability.
Fix typos.
Reduce unnecessary variable scope and method scope.
Simplify some code logic.

Bug: 120645817
Test: atest com.android.settings.wifi.dpp
Change-Id: I8f30b3e445f25ada927e995befee1783d2270b91
2019-07-19 10:29:06 +08:00
TreeHugger Robot
33c8c8e4a2 Merge "[Wi-Fi DPP] remove unused code" 2019-07-09 03:36:42 +00:00
Arc Wang
2d211208d6 [Wi-Fi DPP] remove unused code
Bug: 120645817
Test: atest com.android.settings.wifi.dpp
Change-Id: I467888de0efe8ae663863e9eacc15e77d32487d2
2019-07-08 18:23:56 +08:00
Mark Chien
5cc68af9ca Merge "Fix entitlement failed when device is on CBRS" into qt-r1-dev am: 8a44e4f274
am: 649f98541a

Change-Id: I226fff13988a87780cbf7c042619c36efcbae63f
2019-07-03 19:21:40 -07:00
Mark Chien
649f98541a Merge "Fix entitlement failed when device is on CBRS" into qt-r1-dev
am: 8a44e4f274

Change-Id: Ifabc853b754fd6323e01246613656fe72961c253
2019-07-03 17:19:49 -07:00
markchien
0331222483 Fix entitlement failed when device is on CBRS
When active cellular internet is switched to CBRS in DSDS case,
default data sub id may not be changed. Fix by using active
subscription id and pass this sub id to entitlement app.

Bug: 134994718
Test: atest TetherServiceTest
Test: manual test with carrer SIMs.

Change-Id: I30a1d70c0690f0dba8f4171a2bde884f9b7ccfc4
2019-06-26 17:05:48 +00:00
Yanting Yang
7130bc63b4 Disable flaky test launchDashboard_shouldSeeFooter
To avoid false alarm in presubmit, will plan a new way to fix it later.

Bug: 133334887
Test: atest LifecycleEventHandlingTest
Change-Id: I711319fcb091b19ff895b93b140360b974e80c20
2019-05-28 22:05:11 +08:00
Arc Wang
8e3c49123d [Wi-Fi DPP] Refine Wi-Fi DPP UI layouts with SUW library
1. Use GlifLayout in all fragments
2. Fragments use 32dp icon instead of 48 dp
3. Replace ScrollView & ProgressBar & Header & Footer of original layout with GlifLayout design
4. Remove ActionBar (no more back button on screen top)

Bug: 129021867
Test: manual
Change-Id: I2fda48cb7f7819b2c8dd85c10d39e1f187463bd8
2019-05-21 13:59:39 +08:00
Colin Cross
e43660a00d Merge "Convert Settings to Android.bp" into qt-dev-plus-aosp
am: a7125ade35

Change-Id: I7627072b9a64c6713acc657e47a7755dca7383f9
2019-05-14 17:58:41 -07:00
Colin Cross
946a0fd964 Convert Settings to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Test: m RunSettingsRoboTests-jacoco
Change-Id: I267534c095c30833f77273dbdb1893b7830ed45d
2019-05-13 13:42:01 -07:00
Arc Wang
2723563a19 Merge "Fix back arrow in wifi settings "connect to this network connection qr code" does not work" into qt-dev am: 5c461a2859
am: 6830a691dd

Change-Id: I3c74212e9efa6227f5c591080f3b593fb7e42b5a
2019-05-08 20:32:32 -07:00
Arc Wang
ac75faa207 Fix back arrow in wifi settings "connect to this network connection qr code" does not work
When clicking back button, pop fragment and Finish the activity if there is nothing to pop

Bug: 132132756
Test: atest WifiDppConfiguratorActivityTest
Change-Id: Ia16951e79e578f1625e5fadd26553735fa90bffa
2019-05-07 18:06:54 +08:00
Lei Yu
d68c8c59e5 Fix settings unit test
Also remove some obsolete tests

Fixes: 126257657
Test: atest
Change-Id: Ib9b654b9076176db3c331bf5ca14ac185c9e0b5f
2019-04-24 20:40:59 +00:00