Commit Graph

202 Commits

Author SHA1 Message Date
Zoey Chen
1835f13c4e [Telephoy] Add phone Id to support DSDS
Bug: 185451283
Test: atest TelephonyRegistryTest
Change-Id: I6bf2285e37366ca517a3ea16194a203371e44964
2021-04-15 17:45:27 +08:00
Zoey Chen
4e016ac105 [Telephony] TelephonyCallback API update
- Keep the permission consistency
    1. PhoneStateListener.LISTEN_XXX
    2. PhoneStateListener.onXxxxx
    3. TelephonyCallback.EVENT_XXX
    4. XxxListener.onXxxx

- Remove the permission to keep the consistency with PSL
    1. DataConnectionSTateListener
    2. DataActivityListener,
    3. SignalStrengthListener,
    4. DataActivationStateListener
    5. UserMobileDataStateListener
    6. PhoneCapabilityListener

- Remove AlwaysReportedSignalStengthListener

- onCellInfoChanged and onActiveDataSubscriptionIdChanged:
    Should add READ_PHONE_STATE in TelephonyCallback and PSL, target SDK to check the permission

Bug: 182478738
Test: make
Change-Id: I0b477e5f53f4187223808258b45f0b5f0c1d5578
2021-04-07 09:14:13 +08:00
Brad Ebinger
a8366aeae4 Enforce READ_PHONE_STATE for APIs involving call state
For API version 31+, ensure that READ_PHONE_STATE is checked on
APIs that retrieve/notify the call state of the device.

Bug: 157233955
Test: atest CtsTelecomTestCases2 CtsTelephony2TestCases
Change-Id: I9f8674a3075d3e0f75ee4f41eefce328c0fa6b91
2021-03-25 15:11:00 -07:00
Zoey Chen
f163bf9c6a [Telephony] Remove the permission from TelephonyDisplayInfo
Bug: 183164979
Test: make
Change-Id: I5b1b4fea5feef3ba53603f24d88246d40322e2ff
2021-03-24 14:00:21 -07:00
Zoey Chen
41b368afbe Merge "[Telephony] Exposed PhysicalChannelConfigListener as public API instead of system" am: dd68ace7e0 am: dd7fe097ae am: 8e339fca8a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629270

Change-Id: I1cecbeddbcdeee6a19b4ebc5f9372c7e461e01f6
2021-03-17 22:17:33 +00:00
Kai Shi
5d530fab23 Revert "Revert "Add the LCE system API""
This reverts commit 8d60c5ceb4.

Reason for revert: <this CL doesn't break error prone build. Will redo the CTS one which does break the build>

Change-Id: I5899acf02006a164e31f9b82aeaa7974dd6d2869
Bug: 182869926
2021-03-16 20:38:38 +00:00
Martijn Coenen
8d60c5ceb4 Revert "Add the LCE system API"
Revert "Add CTS test for onLinkCapacityEstimateChanged"

Revert "[Telephony] Notify onLinkCapacityEstimateChanged"

Revert "Remove the system API of getCarrierBandwidth()"

Revert submission 13662828-LceApi

Reason for revert: b/182869926, breaks errorprone
Reverted Changes:
I1998c7e49:Add CTS test for onLinkCapacityEstimateChanged
Id69fa8b7a:Integrate New LCE Api
I0cc020ba3:Remove the system API of getCarrierBandwidth()
Id613dc152:Add the LCE system API
If7cede0f4:[Telephony] Notify onLinkCapacityEstimateChanged

Change-Id: I30813c321509ac44fa0119b0ce905fd28b0f139c
2021-03-16 09:45:23 +00:00
Kai Shi
df3e93af96 Add the LCE system API
Add the link capacity estimate system API.
Remove the system API of getCarrierBandwidth() and CarrierBandwidth as
they are replaced by the new LCE system API in PhoneStateListener.

