Commit Graph

66 Commits

Author SHA1 Message Date
hoffc
39d16d7bfb Fix sim status details not updated after sim hotswap
Telephony callback may be removed in onPause during sim hotswap, but they are not re-registered in onResume for sub info still null.

Listen sub info change and re-register telephony callback when need.

Test: function test pass and SimStatusDialogControllerTest unit test pass.

Change-Id: I17e60c9e3441fc593107048494f830408c37ae61
Bug: 384643359
2025-01-08 11:53:26 +08:00
Chaohui Wang
33d73862bf Refactor signal strength in SIM status
- Move data logic into repository for better testing
- Check carrier config first, if not shows some items, we don't need to
  load data
- Tests in SimStatusDialogControllerTest will be fixed in later cls

Bug: 337417520
Test: manual - on SIM status
Test: unit test
Change-Id: Iccd209fd455d66d4f6438652ee7481d2a0e72a99
2024-05-28 12:35:10 +08:00
Chaohui Wang
3b925a0cfe Refactor SimStatusDialogRepository
- Move data logic into repository for better testing
- Check carrier config first, if not shows some items, we don't need to
  load data
- Tests in SimStatusDialogControllerTest will be fixed in later cls

Bug: 337417520
Test: manual - on SIM status
Test: unit test
Change-Id: Ia0c32882f0b35ec9154b3da58ac6a7b98c879efc
2024-05-28 11:41:24 +08:00
Chaohui Wang
fa0c8d4fd1 Migrate to new ImsRegistrationCallback
Migrate from deprecated api, and use new api as flow.

Bug: 337417520
Test: manual - on SIM status
Test: unit test
Change-Id: I8f938c0ccb6e3e61f8d4f6cb72c293f564351d52
2024-05-22 10:51:00 +08:00
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Bonian Chen
c9ace54b03 [Settings] Unified the source of phone number
Route UI access to phone number into a unified util class within
Settings app.

Bug: 265940535
Test: local

Change-Id: Ic747b0044217101d9a6a1e2cd6e59bbdbcd88021
2023-02-13 04:57:18 +00:00
Bonian Chen
25b403500f [Settings] Remove EID from SimStatusDialog
Remove EID field.

Bug: 260540995
Test: local
Change-Id: I0da91b6e0f21d11aa9ba1660e759b532eb7b7c35
2022-12-28 04:58:55 +00:00
Bonian Chen
6a383db74b [Settings] Add QR code for EID and enable text copy
1. Add QR code for EID (when available)
2. Enable text copy

Bug: 260540995
Test: local
Change-Id: Iba7eace2ca3142a065219a3e65371af52df1511c
2022-12-12 12:50:28 +00:00
Michael Groover
6ce57b67fb Add unaudited exported flag to exposed runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting U or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the U release.

Bug: 234659204
Test: Build
Change-Id: I8fbcf69575d829f26e02d661498d69f5fc8740d0
2022-10-11 17:26:02 -05:00
Bonian Chen
d051e65d3c [Settings] Support phone number talkback
Support phone number talkback in about phone UI pages.

Bug: 182923869
Test: local, junit
Change-Id: I159827070a954dee13230ff7cf6de81dbbaa7545
2021-12-07 10:22:24 +00:00
sandeepjs
40ffe69a3e eSIM deprecated API test Refactoring
Test: build
Bug: 159354974
Change-Id: Iedeb90f186ab9f82894e2fecef86d339c8989542
2021-11-15 05:44:54 +00:00
Jeremy Goldman
300d35062e Null check added when updating the roaming status.
If the serviceState is null, calling getRoaming will cause a crash.
Instead of calling this method, set the string to not-roaming if the
value is null.

Test: atest -c SettingsUnitTest
Bug: 184334050
Change-Id: Ifa8a006838ea17f7d098c1b83bb6ab0349e7d569
2021-06-18 10:46:30 +08:00
Zoey Chen
b8a639f8fd [Settings] Use TelephonyManasger.registerTelephonyCallback instead of TelephonyManager.listen
Bug: 175270951
Test: make and atest
Change-Id: I15e1a199e6a34914db97055bfea9392c5bbdc9c6
2021-03-12 19:27:05 +08:00
SongFerngWang
a5035d9ce7 Add NR SA OVERRIDE_NETWORK_TYPE_NR_ADVANCED for TelephonyDisplayInfo
NetworkTypeController set OVERRIDE_NETWORK_TYPE_NR_ADVANCED when
device connect NR and frequency is mmWave.

