Skip to content
Snippets Groups Projects
Commit b51ba47f authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Move mOnSubscriptionsChangeListener to FgThread

Bug: 332451908
Test: on device
Change-Id: I226654fbe8798eced17d82a26c3eab25fa605d87
parent b485ab8a
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
......@@ -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,7 +201,12 @@ class GnssNetworkConnectivityHandler {
SubscriptionManager subManager = mContext.getSystemService(SubscriptionManager.class);
if (subManager != null) {
subManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangeListener);
if (Flags.subscriptionsListenerThread()) {
subManager.addOnSubscriptionsChangedListener(FgThread.getExecutor(),
mOnSubscriptionsChangeListener);
} else {
subManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangeListener);
}
}
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment