Commit Graph

29 Commits

Author SHA1 Message Date
tom hsu
282b67b1c0 [Settings] Prevent NPE from getting MobileIconGroup instance.
Bug: 187812523
Test: Maunal test.
Change-Id: Ief06c683c1c8a99d4ce2765cd802be221e55820e
2021-07-01 22:32:26 +08:00
Weng Su
c4eb3b1320 [Provider Model] Hide W+ network if it's inactive
Bug: 187854575
Test: manual test
atest -c CarrierWifiTogglePreferenceControllerTest \
         SubscriptionsPreferenceControllerTest

Change-Id: Ib99bc7fef38a99c1da1e365c2002ad30c617d445
2021-06-12 00:55:10 +00:00
Tom Hsu
a2a570f60b Merge "[Settings] Disable gear button if user is not admin." into sc-dev 2021-06-10 04:00:12 +00:00
tom hsu
4f3ac2fcbd [Settings] Resolves unsynced infomation between status bar and settings
When activity go to background, the UI message shall be saved, and When
 activity is back to foreground, the UI shows previous state first.
 The situation make unsynced info between status bar and settings's
 page.

Bug: 187091965
Test: Maunal Test
Test: atest passed
Change-Id: I7db2876e91c00126ebfa9dfa5b87d04c1f717e72
2021-06-09 15:19:48 +08:00
tom hsu
f7811dfd09 [Settings] Disable gear button if user is not admin.
- Mobile settings include many settings which second user shall not
  modify, so make gear button disabled to avoid second user want to try.

Bug: 184303943
Test: Maunal test passeded
Test: atest passed.
Change-Id: Ic04fa71772df4ac424965ad2ca95733b1e15d6a7
2021-06-08 15:03:00 +08:00
tom hsu
2519077d97 Show W+ when connected to Carrier Wi-Fi Network
Internet picker
  - https://screenshot.googleplex.com/7k4ojF65a8Bis5R
 Internet panel
  - https://hsv.googleplex.com/6749112168873984
Bug: 185431894
Test: atest passed

Change-Id: Ic79686b47f033870ad8e7741f9baf3230dde7b7c
2021-05-10 14:08:05 +08:00
tom hsu
f482c28423 [Provider model] Show no connection during out of service.
- When device out of service, show "No connection" on preference summary.
 - Modify the logic of icon and summary.

Bug: 183944316
Test: atest SubscriptionsPreferenceControllerTest passed
Change-Id: I179632918a9145f27cec7d9c08e1c0b675fd1ef6
2021-04-22 21:56:42 +08:00
tom hsu
edaeb41ff7 [Provider Model] Fix preference summary not update.
- When activity enter onPause, the status will not update, then
 sub id of TelephonyManager keep same value after activity go back.

 - Solution: Everytime update the UI, and always get new
 TelephonyManager with the latest sub id.

Bug: 181196545
Test: atest passed.
Test: Manual test passed.
Change-Id: I1d65bbc06af66b97b6c85f40bed394da03213d06
2021-03-04 21:26:57 +08:00
tom hsu
00798a5902 [Provider model] Show a string on internet picker when mobile data off
- https://screenshot.googleplex.com/6JE9ma6UZmGCNFQ

Bug: 178680922
Test: Manual test passed
Test: atest passed
Change-Id: Id276e3f97b4380f648eb9e35ca7780a0ba32bdb2
2021-02-20 15:03:47 +08:00
Jeremy Goldman
9d87cd9126 SubscriptionsPreferenceController shows the unique sim description.
Bug: 148303118
Bug: 150370656
Test: atest -c SubscriptionsPreferenceControllerTest
Change-Id: I041536fe0148087a068c6000383b382b0ff4e17c
2021-01-22 07:02:52 +00:00
Weng Su
99dbb43f0c [Provider Model] Connect carrier network issue fix
- Need to check if the data is enabled on the second SIM in the case of
dual SIM.

Bug: 177411771
Test: manual test
Change-Id: Ieead7a4550628d5380b8d0150cfd7a67c47980ca
2021-01-18 07:59:50 +00:00
tom hsu
b392d43fff [Provider mode] Display network type on mobile data preference.
Connect to 5G mobile network
  - https://screenshot.googleplex.com/8RziSbSjstMaFiK
 Connect to Wi-Fi
  - https://screenshot.googleplex.com/6ND3DFFsnLKSQRd

Bug: 176141828
Test: Manual test passed.
Test: Atest passed

Change-Id: I69b8ce0c1f5a16f0ff492be0b4ab26166a51bdc3
2021-01-16 01:56:39 +08:00
Weng Su
5e76c02d82 [Provider Model] Implement the carrner network selection settings
- Add WifiPickerTrackerHelper to reuse the library

- User taps on carrier network preference
  - Calls MergedCarrierEntry#connect()

- User toggles mobile data On/Off
  - Calls MergedCarrierEntry#setEnabled(true/false)