Bug: 179443240
Bug: 179453836
Test: atest frameworks/opt/telephony/src/java/com/android/internal/telephony/NetworkTypeController.java
atest packages/apps/Settings/tests/unit/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogControllerTest.java

Change-Id: Ib95f6a012c0f725335f46e17b8414005a76ad5c9
Merged-In: Ib95f6a012c0f725335f46e17b8414005a76ad5c9
2021-02-08 14:04:18 +00:00
tom hsu
ba845f7fe4 Avoid wrong telephonymanager with wrong sub id.
When initialized SimStatusDialogController, also create TelephonyManager
with sub id.

Bug: 174171839
Test: Manual test passed, see b/174171839#25
Change-Id: I6bd6975e39c75884252b9d0bcd9d5548dbdfe6d5
2021-01-28 06:26:21 +00:00
Jeremy Goldman
e068542f53 SimStatusDialogControllerTest converted to JUnit
Bug: 175389659
Test: atest -c SimStatusDialogControllerTest
Change-Id: Id2cfb01714f1756f9251b2319d83a1609488b0f6
2020-12-21 04:45:13 +00:00
Sarah Chin
396934a092 Sync main branch with QPR branch changes
Original change (ag/13006754) was modified to merge in QPR
(ag/13023201). Adding the same changes to the main branch to keep it
consistent.

Test: make RunSettingsRoboTests
Bug: 167643728
Change-Id: Iedf14d2c2ac9181c9aad0ed929b19ffeb60560b2
2020-11-12 15:58:46 -08:00
Sarah Chin
3b3704d693 Update signal strength on ServiceState in service
Test: make RunSettingsRobotTests
Bug: 167643728
Change-Id: Ibf69f9e9ec2acafef1316069d37b8d2a27d7d4d7
2020-11-06 14:08:17 -08:00
Treehugger Robot
16503cf517 Merge "Settings: Fix exception in about phone during SIM swap" 2020-08-19 14:47:21 +00:00
hoffc
291fd9b816 Settings: Fix exception in about phone during SIM swap
In about phone SIM status dialog fragment does not correctly remove the subscription change listener and broadcast receiver during SIM swap, which results in IllegalStateException force close and memroy leak.

Make sure to remove sub change listener and un-register broadcast receiver in SIM swap case.

Bug: 159410236

Change-Id: I7867852c58b2b38e0afc73422b7d616aa305199c
2020-08-18 13:57:55 +08:00
Amit Mahajan
42d1d4be6b Look up CBS package name through PackageManager.
Instead of hardcoding it.

Test: manual
Bug: 154436403
Merged-In: I0feb356e6cd4868f71198bdee49a7658b4b98b5d
Change-Id: I9b3b3464614eac7394434e55eb142bc1053e8758
2020-08-05 21:58:45 +08:00
Bonian Chen
44bc04a137 [Settings] Update EID in background
Access EID in background thread to avoid blocking UI.

Bug: 153407357
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=SimStatusDialogControllerTest
Merged-In: Id30851bbd0b0fe080ed703586f9718be8b97abdd
Change-Id: I23fc6168d939bb5cb5e281413462176e7221819c
2020-08-02 22:38:13 +08:00
Sarah Chin
1017caf120 Remove NR NSA from voice network type
Since voice calls on NR NSA use LTE, the voice network type
should not be updated to be NR NSA.

Test: manual testing
Bug: 159382203
Change-Id: I77d92fab0020da356ae43293016237be7494c1e2
Merged-In: I77d92fab0020da356ae43293016237be7494c1e2
2020-06-24 00:40:40 -07:00
Sarah Chin
de62ae7ff4 Add logic for 5G icon to SIM status dialog
Test: manual test with fake 5G data network type
Bug: 156815536
Change-Id: I764f4ade8032511b44098e7eccb19b909fccc717
Merged-In: I764f4ade8032511b44098e7eccb19b909fccc717
2020-06-23 15:32:07 -07:00
Bonian Chen
8dd1b0258d [Settings] Avoid from crash when pull out SIM
Avoid from crash when pull out SIM under SimStatusDialogController.

Bug: 153512823
Test: manual
Merged-In: I3869326bdfb65368827f25469ae83539a68e171f
Change-Id: I60500c058cf15bc432e46e27fe4b9fb1ae2989b7
2020-04-10 16:42:57 +08:00
Bonian Chen
d9957643d9 [Settings] Replacing SubscriptionManager#addOnSubscriptionsChangedListener API
Replace SubscriptionManager#addOnSubscriptionsChangedListener API in
order to compatible with legacy design.

