Commit Graph

24 Commits

Author SHA1 Message Date
Malcolm Chen
1305cee98e Automatically dismiss SIM combination warnings and selection dialogs.
When configuring CBRS profiles this dialog / notification will be
dismissed after configuration is done, to avoid confusion.

Bug: 142092510
Test: manual and unittest
Change-Id: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
Merged-In: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
2020-12-15 16:45:27 -08:00
zoey chen
ac92bab305 [Settings] Replace #getSubIdForPhoneAccount with #getSubscriptionId
Bug: 146823458
Test: make
Change-Id: I437a6e325112bf9d031a4eb11c28cb755c085bee
Merged-In: I437a6e325112bf9d031a4eb11c28cb755c085bee
2019-12-25 16:27:00 +08:00
Brad Ebinger
d206835fe3 Allow SimDialogActivity to be started for result
In Telephony, we sometimes need to be able to launch
the SIM pick dialog activity for SMS without setting
a new default (i.e. user chose "ask every time") for
default SMS subscription.

Adds the ability for the SimDialogActivity to be
called using startActivityForResult and not set the
user's choice as the default.

Bug: 130853716
Bug: 130567323
Test: run Telephony SmsManagerTestApp
Change-Id: If9f9ebbfe9b7b6718ed759937abbcfa6d22c6295
2019-05-10 18:29:54 +00:00
Fan Zhang
e83d718ff9 Include always ask button in SIM picker dialog
Fixes: 129433330
Test: manual
Change-Id: Ia7e5af56541aaf66df9e1749c1cc6e7f97d55a0b
2019-04-24 14:11:50 -07:00
Antony Sargent
a7dc277459 Fix problem of multiple stacked copies of "Select SIM" dialog
The SimDialogActivity is used to ask the user questions about which SIM
card to use for various services like calls, SMS, and data. In some
cases of SIM changes (eg when a SIM is added or removed), the telephony
stack sends a broadcast that SimSelectNotification listens for so it can
pop up a general "SIM cards changed" notification, and we additionally
want to bring up an interruptive dialog to ask the user a specific
question. This might happen for instance when we want to ask the user's
permission to turn on data on a SIM.

Recent DSDS changes in the telephony stack have meant that we
accidentally create several stacked copies of this dialog, because they
send several broadcast updates as information about SIMs asynchronously
changes. For instance, we might initially detect a SIM with a generic
name of "CARD 1", and shortly after discover the actual carrier name. So
what we really want is to put up the dialog, and update it as
information changes.

This CL makes SimDialogActivity use launchMode="singleTop" so that
additional copies of the activity won't be launched. Then it internally
enforces only showing one dialog per type of request (calls, SMS, data,
or preferred sim). If we get a request for a dialog that already exists,
we just update it instead of creating a new one for that type. So there
can still be a stack of more than one dialog, but each one will be
asking a different question.

This also refactors the monolithic, somewhat confusing code for showing
the various types of dialogs into a more clearly separated class
hierarchy, and switches to using DialogFragment for the dialog.

Fixes: 126596081
Test: manual (start with device in DSDS mode with 2 subs, remove SIM
card and re-insert it)

Change-Id: I0dbc41dc3b15015389823a24df10bbff08ec6615
2019-04-15 06:16:52 -07:00
Antony Sargent
85717d9f8d Use better string in dialog asking which SIM to use for SMS
Right now when you have a dual-SIM device but no default set for which
one to use for SMS, when you go to try and send an SMS you'll get a
dialog asking which SIM to use with the generic string of "Select a SIM
card". We recently added a more specific string for this in a separate
CL, which reads "Select a SIM card for SMS". This CL switches the code
to use that more specific string.

Bug: 129021763
Test: compile / manual
Change-Id: I7d12a7191de23366b0a6b6888021e57ff9ddced9
2019-03-28 10:31:36 -07:00
Malcolm Chen
e8fabb522a Enable data when user selects default data through popped up dialog.
In DSDS device, when user explicitly selects a SIM as data SIM, we
should not only set it as default data SIM in Telephony, but also
enable its data.