Bug: 175761096
Test:
- Manual Test
- atest NetworkMobileProviderControllerTest \
        SubscriptionsPreferenceControllerTest \
        WifiPickerTrackerHelperTest

Change-Id: Ia311b10ca7a44a536556c1889ee65743af379822
2021-01-05 15:05:24 +00:00
tom hsu
65f8aa2f7b [Provider model] Internet picker Part II
- Add mobile internet preference with default data subscription.
 - Make prefrence to show dynamically when data subscription changed.

Video exhibition
 - http://rcll/gcmsphfhJ1UzfPSvjWOuXK/c1B2CtaFz27rlIQ2LSTJmo

Code difference
 - SubscriptionsPreferenceControllerTest.java between robolectric and junit.
  - https://diff.googleplex.com/#key=1Zm7JGPhoZwY

Bug: 172229552
Test: atest SubscriptionsPreferenceControllerTest

Change-Id: Ib50c2c51159f60f19631d1a02081eafde3436e94
2020-12-29 19:48:21 +08:00
Bonian Chen
79b8ce0212 [Settings] code refactor - rename isSubscriptionCanBeDisplayed
canSubscriptionBeDisplayed is more readable.

Reasonale:
When cherry-picking ag/12886476 into Android R branch (ag/13209427), a comment from code reviewer suggested this change.
Since ag/12886476 has been merged for a while, another patch for it is perferred option when comparing with reverting that CL and resubmit it.

Bug: 175830728
Change-Id: Ie91eb82504fd7cff6671803a2bc2560139690952
Test: build pass
2020-12-17 03:04:24 +00:00
tom hsu
95b1d7cbbd Internet Picker implementation.
This version is to resolve the Reverted CL, ag/13127781
and make NetworkProviderSettingsTest passed

 Show mobile network on internet page

 With mobile network
  - https://screenshot.googleplex.com/7HzGhnbpitErynY

 Without mobile network
  - https://screenshot.googleplex.com/8sNVggTpKEhKeRh

Class diff: https://diff.googleplex.com/#key=WosyTF0ANVMf

Doc: https://docs.google.com/presentation/d/1azrZVS54pxM2lt9LkZHtFh_6W3fyDw_kTTPVQ_mJCi4/edit#slide=id.g9c7123c172_0_448

Bug: 173105859
Test: atest NetworkMobileProviderControllerTest passed
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest passed
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest passed

Change-Id: Ib0bdd148424881353f18307cb83798b4217060fc
2020-11-27 14:20:03 +00:00
Jason Chiu
ec3d482884 Revert "[Provider Model] Internet Picker implementation."
This reverts commit 329d753a29.

Reason for revert: Broken tests on NetworkProviderSettingsTest

Bug: 174285440
Change-Id: I47e6a9479559cb424bd4b8ac0e967f013f2fba86
2020-11-26 07:05:00 +00:00
tom hsu
329d753a29 [Provider Model] Internet Picker implementation.
Show mobile network on internet page

 With mobile network
  - https://screenshot.googleplex.com/7HzGhnbpitErynY

 Without mobile network
  - https://screenshot.googleplex.com/8sNVggTpKEhKeRh

Class diff: https://diff.googleplex.com/#key=WosyTF0ANVMf

Doc: https://docs.google.com/presentation/d/1azrZVS54pxM2lt9LkZHtFh_6W3fyDw_kTTPVQ_mJCi4/edit#slide=id.g9c7123c172_0_448

Bug: 173105859
Test: atest NetworkMobileProviderControllerTest passed
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest passed

Change-Id: I9671a0b85aad1dd2f53772539505b0ad96edbda3
2020-11-23 15:55:40 +08:00
Zoey Chen
3abe48ef38 [Provider Model] Add new API to detect
1. current connection is mobile data
 - remove the SubscriptionsPreferenceController#activeNetworkIsCellular() and move into MobileNetworkUtils
2. isProviderModel API
 - Add it in Util for Provider Model
3. isWiFiCallingEnabled
 - remove WifiCallingPreferenceController#isWifiCallingEnabled() and move into MobileNetworkUtils
4. Add nes test case for MobileNetworkUtils

Bug: 171873895
Test: atest -c MobileNetworkUtilsTest
Change-Id: I4bfdf0537fe07d064d6c0ba4a2c44b4a4f158d91
2020-11-13 18:01:10 +08:00
Bonian Chen
a6b249d625 [Settings] Only display 1 SIM UI when multiple with same group UUID
Some carrier(s) expand their service through providing eSIM in companion
with pSIM. Group UUID is designed to group them together as an single
SIM.

Bug: 165363542
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest
Change-Id: I0934a45a2917ab106627c733162efbee9a13f216
2020-10-21 13:31:04 +08:00
Antony Sargent
223c179cd3 Add signal strength icons to multi-SIM header
When a device is in DSDS mode with multiple SIMs, we show a header on
the Network & internet page with a "connectivity overview", with an
entry for Wi-Fi (if connected) and each active SIM. The icon for Wi-Fi
shows signal strength, but the icons for the active SIMs were just
static; this CL fixes that. It introduces a class for listening to
signal strength changes on a set of subscriptions, and moves some
existing code we had for displaying signal strength (when manually
picking networks for GSM) in NetworkOperatorPreference into a utility
method that can be shared.