Bug: 151838951
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=SubscriptionsChangeListenerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=ActiveSubsciptionsListenerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=SimStatusDialogControllerTest
Merged-In: Ib98ce0dcbf18b6f48a6f267dd9e7be017d571157
Merged-In: I350604a64a56151195f52d38bd258e34c76e40c5
Change-Id: I4fc89e91381b1562ee7e2f48cfc159949c81a414
2020-04-08 06:38:10 +00:00
Jack Yu
922e1d23d8 Added slot index in area info broadcast
Added slot index information in the broadcast
so the receiver knows which slot to get information.

Test: Manual
Merged-In: Icd1bcc2fa905bae6b0f2220e9a27178711bac0c7
Change-Id: Icd1bcc2fa905bae6b0f2220e9a27178711bac0c7
Fix: 150126754
(cherry picked from commit 5a4dabcba2)
2020-03-20 13:18:09 -07:00
Daniel Bright
b9fd856273 [Mainline] Remove NETWORK_TYPE_LTE_CA
NETWORK_TYPE_LTE_CA is not bubbled up outside of the Telephony Packages

Test: make,flash
Bug: 147111233
Merged-In: I1eed95ee1060aff953306a696e91e0205acdad7c
Change-Id: I1eed95ee1060aff953306a696e91e0205acdad7c
2020-03-09 17:27:06 -07:00
Bonian Chen
a0b4ca3684 [Settings] Replace isImsRegistered
Replace isImsReigstered() by callback from ImsMmTelManager.

Bug: 140542283
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=SimStatusDialogControllerTest
Merged-In: I904da749df7074918d205ebd004a173ed109c561
Change-Id: I193805ef947636e50bb21d273be15361378d8f8a
2020-03-03 15:11:27 +08:00
tom hsu
28c11a8c01 Remove reference to PhoneConstant.
Create static constant in SimStatusDialogController.

Test: make
Test: m RunSettingsRoboTests
Change-Id: I2e1b9ac5b9ab051876f1bb26866d055f822bac90
Merged-In: I2e1b9ac5b9ab051876f1bb26866d055f822bac90
2020-03-03 15:08:36 +08:00
Jack Yu
98973e3ba1 Refactored cell broadcast area info support
Area info cell broadcast messages are not handled
by cell broadcast receiver anymore. Instead, they will
be processed in cell broadcast service. Privileged apps
that are interested in getting the information will need
to get it directly from cell broadcast service.

Note this is only enabled for certain countries and carriers.

Test: Manual
Bug: 141318859
Merged-In: If6a0a0c6a76e8b90a8feaea1e2771993e2d0edfe
Change-Id: If6a0a0c6a76e8b90a8feaea1e2771993e2d0edfe
(cherry picked from commit c4da22a2ce)
2020-02-04 20:42:43 -08:00
SongFerngWang
d6bc6dee08 Mainline:SimStatusDialogController decouple TelephonyManager hidden APIs
- telephonymanager set subid by createForSubscriptionId
  -getDataNetworkType(I)
  -getVoiceNetworkType(I)
  -getSimSerialNumber(I)
  -getServiceStateForSubscriber(I)
- copy getNetworkTypeName() to SimStatusDialogController

Bug: 143998492
Test: Build pass.
      make RunSettingsRoboTests ROBOTEST_FILTER\
      =SimStatusDialogControllerTest

Change-Id: Ieb8547496a4b0da7332abd227056f9b786c7ef6a
2019-12-23 14:12:56 +08:00
Yoshiaki Naka
81dbc00b6e Retrieve EID from each card
Each eUICC has its own EID. The same EID retrieved from the default
eUICC shall not be displayed for all the SIM status dialogs when the
device supports multiple UICCs.

Bug: 141256483
Test: Manual and SimStatusDialogControllerTest

Change-Id: I367ae3a5f97ff92e03312bed6fe37727ae3798ab
2019-12-18 17:57:47 +09:00
SongFerngWang
54b00d859b Mainline use cellSignalStrength instead
Bug: 146046311
Test: 1. open SIM status and check signal strength. (PASS)
2.atest make RunSettingsRoboTests /
ROBOTEST_FILTER=SimStatusDialogControllerTest(PASS)

Change-Id: I93e9dc09a01aa76b7d26660a32944df79cda93f3
Merged-In: I93e9dc09a01aa76b7d26660a32944df79cda93f3
2019-12-12 16:15:21 +08:00
Bonian Chen
dfba6f8720 [Setting] Fix merge conflict
Fix merge conflict for I367ae3a5f97ff92e03312bed6fe37727ae3798ab

