Merge "Address comments from aosp/1298476" am: 72b4ffad5c am: eb276cb5b3 am: e9d35cc556 am: 15156482c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040 Change-Id: I067965de3d884bfe8f2832e5116daadd5bda1ae5
This commit is contained in:
@@ -442,7 +442,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
handlerThread.start();
|
||||
mHandler = new NetworkStatsHandler(handlerThread.getLooper());
|
||||
mNetworkStatsSubscriptionsMonitor = deps.makeSubscriptionsMonitor(mContext,
|
||||
new HandlerExecutor(mHandler), this);
|
||||
mHandler.getLooper(), new HandlerExecutor(mHandler), this);
|
||||
mContentResolver = mContext.getContentResolver();
|
||||
mContentObserver = mDeps.makeContentObserver(mHandler, mSettings,
|
||||
mNetworkStatsSubscriptionsMonitor);
|
||||
@@ -468,11 +468,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
*/
|
||||
@NonNull
|
||||
public NetworkStatsSubscriptionsMonitor makeSubscriptionsMonitor(@NonNull Context context,
|
||||
@NonNull Executor executor, @NonNull NetworkStatsService service) {
|
||||
@NonNull Looper looper, @NonNull Executor executor,
|
||||
@NonNull NetworkStatsService service) {
|
||||
// TODO: Update RatType passively in NSS, instead of querying into the monitor
|
||||
// when forceUpdateIface.
|
||||
return new NetworkStatsSubscriptionsMonitor(context, executor, (subscriberId, type) ->
|
||||
service.handleOnCollapsedRatTypeChanged());
|
||||
return new NetworkStatsSubscriptionsMonitor(context, looper, executor,
|
||||
(subscriberId, type) -> service.handleOnCollapsedRatTypeChanged());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import static android.net.NetworkTemplate.getCollapsedRatType;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.os.Looper;
|
||||
import android.telephony.Annotation;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.ServiceState;
|
||||
@@ -75,9 +76,9 @@ public class NetworkStatsSubscriptionsMonitor extends
|
||||
@NonNull
|
||||
private final Executor mExecutor;
|
||||
|
||||
NetworkStatsSubscriptionsMonitor(@NonNull Context context, @NonNull Executor executor,
|
||||
@NonNull Delegate delegate) {
|
||||
super();
|
||||
NetworkStatsSubscriptionsMonitor(@NonNull Context context, @NonNull Looper looper,
|
||||
@NonNull Executor executor, @NonNull Delegate delegate) {
|
||||
super(looper);
|
||||
mSubscriptionManager = (SubscriptionManager) context.getSystemService(
|
||||
Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
||||
mTeleManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
||||
Reference in New Issue
Block a user