Commit Graph

72 Commits

Author SHA1 Message Date
Bonian Chen
8a439d0a02 [Settings] Code refactor for SIM change detection
Code refactor for maintainance:
  Move subscription change monitor out of ResetnetworkConfirm

Bug: 259611847
Test: local test, auto testing
Change-Id: I97a251ced4435d0cc390b40028edef07fd71e24f
2022-12-05 05:42:11 +00:00
Bonian Chen
e76bcc5388 [Settings] Code refactor
Wrap reset options into an Object, for better supporting

Bug: 260034791
Test: auto testing
Change-Id: I98cc12440414077b600bba0b5598c887608419cc
2022-11-23 12:52:55 +00:00
Bonian Chen
c3028291ed [Settings] Code Refactor
Adjust code structure for maintainance.

Bug: 259611847
Test: auto test
Change-Id: I1fab8d0347f64c01ee768e4bb9ea838a9e7ad4fc
2022-11-19 13:14:07 +00:00
Bonian Chen
e1f641a130 [Settings] Code Refactor
Adjust code structure for maintainance.

Bug: 259611847
Test: auto test
Change-Id: I6710aa814441c0858c712f416ffddde44081d4d1
2022-11-18 08:36:53 +00:00
hoffc
6771edae5c Settings: Fix sometimes reset progress dialog not dismissed
The display of reset progress dialog takes time. User can initiate multiple clicks and show multiple progress dialogs during the internal. But in fact, only once dismiss request initiated.

Check the reset progress dialog, if it is showing, dismiss it firstly before show another reset progress dialog.

Change-Id: Ia944990ea489927b38be59b1f7a8ad66fc8b669a
Buganizer: 227413950
2022-03-30 14:28:17 +08:00
William Escande
cd1d375cbd API Review: factoryReset->clearBluetooth
> Consider renaming the factoryReset method to “clearBluetooth”.

Bug: 222725037
Test: TH
Tag; #refactor

Change-Id: Id42a3344b6ae1a42d0128d2a055b9710f81c4b81
2022-03-16 16:14:11 +01:00
Lorenzo Colitti
5320dbda4e Merge "Reset VPN settings by calling VpnManager." am: be4a0e84ef am: 9e072f09a0 am: e584f62ac4
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1594351

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I24d89cb5138f86d86a0981b7580f52c50b70133b
2021-02-20 17:32:39 +00:00
Lorenzo Colitti
e584f62ac4 Merge "Reset VPN settings by calling VpnManager." am: be4a0e84ef am: 9e072f09a0
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1594351

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I09ebb58281e60c246550426b2b962a4dce6b72ad
2021-02-19 09:16:56 +00:00
Lorenzo Colitti
b5ea7d584e Reset VPN settings by calling VpnManager.
Currently, ConnectivityManager#factoryReset calls
VpnManager#factoryReset. Call the VpnManager method directly so
it can be removed from ConnectivityManager.

Bug: 173331190
Test: atest SettingsRoboTests
Change-Id: I7c702a627cd448dbde40e0d885fbc570ecd1e55d
2021-02-18 23:51:11 +09:00
Jeremy Goldman
398a500ea7 Log added once Network Factory Reset is complete
Test: N/A log message
Change-Id: I1372b2b535c50a79a1253555975d85cd2ca2be31
2020-12-22 00:40:01 +00:00
Jiashen Wang
5e9380f512 Merge "Move eSIM reset before telephony manager reset in ResetNetworkConfirm" into rvc-qpr-dev am: 60de630fee am: ac636e9678
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13226296

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib4b7d4f3c411a05b1d2279928e7831c7c420e37b
2020-12-17 18:52:41 +00:00
Bonian Chen
0da056b2dd [Settings] Close reset network confirm dialog when SIM removed
When SIM removed, the network reset confirm UI no longer represents
the wordings which presented to the user.

Proceed on resetting will only reset APN on removed SIM and
lead to some side effect if user inserted a new SIM while
keeping displaying the confirmation dialog.

With this situation, close the confirmation dialog is current
decision in design. And the UI which prior to the confirm UI
also need to be updated to avoid from user accessing that
removed SIM.

Bug: 171070050
Test: manual
Change-Id: I338835ca98593f95d98bafa70f12b177c43bf91a
2020-12-16 02:35:26 +00:00
Jiashen Wang
c1ed4d5485 Move eSIM reset before telephony manager reset in ResetNetworkConfirm
TelephonyManager#resetSettings triggers modem restart. It could cause
eSIM reset failure since Modem is not available. In order to resolve
this issue, we move eSIM reset befor telephony manager reset.
Bug: 175239934
Test: Manually tested

