diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/telephony/PhoneStateListener.java | 54 | ||||
| -rw-r--r-- | core/java/android/telephony/TelephonyCallback.java | 125 | ||||
| -rw-r--r-- | core/java/android/telephony/TelephonyRegistryManager.java | 4 |
3 files changed, 98 insertions, 85 deletions
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java index 49065aaa2d23..a1ffe345d457 100644 --- a/core/java/android/telephony/PhoneStateListener.java +++ b/core/java/android/telephony/PhoneStateListener.java @@ -110,6 +110,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.MessageWaitingIndicatorListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int LISTEN_MESSAGE_WAITING_INDICATOR = 0x00000004; /** @@ -123,6 +124,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.CallForwardingIndicatorListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int LISTEN_CALL_FORWARDING_INDICATOR = 0x00000008; /** @@ -141,6 +143,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.CellLocationListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public static final int LISTEN_CELL_LOCATION = 0x00000010; /** @@ -194,7 +197,7 @@ public class PhoneStateListener { * @see #onSignalStrengthsChanged * * @hide - * @deprecated Use {@link TelephonyCallback.AlwaysReportedSignalStrengthListener} + * @deprecated Use TelephonyManager#setSignalStrengthUpdateRequest * instead. */ @Deprecated @@ -204,13 +207,18 @@ public class PhoneStateListener { /** * Listen for changes to observed cell info. * - * Listening to this event requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} + * Listening to this event requires the {@link Manifest.permission#READ_PHONE_STATE} and + * {@link Manifest.permission#ACCESS_FINE_LOCATION} * permission. * * @see #onCellInfoChanged * @deprecated Use {@link TelephonyCallback.CellInfoListener} instead. */ @Deprecated + @RequiresPermission(allOf = { + Manifest.permission.READ_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public static final int LISTEN_CELL_INFO = 0x00000400; /** @@ -261,7 +269,7 @@ public class PhoneStateListener { * * <p>Requires permission {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE} * - * @see #onServiceStateChanged(ServiceState) + * @see #onSrvccStateChanged * @hide * @deprecated Use {@link TelephonyCallback.SrvccStateListener} instead. */ @@ -376,6 +384,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.ActiveDataSubscriptionIdListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE = 0x00400000; /** @@ -399,6 +408,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.EmergencyNumberListListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int LISTEN_EMERGENCY_NUMBER_LIST = 0x01000000; /** @@ -487,7 +497,10 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.RegistrationFailedListener} instead. */ @Deprecated - @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) + @RequiresPermission(allOf = { + Manifest.permission.READ_PRECISE_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public static final int LISTEN_REGISTRATION_FAILURE = 0x40000000; /** @@ -503,7 +516,10 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.BarringInfoListener} instead. */ @Deprecated - @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) + @RequiresPermission(allOf = { + Manifest.permission.READ_PRECISE_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public static final int LISTEN_BARRING_INFO = 0x80000000; /* @@ -650,6 +666,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.MessageWaitingIndicatorListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void onMessageWaitingIndicatorChanged(boolean mwi) { // default implementation empty } @@ -666,6 +683,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.CallForwardingIndicatorListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void onCallForwardingIndicatorChanged(boolean cfi) { // default implementation empty } @@ -682,6 +700,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.CellLocationListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void onCellLocationChanged(CellLocation location) { // default implementation empty } @@ -801,6 +820,10 @@ public class PhoneStateListener { * @param cellInfo is the list of currently visible cells. * @deprecated Use {@link TelephonyCallback.CellInfoListener} instead. */ + @RequiresPermission(allOf = { + Manifest.permission.READ_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) @Deprecated public void onCellInfoChanged(List<CellInfo> cellInfo) { // default implementation empty @@ -875,14 +898,14 @@ public class PhoneStateListener { * subId. Otherwise, this callback applies to * {@link SubscriptionManager#getDefaultSubscriptionId()}. * - * <p>Requires permission {@link android.Manifest.permission#MODIFY_PHONE_STATE} + * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE} * or the calling app has carrier privileges * (see {@link TelephonyManager#hasCarrierPrivileges}). * * @param dataConnectionState {@link PreciseDataConnectionState} * @deprecated Use {@link TelephonyCallback.PreciseDataConnectionStateListener} instead. */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) @Deprecated public void onPreciseDataConnectionStateChanged( @NonNull PreciseDataConnectionState dataConnectionState) { @@ -924,6 +947,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onSrvccStateChanged(@SrvccState int srvccState) { // default implementation empty } @@ -944,6 +968,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onVoiceActivationStateChanged(@SimActivationState int state) { // default implementation empty } @@ -1026,6 +1051,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.EmergencyNumberListListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void onEmergencyNumberListChanged( @NonNull Map<Integer, List<EmergencyNumber>> emergencyNumberList) { // default implementation empty @@ -1043,6 +1069,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void onOutgoingEmergencyCall(@NonNull EmergencyNumber placedEmergencyNumber) { // default implementation empty } @@ -1068,6 +1095,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void onOutgoingEmergencyCall(@NonNull EmergencyNumber placedEmergencyNumber, int subscriptionId) { // Default implementation for backwards compatibility @@ -1086,6 +1114,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void onOutgoingEmergencySms(@NonNull EmergencyNumber sentEmergencyNumber) { // default implementation empty } @@ -1158,6 +1187,7 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.ActiveDataSubscriptionIdListener} instead. */ @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void onActiveDataSubscriptionIdChanged(int subId) { // default implementation empty } @@ -1178,6 +1208,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public void onCallAttributesChanged(@NonNull CallAttributes callAttributes) { // default implementation empty } @@ -1199,6 +1230,7 @@ public class PhoneStateListener { */ @SystemApi @Deprecated + @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onRadioPowerStateChanged(@RadioPowerState int state) { // default implementation empty } @@ -1253,6 +1285,10 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.RegistrationFailedListener} instead. */ @Deprecated + @RequiresPermission(allOf = { + Manifest.permission.READ_PRECISE_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public void onRegistrationFailed(@NonNull CellIdentity cellIdentity, @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode) { // default implementation empty @@ -1269,6 +1305,10 @@ public class PhoneStateListener { * @deprecated Use {@link TelephonyCallback.BarringInfoListener} instead. */ @Deprecated + @RequiresPermission(allOf = { + Manifest.permission.READ_PRECISE_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public void onBarringInfoChanged(@NonNull BarringInfo barringInfo) { // default implementation empty } diff --git a/core/java/android/telephony/TelephonyCallback.java b/core/java/android/telephony/TelephonyCallback.java index 1ab6e0ffc34e..1a25c8b4e671 100644 --- a/core/java/android/telephony/TelephonyCallback.java +++ b/core/java/android/telephony/TelephonyCallback.java @@ -218,10 +218,9 @@ public class TelephonyCallback { * even in some situations such as the screen of the device is off. * * @hide - * @see AlwaysReportedSignalStrengthListener#onSignalStrengthsChanged + * @see TelephonyManager#setSignalStrengthUpdateRequest */ @SystemApi - @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) public static final int EVENT_ALWAYS_REPORTED_SIGNAL_STRENGTH_CHANGED = 10; /** @@ -231,8 +230,10 @@ public class TelephonyCallback { * @see CellInfoListener#onCellInfoChanged */ @SystemApi - @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) - public static final int EVENT_CELL_INFO_CHANGED = 11; + @RequiresPermission(allOf = { + Manifest.permission.READ_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) public static final int EVENT_CELL_INFO_CHANGED = 11; /** * Event for {@link android.telephony.Annotation.PreciseCallStates} of ringing, @@ -369,9 +370,10 @@ public class TelephonyCallback { /** * Event for changes to active data subscription ID. Active data subscription is - * the current subscription used to setup Cellular Internet data. For example, - * it could be the current active opportunistic subscription in use, or the - * subscription user selected as default data subscription in DSDS mode. + * the current subscription used to setup Cellular Internet data. The data is only active on the + * subscription at a time, even it is multi-SIM mode. For example, it could be the current + * active opportunistic subscription in use, or the subscription user selected as default data + * subscription in DSDS mode. * * <p>Requires permission {@link android.Manifest.permission#READ_PHONE_STATE} or the calling * app has carrier privileges (see {@link TelephonyManager#hasCarrierPrivileges}). @@ -668,8 +670,7 @@ public class TelephonyCallback { * @see ServiceState#STATE_OUT_OF_SERVICE * @see ServiceState#STATE_POWER_OFF */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onServiceStateChanged(@NonNull ServiceState serviceState); + void onServiceStateChanged(@NonNull ServiceState serviceState); } /** @@ -687,7 +688,7 @@ public class TelephonyCallback { * {@link SubscriptionManager#getDefaultSubscriptionId()}. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public void onMessageWaitingIndicatorChanged(boolean mwi); + void onMessageWaitingIndicatorChanged(boolean mwi); } /** @@ -706,7 +707,7 @@ public class TelephonyCallback { * {@link SubscriptionManager#getDefaultSubscriptionId()}. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public void onCallForwardingIndicatorChanged(boolean cfi); + void onCallForwardingIndicatorChanged(boolean cfi); } /** @@ -724,7 +725,7 @@ public class TelephonyCallback { * {@link SubscriptionManager#getDefaultSubscriptionId()}. */ @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) - public void onCellLocationChanged(@NonNull CellLocation location); + void onCellLocationChanged(@NonNull CellLocation location); } /** @@ -753,7 +754,7 @@ public class TelephonyCallback { * @param state the current call state */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public void onCallStateChanged(@Annotation.CallState int state); + void onCallStateChanged(@Annotation.CallState int state); } /** @@ -777,9 +778,8 @@ public class TelephonyCallback { * @see TelephonyManager#DATA_CONNECTED * @see TelephonyManager#DATA_SUSPENDED */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onDataConnectionStateChanged(@TelephonyManager.DataState int state, - @Annotation.NetworkType int networkType); + void onDataConnectionStateChanged(@TelephonyManager.DataState int state, + @Annotation.NetworkType int networkType); } /** @@ -802,8 +802,7 @@ public class TelephonyCallback { * @see TelephonyManager#DATA_ACTIVITY_INOUT * @see TelephonyManager#DATA_ACTIVITY_DORMANT */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onDataActivity(@Annotation.DataActivityType int direction); + void onDataActivity(@Annotation.DataActivityType int direction); } /** @@ -820,27 +819,7 @@ public class TelephonyCallback { * subscription ID. Otherwise, this callback applies to * {@link SubscriptionManager#getDefaultSubscriptionId()}. */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onSignalStrengthsChanged(@NonNull SignalStrength signalStrength); - } - - /** - * Interface for network signal strengths callback which always reported from modem. - */ - public interface AlwaysReportedSignalStrengthListener { - /** - * Callback always invoked from modem when network signal strengths changes on the - * registered subscription. - * Note, the registration subscription ID comes from {@link TelephonyManager} object - * which registers TelephonyCallback by - * {@link TelephonyManager#registerTelephonyCallback(Executor, TelephonyCallback)}. - * If this TelephonyManager object was created with - * {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the - * subscription ID. Otherwise, this callback applies to - * {@link SubscriptionManager#getDefaultSubscriptionId()}. - */ - @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) - public void onSignalStrengthsChanged(@NonNull SignalStrength signalStrength); + void onSignalStrengthsChanged(@NonNull SignalStrength signalStrength); } /** @@ -860,8 +839,11 @@ public class TelephonyCallback { * * @param cellInfo is the list of currently visible cells. */ - @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) - public void onCellInfoChanged(@NonNull List<CellInfo> cellInfo); + @RequiresPermission(allOf = { + Manifest.permission.READ_PHONE_STATE, + Manifest.permission.ACCESS_FINE_LOCATION + }) + void onCellInfoChanged(@NonNull List<CellInfo> cellInfo); } /** @@ -884,7 +866,7 @@ public class TelephonyCallback { * @param callState {@link PreciseCallState} */ @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onPreciseCallStateChanged(@NonNull PreciseCallState callState); + void onPreciseCallStateChanged(@NonNull PreciseCallState callState); } /** @@ -905,8 +887,8 @@ public class TelephonyCallback { * @param preciseDisconnectCause {@link PreciseDisconnectCause}. */ @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onCallDisconnectCauseChanged(@Annotation.DisconnectCauses int disconnectCause, - @Annotation.PreciseDisconnectCauses int preciseDisconnectCause); + void onCallDisconnectCauseChanged(@Annotation.DisconnectCauses int disconnectCause, + @Annotation.PreciseDisconnectCauses int preciseDisconnectCause); } /** @@ -926,7 +908,7 @@ public class TelephonyCallback { * @param imsReasonInfo {@link ImsReasonInfo} contains details on why IMS call failed. */ @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onImsCallDisconnectCauseChanged(@NonNull ImsReasonInfo imsReasonInfo); + void onImsCallDisconnectCauseChanged(@NonNull ImsReasonInfo imsReasonInfo); } /** @@ -952,7 +934,7 @@ public class TelephonyCallback { * @param dataConnectionState {@link PreciseDataConnectionState} */ @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onPreciseDataConnectionStateChanged( + void onPreciseDataConnectionStateChanged( @NonNull PreciseDataConnectionState dataConnectionState); } @@ -976,7 +958,7 @@ public class TelephonyCallback { * {@link SubscriptionManager#getDefaultSubscriptionId()}. */ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) - public void onSrvccStateChanged(@Annotation.SrvccState int srvccState); + void onSrvccStateChanged(@Annotation.SrvccState int srvccState); } /** @@ -1000,7 +982,7 @@ public class TelephonyCallback { * @param state is the current SIM voice activation state */ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) - public void onVoiceActivationStateChanged(@Annotation.SimActivationState int state); + void onVoiceActivationStateChanged(@Annotation.SimActivationState int state); } @@ -1021,8 +1003,7 @@ public class TelephonyCallback { * * @param state is the current SIM data activation state */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onDataActivationStateChanged(@Annotation.SimActivationState int state); + void onDataActivationStateChanged(@Annotation.SimActivationState int state); } /** @@ -1043,8 +1024,7 @@ public class TelephonyCallback { * @param enabled indicates whether the current user mobile data state is enabled or * disabled. */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onUserMobileDataStateChanged(boolean enabled); + void onUserMobileDataStateChanged(boolean enabled); } /** @@ -1058,7 +1038,7 @@ public class TelephonyCallback { * * @param telephonyDisplayInfo The display information. */ - public void onDisplayInfoChanged(@NonNull TelephonyDisplayInfo telephonyDisplayInfo); + void onDisplayInfoChanged(@NonNull TelephonyDisplayInfo telephonyDisplayInfo); } /** @@ -1089,8 +1069,8 @@ public class TelephonyCallback { * empty. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public void onEmergencyNumberListChanged( - @NonNull Map<Integer, List<EmergencyNumber>> emergencyNumberList); + void onEmergencyNumberListChanged(@NonNull Map<Integer, + List<EmergencyNumber>> emergencyNumberList); } /** @@ -1118,8 +1098,8 @@ public class TelephonyCallback { * {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}. */ @RequiresPermission(Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) - public void onOutgoingEmergencyCall(@NonNull EmergencyNumber placedEmergencyNumber, - int subscriptionId); + void onOutgoingEmergencyCall(@NonNull EmergencyNumber placedEmergencyNumber, + int subscriptionId); } /** @@ -1139,8 +1119,8 @@ public class TelephonyCallback { * @param subscriptionId The subscription ID used to send the emergency sms. */ @RequiresPermission(Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) - public void onOutgoingEmergencySms(@NonNull EmergencyNumber sentEmergencyNumber, - int subscriptionId); + void onOutgoingEmergencySms(@NonNull EmergencyNumber sentEmergencyNumber, + int subscriptionId); } /** @@ -1156,8 +1136,7 @@ public class TelephonyCallback { * * @param capability the new phone capability */ - @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) - public void onPhoneCapabilityChanged(@NonNull PhoneCapability capability); + void onPhoneCapabilityChanged(@NonNull PhoneCapability capability); } /** @@ -1168,13 +1147,14 @@ public class TelephonyCallback { * Callback invoked when active data subscription ID changes. * Note, this callback triggers regardless of registered subscription. * - * @param subId current subscription used to setup Cellular Internet data. + * @param subId current subscription used to setup Cellular Internet data. The data is + * only active on the subscription at a time, even it is multi-SIM mode. * For example, it could be the current active opportunistic subscription * in use, or the subscription user selected as default data subscription in * DSDS mode. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public void onActiveDataSubscriptionIdChanged(int subId); + void onActiveDataSubscriptionIdChanged(int subId); } /** @@ -1197,7 +1177,7 @@ public class TelephonyCallback { * @param state the modem radio power state */ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) - public void onRadioPowerStateChanged(@Annotation.RadioPowerState int state); + void onRadioPowerStateChanged(@Annotation.RadioPowerState int state); } /** @@ -1221,7 +1201,7 @@ public class TelephonyCallback { * @param active If the carrier network change is or shortly will be active, * {@code true} indicate that showing alternative UI, {@code false} otherwise. */ - public void onCarrierNetworkChange(boolean active); + void onCarrierNetworkChange(boolean active); } /** @@ -1263,9 +1243,8 @@ public class TelephonyCallback { Manifest.permission.READ_PRECISE_PHONE_STATE, Manifest.permission.ACCESS_FINE_LOCATION }) - public void onRegistrationFailed(@NonNull CellIdentity cellIdentity, - @NonNull String chosenPlmn, @NetworkRegistrationInfo.Domain int domain, int causeCode, - int additionalCauseCode); + void onRegistrationFailed(@NonNull CellIdentity cellIdentity, @NonNull String chosenPlmn, + @NetworkRegistrationInfo.Domain int domain, int causeCode, int additionalCauseCode); } /** @@ -1303,8 +1282,7 @@ public class TelephonyCallback { * long type value}. */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) - void onAllowedNetworkTypesChanged( - @TelephonyManager.AllowedNetworkTypesReason int reason, + void onAllowedNetworkTypesChanged(@TelephonyManager.AllowedNetworkTypesReason int reason, @TelephonyManager.NetworkTypeBitMask long allowedNetworkType); } @@ -1348,7 +1326,7 @@ public class TelephonyCallback { Manifest.permission.READ_PRECISE_PHONE_STATE, Manifest.permission.ACCESS_FINE_LOCATION }) - public void onBarringInfoChanged(@NonNull BarringInfo barringInfo); + void onBarringInfoChanged(@NonNull BarringInfo barringInfo); } /** @@ -1361,7 +1339,7 @@ public class TelephonyCallback { * @param configs List of the current {@link PhysicalChannelConfig}s */ @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onPhysicalChannelConfigChanged(@NonNull List<PhysicalChannelConfig> configs); + void onPhysicalChannelConfigChanged(@NonNull List<PhysicalChannelConfig> configs); } /** @@ -1379,8 +1357,7 @@ public class TelephonyCallback { * See {@link TelephonyManager.DataEnabledReason}. */ @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) - public void onDataEnabledChanged(boolean enabled, - @TelephonyManager.DataEnabledReason int reason); + void onDataEnabledChanged(boolean enabled, @TelephonyManager.DataEnabledReason int reason); } /** diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java index 1ec12fe12b36..340fa406bbb7 100644 --- a/core/java/android/telephony/TelephonyRegistryManager.java +++ b/core/java/android/telephony/TelephonyRegistryManager.java @@ -894,10 +894,6 @@ public class TelephonyRegistryManager { eventList.add(TelephonyCallback.EVENT_SIGNAL_STRENGTHS_CHANGED); } - if (telephonyCallback instanceof TelephonyCallback.AlwaysReportedSignalStrengthListener) { - eventList.add(TelephonyCallback.EVENT_ALWAYS_REPORTED_SIGNAL_STRENGTH_CHANGED); - } - if (telephonyCallback instanceof TelephonyCallback.CellInfoListener) { eventList.add(TelephonyCallback.EVENT_CELL_INFO_CHANGED); } |
