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();
|
handlerThread.start();
|
||||||
mHandler = new NetworkStatsHandler(handlerThread.getLooper());
|
mHandler = new NetworkStatsHandler(handlerThread.getLooper());
|
||||||
mNetworkStatsSubscriptionsMonitor = deps.makeSubscriptionsMonitor(mContext,
|
mNetworkStatsSubscriptionsMonitor = deps.makeSubscriptionsMonitor(mContext,
|
||||||
new HandlerExecutor(mHandler), this);
|
mHandler.getLooper(), new HandlerExecutor(mHandler), this);
|
||||||
mContentResolver = mContext.getContentResolver();
|
mContentResolver = mContext.getContentResolver();
|
||||||
mContentObserver = mDeps.makeContentObserver(mHandler, mSettings,
|
mContentObserver = mDeps.makeContentObserver(mHandler, mSettings,
|
||||||
mNetworkStatsSubscriptionsMonitor);
|
mNetworkStatsSubscriptionsMonitor);
|
||||||
@@ -468,11 +468,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public NetworkStatsSubscriptionsMonitor makeSubscriptionsMonitor(@NonNull Context context,
|
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
|
// TODO: Update RatType passively in NSS, instead of querying into the monitor
|
||||||
// when forceUpdateIface.
|
// when forceUpdateIface.
|
||||||
return new NetworkStatsSubscriptionsMonitor(context, executor, (subscriberId, type) ->
|
return new NetworkStatsSubscriptionsMonitor(context, looper, executor,
|
||||||
service.handleOnCollapsedRatTypeChanged());
|
(subscriberId, type) -> service.handleOnCollapsedRatTypeChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static android.net.NetworkTemplate.getCollapsedRatType;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Looper;
|
||||||
import android.telephony.Annotation;
|
import android.telephony.Annotation;
|
||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
@@ -75,9 +76,9 @@ public class NetworkStatsSubscriptionsMonitor extends
|
|||||||
@NonNull
|
@NonNull
|
||||||
private final Executor mExecutor;
|
private final Executor mExecutor;
|
||||||
|
|
||||||
NetworkStatsSubscriptionsMonitor(@NonNull Context context, @NonNull Executor executor,
|
NetworkStatsSubscriptionsMonitor(@NonNull Context context, @NonNull Looper looper,
|
||||||
@NonNull Delegate delegate) {
|
@NonNull Executor executor, @NonNull Delegate delegate) {
|
||||||
super();
|
super(looper);
|
||||||
mSubscriptionManager = (SubscriptionManager) context.getSystemService(
|
mSubscriptionManager = (SubscriptionManager) context.getSystemService(
|
||||||
Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
||||||
mTeleManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
mTeleManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
|||||||
Reference in New Issue
Block a user