Commit Graph

43 Commits

Author SHA1 Message Date
Bonian Chen
2b048b22f0 [Settings][Back port] configuration for hidding SIM related UI
Add overriable configuration for hidding SIM related UI.

Bug: 240515161
Test: test cases and local testing
Merged-In: I8d7ddd18861a696830da39f040dfb14b9ed46726
Change-Id: I709a8007362b09dbb1ec1bd5d32c68d23ed0cfa9
2022-10-28 09:49:21 +00:00
SongFerngWang
64430ba2d2 Unable to enable the removable esim
When the user enable the removable esim, the settings select wrong
slot(esim slot). The slot shold be the removable + esim slot and the
UiccCardInfo's cardId is the same as the removable esim's cardId.

Bug: 233170453
Bug: 233338345
Test: atest UiccSlotUtilTest
Change-Id: Ibd324b781c84318c994e3742bb82e1d1393b94e4
2022-06-06 17:56:25 +08:00
Zoey Chen
989dd669b2 [Large Screen] Launch MobileNetworkActivity as a fragment for split mode
Receive intent in MobileNetworkActivity and launch a activity which extend SettingsActivity

Test: atest
Bug: 197609014
Bug: 209606859
Change-Id: Ic07b18b3ea11744f240b25a0986474df763a199b
2021-12-10 08:33:33 +00:00
Bonian Chen
3dfad58897 [Settings] support of getPhoneNumber API
Access to new API for retrieving phone number.

Bug: 208321353
Test: local build pass
Change-Id: I8484f94934670f24c80c95df89e8752420c1f439
2021-11-30 11:04:38 +00:00
sandeepjs
40ffe69a3e eSIM deprecated API test Refactoring
Test: build
Bug: 159354974
Change-Id: Iedeb90f186ab9f82894e2fecef86d339c8989542
2021-11-15 05:44:54 +00:00
Bonian Chen
4c2dfa26e3 [Settings] Correct some typo
Bug: 193026761
Test: build pass
Change-Id: Ic710c84e5aca093381c5e06d4f6e987cf6f729a7
2021-07-07 23:44:04 +08:00
Bonian Chen
75f1450bbf [Settings] Hide subscriptions not existed within device
For non-active subscriptions, the one inserted in slot
but turned off need to be visible to the user. However,
the one un-plugged need to be invisble.

Since SubscriptionUtil#getSelectableSubscriptionInfoList() didn't cover all the cases required. Create this one to fit into the criteria required here.

Bug: 191228344
Test: local
Change-Id: Ia68c23b007164b7520456cb6c7427ca142558b59
2021-07-07 07:02:55 +00:00
Peter Wang
d368e85c2e Use translated name ("SIM") for default profile display name ("CARD")
Bug: 186156909
Test: Local
Change-Id: Icb8e5e7afb64d28e1ff7567882288fb1621dbe9a
2021-06-15 02:59:21 -07:00
Zoey Chen
71fada3af8 [ProviderModel] Use category to separate physical SIM and e-SIM
Mock from UX: https://screenshot.googleplex.com/4kscwJvoQE7vwF3.png

Implementation UI: https://screenshot.googleplex.com/AEeVzLi364KiPGa.png

Bug: 187071119
Test: atest NetworkProviderSimListControllerTest
Test: atest NetworkProviderSimsCategoryControllerTest
Test: atest NetworkProviderDownloadedSimListControllerTest
Test: atest NetworkProviderDownloadedSimsCategoryControllerTest

Change-Id: Ia84bebe6ea431cdbae19f3e4b840f7cd56dc2d6f
2021-05-31 23:59:37 +08:00
Jeremy Goldman
a51780f35d Subscription name has whitespace trimmed to determine uniqueness
For example, if a subscription has the name "subsc" and another has
"subsc    " the extra unique information will be added to the
subscriptions.

Test: atest -c SubscriptionUtilTest
Bug: 183664625
Change-Id: Ia137169f6cdd9804ab04126e5045c9fb61556d54
2021-04-07 16:26:52 +08:00
Bonian Chen
a9a411e3df [Settings] Only display backup calling when more than 1 SIM
Backup calling only available when more than 1 SIM available.