Bug: 144960427
Test: build pass
Change-Id: I24d684b4e695e8ab777f2ba7811b93f6028260d9
Merged-In: I5dfb71ceb87a8f658ef7fbceacf460ef8d35593a
2019-11-26 07:20:30 +00:00
Sunny Shao
f3865e9264 Synced the code from master branch
Fixes: 144364245
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.deviceinfo.PhoneNumberPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.deviceinfo.simstatus.SimStatusDialogControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.network.telephony.RenameMobileNetworkDialogFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.homepage.contextualcards.deviceinfo.DeviceInfoSliceTest
Change-Id: Ibb26f5a63a969b28915a226a0197bc4033c91346
Merged-In: I5dfb71ceb87a8f658ef7fbceacf460ef8d35593a
2019-11-14 21:57:12 +08:00
Chen Xu
24a72eb92a move CellBroadcastMessage from telephony-common to app
1. add slotIndex in SmsCbMesage(cellbroadcast can be received
when sim is absent)
2. move cellbroadcastMessage from telephony-common to app
next step, considering merging CellBroadcast to SmsCbMessage

Bug: 135956699
Bug: 141962867
Test: build & unit test
Change-Id: Iba5e727fc1a1adaf44a7fa1eebfefe34fa8644aa
(cherry picked from commit 86a8e9b627)
Merged-in: Iba5e727fc1a1adaf44a7fa1eebfefe34fa8644aa
2019-10-20 04:05:06 +00:00
Antony Sargent
5c46d93bd8 Prevent NullPointerException in SimStatusDialogController
In rare cases the SignalStrength we get for a SIM can be null, which
wasn't checked for in this code. This CL adds a null check and fixes the
tests so it's possible to verify the fix (one of the methods that would
have crashed was being spy'd over unnecessarily).

Fixes: 132570076
Test: make RunSettingsRobotests
Change-Id: Ifdec24f184ee2d93e5e242eb2c20695249992fc6
2019-05-21 10:02:10 -07:00
Pengquan Meng
0ab776f69d Fixed network name for about/sim_status
The network name in sim status dialog is not the same as the one in the
about page. This CL use the carrier text which is resolved in
ServiceStateTracker as the network name, this keep the network name sync
with the status bar and the summary of sim status in the about page.

Bug: 31784938
Test: build & manual test
Change-Id: Ia741baabaa98ae447dbedf9e28fd2fda222e6d2e
2019-05-09 15:16:20 -07:00
andychou
6185e381e0 Fix incorrect mapping to get subscriptioninfo
getActiveSubscriptionInfoList() returns a list of active subscription.
It doesn't 1:1 mapping with slotId. So it is not correct to use slotId
as index to get subscriptioninfo from list.
Use framework interface getActiveSubscriptionInfoForSimSlotIndex() to
get subscriptioninfo per slotid instead.

Bug: 131123246
Test: Test with dual SIM device and atest SimStatusDialogControllerTest
pass

Change-Id: If7140f602571a5cb8dcdfff939bd84ccff0b482f
2019-04-24 23:18:51 +08:00
chen xu
96d0c484f3 Create TM for each subId to register phonestatelistner
To register phonestatelistner for different subscription, do not
create phonestatelistener(subId) this contructor is going to be removed.
instead, create TelephonyManager instance for each subId and pass
separate phonestateListener object.

Bug: 117555407
Test: Maunal test
Change-Id: Ia2a1be6e559c3a5b98e178a02d0eee14cc14eb47
2019-03-20 17:28:26 -07:00
Qingxi Li
02f2547482 Check euiccManager available before update EID
Test: E2E & Included
Bug: 126264451
Change-Id: Ic3876567dd139819d67e8b6ddc6f2b6ba03c98fa
2019-02-28 19:53:15 -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
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
Hall Liu
78cc28d962 Merge "Start using CarrierConfig for 4G/LTE icon" am: 558535f3f2 am: e419904aa0
am: 322091c7eb

Change-Id: I356e58af3dfe50a59ffc70b096ece86ece7c5d66
2018-10-18 15:54:56 -07:00
Hall Liu
e419904aa0 Merge "Start using CarrierConfig for 4G/LTE icon"
am: 558535f3f2

Change-Id: I9bb6a91c0c3a79f4b3fae4d50c431e0286b8c06f
2018-10-18 14:56:56 -07:00
Niklas Lindgren
8fdf33d50a Start using CarrierConfig for 4G/LTE icon
Icon will be updated on sim swap or in case
the default data SIM changes.

Test: Add configs in vendor xml and swap between sim cards.
Tested on both single sim and dual sim.
Bug: 113309356
Change-Id: I1847bcb4e6c1b6dcef7b14bce14f91bd3e4734a5
2018-10-04 09:42:27 +02:00