Commit Graph

39 Commits

Author SHA1 Message Date
Chaohui Wang
a6db1aabb6 Create SimRepository
Which unifies whether we should sim settings on some related pages.

Before this change, we check SubscriptionUtil.isSimHardwareVisible()
and / or Utils.isWifiOnly().

After this change, we unified logic to,
canChangeSimSettings() =
  packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) &&
    userManager.isAdminUser

Fix: 365924140
Flag: EXEMPT bug fix
Test: manual - check Network & internet
Test: unit tests
Change-Id: Ibf83237e3d0088f78c96a1b39ee8f1e3a9c756ea
2024-09-12 08:59:26 +00:00
Chaohui Wang
f74e90787e Create EuiccRepository
Which also avoid calling from main thread.

Bug: 356684993
Flag: EXEMPT bug fix
Test: manual - on SIMs
Test: atest EuiccRepositoryTest
Change-Id: I0b11b0bd1e8a4b5754781e888fd220fa3080a212
2024-08-29 11:34:19 +08:00
Jason Chiu
c53a73ef70 [Safer intents] Connectivity
To avoid implicit intents, make intents launch explicitly.

Bug: 323061508
Test: build
Change-Id: I44ff8a789d933f11ba7e68e52055575245276224
2024-03-26 16:44:48 +08:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
tom hsu
f2bf350303 [Settings] Remove redundant sort
- Use sql command to sort subscription info data instead of current.

Bug: 284306899
Test: Manual test
Change-Id: Ie0c5f5614a336771f865f02e7675b4e125ff15bb
2023-05-26 10:14:49 +00:00
tom hsu
50dc4e857b Ordering the SIM display name by slot ID to the preference summary.
Bug: 271975836
Test: Manual Test
Change-Id: Ib28062c8d0f1299cf30d494561c161fc4532dbc9
2023-05-11 20:48:09 +08:00
Zoey Chen
db02f10b07 [Settings] update the db list when back to UI
Bug: 271524675
Test: local test
Change-Id: I26c7d64e6f040c62c9efb1438efe328f5744fa02
2023-03-20 09:08:34 +00:00
Zoey Chen
5645c092a9 [Settings] 1.Clean up unnecessary callback 2. register listener and
manager by subId

Bug: 269742364
Test: manual
Change-Id: Id536dedb200385dc6de5697848f8a68f2302351f
2023-02-18 07:28:56 +00:00
Zoey Chen
4fab96ffe5 [Settings] Do not insert subInfo repeatedly
Bug: 264322977
Test: manual
Change-Id: If1e9144c9d682befe5bccd3fa506ad82e2807b09
2023-01-19 20:25:35 +00:00
Zoey Chen
f172189e8e [Settings] eSIM transfer: MobileNetworkSummaryController
1. MobileNetworkSummaryController

 - No matter single SIM or multiple SIMs, always launch MobileNetworkListFragment
 - Remove the + and |

APM off: https://screenshot.googleplex.com/7M8qzsXFesy3nDi.png
APM on: https://screenshot.googleplex.com/C4ZnbpgUTPzTijL.png

2. Fix the APM mode

Bug: 244786012
Bug: 261810065
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MobileNetworkSummaryControllerTest
Change-Id: I8e5c9b8a58ef13b6deaea284e9793077b2da58f6
2022-12-08 10:29:08 +00:00
Zoey Chen
64330a235a [Settings] Apply the SettingsDataService to the SIM page, calls/smscontroller
Calls/SmsDefaultSubscriptionController

Bug: 257197354
Test: atest DefaultSubscriptionControllerTest
Change-Id: I67cb2d3aa5ef3c6751d90b96db27a062071c8113
2022-11-21 06:39:12 +00:00
Zoey Chen
e2e753e2fc [Settings] Remove the unexisted subinfo from map
Bug: 258250247
Test: manual
Change-Id: Ied5be71d6ccb251750cf9026f672aeaede860f35
2022-11-10 20:24:53 +00:00
Zoey Chen
97291ac0ad [Settings] Do not creat multiple database
Bug: 254405469
Test: manual
Change-Id: I96ea77899270439a87569bd1676d38b52dd36650
2022-10-28 11:07:39 +00:00
Bonian Chen
2f07595eb0 [Settings] configuration for hidding SIM provider UI
Hide SIM provider UI based on configuraion.