Bug: 180434672
Bug: 176814680
Test: manual test of the new LCE system API in LinkBandwidthEstimator
Test: atest -c PhoneStateListenerTest
Change-Id: Id613dc152e524045a89295e5dd03171b22377e16
2021-03-15 15:00:01 -07:00
SongFerng Wang
3e9d0bedf6 Merge "The phone didn't reload the allowed Network Type" into sc-dev 2021-03-12 18:49:49 +00:00
Zoey Chen
943a0c590b [Telephony] Exposed PhysicalChannelConfigListener as public API instead of system
Bug: 182408018
Test: make
Change-Id: I294453b0c28b79e309063a1cd2f57644b3a6242c
2021-03-12 15:54:29 +08:00
SongFerngWang
a71b2c613c The phone didn't reload the allowed Network Type
Reload the allowed Network after device insert SIM card.
Change the behavior of notifyAllowedNetworkTypesChanged.
Log print String representation of the allowed network types.
Bug: 180903931
Bug: 179814490
Test: atest cts/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#testSetAllowedNetworkTypesForReason_moreReason
atest cts/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#testSetAllowedNetworkTypesForReason
atest android.telephony.cts.TelephonyCallbackTest

Change-Id: Icfffea3c74ecf6938455d841da9d6175f6aa07de
2021-03-10 15:26:24 +08:00
Tyler Gunn
95674c6cd1 Remove phone number from the "new" CallStateListener.
When the legacy PhoneStateListener was migrated to the new
TelephonyCallback class, the onCallStateChanged listener was copied over
as is.  This CL removes the phone number parameter from the new listener.
Under the hood, both the old PhoneStateListener and the new one use the
same IPhoneStateListener.aidl file, so the onCallStateChanged method for
the legacy listener is changed to onLegacyCallStateListener.

