Commit Graph

853 Commits

Author SHA1 Message Date
Jeremy Goldman
ff6bc3ce27 [Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest
Diff: https://diff.googleplex.com/#key=OYsSkuGzJNkP
Test: atest -c MobileDataPreferenceControllerTest
Change-Id: I1a2d7b38023681f3db3320aa9f315109280cfbd0
2020-09-10 15:15:08 +00:00
Betty Chang
e8b877e3ee Merge "[Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest" 2020-09-10 02:30:24 +00:00
Betty Chang
914fdb6b5f Merge "[Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest" 2020-09-10 02:30:09 +00:00
changbetty
0bf90f7186 [Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Add @Before setup() for context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug: 167997296
Test: atest -c MobilePlanPreferenceControllerTest
Change-Id: I5f43b6a4d20108195164038c02810b725abbcd06
2020-09-09 15:34:52 +08:00
changbetty
f24a8be2d8 [Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Run the NetworkDashboardFragment on the Main thread

Bug: 168000627
Test: atest -c NetworkDashboardFragmentTest
Change-Id: I6d10737b9ac8299f2d7c847a9fdb1c3bdc4e390d
2020-09-09 11:26:42 +08:00
Betty Chang
4badae1a03 Merge "[Testing] Use AndroidJUnit4 instead in DataServiceSetupPreferenceControllerTest" 2020-09-08 01:45:08 +00:00
Betty Chang
b05056bce7 Merge "[Testing] Use AndroidJUnit4 instead in DisableSimFooterPreferenceControllerTest" 2020-09-08 01:44:17 +00:00
Betty Chang
9928db2e7e Merge "[Testing] Use AndroidJUnit4 instead in PreferredNetworkModePreferenceControllerTest test files" 2020-09-08 01:35:45 +00:00
Betty Chang
13aa43c2f8 Merge "[Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files" 2020-09-08 01:33:51 +00:00
Betty Chang
645da1dac4 Merge "[Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest" 2020-09-07 09:34:56 +00:00
changbetty
bc7475a08f [Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug:
Test: atest -c AutoSelectPreferenceControllerTest
      atest -c OpenNetworkSelectPagePreferenceControllerTest
Change-Id: Ic80da4fcc6a64e7fde55705dda128741c26ce3cf
2020-09-07 02:31:30 +00:00
changbetty
ca2e8c8250 [Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Remove the @Ignore tag in isAvailable_dataOnAndDsdsAnd5GSupported_Available

Bug: 167933210
Test: atest -c NrDisabledInDsdsFooterPreferenceControllerTest
Change-Id: I455a543d7a006be21523918e48cc77b403f8b56d
2020-09-07 09:27:17 +08:00
Betty Chang
fd1f4cba36 Merge "[Testing] Use AndroidJUnit4 instead in TelephonyBasePreferenceControllerTest" 2020-09-07 00:35:18 +00:00
changbetty
6a66732801 [Testing] Use AndroidJUnit4 instead in DataServiceSetupPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 167386055
Test: atest -c DataServiceSetupPreferenceControllerTest
Change-Id: I06b4e9a99336e68af954138457b602061c776baa
2020-09-01 22:30:53 +08:00
changbetty
0d220e600d [Testing] Use AndroidJUnit4 instead in DisableSimFooterPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 167383385
Test: atest -c DisableSimFooterPreferenceControllerTest
Change-Id: Ic725be35c4ecd44006919a74cfeab3febc6e3532
2020-09-01 14:14:10 +00:00
changbetty
7644e35698 [Testing] Use AndroidJUnit4 instead in PreferredNetworkModePreferenceControllerTest test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found
5. Add @After to reset the content provider data

Bug: 167377501
Test: atest -c PreferredNetworkModePreferenceControllerTest
Change-Id: I8c123747a59eb4cf6c6b8b73109cf00cef4515f0
2020-09-01 13:42:30 +00:00
Xin Li
748efff856 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ie9d2c4d6d4618a167af1c5627d5d7918a404f398
Change-Id: I2ae428e37fd96226ce4e06032e2c0beaacbd0301
2020-08-28 23:35:54 -07:00
Jeff DeCew
b409b64045 Update NotificationChannelSettings Preferences in place to prevent re-layout.
Fixes: 110093185
Test: ChannelListPreferenceControllerTest
Change-Id: If6acf305c44085e502a3304ea57e409ce049b40f
2020-08-24 15:11:22 -04:00
Betty Chang
dd6f6fdb64 Merge "[Testing] Use AndroidJUnit4 instead in ApnPreferenceControllerTest" 2020-08-20 08:28:15 +00:00
changbetty
6f53c94b9a [Testing] Use AndroidJUnit4 instead in ApnPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right

Bug: 165232573
Test: atest -c ApnPreferenceControllerTest
Change-Id: Iab7f648061bab9ea33f6a15231be2344be6b3499
2020-08-20 14:13:46 +08:00
Betty Chang
0ab88f263d Merge "[Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest" 2020-08-20 04:15:36 +00:00
Betty Chang
19a7ddd02b Merge "[Testing] Use AndroidJUnit4 instead in TelephonyTogglePreferenceControllerTest" 2020-08-18 10:27:32 +00:00
changbetty
fc29bdedc7 [Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right
4. Create the real object for PhoneAccountHandle and ComponentName

Bug: 164989754
Test: atest -c MobileNetworkUtilsTest
Change-Id: I1778832b0602062adb24928343c0c1d0e525942d
2020-08-18 16:18:56 +08:00
changbetty
d2e9e42f32 [Testing] Use AndroidJUnit4 instead in TelephonyTogglePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right

Bug: 164986958
Test: atest -c TelephonyTogglePreferenceControllerTest
Change-Id: I3d6c39f45cb1efb1742148f20f03372214eb0cbe
2020-08-17 12:41:53 +00:00
changbetty
933e4df3c9 [Testing] Use AndroidJUnit4 instead in TelephonyBasePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 164986221
Test: atest -c TelephonyBasePreferenceControllerTest
Change-Id: Iabe24aef0b7a5c3aa9d7be275f0c4ed552cdd2e8
2020-08-17 12:41:20 +00:00
Betty Chang
1adaa8ba27 Merge "[Testing] Use AndroidJUnit4 instead in SubscriptionUtilTest" 2020-08-17 10:46:30 +00:00
changbetty
57abc1f865 [Testing] Use AndroidJUnit4 instead in SubscriptionUtilTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Add spy context and get the SubscriptionManager and TelephonyManager
from the spy context

Bug: 163298785
Test: atest -c SubscriptionUtilTest
Change-Id: Iefcf29904c9c4475221c20318526ce48cb88a45a
2020-08-17 11:57:22 +08:00
Bonian Chen
6f5e9d1ee2 Merge "[Settings] Grant permissions to submit junit test" am: 33e4971820 am: af57413abc am: 45cc4bbe61 am: 454bcb012e am: a716d48ffc
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1398398

Change-Id: I41e6a4e0604d9fe051fdb8168287c53a8da763c8
2020-08-14 09:13:01 +00:00
Bonian Chen
45cc4bbe61 Merge "[Settings] Grant permissions to submit junit test" am: 33e4971820 am: af57413abc
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1398398

Change-Id: I1e5921c9a4cc5b223d0ee61eae2cac7afaa19e2a
2020-08-14 08:20:48 +00:00
Betty Chang
18c9d1db3f Merge "[Testing] Use AndroidJUnit4 instead in GlobalSettingsChangeListenerTest" 2020-08-13 13:19:59 +00:00
Bonian Chen
1c97e70641 [Settings] Grant permissions to submit junit test
Grant permissions for adding new Junit test case.

Change-Id: Iabde2307669815fd50cdba241492c82b9e2cf64d
2020-08-13 18:49:31 +08:00
changbetty
7f94b4dbb9 [Testing] Use AndroidJUnit4 instead in GlobalSettingsChangeListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Add new TestListener for spy GlobalSettingsChangeListener

Bug: 163299183
Test: atest -c GlobalSettingsChangeListenerTest
Change-Id: I0290470d3d3b235e0069ecbb9c1ce87a705d71d1
2020-08-13 18:24:49 +08:00
SongFerngWang
4ba7007aba Add AirplaneModePreferenceControllerTest at Androidx.Test
Bug: 161875909
Test: atest AirplaneModePreferenceControllerTest (PASS)
Change-Id: Id1c50824fa420d958fcc45f80aba30a360c40b94
2020-08-13 17:32:13 +08:00
Edgar Wang
a8742aa7ab Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: Ia8625091a107fc3fb652d3ba3f75ea3cc1a8d9f5
2020-08-12 11:29:07 +08:00
changbetty
7f57ef4766 [Testing] Use AndroidJUnit4 instead in DataConnectivityListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c DataConnectivityListenerTest
Change-Id: I8f05ac7f5f14cb2b990da137099a22e4a89fcc37
2020-08-11 15:32:58 +08:00
changbetty
c3aa6d26ee [Testing] Remove Robolectric import and use AndroidJUnit4 instead in MobileDataEnabledListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c MobileDataEnabledListenerTest
Change-Id: I81b3d6ac075666a45649c8d811832a40bdb1b41b
2020-08-05 22:53:29 +08:00
markchien
77c297df4f 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
Merged-In: I3b0da2672246997aee16b11576ce5ae9bfe596dc
2020-06-19 23:23:02 +08:00
markchien
6d2c010891 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
Merged-In: I3d06df01302a9c1f0893712d9250fe394dc66588
2020-06-19 23:21:17 +08:00
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