Loading core/java/android/app/usage/flags.aconfig +0 −8 Original line number Diff line number Diff line Loading @@ -17,14 +17,6 @@ flag { bug: "296056771" } flag { name: "use_dedicated_handler_thread" namespace: "backstage_power" description: "Flag to use a dedicated thread for usage event process" is_fixed_read_only: true bug: "299336442" } flag { name: "filter_based_event_query_api" is_exported: true Loading services/usage/java/com/android/server/usage/UsageStatsService.java +4 −15 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ import android.util.SparseSetArray; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.content.PackageMonitor; import com.android.internal.os.BackgroundThread; import com.android.internal.util.CollectionUtils; import com.android.internal.util.DumpUtils; import com.android.internal.util.FrameworkStatsLog; Loading Loading @@ -154,10 +153,6 @@ public class UsageStatsService extends SystemService implements public static final boolean ENABLE_TIME_CHANGE_CORRECTION = SystemProperties.getBoolean("persist.debug.time_correction", true); private static final boolean USE_DEDICATED_HANDLER_THREAD = SystemProperties.getBoolean("persist.debug.use_dedicated_handler_thread", Flags.useDedicatedHandlerThread()); static final boolean DEBUG = false; // Never submit with true static final boolean DEBUG_RESPONSE_STATS = DEBUG || Log.isLoggable(TAG, Log.DEBUG); static final boolean COMPRESS_TIME = false; Loading Loading @@ -406,18 +401,16 @@ public class UsageStatsService extends SystemService implements mAppStandby.addListener(mStandbyChangeListener); mPackageMonitor.register(getContext(), /* thread= */ USE_DEDICATED_HANDLER_THREAD ? mHandler.getLooper() : null, mPackageMonitor.register(getContext(), /* thread= */ mHandler.getLooper(), UserHandle.ALL, true); IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED); filter.addAction(Intent.ACTION_USER_STARTED); getContext().registerReceiverAsUser(new UserActionsReceiver(), UserHandle.ALL, filter, null, /* scheduler= */ USE_DEDICATED_HANDLER_THREAD ? mHandler : null); null, /* scheduler= */ mHandler); getContext().registerReceiverAsUser(new UidRemovedReceiver(), UserHandle.ALL, new IntentFilter(ACTION_UID_REMOVED), null, /* scheduler= */ USE_DEDICATED_HANDLER_THREAD ? mHandler : null); new IntentFilter(ACTION_UID_REMOVED), null, /* scheduler= */ mHandler); mRealTimeSnapshot = SystemClock.elapsedRealtime(); mSystemTimeSnapshot = System.currentTimeMillis(); Loading Loading @@ -509,11 +502,7 @@ public class UsageStatsService extends SystemService implements } private Handler getUsageEventProcessingHandler() { if (USE_DEDICATED_HANDLER_THREAD) { return new H(UsageStatsHandlerThread.get().getLooper()); } else { return new H(BackgroundThread.get().getLooper()); } } private void onUserUnlocked(int userId) { Loading Loading
core/java/android/app/usage/flags.aconfig +0 −8 Original line number Diff line number Diff line Loading @@ -17,14 +17,6 @@ flag { bug: "296056771" } flag { name: "use_dedicated_handler_thread" namespace: "backstage_power" description: "Flag to use a dedicated thread for usage event process" is_fixed_read_only: true bug: "299336442" } flag { name: "filter_based_event_query_api" is_exported: true Loading
services/usage/java/com/android/server/usage/UsageStatsService.java +4 −15 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ import android.util.SparseSetArray; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.content.PackageMonitor; import com.android.internal.os.BackgroundThread; import com.android.internal.util.CollectionUtils; import com.android.internal.util.DumpUtils; import com.android.internal.util.FrameworkStatsLog; Loading Loading @@ -154,10 +153,6 @@ public class UsageStatsService extends SystemService implements public static final boolean ENABLE_TIME_CHANGE_CORRECTION = SystemProperties.getBoolean("persist.debug.time_correction", true); private static final boolean USE_DEDICATED_HANDLER_THREAD = SystemProperties.getBoolean("persist.debug.use_dedicated_handler_thread", Flags.useDedicatedHandlerThread()); static final boolean DEBUG = false; // Never submit with true static final boolean DEBUG_RESPONSE_STATS = DEBUG || Log.isLoggable(TAG, Log.DEBUG); static final boolean COMPRESS_TIME = false; Loading Loading @@ -406,18 +401,16 @@ public class UsageStatsService extends SystemService implements mAppStandby.addListener(mStandbyChangeListener); mPackageMonitor.register(getContext(), /* thread= */ USE_DEDICATED_HANDLER_THREAD ? mHandler.getLooper() : null, mPackageMonitor.register(getContext(), /* thread= */ mHandler.getLooper(), UserHandle.ALL, true); IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED); filter.addAction(Intent.ACTION_USER_STARTED); getContext().registerReceiverAsUser(new UserActionsReceiver(), UserHandle.ALL, filter, null, /* scheduler= */ USE_DEDICATED_HANDLER_THREAD ? mHandler : null); null, /* scheduler= */ mHandler); getContext().registerReceiverAsUser(new UidRemovedReceiver(), UserHandle.ALL, new IntentFilter(ACTION_UID_REMOVED), null, /* scheduler= */ USE_DEDICATED_HANDLER_THREAD ? mHandler : null); new IntentFilter(ACTION_UID_REMOVED), null, /* scheduler= */ mHandler); mRealTimeSnapshot = SystemClock.elapsedRealtime(); mSystemTimeSnapshot = System.currentTimeMillis(); Loading Loading @@ -509,11 +502,7 @@ public class UsageStatsService extends SystemService implements } private Handler getUsageEventProcessingHandler() { if (USE_DEDICATED_HANDLER_THREAD) { return new H(UsageStatsHandlerThread.get().getLooper()); } else { return new H(BackgroundThread.get().getLooper()); } } private void onUserUnlocked(int userId) { Loading