Bug: 179802059
Test: on device
Change-Id: I24e5eb9e1a7064c3ea65389fbb00c0ff2a5852ed
2021-03-02 21:14:53 +08:00
Jeremy Goldman
9e949b1920 Unique display name util uses available, rather than active, subscriptions.
Test: atest -c SettingsUnitTest
Bug: 178560175
Change-Id: Ief035cf3de3ac03fe348095f36bfb78a41f93d2c
(cherry picked from commit c14e3b3115)
Merged-In: Ief035cf3de3ac03fe348095f36bfb78a41f93d2c
2021-02-04 03:15:41 +00:00
Jiashen Wang
428273765b Merge "Slot Change Receiver Migration" into sc-dev 2021-02-01 23:57:09 +00:00
Jeremy Goldman
3dd2878437 SubscriptionUtil checks that SubscriptionInfo is null before accessing.
Test: atest -c SubscriptionUtilTest
Bug: 178707680
Change-Id: I03938405929c3307460107671bbe695ee5e0f6e9
2021-02-01 05:01:49 +00:00
Jiashen Wang
b54d25ee13 Slot Change Receiver Migration
Implemented slot change cases when pSIM is inserted and removed.
Bug: 153811431
Bug: 170508680
Test: Manually tested

Change-Id: Ib0a96da1d7d702f7c64e75b929c73b8548f8e459
2021-01-28 14:15:53 -08:00
Jeremy Goldman
67c75ac102 Helper function to return the unique name for subscription info
Many classes within Settings have access to the subscription info, rather
than only having access to the subscription id. For these classes, it is
more convenient to have a helper method where the whole subscription
info can be passed in, rather than having to call the
getSubscriptionId() helper method in so many locations within the
telephony settings codebase.

Bug: 150370656
Bug: 148303118
Test: atest -c SubscriptionUtilTest
Change-Id: I181960933ab8610d5572b7a7d6671fab8c1dbd22
2021-01-19 09:30:14 +00:00
Jeremy Goldman
3c334cc47f Utility to compute a single subscription's unique display name.
Bug: 150370656
Bug: 148303118
Test: atest -c SubscriptionUtilTest
Change-Id: Id4600dbf038117129c62331f9e00b7035af1c0fd
2021-01-13 22:03:03 +08:00
Jeremy Goldman
2fb7e1bbc4 Return mapping of subscription id to unique display name.
Fallback 1: if display names are the same, use the last 4 digits of a
phone number
Fallback 2: if the phone number cannot be displayed or the last 4 digits
are identical, fallback to use the subscription id

This function depends on DeviceInfoUtils for the phone number
formatting. Because DeviceInfoUtils is within SettingsLib, this function
(at least for now) is located within the Settings codebase itself.

go/unique-sub-display-names

Bug: 148303118
Bug: 150370656
Test: atest -c SubscriptionUtilTest
Change-Id: Id3e26254d4b193c13506df52fb59e97643df7a32
2021-01-13 16:18:00 +08:00
Jiashen Wang
8271561a76 [SIM Dialog Migration] Enable SIM operation dialog in Settings
Change Settings to not call SubscriptionManager#setSubscriptionEnabled.
Instead, make Settings call EuiccManager APIs directly.
Design: https://docs.google.com/document/d/1wb5_hoBkZVbkXGNWHbx4Jf61swjfxsJzkytiTzJosYo/edit?usp=sharing
Bug: 160819390
Test: Manually tested eSIM profile enabling.

Change-Id: I56bbcbb9ccb886b0f9249e67c5a6a6444bb7dd45
2020-12-05 21:48:09 -08:00
Jiashen Wang
ff311a2107 [SIM Dialog Migration] Migrate eSIM erase dialog
Bug: 160819390
Test: Manually tested eSIM profile disabling.
Design: https://docs.google.com/document/d/1wb5_hoBkZVbkXGNWHbx4Jf61swjfxsJzkytiTzJosYo/edit?usp=sharing
Change-Id: I9523ee5dbab5b6a5ea020647a20992ac0b1aea86
2020-10-08 22:31:53 -07:00
Jiashen Wang
d8bd3bb669 Migrate SIM operation dialog from LPA to Settings
In Android R, when users enable, disable, delete, or rename a profile,
Settings calls SubscriptionManager APIs which telephony ends up to send
actions “TOGGLE_SUBSCRIPTION_PRIVILEGED”,
“DELETE_SUBSCRIPTION_PRIVILEGED”, and “RENAME_SUBSCRIPTION_PRIVILEGED”
to EuiccManager. After EuiccUiDispatcher dispatches the action, Google
LPA receives it and starts the corresponding operations and DSDS
dialogs. We can see there some back-and-forth that goes on between LPA
and telephony. In order to improve the current structure, we devided
to move the dialogs to Settings and make it call EuiccManager APIs
directly.