Bug: 240515161
Test: test cases and local testing
Change-Id: I1cb83787dc1ac1d61bb6bed6aa9c5e7a3ad6e69b
2022-10-20 11:35:28 +00:00
Zoey Chen
a87affdb82 [Settings] Change the way in MobileNetworkSummaryController for getting the subscription info from room db
Bug: 236919685
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MobileNetworkSummaryControllerTest
Change-Id: If417b792224261ad1965196d3675f28f55448fd6
2022-10-14 12:19:16 +00:00
Zoey Chen
6f914da06a [Large Screen] Launch MobileNetworkSettings by SubSettingsLauncher
Test: atest
Bug: 197609014
Bug: 209606859
Change-Id: Icda934a26daeee13f663c986ebcbc92c952f9c2e
2021-12-10 08:33:58 +00:00
Zoey Chen
5515e9bde5 [Provider Model] Internal cleanup - remove Provider Model flag and deprecated legacy UI
Test: atest NetworkProviderCallsSmsFragmentTest, SubscriptionsPreferenceControllerTest
Bug: 197066557
Change-Id: I55e0fa2ca7317cd8c9d1bce7c229b8344f43cc92
2021-11-17 10:37:20 +00:00
Zoey Chen
6cf16b0aa9 [Settings] 1. Add configChange for WFC Activity to cover the changes of rotation and screen size
2. register split rule for MobileNetworkActivity

Bug: 204508876
Test: manual
Change-Id: Iff3dae41293e79b274d2928cb51efea46fb45dd4
2021-11-12 15:22:43 +08:00
Arc Wang
80887b6be3 [Large screen] Shows MobileNetworkActivity in 2-pane
MobileNetworkActivity has launchMode singleTask, it makes
the Activity shows in full screen instead of 2-pane.

This change register SplitPairRule for the Activity to show
in 2-pane. However, there are other objects which starts
MobileNetworkActivity, it still needs later CL to refine
and register SplitPairRule for other objects which starts
MobileNetworkActivity.

Bug: 204039043
Test: manual
      Settings -> Network & Internet -> SIMs
Change-Id: Ia15c17c88efd46c5bb2b41aa21848293b9ff5610
2021-11-10 14:39:47 +08:00
Bonian Chen
3f0dc952ac [Settings] Allow disabled SIM to be controlled in UI
Disabled SIM are hidden from UI due to the API only check if there's a
SIM with mobile data capability active within device.

Right now, the UI design has been changed. The UI here should be
accessible no mater with or without the support of mobile data.

Bug: 193820245
Bug: 194761536
Test: local
Change-Id: I9c8b8fa16e74cd0fe4419966cc97ad55b5b87b17
(cherry picked from commit 847f326cd4)
(cherry picked from commit a8ce9abde7)
2021-07-28 11:58:23 +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
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
Zoey Chen
87a5961243 [Provider Model] Show all carrier's name on MobileNetworkSummaryController's summary
Screenshot of Provider Model: https://screenshot.googleplex.com/6mKLeMWGWZJh86u.png

Screenshot of current: https://screenshot.googleplex.com/Abncb2QGh5TWxEv.png

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

Bug: 172229551
Test: manual and make RunSettingsRoboTests ROBOTEST_FILTER=MobileNetworkSummaryControllerTest

Change-Id: I0f2a23659ef80b6a76b34af9503ad8d746967859
2020-11-17 08:33:54 +00:00
Jason Chiu
2d609759cd Add preference click metric logs for some special cases
Bug: 137559984
Test: visual, robotest
Change-Id: If8624b49abcd0000487065160ce4a7ba861f234c
2020-01-02 17:45:23 +08: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
482415d37e Protect entry points to add an eSIM when admin restricted
If the DISALLOW_CONFIG_MOBILE_NETWORKS admin policy is set, we were
accidentally still allowing access to the flow where you add an eSIM
subscription via the "plus" button on the Network & internet page. While
fixing this, I also noticed that the mobile networks list page (which
only becomes available if you have multiple subscriptions) has a link at
the bottom to start the flow as well, and that wasn't being protected.

The fix for the plus button on the Network & internet page was just to
make sure not to call setEnabled(true) if the preference was already
disabled by admin policy, since that has the effect of overriding the
admin-disabling.

The fix for the mobile networks list page just needed to add the
relevant tags in the layout XML, and then we get it for free.

Fixes: 137627845
Test: make RunSettingsRoboTests
Change-Id: I896ac248f50aaeecc157791938a0a0a98265aa07
2019-07-31 12:53:39 -07: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
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
Lei Yu
3000943432 Hide Mobile preference for secondary user
Fixes: 128917967
Test: RunSettingsRoboTests
Change-Id: Ibb95e3f0f42a8c484807a286bc77e8764eb31fcf
2019-04-15 15:17:58 -07:00
Lei Yu
8164361792 Disable Mobile settings in one condition.
If there is no active subscription and esim is unsupported, disable
this preference.

Bug: 129143739
Test: RunSettingsRoboTests
Change-Id: I5f8b0d95df8764a3a505aae5e26df42e9412c021
2019-04-15 12:28:53 -07:00
Antony Sargent
f5bc241627 Use helper method for determining whether eSIM is supported
It turns out to be more complicated than I had thought to determine if a
device should be considered to support eSIM. But the good news is that
we already had a helper method for this - this CL switches to using it
in some code for DSDS UI.

