Commit Graph

24 Commits

Author SHA1 Message Date
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