Bug: 160819390
Test: Manually tested eSIM profile disabling.
Design: https://docs.google.com/document/d/1wb5_hoBkZVbkXGNWHbx4Jf61swjfxsJzkytiTzJosYo/edit?usp=sharing
Change-Id: Ib933df42ca3606de2310edc4d64c3e11800a1096
2020-09-28 13:38:10 -07:00
SongFerngWang
5189dc3860 Mainline remove hide api SubscriptionInfo.getCardString
Bug: 147128878
Test: build pass
Change-Id: Idb44af6a01626013339f5ca05486dd11112a5867
2020-01-31 18:48:09 +08:00
changbetty
e30517f9a5 [Mainline] Copy the method getSelectableSubscriptionInfoList from SubscriptionManager to Settings
Bug: 147206736
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=SubscriptionUtilTest
      make RunSettingsRoboTests -j ROBOTEST_FILTER=MobileDataSliceTest

Change-Id: I6d7e72a656723c0620d579e1e223945e2a3588af
2020-01-21 14:05:14 +08:00
SongFerngWang
affe5406a6 Mainline: removed legacy UI for network selection mode.
This cl base on ag/10098777. Now inserted inactive pSIM
will be included in Telephony's get available and
get selectable subInfo list so that logic is no longer
needed.

Bug: 147128878
Test: build pass
Change-Id: I1a0f431f05268d29afce145c3eb720594cfc57a3
2020-01-16 10:55:46 +00:00
Xiangyu/Malcolm Chen
69a7e054f5 Merge "Remove logic to manually search inactive pSIM." 2020-01-16 04:24:34 +00:00
Malcolm Chen
640e56433f Remove logic to manually search inactive pSIM.
Nowe inserted inactive pSIM will be included in Telephony's get
available and get selectable subInfo list so that logic is no longer
needed.

Bug: 147128878
Test: unittest
Change-Id: Icd131f133e47dae0770a4da71c51de3c2a94b42b
2020-01-15 14:58:07 -08:00
Bonian Chen
ec344c6031 [Settings] Remove null checking for TelephonyManager
1. TelephonyManager#createForSubscriptionId(int) never returns null
   Remove null checking.
2. Adopting context#getSystemService(SubscriptionManager.class)

Bug: None
Test: make
Change-Id: Ie36dea80a4dfabbc34d9d25c50e60e4928b2f936
2020-01-14 01:01:51 +08:00
Bonian Chen
2716dd18bb [Settings] Unable to display disabled SIM
Disabled p(e)SIM should be allowed to display to the user.

Bug: 144172733
Test: Manual
Change-Id: I6825fde8ffb22bc95d6c50a60bdeb8027a2f93b8
2019-12-18 16:44:42 +08:00
Xiangyu/Malcolm Chen
e0f40d5948 Merge "Mainline: remove usage of hiddepn API SubscriptionManager#getPhoneId" 2019-12-17 01:59:43 +00:00
Malcolm Chen
26e5dbdbfd Mainline: remove usage of hiddepn API SubscriptionManager#getPhoneId
Bug: 140908357
Test: build
Change-Id: Idaa206c7659717a269738c0121a31d957f7d90d0
2019-12-16 11:43:00 -08:00
Automerger Merge Worker
107cd136a3 Merge "[Settings] Adopting public API" am: 8ddd0da0a1 am: 40d2a2dd8d am: 11fa77b023
Change-Id: I87282b78a9db6eb3611591f0c4702447b8470db4
2019-12-16 08:31:03 +00:00
Bonian Chen
1247771b88 [Settings] Adopting public API
Replace SubscriptionManager#getActiveSubscriptionInfoList(true) by
SubscriptionManager#getActiveSubscriptionInfoList() since they're
equivalent.

Bug: 146312766
Test: build pass
Change-Id: Iab8a141277e0199f75a3419527e15d63669224fc
2019-12-16 06:35:43 +00:00
Malcolm Chen
e5dcd02f4c Add disable pSIM option in Settings
As we start disabling pSIM option in R, we check that if the feature is
supported, add the "Use SIM" toggle back to pSIM page.