Bug: 128855095
Test: make RunSettingsRoboTests
Change-Id: I668cafe1e9f9c3651b1f33783c8538ad9c2732b5
2019-05-28 12:49:08 -07:00
Antony Sargent
4bb253358b Fix two problems related to data connectivity in the multi-SIM header
When you have multiple active SIMs, the Network & internet page has a
header showing entries for each one, with summary text indicating which
one is used for data (and whether it is just set as the default, or
actively using data). We were not properly setting this text when either
data wasn't being used, eg when connected to wifi, or mobile data was
disabled for this SIM. This CL fixes both these problems by adding new
helper classes to listen for relevant events.

Test: make RunSettingsRoboTests
Fixes: 124394250
Fixes: 128857712
Change-Id: I34f2679752fa41a50247dd0b12581cbfd77a34f6
2019-05-07 16:10:52 -07:00
Antony Sargent
4646fe8e63 Use active instead of available subscriptions in 2 places
In a couple of places we were showing DSDS UI using the list of
*available* subscriptions instead of the list of *active* ones. This
difference is relevant for instance if you have multiple eSIM profiles -
in typical hardware only one of those can be active at one time. This CL
fixes that problem in two places:

1) The header at the top of the Network & internet page

2) The ListPreference's on the mobile network detail page for selecting
   the default subscription for Calls / SMS.

Fixes: 129673046
Test: make RunSettingsRoboTests
Change-Id: I891c856bdd4516286fcee1067684d9161ceaca80
2019-04-08 16:22:55 -07:00
Antony Sargent
24aa3b3504 Fix 'Advanced' collapse point on Network & internet page
On the Network & internet page, we want to collapse all the prefs into
'Advanced' that appear after 'Data Saver'. The mechanism for specifying
where the collapse point starts is just a static count, and it doesn't
really understand the concept of dynamically added preferences like the
ones we add at the top when the device is in DSDS mode. To fix this in
the short term, this CL makes the header that manages these prefs
manually adjust the count as needed. In the future we'd like to have a
better mechanism for this added in the support library.

Fixes: 128855968
Test: make RunSettingsRoboTests
Change-Id: I4509726ff29bc71e1f0b3d4a2f60dffe4b1dd7ac
2019-04-04 10:21:24 -07:00
Fan Zhang
7db118e367 Mass clean up: don't cast class when not needed.
Bug: none
Test: rebuild
Change-Id: Ie3f58a3d5ae99ade28a33dcac80c18de90d4d5b2
2019-02-14 12:26:09 -08:00
Antony Sargent
8fc473629a Set summary for SIM entries in multi-SIM header
On the Network & internet page, when you have multiple active SIMs we
add a header with an entry for each one. This CL sets the summary for
those entries to be a 1 or 2 line indication of what services (calls,
SMS, and data) that SIM is used for by default, or just an indication
that the SIM is available. And for the SIM used by default for data, we
include status information about whether it's connected or not.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: I46f37433f753724bbde8876f0d89c3155b2c3812
2019-02-08 20:18:30 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Antony Sargent
8e57fedc95 Make taps on subscriptions in multi-network header go to mobile page
This CL does 2 things:

-Makes the MobileNetworkActivity class capable of showing details for
 "available" in addition to just "active" networks. This is useful for
 dual-standby devices where one subscription is active and another is
 registered but not currently active. It also changes the title of this
 screen to be the network display name (defaults to the carrier name
 but can be customized by the user) instead of the generic "Mobile
 network".

-Wires up the subscription entries in the multi-network header (which
 only appears when a device has multiple subscriptions) so that taps on
 a subscription preference bring you to the MobileNetworkActivity screen
 to show details for that network.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: I0e985652c1d8ec3c597b6b6e4426d222e2ad5352
2018-12-20 09:03:34 -08:00
Antony Sargent
e92e07eb97 Add subscriptions list to the multi-network header
The new UX for showing multiple active mobile plan subscriptions (SIMs,
eSIMs, etc.)  needs a header at the top of the Network & internet page
that shows wifi status and a list of active mobile subscriptions in the
form of one Preference per subscription.

This CL adds display of the mobile subscriptions to this header. It does
not yet show the correct summary text or do anything when you tap on
them - that will be coming in subsequent CLs. Also, since adding a
variable number of items to the top of the page messes up our current
strategy of having a fixed number of hidden items at the bottom based on
overall item count, this CL just makes all items visible. Subsequent CLs
can restore this behavior with dynamic adjustment.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ibfadf8cb61f6f5aff6ce38b7974267b1e4ddc719
2018-12-17 13:26:13 -08:00