Bug: 120712558
Test: manual
Change-Id: I429efa090ebf5bb71ee491ae66525abee00f62c6
2019-02-06 15:23:23 -08:00
Malcolm Chen
14dde50c3a Don't show hidden Cellular subscription in Settings.
Replace getActiveSubscriptionInfoList() with
getActiveSubscriptionInfoList(true) so that settings will not show
hidden subscriptions to the user in various pages.

Bug: 121396526
Test: manual
Change-Id: I717999fed7d3a5a037914239694bef52df7c6207
2019-01-16 00:21:30 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
liurong
c2daeaf7e7 Optimized Code: call direct method to get integer extra
Description: Make the default preferred sim slot as the first one(0) when get PREFERRED_SIM.

Test: NA
Change-Id: Id54bdbefd413c58ecd637cb8ff522861ead79331
Signed-off-by: liurong <liurong@xiaomi.com>
2017-03-16 22:02:32 +08:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Stuart Scott
f51d006350 Correct the way settings deals with subscriptions.
Change-Id: I19e9dfaf248fce7376b124ee91de7e73fdc99fb3
2015-04-08 11:11:34 -07:00
John Spurlock
9a23adf69d Settings: Remove all unused imports.
Change-Id: Iebfa52cb849d69974c94902b0b020893cf5618a3
2015-03-18 15:51:15 -04:00
Santos Cordon
9a9c361523 Update Multi-SIM setting to use getSubIdForPhoneAccount API.
Settings app should not be parsing the subId direction from the phone
account.  Instead this CL updates the settings app to use a new API to
grab the sub ID.

Change-Id: Iefd1831b04c061168fa2b135a2d296a27e3d4e92
2015-02-19 21:29:35 -08:00
Sanket Padawe
4d902bcc8f Fixed crash caused by non-integer phoneAccountId in SimDialogActivity.
Bug: 18834691
Change-Id: I75b5ba4d72523474fe91eaf80f8201d9a53a683a
2015-01-06 10:54:55 -08:00
Sanket Padawe
79d5da7bf6 Fixed settings crash issue while recovering from phone crash.
Bug: 18816868
Change-Id: I2b3015f563aed2d997a3a5466ca8f0689fc53ddb
2014-12-22 10:33:49 -08:00
Sanket Padawe
d059127659 Merge "Exiting activity on clicking outside dialog acitivity." into lmp-mr1-dev 2014-12-16 02:42:17 +00:00
PauloftheWest
c6f5c924d8 Merge "Fixed then icons of SIMs in the call dialog." into lmp-mr1-dev 2014-12-15 22:46:58 +00:00
PauloftheWest
a886d69f9d Fixed then icons of SIMs in the call dialog.
Bug: 18672758
Change-Id: I812e79a48b048f8449cc07fdcccab57a114cdd24
2014-12-12 12:21:17 -08:00
Sanket Padawe
75e0082ae8 Exiting activity on clicking outside dialog acitivity.
Bug: 18705619
Change-Id: I50cb08884f1c97352f5ad3a3e7d218b42af1ada4
2014-12-11 14:36:26 -08:00
Stuart Scott
b3dd601286 Show toast when cellular data option is changing.
bug: 18594162
Change-Id: I19dc265af47c0a40a6ace6d4bf42e21e035daf0a
2014-12-10 13:31:36 -08:00
PauloftheWest
c29c583536 Fixed a SIM Cards crash.
+ Added a check if getActiveSubscriptionInfoList returns null.

Bug: 18634751
Change-Id: Ib6012816c26525a61fb199912d06d6c1572e0fd6
2014-12-08 12:24:28 -08:00
PauloftheWest
ffef98b3a0 Add SIM notification pop-ups.
+ Added a SimDialogActivity so any application can iniate a request to
se tthe default Data, Calls, and SMS.

Bug: 18293625
Change-Id: I60535125b40ece5ebc14542d732e4493bddefbae
2014-12-02 16:35:32 -08:00