Change-Id: I44644c67577469898726ba07dcd6b68b3fb73b2a
2020-12-14 22:44:41 -08:00
tom hsu
2fd7c9ffd1 [Settings] Refractor ApnSettings code to independent package folder.
Bug: 169750507
Test: make RunSettingsRoboTests
Change-Id: I8b2709ba8d16c625863d8a17abc3d0ab5d019bb8
2020-09-30 15:56:01 +00:00
Edgar Wang
21f8cb3a44 Refactor Reset options Settings
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: I94969f6903d047b9bc41b1e8c14096c92c460b38
2020-08-04 23:33:50 +08:00
Bonian Chen
3fef55d53b Remove reference of Phoneconstants for SUBSCRIPTION_KEY
- use SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX instead of it

Test: make
Test: m RunSettingsRoboTests
Merged-In: Ic635b11c995077ebf1e143d9562b100d7730fe52
Change-Id: I42cbf1074af3b325ebb37281efd505954a2ca25c
2020-03-06 09:07:24 +00:00
tom hsu
a381196b8b Remove reference of Phoneconstants for SUBSCRIPTION_KEY
- use SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX instead of it

Test: make
Test: m RunSettingsRoboTests
Change-Id: Ic635b11c995077ebf1e143d9562b100d7730fe52
2020-01-14 15:31:02 +08:00
Betty Chang
b8104d5e70 Merge "[Mainline] To use @SystemApi to replace non-formal APIs for mainline" 2020-01-09 06:50:13 +00:00
Bonian Chen
4fa40aed87 [Settings] Remove IMS factoryReset()
IMS factoryReset() has been done within
TelephonyManager.resetSettings().

Bug: 147342492
Test: manual
Change-Id: Ic17b8235e76a4bcf3e6bf5329a88477697a33c51
Merged-In: Id5c868726189397fc2a85717326e56e055b640af
2020-01-08 14:15:37 +00:00
Bonian Chen
45d9f23fee [Settings] Remove IMS factoryReset()
IMS factoryReset() has been done within
TelephonyManager.resetSettings().

Bug: 147342492
Test: manual
Change-Id: Id5c868726189397fc2a85717326e56e055b640af
2020-01-08 22:12:01 +08:00
changbetty
ebe36cf96c [Mainline] To use @SystemApi to replace non-formal APIs for mainline
- getResourcesForSubId(Context, int, boolean)
      - @SystemApi getResourcesForSubId(Context, int)
    - isUsableSubIdValue(int subId)
      - public isUsableSubscriptionId(int subId)

Bug: 147206736
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ResetNetworkTest
      make RunSettingsRoboTests ROBOTEST_FILTER=ResetNetworkConfirmTest
      make RunSettingsRoboTests ROBOTEST_FILTER=CellularFallbackPreferenceControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=WifiCallingSettingsForSubTest

Change-Id: I1a67db80b114a438afda7d45af90e54af38703c3
2020-01-08 22:06:26 +08:00
zoey chen
f74850d559 [Settings] Replace #getSubscriberId(I) with #getSubscriberId()
Bug: 146823314
Test: make
Change-Id: Idec4b7ed362a3be0693fa9670ecb2aba7c7fd1d1
Merged-In: Idec4b7ed362a3be0693fa9670ecb2aba7c7fd1d1
2019-12-25 16:23:16 +08:00
zoey chen
353926a446 [Settings] Replace #getSubscriberId(I) with #getSubscriberId()
Bug: 146823314
Test: make
Change-Id: Idec4b7ed362a3be0693fa9670ecb2aba7c7fd1d1
2019-12-25 15:04:20 +08:00
zoey chen
7ab984b603 [Setting] Use @SystemApi to replace the hidden api
Bug: 145785535
Test: make
Change-Id: I32554eec8e9f0477a7342a8137a32939b5393fad
Merged-In: I32554eec8e9f0477a7342a8137a32939b5393fad
2019-12-18 17:41:02 +08:00
zoey chen
8ea5428c07 [Setting] Use @SystemApi to replace the hidden api
Bug: 145785535
Test: make
Change-Id: I32554eec8e9f0477a7342a8137a32939b5393fad
2019-12-18 10:39:48 +08: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
Raff Tsai
a5b25dfb06 Misc change about ResetNetworkConfirm
- Modify reset network layout
- Merge changes from Qt-dev

Fixes:131127455
Test: manual
Change-Id: I6d63a821016588ea81a04ef792111c2b96dfe7fe
2019-05-07 09:31:15 +00:00
Raff Tsai
1f0a1171b7 ANR observed under settings when trying to reset network settings
- Move reset network settings code to async task.

Test: manual, Robolectric
Fixes: 130772994
Change-Id: I59345f48ed840ecfd64c29c2c20ab8caf2679f63
Merged-In: I59345f48ed840ecfd64c29c2c20ab8caf2679f63
2019-05-03 13:02:07 +08:00
Raff Tsai
3aeb915355 ANR observed under settings when trying to reset network settings
- Move reset network settings code to async task.

Test: manual, Robolectric
Fixes: 130772994
Change-Id: I59345f48ed840ecfd64c29c2c20ab8caf2679f63
2019-04-25 02:55:25 +00:00
Andrew Sapperstein
88930e373e Update eSIM deletion strings.
Adds some conditional behavior for the confirmation screens.
When the erase eSIM option is visible and checked, shows alternate string.

