Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60da1b02 authored by Yu-Han Yang's avatar Yu-Han Yang Committed by Android (Google) Code Review
Browse files

Merge "Move mOnSubscriptionsChangeListener to FgThread" into main

parents aa8d20d6 b51ba47f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -78,6 +78,13 @@ flag {
    bug: "314328533"
}

flag {
    name: "subscriptions_listener_thread"
    namespace: "location"
    description: "Flag for running onSubscriptionsChangeListener on FgThread"
    bug: "332451908"
}

flag {
    name: "gnss_configuration_from_resource"
    namespace: "location"
+7 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
import android.util.Log;

import com.android.internal.location.GpsNetInitiatedHandler;
import com.android.server.FgThread;

import java.net.Inet4Address;
import java.net.Inet6Address;
@@ -200,8 +201,13 @@ class GnssNetworkConnectivityHandler {

        SubscriptionManager subManager = mContext.getSystemService(SubscriptionManager.class);
        if (subManager != null) {
            if (Flags.subscriptionsListenerThread()) {
                subManager.addOnSubscriptionsChangedListener(FgThread.getExecutor(),
                        mOnSubscriptionsChangeListener);
            } else {
                subManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangeListener);
            }
        }

        PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_KEY);