Add addOnSubscriptionsChangedListener with an executor as a parameter
Bug: 140562205 Test: Manual Change-Id: I4c81d9f3a8a3c7d11261cdfe1ae27b49abc33e43
This commit is contained in:
@@ -45306,6 +45306,7 @@ package android.telephony {
|
||||
public class SubscriptionManager {
|
||||
method public void addOnOpportunisticSubscriptionsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener);
|
||||
method public void addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
|
||||
method public void addOnSubscriptionsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
|
||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void addSubscriptionsIntoGroup(@NonNull java.util.List<java.lang.Integer>, @NonNull android.os.ParcelUuid);
|
||||
method public boolean canManageSubscription(android.telephony.SubscriptionInfo);
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.os.ParcelUuid createSubscriptionGroup(@NonNull java.util.List<java.lang.Integer>);
|
||||
|
||||
@@ -1040,6 +1040,23 @@ public class SubscriptionManager {
|
||||
*/
|
||||
public void addOnSubscriptionsChangedListener(OnSubscriptionsChangedListener listener) {
|
||||
if (listener == null) return;
|
||||
addOnSubscriptionsChangedListener(listener.mExecutor, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register for changes to the list of active {@link SubscriptionInfo} records or to the
|
||||
* individual records themselves. When a change occurs the onSubscriptionsChanged method of
|
||||
* the listener will be invoked immediately if there has been a notification. The
|
||||
* onSubscriptionChanged method will also be triggered once initially when calling this
|
||||
* function.
|
||||
*
|
||||
* @param listener an instance of {@link OnSubscriptionsChangedListener} with
|
||||
* onSubscriptionsChanged overridden.
|
||||
* @param executor the executor that will execute callbacks.
|
||||
*/
|
||||
public void addOnSubscriptionsChangedListener(
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull OnSubscriptionsChangedListener listener) {
|
||||
String pkgName = mContext != null ? mContext.getOpPackageName() : "<unknown>";
|
||||
if (DBG) {
|
||||
logd("register OnSubscriptionsChangedListener pkgName=" + pkgName
|
||||
@@ -1051,7 +1068,7 @@ public class SubscriptionManager {
|
||||
mContext.getSystemService(Context.TELEPHONY_REGISTRY_SERVICE);
|
||||
if (telephonyRegistryManager != null) {
|
||||
telephonyRegistryManager.addOnSubscriptionsChangedListener(listener,
|
||||
listener.mExecutor);
|
||||
executor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user