Test: See CTS test CL; added a bunch of CTS tests for this.
Fixes: 165831812
Change-Id: Ia67968b5235954b606c6bd2890cc6f46c468e041
2021-03-08 16:02:41 -08:00
Zoey Chen
4fff45499f [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
To avoid the IDE does not have the warn if developers implement callback:

1. Revert PhoneStateListener to Android 11 version.
2. New TelephonyCallback
3. Deprecate the old PhoneStateListener.onXx() callbacks

Bug: 167684594
Test: make and PhoneStateListenerTest and TelephonyCallbackTest
Change-Id: I0fdd7fc3c3d67310197862c84d02f30164ec80d1
Merged-In: I0fdd7fc3c3d67310197862c84d02f30164ec80d1
2021-03-08 15:11:32 +08:00
SongFerngWang
e206456a16 Improve AllowedNetworkTypesForReason and refactor PreferredNetworkType
- Add more reasons of allowed network type
  - ALLOWED_NETWORK_TYPES_REASON_USER
  - ALLOWED_NETWORK_TYPES_REASON_CARRIER
- Add @systemApi for below
  - ALLOWED_NETWORK_TYPES_REASON_USER
  - ALLOWED_NETWORK_TYPES_REASON_POWER
  - ALLOWED_NETWORK_TYPES_REASON_CARRIER
  - setAllowedNetworkTypesForReason API
  - getAllowedNetworkTypesForReason API
  - getAllowedNetworkTypesBitmask API
- Add Public for below
  - CARRIER_NR_AVAILABILITY_NONE
  - CARRIER_NR_AVAILABILITY_NSA
  - CARRIER_NR_AVAILABILITY_SA
  - KEY_CARRIER_NR_AVAILABILITY_INT
- @Deprecated API
  - setPreferredNetworkTypeBitmask
  - getPreferredNetworkTypeBitmask
  - setAllowedNetworkType
  - getAllowedNetworkType
- Add a new way to notify allowedNetworkType at PhoneStateListener
- Replace KEY_NR_ENABLED_BOOL with KEY_CARRIER_NR_AVAILABILITY_INT

Bug: 161434786
Test: atest TelephonyManagerTest#testSetAllowedNetworkTypesForReason
(PASS)
atest TelephonyManagerTest#\
testSetAllowedNetworkTypesForReason_moreReason
(PASS)
atest PhoneStateListenerTest#\
testOnAllowedNetworkTypesChangedByRegisterPhoneStateListener
(PASS)

Change-Id: I3d0c119a0c2a30c56b0c127ba6525f8992b4e9dd
Merged-In: I3d0c119a0c2a30c56b0c127ba6525f8992b4e9dd
2021-03-04 14:58:54 +08:00
Zoey Chen
0b1d5c1f10 [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
To avoid the IDE does not have the warn if developers implement callback:

1. Revert PhoneStateListener to Android 11 version.
2. New TelephonyCallback
3. Deprecate the old PhoneStateListener.onXx() callbacks

Bug: 167684594
Test: make and PhoneStateListenerTest and TelephonyCallbackTest
Change-Id: I0fdd7fc3c3d67310197862c84d02f30164ec80d1
2021-03-03 13:18:16 +08:00
Zoey Chen
c9448b5efc [Telephony] Implement onDataEnabled callback
Bug: 147577230
Test: atest CtsTelephonyTestCases:PhoneStateListenerTest
Change-Id: I1b9fe50e4b805f5117fb6e03438dd0a09fbcfebc
Merged-In: I1b9fe50e4b805f5117fb6e03438dd0a09fbcfebc
2021-02-25 14:16:53 +00:00
Zoey Chen
4d459c28db [Telephony] Store correct value for multi-sim case - DataEnabled
Bug: 180438087
Text: manual and make
Change-Id: I4bcb66d125be582f3392f4c5af1471849a0fe9b1
2021-02-24 18:22:36 +08:00
Yomna Nasser
8fa54b7c20 Implementation of "Enable 2G" for Settings.
(1) Adds KEY_HIDE_ENABLE_2G_BOOL to CarrierConfigManager, and
(2) Adds new reason ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G.

Test: manual & atest -c Enable2gPreferenceControllerTest
Bug: b/163168917
Change-Id: I81052549f8dde491697c35365320145fd24c3842
2021-02-17 19:38:33 +00:00
SongFerng Wang
816ef2dde1 Merge "Add getPhoneCapability function in TelephonyManager" 2021-01-26 07:46:55 +00:00
SongFerngWang
13d5297155 Add getPhoneCapability function in TelephonyManager
- Add a resource for Device's Nr information.
- Expose below as systemApi
  - getDeviceNrCapabilityBitmask()
  - getMaxActiveInternetData()
  - getMaxActivePacketSwitchedVoiceCalls()
Bug: 175711587
Test: atest TelephonyManager#testGetPhoneCapability
atest PhoneCapabilityTest
atest PhoneConfigurationManagerTest
atest CellularNetworkValidatorTest
atest PhoneSwitcherTest
atest TelephonyRegistryTest
atest PhoneCapabilityTest

Change-Id: Ide25344787c15b3a57a9e6621766ad02a906f12e
2021-01-26 09:24:28 +08:00
Zoey Chen
cc25130f6f [Telephony] Remove redundant code in PhoneStateListener
Bug: 178335048
Test: atest -c TelephonyManagerTest
Change-Id: Ic49d00c912bd4c5a6f770dc192667a21ec56d875
2021-01-25 18:45:07 +08:00
SongFerngWang
7d95185d46 Improve AllowedNetworkTypesForReason and refactor PreferredNetworkType
- Add more reasons of allowed network type
  - ALLOWED_NETWORK_TYPES_REASON_USER
  - ALLOWED_NETWORK_TYPES_REASON_CARRIER
- Add @systemApi for below
  - ALLOWED_NETWORK_TYPES_REASON_USER
  - ALLOWED_NETWORK_TYPES_REASON_POWER
  - ALLOWED_NETWORK_TYPES_REASON_CARRIER
  - setAllowedNetworkTypesForReason API
  - getAllowedNetworkTypesForReason API
  - getAllowedNetworkTypesBitmask API
- Add Public for below
  - CARRIER_NR_AVAILABILITY_NONE
  - CARRIER_NR_AVAILABILITY_NSA
  - CARRIER_NR_AVAILABILITY_SA
  - KEY_CARRIER_NR_AVAILABILITY_INT
- @Deprecated API
  - setPreferredNetworkTypeBitmask
  - getPreferredNetworkTypeBitmask
  - setAllowedNetworkType
  - getAllowedNetworkType
- Add a new way to notify allowedNetworkType at PhoneStateListener
- Replace KEY_NR_ENABLED_BOOL with KEY_CARRIER_NR_AVAILABILITY_INT

Bug: 161434786
Test: atest TelephonyManagerTest#testSetAllowedNetworkTypesForReason
(PASS)
atest TelephonyManagerTest#\
testSetAllowedNetworkTypesForReason_moreReason
(PASS)
atest PhoneStateListenerTest#\
testOnAllowedNetworkTypesChangedByRegisterPhoneStateListener
(PASS)

Change-Id: I3d0c119a0c2a30c56b0c127ba6525f8992b4e9dd
2021-01-23 06:51:05 +08:00
Zoey Chen
041679fa9a [Telephony] PhoneStateListener redesign for new event
1. Add int EVENT_* and expose these as @SystemApi
 2. Add listener interface
 3. Deprecated LISTEN_*
 4. un/registerPhoneStateListener
 5. get event from event listener
 6. Add event to list

Test: manual and
atest TelephonyManagerTest#testRegisterPhoneStateListener
atest TelephonyManagerPermissionTest
atest CtsTelephonyTestCases:PhoneStateListenerTest
atest TelephonyRegistryManagerTest
atest CtsTelecomTestCases:android.telecom.cts.IncomingCallTest
atest CtsTelecomTestCases:android.telecom.cts.OutgoingCallTest

Bug: 167684594
Change-Id: Id89a541745fb8700e1ebd2cc162ee55cd1055661
Merged-In: Id89a541745fb8700e1ebd2cc162ee55cd1055661
2021-01-14 16:58:33 +08:00
Zoey Chen
d5d79830ad Merge "Handle PhoneStateListener created on a non-looper thread correctly." 2021-01-10 09:51:48 +00:00
Jeff Sharkey
3ae096f1be Merge "Additional per-file OWNERS for shared directories." am: 8b102a5988 am: 7a9f3e10de am: 845bfdd0ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1523618

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id32f96bb4acc5bd3a41cfd0750abfbba274c42cb
2020-12-11 10:51:09 +00:00
Amit Mahajan
8de8a95857 Handle PhoneStateListener created on a non-looper thread correctly.
Also use the Executor passed in through TM#registerPhoneStateListener
instead of the one created in PSL from Looper.myLooper().

Test: atest -c TelephonyManagerTest
Bug: 175263146
Change-Id: I158dbc88532470e86a89822b63421e5cadfea26f
2020-12-11 09:46:11 +00:00
Jeff Sharkey
e2cc3f8bec Additional per-file OWNERS for shared directories.
Iteration based on areas of tree where detailed ownership was found
to be missing during routine code reviews.

Also add more detailed examples to OWNERS.md.

Bug: 174932174
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I46ccef33b34594181ae8dc62973d68020f827d6b
2020-12-10 08:37:23 -07:00
Zoey Chen
cc8c3ba4a9 Merge "[Telephony] Implement onDataEnabled callback" 2020-12-10 08:46:15 +00:00
Zoey Chen
6ec5712446 [Telephony] PhoneStateListener redesign for new event
1. Add int EVENT_* and expose these as @SystemApi
 2. Add listener interface
 3. Deprecated LISTEN_*
 4. un/registerPhoneStateListener
 5. get event from event listener
 6. Add event to list

Test: manual and
atest TelephonyManagerTest#testRegisterPhoneStateListener
atest TelephonyManagerPermissionTest
atest CtsTelephonyTestCases:PhoneStateListenerTest
atest TelephonyRegistryManagerTest
atest CtsTelecomTestCases:android.telecom.cts.IncomingCallTest
atest CtsTelecomTestCases:android.telecom.cts.OutgoingCallTest

Bug: 167684594
Change-Id: Id89a541745fb8700e1ebd2cc162ee55cd1055661
2020-12-03 17:46:22 +08:00
Hall Liu
1f1dbee262 Revert "[Telephony] PhoneStateListener redesign for new event"
Revert "[Telephony] PhoneStateListener redesign - cts test"

Revert "[Telephony] PhoneStateListener redesign"

Revert submission 12947610-PhoneStateListener_Redesign

Reason for revert: Multiple test failures: b/173726360, b/173724464, b/173722831
Reverted Changes:
Id69d2b2e7:[Telephony] PhoneStateListener redesign - remove L...
I210f371ed:[Telephony] PhoneStateListener redesign - cts test...
I97e93707f:[Telephony] PhoneStateListener redesign - cts test...
Ibdbaa7d65:[Telephony] PhoneStateListener redesign - cts test...
I5ed16d700:[Telephony] PhoneStateListener redesign - cts test...
I40cc4c234:[Telephony] PhoneStateListener redesign for new ev...
Idd69f5e48:[Telephony] PhoneStateListener redesign
I827471472:[Telephony] PhoneStateListener redesign - cts test...
Bug: 173726360
Bug: 173724464
Bug: 173722831
Change-Id: Iba85a04db03c9fb9c4d4102618e65fcff537d815
2020-11-20 02:32:42 +00:00
Zoey Chen
4ad5f0a7c7 [Telephony] Implement onDataEnabled callback
Bug: 147577230
Test: atest CtsTelephonyTestCases:PhoneStateListenerTest
Change-Id: I1b9fe50e4b805f5117fb6e03438dd0a09fbcfebc
2020-11-18 13:49:34 +08:00
Zoey Chen
03105edc84 [Telephony] PhoneStateListener redesign for new event
1. Add int EVENT_* and expose these as @SystemApi
 2. Add listener interface
 3. Deprecated LISTEN_*

Bug: 167684594
Test: atest TelephonyManagerTest#testRegisterPhoneStateListener
Change-Id: Icfb2f892a18c4fd101473aed5c87c9d7a4bd3f18

[Telephony] PhoneStateListener redesign - use Set<Integer> instead of long

 - Remove old listen api
 - Use listenWithEventList for new design

Bug: 167684594
Test: atest TelephonyManagerTest#testRegisterPhoneStateListener
Change-Id: I2184454c3fd127989edee6c09b175185de960f06

[Telephony] PhoneStateListener redesign - registerPhoneStateListener

 - should register PhoneStateListener for event
 - get event from event listener
 - Add event to list

Bug: 167684594
Test: manual and atest TelephonyManagerTest#testRegisterPhoneStateListener
Change-Id: I7ef23287879111277610b27aeeab5c8218ab3361

[Telephony] PhoneStateListener redesign - check permission

Bug: 167684594
Test: atest TelephonyManagerTest#testRegisterPhoneStateListener
Change-Id: I40cc4c234ae6c70405193806ff3159fde0b4486d
2020-11-18 09:12:01 +08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Hall Liu
adfc80c4d5 Update PhoneStateListener#onOutgoingEmergencySms
Update the callback for emergency SMS to follow the same pattern as for
emergency calls for API consistency.

Fixes: 168269065
Test: atest CtsTelephonyTestCases:PhoneStateListenerTest
Change-Id: If27771aef1858ea92dd620b56368d1a6a4f61ab3
Merged-In: If27771aef1858ea92dd620b56368d1a6a4f61ab3
2020-10-22 11:34:28 -07:00
Hall Liu
bed564c956 Update docs for onEmergencyNumberListChanged
Clarify structure of the argument for the onEmergencyNumberListChanged
callback based on API council feedback.

Bug: 166230518
Test: NA
Change-Id: I9819337da12a17dc4736ba97b00018a156274680
2020-10-21 16:10:59 -07:00
Hall Liu
486ef8978d Call onOutgoingEmergencyCall only once.
For backwards compatibility, instead of calling both the old and new
versions of onOutgoingEmergencyCall, only call the new version, and call
the old version from the default impl of the new version instead.

Change suggested by API council.

Bug: 166230518
Test: atest CtsTelecomTestCases:OutgoingCallTest
Change-Id: Ifa9276cc615d0e33d37ebc702dbc0cd155e0d489
2020-10-21 16:10:21 -07:00
Hall Liu
e182543791 Expose onEmergencyNumberListChanged, semantics change
Expose the onEmergencyNumberListChanged method, which seems to have been
left hidden inadvertently when introduced.

Add a new version of onOutgoingEmergencyCall that supplies a
subscription ID and deprecate the old one. Along with this, send
emergency call events from any subscription to all listeners regardless
of which subscription the listener specified.

Test: atest CtsTelecomTestCases:OutgoingCallTest
Bug: 162647577
bug: 165660452
Change-Id: Ia0e10bfb3376ff82d03a6dbc4bf71c22b0ace366
Merged-In: Ia0e10bfb3376ff82d03a6dbc4bf71c22b0ace366
2020-10-21 16:07:04 -07:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Chen Xu
a34f7f7a02 Merge "area info update improvement" into mainline-prod am: 51571f8993
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12787956

Change-Id: Iccbe9f7fbc9de42102fafcf98d422a98db6cbd6c
2020-10-08 17:59:47 +00:00
TreeHugger Robot
4ae12e905b Merge "Update docs for onEmergencyNumberListChanged" 2020-10-08 03:21:09 +00:00
Chen Xu
8c4983fd63 area info update improvement
when users disable areaInfo toggle from CBR, clear areaInfos and
notify listeners that area info updated so that settings and systemUI
could refresh the UI instead of showing outdated area info.

Bug: 162475765
Test: Manual
Change-Id: I8c2b29750817a71165adff3ee64c96249e9d7380
2020-10-07 21:28:50 +00:00
Jack Yu
4f2a849e25 Refactored precise data connection state
Instead of triggering the data connection state changed
event from outside, now the event is triggering from
DataConnection. Whenever detecting data connection
state changes, the event will be triggered. This significantly
reduced the unnecessary redundant events sent to telephony registry,
even though it has a duplicate detection mechanism.

This are also two behavioral changes.

1. Previously if a data connection supports multiple APN types,
there will be multiple data connection state changed event for
each APN type. Now there is only one. The listener should use
PreciseDataConnectionState.getApnSetting().getApnTypeBitmask()
to check which APN types this data connection supports.

2. If setup data call fails before a data connection instance
can be created, there won't be any event with fail cause.

Fix: 161572838
Test: FrameworksTelephonyTests and manual
Merged-In: I9723d5284c2a8fbae9f63179dc30ddc42da1d0fc
Change-Id: I9723d5284c2a8fbae9f63179dc30ddc42da1d0fc
(cherry picked from commit 34a09a4cbd)
2020-09-24 09:57:50 -07:00
Treehugger Robot
2e2bd28efa Merge "TelephonyRegistry: Avoid adding duplicate listener" am: 6334152357 am: 3ba0f5da1d am: 4aeb2ecda5 am: 276ee5c666 am: 3565a854ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433021

Change-Id: I1328d6bc805987cc52fb7264a4b96a0300a87492
2020-09-22 02:02:49 +00:00
Wileen Chiu
e305baa074 TelephonyRegistry: Avoid adding duplicate listener
- Currently, a new callback is created when a listener
  is passed in, so it is possible to create multiple
  callbacks for the same listener
- However, when removing the listener, only the latest
  entry is removed, which could result in improper cleanup
- If a listener is already in the map, do not add the listener
  with the new callback

Change-Id: I46f344eb55db38916224f7765cd838347ac8f0f2
Bug: 168886894
2020-09-21 11:36:04 -07:00
Hall Liu
4c1e8a2a9e Update PhoneStateListener#onOutgoingEmergencySms
Update the callback for emergency SMS to follow the same pattern as for
emergency calls for API consistency.

Fixes: 168269065
Test: atest CtsTelephonyTestCases:PhoneStateListenerTest
Change-Id: If27771aef1858ea92dd620b56368d1a6a4f61ab3
2020-09-11 13:32:16 -07:00