[Settings] Enable access from non-UI thread

To support query from settings intelligent, these listeners need to
support accessing from non-UI thread.

Bug: 149543756
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=ActiveSubsciptionsListenerTest
Change-Id: I768f41f76d0223634be2b728d33fa0cfcc69fe69
This commit is contained in:
Bonian Chen
2020-05-04 11:04:09 +08:00
parent 37c795af3a
commit 19507e7585
2 changed files with 2 additions and 1 deletions

View File

@@ -73,6 +73,7 @@ public abstract class ActiveSubsciptionsListener
* @param context {@code Context} of this listener
*/
public ActiveSubsciptionsListener(Looper looper, Context context) {
super(looper);
mLooper = looper;
mContext = context;

View File

@@ -72,7 +72,7 @@ public class ProxySubscriptionManager implements LifecycleObserver {
private static ProxySubscriptionManager sSingleton;
private ProxySubscriptionManager(Context context) {
final Looper looper = Looper.getMainLooper();
final Looper looper = context.getMainLooper();
mActiveSubscriptionsListeners =
new ArrayList<OnActiveSubscriptionChangedListener>();