Merge "Telephony: Allow custom looper for OnSubscriptionsChangedListener"
This commit is contained in:
@@ -26,6 +26,7 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
@@ -408,7 +409,15 @@ public class SubscriptionManager {
|
||||
* for #onSubscriptionsChanged to be invoked.
|
||||
*/
|
||||
public static class OnSubscriptionsChangedListener {
|
||||
private final Handler mHandler = new Handler() {
|
||||
private class OnSubscriptionsChangedListenerHandler extends Handler {
|
||||
OnSubscriptionsChangedListenerHandler() {
|
||||
super();
|
||||
}
|
||||
|
||||
OnSubscriptionsChangedListenerHandler(Looper looper) {
|
||||
super(looper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if (DBG) {
|
||||
@@ -416,7 +425,22 @@ public class SubscriptionManager {
|
||||
}
|
||||
OnSubscriptionsChangedListener.this.onSubscriptionsChanged();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private final Handler mHandler;
|
||||
|
||||
public OnSubscriptionsChangedListener() {
|
||||
mHandler = new OnSubscriptionsChangedListenerHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow a listener to be created with a custom looper
|
||||
* @param looper the looper that the underlining handler should run on
|
||||
* @hide
|
||||
*/
|
||||
public OnSubscriptionsChangedListener(Looper looper) {
|
||||
mHandler = new OnSubscriptionsChangedListenerHandler(looper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when there is any change to any SubscriptionInfo. Typically
|
||||
|
||||
Reference in New Issue
Block a user