Fixes: 126262481
Fixes: 118751918
Test: visual inspection & make -j RunSettingsRoboTests
Change-Id: I40f983b03ad470d785bf104e645dbc92e7897d2d
2019-03-22 13:03:25 -07:00
Amit Mahajan
defd0155a1 Merge "Move SMS raw db deletion to phone process." am: 479ec92c27 am: f784db5cae
am: 1285b12980

Change-Id: I349002ff9a72b08056a8af47361de4914afb2b3d
2019-03-14 18:55:13 -07:00
Amit Mahajan
d0ff80dc79 Move SMS raw db deletion to phone process.
Test: manual
Bug: 127929687
Change-Id: Ib23efc647fbd4b3007197932b9493393dc5b4d5b
2019-03-13 17:36:16 -07: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
Jimmy Chen
d62453d3de p2p: do P2P factory reset for Network Reset
Bug: 109866998
Test: * manual trigger network reset in below conditions:
        * trigger network reset with P2P on
        * trigger network reset with WiFi on, P2P off
        * trigger network reset with WiFi off
        * trigger network reset with WiFi off then do reboot
      * check groups shown in WiFi Direct page
      * use wpa_cli -i p2p0 list_network
Test: RobotTest - make ROBOTEST_FILTER=ResetNetworkConfirmTest

Change-Id: If5292e34cb9702d4319a4c9bbd867e0e5ed716a2
2018-11-09 18:41:36 +08:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07: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
Aurimas Liutikas
b1af85d155 Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
2018-08-28 11:48:56 -07: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
Brad Ebinger
c30af9b8d1 Merge "IMS: Use the slot based ImsManager factory reset API." am: 9e4ff6fca6 am: 15ca33865c
am: aca1e304bd

Change-Id: I0b3b6198e895caf4c33354ffb2fc20b599540387
2018-07-16 14:21:57 -07:00
Brad Ebinger
15ca33865c Merge "IMS: Use the slot based ImsManager factory reset API."
am: 9e4ff6fca6

Change-Id: I42b0a06ed5707475d105646233ac49958de29d75
2018-07-16 13:32:55 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Malcolm Chen
0508cb5c46 Clean Sms raw table when resetting network.
There has been issues when Sms raw table somehow stores orphan
fragments. They lead to garbled message when new fragments come
in and combied with those stale ones. While we work on proper
fixes, one of the options we offer to the user if it happens again,
is to reset all network settings which will clean up this table.

Bug: 77910620
Test: manual test
Change-Id: Ib80c395fb9a1501f35716fdca43df3e5c87893c7
2018-04-17 15:57:18 -07:00
Pengquan Meng
7a1c93dcf3 Move apn settings to network
This is a clean up CL, move the apn settings related class from settings'
root to network's directory.

Bug: 77339683
Test: make ROBOTEST_FILTER=ApnEditorTest -j40 RunSettingsRoboTests
Change-Id: I751a6c2a27c9a1e08d7308407d75ccb355f295aa
2018-04-02 17:27:56 -07:00
Fan Zhang
c0c3eaa66c Remove more wrappers
Bug: 76167422
Test: make RunSettingsRoboTests -j40
Change-Id: I0dc42c483ae92d508dec94e42573b55ced0e4bb0
2018-03-30 14:29:50 -07:00
Suresh Koleti
981f940ee9 IMS: Use the slot based ImsManager factory reset API.
Use the slot based factory reset API of ImsManager
to reset the IMS settings values for appropriate sub.

Test: Manual
Bug: 74412226
Change-Id: Iceabb225764ac01f0172142ef95e874ca93c061d
2018-03-09 13:12:09 +05:30
arangelov
e35badd9d5 Make "Action not allowed" dialog compliant with Material Spec and replace full screen activities with the dialog.
Bug: 64893948
Test: make ROBOTEST_FILTER=ActionDisabledByAdminDialogTest -j40 RunSettingsRoboTests
Test: make ROBOTEST_FILTER=ActionDisabledByAdminDialogHelperTest -j40 RunSettingsRoboTests
Change-Id: I9308d8d86a3789b8f2c92b9f4f20cf00cce71d14
2018-03-05 20:27:51 +00:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
Antony Sargent
1a0d4428ba Call super.onDestroy in ResetNetworkConfirm fragment
Test: monkey tests
Change-Id: I0ca8d0296db20a48e318391ef111cada8109e13b
Fixes: 72999943
2018-02-06 15:49:12 -08:00
Doris Ling
72489725c6 Change superclass to InstrumentedFragment.
- for fragments that do not implement the preference screen, change them
to inherit from InstrumentedFragment instead.

Change-Id: I791c2634024bd2c248efea955be5c680180d735c
Fixes: 68277111
Test: make RunSettingsRoboTests
2018-02-02 13:41:16 -08:00