Commit Graph

226 Commits

Author SHA1 Message Date
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Rambo Wang
d7fe72bfbd Merge "Rethrow RemoteException in TelephonyRegistryManager" am: 9368bb8e83 am: f1f634458f am: bd13c947c1 am: e6f884c45d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1936562

Change-Id: I945404e2cc0f7dd88a6e96adc13259d7e73b60f3
2022-01-13 00:44:58 +00:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Rambo Wang
cabbfbab9e Rethrow RemoteException in TelephonyRegistryManager
Follows the best practice in
go/android-api-guidelines#rethrow-remoteexception, Rethrow
RemoteException as RuntimeException when system server crash to
ensure that apps don’t accidentally persist security or policy decisions

Bug: 210990980
Test: atest TelephonyRegistryManagerTest
Change-Id: I1656a2385590910c97660a270cae60ca754c8e3a
2022-01-11 15:39:39 +00:00
TreeHugger Robot
28049a6dc2 Merge "Create new DataEnabledReasons for for DataSettingsManager" 2021-12-23 01:44:13 +00:00
Sarah Chin
419e4ff03a Create new DataEnabledReasons for for DataSettingsManager
DataEnabledSettings used an internal DataEnabledChangedReason when
notifying data enabled was changed. For DataSettingsManager, sync the
reasons with TelephonyManager#DataEnabledReasons and remove the internal
reaons.

Test: atest FrameworksTelephonyTests
Bug: 204309297
Change-Id: I8d6fd13e319ce165e25f2afd93bf9884fbf22667
2021-12-22 13:32:52 -08:00
Jack Yu
3c3c522cfb Telephony data refactoring API changes
DataProfile is the parameters used for setup data, but DataProfile
is almost identical as ApnSetting. So move ApnSetting into
DataProfile, also add TrafficDescriptor, which is specific to
5G SA network.

Also added a new state for data handover between IWLAN and cellular.

Bug: 196597630
Test: CTS && atest FrameworksTelephonyTests
Change-Id: I3f188921b92b4a14c323819ff58ab9ae57488937
2021-12-21 08:57:59 -08:00
Hunter Knepshield
d95546ffed Merge "Create CarrierPrivilegesListener callback." am: d54e1126ab am: e66c82b449 am: c7a0de9f6f am: 93a25e9cd1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1912993

Change-Id: Ica9fba211d8cc8c866a370a83c57e070dd6f338c
2021-12-16 20:48:34 +00:00
Hunter Knepshield
d54e1126ab Merge "Create CarrierPrivilegesListener callback." 2021-12-16 19:00:24 +00:00
Rambo Wang
19384d89da Merge "Support CarrierService#notifyCarrierNetworkChange with subscription" am: eaa2a701cd am: c37af99d0a am: 48f89c249b am: 7f9a9fd489
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1897973

Change-Id: Ib1af4cc68a27a5ee5d7268b4122bc0f950d2428d
2021-12-16 01:34:36 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Rambo Wang
241b1fa964 Support CarrierService#notifyCarrierNetworkChange with subscription
Current APIs does not include subId or phoneId to locate which
carrier network reported the change. A patch based on carrier
privilege were deployed in Q to temprarily fix the issue.

However, multiple subscriptions which all have the carrier
privileges will all get notified, even only one of them
has the real change.

To throughly resolve the issue, the subscription is introduced
in the API to distinguish which network actually has the change.

Bug: 131697791
Test: atest TelephonyRegistryManagerTest CarrierServiceTest
Change-Id: Ie7ee25f53da605c15e1a9228482cc8c4e7406d2a
2021-12-15 17:35:52 +00:00
Sooraj Sasindran
5d02dbb7bf Allow renounce location permission
Allow renounce location permission

Bug: 198533763
Test: CTS
Merged-In: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
Change-Id: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
2021-12-14 13:25:04 -08:00
Sooraj Sasindran
1e7a4169ce Allow renounce location permission
Allow renounce location permission

Bug: 198533763
Test: CTS
Change-Id: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
2021-12-09 13:30:43 -08:00
Hunter Knepshield
866d3a4d03 Create CarrierPrivilegesListener callback.
This callback will allow privileged components to listen to changes
around carrier privileged apps in a way that is aware and accounts for
SIM profile switches. This callback will be backed by
CarrierPrivilegesTracker as a follow-up change.

Bug: 205736323
Test: atest android.telephony.cts.TelephonyRegistryManagerTest
Change-Id: I432ed00be16c68303bf5c8e074fb9d6cf83e82c9
2021-12-08 15:53:33 -08:00
Rambo Wang
14cc15dc37 Clear up ALWAYS_REPORTED_SIGNAL_STRENGTH_CHANGED logic
The feature is now replaced with TM#setSignalStrengthUpdateRequest
introduced in S release. The logic for the obsoleted feature is
cleared up.

The request to report system signal strength while idle is
still protected by permission to use internally.

Bug: 177924721
Test: atest TelephonyRegistryTest SignalStrengthUpdateRequestTest
Change-Id: Idad4ca59720fac50b5ec0fe50e2b6ac8e9dbb801
2021-11-03 11:39:17 -07:00
Zoey Chen
9b66398997 [Telephony] Add more javadoc for carrier privileges
Bug: 192252210
Change-Id: I9f43b7ba2e0184d48149a3496559a4be6d07cf6a
Merged-In: I9f43b7ba2e0184d48149a3496559a4be6d07cf6a
Test: manual
2021-10-18 16:22:57 +00:00
Benedict Wong
e8233d01a8 Merge "Clear binder calling identity before calling callback" am: 483a604f27 am: cda8a7ec57
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767051

Change-Id: Ia3476638f5ccf52d19ab2b0510e279ba70d519b0
2021-07-15 18:55:23 +00:00
Benedict Wong
bc02830a59 Clear binder calling identity before calling callback
This change clears calling identities before the
onSubscriptionsChangedListener.onSubscriptionsChanged() callback is
made.

Bug: 193731920
Test: atest TelephonyRegistryManagerTest
Change-Id: I21f14e40a05f76346eb90b8f36608b4d6bdf1a29
2021-07-15 06:58:12 +00:00
Zoey Chen
6d33beea88 [Telephony] Add description about location permission
- Hold ACCESS_FINE_LOCATION: full service state
    - Hold ACCESS_COARSE_LOCATION: set cellIdentity is null
    - No local permission: set cellIdentity, mOperatorAlphaLong, mOperatorAlphaShort
        and mOperatorNumeric are null

Bug: 165014401
Test: make
Change-Id: I9ada08a530d9b8bc8483edfad783ff3b7434faa3
2021-06-29 16:11:13 +08:00
Zoey Chen
30ad4bf90a [Telephoy] Add phone Id to support DSDS
Bug: 185451283
Test: atest TelephonyRegistryTest
Change-Id: Ia09d0979bda94470f0c41cff9349c74d06ecc003
Merged-In: I6bf2285e37366ca517a3ea16194a203371e44964
2021-04-15 11:11:11 +00:00
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
SongFerngWang
84bced4979 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
Merged-In: Icfffea3c74ecf6938455d841da9d6175f6aa07de
2021-03-19 21:56:17 +08:00
Kai Shi
857391f361 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

Merged-In: I5899acf02006a164e31f9b82aeaa7974dd6d2869
Change-Id: I5899acf02006a164e31f9b82aeaa7974dd6d2869
2021-03-17 18:56:11 -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