Bug: 141018421
Test: manual test
Change-Id: I1af497ce5ede93f823825718b8136ff8ae0ab49c
2019-12-06 13:20:06 -08:00
Antony Sargent
e548fc6334 Remove on/off toggle for physical SIMs
Our original design for mobile network subscription management included
having an on/off toggle for both eSIMs and physical SIMs. However, it
turns out that our current telephony stack has some problems with
disabling physical SIMs, so for now we're removing the on/off
toggle. Because of this, we've added a footer to the SIM details page
for physical SIMS letting users know that to disable them you need to
remove them from the device.

Even though we're removing the on/off toggle for pSIMs, there are still
a few edge cases where you could end up with a disabled one (eg having
two SIMs in single-SIM mode where the eSIM is active and then you erased
the eSIM). In order to have a way to re-enable the pSIM in these cases,
this CL changes the relevant pref's summary to "Tap to activate <name>"
and makes the tap action begin the re-enabling. This can affect either
the Mobile network pref on the Network & internet main page (if this
disabled pSIM is the only SIM), or an entry in the Mobile networks list
page (if there are still multiple SIMs present).

Finally, this also fixes a problem where we weren't showing the on/off
toggle for eSIMs if you only had one SIM total; we actually always want
to show it for eSIMs.

Bug: 132921553
Test: make RunSettingsRoboTests
Change-Id: Id0750ebd5bed46dc2450b65b53cc81847ef09b82
2019-06-10 14:41:08 -07:00
Salvador Martinez
b5d471c19b Fix null pointer in SubscriptionUtil
Sometimes we get null sub info which causes a crash. This just
makes it so that if we see that we treat it as inactive since
there isn't really a world where an active null sub info makes
sense.

Test: atest SubscriptionUtilTest
Bug: 131603073
Change-Id: Id5ecbecf011e19ff02d9465e0571b1d17c83de9a
2019-04-30 09:59:27 -07:00
Antony Sargent
972bf437f6 Remove empty MNC filtering when retrieving available subscriptions
During the early phase of work on DSDS, we found that a hacky solution
to seeing duplicate subscriptions that are part of a logical group (eg
Google Fi) was to filter out the entries with empty MNC strings. It
turns out this breaks things for some legitimate eSIM subsctiptions, and
isn't needed anymore because of the fixes that landed for b/127833821.

Fixes: 130706446
Test: make RunSettingsRoboTests
Change-Id: Ic4472c1de3c3e2449139b3e2ffb20d11a0058e8a
2019-04-26 13:45:53 -07:00
Antony Sargent
bdd9eb3ba7 Always show disabled pSIMs in single-sim mode
In single-sim mode, you can have both an eSIM subscription and a pSIM
inserted into the device, and only one of them can be enabled. It turns
out that if the pSIM is the disabled one, we would not show it in the
settings UI; this CL fixes that.

It also fixes a somewhat related problem that I noticed while testing
this, that if you have only one subscription that happens to be
disabled, we were not showing the on/off switch at the top of the page,
which would leave you with no way to enable it.

Bug: 129864878
Test: make RunSettingsRoboTests
Change-Id: I4214ad34c59ac2df429772c066c51a9318f5baa7
2019-04-23 10:55:51 -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
Malcolm Chen
0a36e91a49 Don't show hidden subscriptions.
Replace getAvailableSubscriptionInfoList with getSelectableSubscriptionInfoList
so that hidden subscriptions won't show up.

Bug: 121396526
Test: manual
Change-Id: I73c41a6605b68011ba5b619f9d6e8d41d18a9dcd
2019-02-14 02:54:31 +00:00
Antony Sargent
ff484e11e9 Add default calls/SMS subscription prefs to mobile details page
This adds prefs to the the details page for mobile network subscriptions
that appear in multi-SIM mode. They show which subscription is set as
the default for calls and SMS respectively, and let the user change what
the default is for each. They can be set to either a specific
subscription, or set to "Ask every time".

Bug: 122670283
Test: make RunSettingsRoboTests
Change-Id: Id2b23e4b5c3d1b5c04b5766e73fc8202c05d8f75
2019-01-22 16:59:14 -08: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
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
Antony Sargent
270296ea23 Add a helper class for filtering available subscriptions
In several places implementing the new changes for better UX with
multiple mobile subscriptions, we need a bit of code that filters the
results coming from the SubscriptionManager. This CL adds that common
code in a util class that will be used in later CLs.

Bug: 116349402
Test: RunSettingsRoboTests
Change-Id: Ie9376629604ac2c4a2f15123edc380c5999f2f83
2018-12-07 13:40:28 -08:00