Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -605,6 +605,7 @@ java_defaults { "telephony/java/com/android/internal/telephony/IOns.aidl", "telephony/java/com/android/internal/telephony/ITelephony.aidl", "telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl", "telephony/java/com/android/internal/telephony/IUpdateAvailableNetworksCallback.aidl", "telephony/java/com/android/internal/telephony/IWapPushManager.aidl", "telephony/java/com/android/internal/telephony/euicc/IAuthenticateServerCallback.aidl", "telephony/java/com/android/internal/telephony/euicc/ICancelSessionCallback.aidl", Loading api/current.txt +6 −1 Original line number Diff line number Diff line Loading @@ -45166,7 +45166,7 @@ package android.telephony { method @Deprecated public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri); method @Deprecated public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void switchMultiSimConfig(int); method public boolean updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>); method public void updateAvailableNetworks(@NonNull java.util.List<android.telephony.AvailableNetworkInfo>, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>); field public static final String ACTION_CARRIER_MESSAGING_CLIENT_SERVICE = "android.telephony.action.CARRIER_MESSAGING_CLIENT_SERVICE"; field public static final String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL"; field public static final String ACTION_NETWORK_COUNTRY_CHANGED = "android.telephony.action.NETWORK_COUNTRY_CHANGED"; Loading Loading @@ -45259,6 +45259,11 @@ package android.telephony { field public static final int UNINITIALIZED_CARD_ID = -2; // 0xfffffffe field public static final int UNKNOWN_CARRIER_ID = -1; // 0xffffffff field public static final int UNSUPPORTED_CARD_ID = -1; // 0xffffffff field public static final int UPDATE_AVAILABLE_NETWORKS_ABORTED = 2; // 0x2 field public static final int UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS = 3; // 0x3 field public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4; // 0x4 field public static final int UPDATE_AVAILABLE_NETWORKS_SUCCESS = 0; // 0x0 field public static final int UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE = 1; // 0x1 field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff field public static final String VVM_TYPE_CVVM = "vvm_type_cvvm"; telephony/java/android/telephony/SubscriptionManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2706,7 +2706,8 @@ public class SubscriptionManager { * 1) Even if it's active, it will be dormant most of the time. The modem will not try * to scan or camp until it knows an available network is nearby to save power. * 2) Telephony relies on system app or carrier input to notify nearby available networks. * See {@link TelephonyManager#updateAvailableNetworks(List)} for more information. * See {@link TelephonyManager#updateAvailableNetworks(List, Executor, Consumer)} * for more information. * 3) In multi-SIM devices, when the network is nearby and camped, system may automatically * switch internet data between it and default data subscription, based on carrier * recommendation and its signal strength and metered-ness, etc. Loading telephony/java/android/telephony/TelephonyManager.java +65 −11 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ISetOpportunisticDataCallback; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephonyRegistry; import com.android.internal.telephony.IUpdateAvailableNetworksCallback; import com.android.internal.telephony.OperatorInfo; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RILConstants; Loading Loading @@ -10190,6 +10191,41 @@ public class TelephonyManager { */ public static final int SET_OPPORTUNISTIC_SUB_INVALID_PARAMETER = 2; /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"UPDATE_AVAILABLE_NETWORKS"}, value = { UPDATE_AVAILABLE_NETWORKS_SUCCESS, UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE, UPDATE_AVAILABLE_NETWORKS_ABORTED, UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS, UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE}) public @interface UpdateAvailableNetworksResult {} /** * No error. Operation succeeded. */ public static final int UPDATE_AVAILABLE_NETWORKS_SUCCESS = 0; /** * There is a unknown failure happened. */ public static final int UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE = 1; /** * The request is aborted. */ public static final int UPDATE_AVAILABLE_NETWORKS_ABORTED = 2; /** * The parameter passed in is invalid. */ public static final int UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS = 3; /** * No carrier privilege. */ public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4; /** * Set preferred opportunistic data subscription id. * Loading Loading @@ -10269,31 +10305,49 @@ public class TelephonyManager { /** * Update availability of a list of networks in the current location. * * This api should be called to inform OpportunisticNetwork Service about the availability * of a network at the current location. This information will be used by OpportunisticNetwork * service to decide to attach to the network opportunistically. If an empty list is passed, * it is assumed that no network is available. * This api should be called by opportunistic network selection app to inform * OpportunisticNetwork Service about the availability of a network at the current location. * This information will be used by OpportunisticNetwork service to decide to attach to the * network opportunistically. * If an empty list is passed, it is assumed that no network is available. * Requires that the calling app has carrier privileges on both primary and * secondary subscriptions (see {@link #hasCarrierPrivileges}), or has permission * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}. * @param availableNetworks is a list of available network information. * @return true if request is accepted * @param executor The executor of where the callback will execute. * @param callback Callback will be triggered once it succeeds or failed. * */ @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges public boolean updateAvailableNetworks(List<AvailableNetworkInfo> availableNetworks) { public void updateAvailableNetworks(@NonNull List<AvailableNetworkInfo> availableNetworks, @Nullable @CallbackExecutor Executor executor, @UpdateAvailableNetworksResult @Nullable Consumer<Integer> callback) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; boolean ret = false; try { IOns iOpportunisticNetworkService = getIOns(); if (iOpportunisticNetworkService != null && availableNetworks != null) { ret = iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, pkgForDebug); if (iOpportunisticNetworkService == null || availableNetworks == null) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> { callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS); })); return; } IUpdateAvailableNetworksCallback callbackStub = new IUpdateAvailableNetworksCallback.Stub() { @Override public void onComplete(int result) { if (executor == null || callback == null) { return; } Binder.withCleanCallingIdentity(() -> executor.execute(() -> { callback.accept(result); })); } }; iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, callbackStub, pkgForDebug); } catch (RemoteException ex) { Rlog.e(TAG, "updateAvailableNetworks RemoteException", ex); } return ret; } /** Loading telephony/java/com/android/internal/telephony/IOns.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony; import android.telephony.AvailableNetworkInfo; import com.android.internal.telephony.ISetOpportunisticDataCallback; import com.android.internal.telephony.IUpdateAvailableNetworksCallback; interface IOns { Loading Loading @@ -97,9 +98,9 @@ interface IOns { * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}. * @param availableNetworks is a list of available network information. * @param callingPackage caller's package name * @return true if request is accepted * @param callback callback upon request completion. * */ boolean updateAvailableNetworks(in List<AvailableNetworkInfo> availableNetworks, String callingPackage); void updateAvailableNetworks(in List<AvailableNetworkInfo> availableNetworks, IUpdateAvailableNetworksCallback callbackStub, String callingPackage); } Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -605,6 +605,7 @@ java_defaults { "telephony/java/com/android/internal/telephony/IOns.aidl", "telephony/java/com/android/internal/telephony/ITelephony.aidl", "telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl", "telephony/java/com/android/internal/telephony/IUpdateAvailableNetworksCallback.aidl", "telephony/java/com/android/internal/telephony/IWapPushManager.aidl", "telephony/java/com/android/internal/telephony/euicc/IAuthenticateServerCallback.aidl", "telephony/java/com/android/internal/telephony/euicc/ICancelSessionCallback.aidl", Loading
api/current.txt +6 −1 Original line number Diff line number Diff line Loading @@ -45166,7 +45166,7 @@ package android.telephony { method @Deprecated public void setVoicemailRingtoneUri(android.telecom.PhoneAccountHandle, android.net.Uri); method @Deprecated public void setVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void switchMultiSimConfig(int); method public boolean updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>); method public void updateAvailableNetworks(@NonNull java.util.List<android.telephony.AvailableNetworkInfo>, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>); field public static final String ACTION_CARRIER_MESSAGING_CLIENT_SERVICE = "android.telephony.action.CARRIER_MESSAGING_CLIENT_SERVICE"; field public static final String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL"; field public static final String ACTION_NETWORK_COUNTRY_CHANGED = "android.telephony.action.NETWORK_COUNTRY_CHANGED"; Loading Loading @@ -45259,6 +45259,11 @@ package android.telephony { field public static final int UNINITIALIZED_CARD_ID = -2; // 0xfffffffe field public static final int UNKNOWN_CARRIER_ID = -1; // 0xffffffff field public static final int UNSUPPORTED_CARD_ID = -1; // 0xffffffff field public static final int UPDATE_AVAILABLE_NETWORKS_ABORTED = 2; // 0x2 field public static final int UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS = 3; // 0x3 field public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4; // 0x4 field public static final int UPDATE_AVAILABLE_NETWORKS_SUCCESS = 0; // 0x0 field public static final int UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE = 1; // 0x1 field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff field public static final String VVM_TYPE_CVVM = "vvm_type_cvvm";
telephony/java/android/telephony/SubscriptionManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2706,7 +2706,8 @@ public class SubscriptionManager { * 1) Even if it's active, it will be dormant most of the time. The modem will not try * to scan or camp until it knows an available network is nearby to save power. * 2) Telephony relies on system app or carrier input to notify nearby available networks. * See {@link TelephonyManager#updateAvailableNetworks(List)} for more information. * See {@link TelephonyManager#updateAvailableNetworks(List, Executor, Consumer)} * for more information. * 3) In multi-SIM devices, when the network is nearby and camped, system may automatically * switch internet data between it and default data subscription, based on carrier * recommendation and its signal strength and metered-ness, etc. Loading
telephony/java/android/telephony/TelephonyManager.java +65 −11 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ISetOpportunisticDataCallback; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephonyRegistry; import com.android.internal.telephony.IUpdateAvailableNetworksCallback; import com.android.internal.telephony.OperatorInfo; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RILConstants; Loading Loading @@ -10190,6 +10191,41 @@ public class TelephonyManager { */ public static final int SET_OPPORTUNISTIC_SUB_INVALID_PARAMETER = 2; /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"UPDATE_AVAILABLE_NETWORKS"}, value = { UPDATE_AVAILABLE_NETWORKS_SUCCESS, UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE, UPDATE_AVAILABLE_NETWORKS_ABORTED, UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS, UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE}) public @interface UpdateAvailableNetworksResult {} /** * No error. Operation succeeded. */ public static final int UPDATE_AVAILABLE_NETWORKS_SUCCESS = 0; /** * There is a unknown failure happened. */ public static final int UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE = 1; /** * The request is aborted. */ public static final int UPDATE_AVAILABLE_NETWORKS_ABORTED = 2; /** * The parameter passed in is invalid. */ public static final int UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS = 3; /** * No carrier privilege. */ public static final int UPDATE_AVAILABLE_NETWORKS_NO_CARRIER_PRIVILEGE = 4; /** * Set preferred opportunistic data subscription id. * Loading Loading @@ -10269,31 +10305,49 @@ public class TelephonyManager { /** * Update availability of a list of networks in the current location. * * This api should be called to inform OpportunisticNetwork Service about the availability * of a network at the current location. This information will be used by OpportunisticNetwork * service to decide to attach to the network opportunistically. If an empty list is passed, * it is assumed that no network is available. * This api should be called by opportunistic network selection app to inform * OpportunisticNetwork Service about the availability of a network at the current location. * This information will be used by OpportunisticNetwork service to decide to attach to the * network opportunistically. * If an empty list is passed, it is assumed that no network is available. * Requires that the calling app has carrier privileges on both primary and * secondary subscriptions (see {@link #hasCarrierPrivileges}), or has permission * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}. * @param availableNetworks is a list of available network information. * @return true if request is accepted * @param executor The executor of where the callback will execute. * @param callback Callback will be triggered once it succeeds or failed. * */ @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges public boolean updateAvailableNetworks(List<AvailableNetworkInfo> availableNetworks) { public void updateAvailableNetworks(@NonNull List<AvailableNetworkInfo> availableNetworks, @Nullable @CallbackExecutor Executor executor, @UpdateAvailableNetworksResult @Nullable Consumer<Integer> callback) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; boolean ret = false; try { IOns iOpportunisticNetworkService = getIOns(); if (iOpportunisticNetworkService != null && availableNetworks != null) { ret = iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, pkgForDebug); if (iOpportunisticNetworkService == null || availableNetworks == null) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> { callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS); })); return; } IUpdateAvailableNetworksCallback callbackStub = new IUpdateAvailableNetworksCallback.Stub() { @Override public void onComplete(int result) { if (executor == null || callback == null) { return; } Binder.withCleanCallingIdentity(() -> executor.execute(() -> { callback.accept(result); })); } }; iOpportunisticNetworkService.updateAvailableNetworks(availableNetworks, callbackStub, pkgForDebug); } catch (RemoteException ex) { Rlog.e(TAG, "updateAvailableNetworks RemoteException", ex); } return ret; } /** Loading
telephony/java/com/android/internal/telephony/IOns.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony; import android.telephony.AvailableNetworkInfo; import com.android.internal.telephony.ISetOpportunisticDataCallback; import com.android.internal.telephony.IUpdateAvailableNetworksCallback; interface IOns { Loading Loading @@ -97,9 +98,9 @@ interface IOns { * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}. * @param availableNetworks is a list of available network information. * @param callingPackage caller's package name * @return true if request is accepted * @param callback callback upon request completion. * */ boolean updateAvailableNetworks(in List<AvailableNetworkInfo> availableNetworks, String callingPackage); void updateAvailableNetworks(in List<AvailableNetworkInfo> availableNetworks, IUpdateAvailableNetworksCallback callbackStub, String callingPackage); }