Fixes: 129061243
Test: make RunSettingsRoboTests
Change-Id: I41e500eb70b6c6b725c0ddf09fe1ca1a69df4563
2019-04-09 11:31:08 -07:00
Antony Sargent
10353cd8b6 Fix for affordances to add a mobile subscription
This changes the behavior for when we show an affordance to add a mobile
subscription via the eSIM manager (if eSIM is supported).  On the
Network & internet page, the behavior we now want for the "Mobile
network" pref has several possibilities as detailed below.

No existing subscriptions:
- Summary is "Add a network"
- Tapping on pref leads to the add subscription flow

One existing subscription:
- Summary is the name of the subscription (usually the carrier name)
- Tapping left-hand side of the pref leads to mobile network details
- A "+" button is shown on right of pref, and tapping "+" leads to the
  add subscription flow

2 or more existing subscriptions:
- Summary is "<count> SIMs"
- Tapping left-hand side of the pref leads to a new page with the list
  of subscriptions
- A "+" button is shown on right of pref, and tapping "+" leads to the
  add subscription flow

The existing code controlling the "Mobile network" pref (in
MobileNetworkSummaryController.java) already had behavior similar to
this, but needed to be updated to no longer rely on whether we're in
DSDS mode.

Also, the page with the list of subscriptions that you can go to in the
"2 or more existing subscriptions" case mentioned above has an "Add
more" link at the bottom which leads to the same eSIM manager flow, but
it was always showing this link even if the device doesn't support
eSIM. This CL also fixes that problem.

Bug: 127870567
Test: make RunSettingsRoboTests
Change-Id: Ie8cca47ac81f8992fa6ecf1940bdfed411fd333b
2019-03-15 10:27:21 -07:00
TreeHugger Robot
2feea46860 Merge "Fix unit test problems in MobileNetworkSummaryController" 2019-03-08 23:20:29 +00:00
Antony Sargent
8b26dd27e8 Fix unit test problems in MobileNetworkSummaryController
There were two failing tests due to problems in this class:
-PreferenceControllerContractTest
-SettingsSearchIndexablesProviderTest

In one case it was because we weren't checking for a valid Lifecycle,
and in the other it wasn't implementing PreferenceControllerMixin (or
inheriting from BasePreferenceController).

Bug: 127524919
Test: atest SettingsUnitTests
Change-Id: I662e300d68a21c28e1efb3ec9e23c4a882497176
2019-03-08 11:23:21 -08:00
Antony Sargent
68d56353fb Add extra to the intent for adding additional subscription
In the places where we have a link to let the user add an additional
mobile network subscription, we need the "fore provision" extra added to
the intent.

Bug: 127532036
Test: manual (enable DSDS mode and the settings_network_internet_v2
feature flag, then go to Settings->Network & internet and try clicking
on the '+' button on the right of the Mobile network preference, or
click through that pref if you have 2+ sims and hit the 'Add more'
link. This should bring you into an 'add sim' flow provided by the eSIM
manager)

Change-Id: I56ab2125938f2df07f756d100a7ac993b1e5ced3
2019-03-08 08:51:55 -08:00
Antony Sargent
475dde51b6 Fix some problems with the "Mobile network" preference
This fixes a few issues with the "Mobile network" preference that shows
on the Network & internet page:

-The pref should not be available at all if the device is wifi-only.

-The pref should be disabled in airplane mode.

-If eSIM support is disabled, we need to disable entry points for adding
 a new eSIM subscription (the summary and click handler in single-SIM
 mode with no physical SIM, and the 'add' button in dual-SIM mode).

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ic6fe426e9f890d80b399d48a2c9984d4d8b02a10
2019-02-11 09:50:38 -08:00
Antony Sargent
59adc31773 Add a plus button to the mobile pref on Network & internet page
On the Network & internet page, we have a "Mobile network" pref that in
single-SIM mode leads to a detail page for the current SIM. In multi-SIM
mode it has more complicated behavior (leading either to details about
the current subscription if there is only one, or a list of
subscriptions if more than one).

One of the things we wanted to add was a shortcut to add another eSIM
subscription. So this CL adds a plus button control on the right of the
preference which leads to a flow to add another mobile subscription via
the eSIM manager.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: I38e0031e3bd603e93c45dcb4557750e7bc1b8b5a
2019-01-29 12:27:46 -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
f4ee4ef3bf Add page listing multiple mobile networks
When a device supports simultaneous connection to multiple mobile
networks, we want the "Mobile network" entry on the Network & internet
page to list the number of active SIMs and when clicked, go to a page
that lists them all.

Bug: 116349402
Test: make RunSettingsRoboTests
Change-Id: Ie642d7801cda07dcbbe74d42c234db6605566be4
2019-01-15 21:57:39 -08:00