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

Commit b3bf595c authored by Xin Guan's avatar Xin Guan Committed by Android (Google) Code Review
Browse files

Merge "UsageStats: Don't trigger idle check for USER_SYSTEM during boot up" into main

parents a5f83382 695e1b67
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -47,3 +47,14 @@ flag {
    description: "Feature flag for collecting app data size by file type API"
    bug: "294088945"
}

flag {
    name: "disable_idle_check"
    namespace: "backstage_power"
    description: "disable idle check for USER_SYSTEM during boot up"
    is_fixed_read_only: true
    bug: "337864590"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -654,11 +654,14 @@ public class UsageStatsService extends SystemService implements
                }
            } else if (Intent.ACTION_USER_STARTED.equals(action)) {
                if (userId >= 0) {
                    if (!Flags.disableIdleCheck() || userId > 0) {
                        // Don't check idle state for USER_SYSTEM during the boot up.
                        mHandler.obtainMessage(MSG_USER_STARTED, userId, 0).sendToTarget();
                    }
                }
            }
        }
    }

    private class UidRemovedReceiver extends BroadcastReceiver {
        @Override
@@ -2013,6 +2016,8 @@ public class UsageStatsService extends SystemService implements
                + ": " + Flags.useParceledList());
        pw.println("    " + Flags.FLAG_FILTER_BASED_EVENT_QUERY_API
                + ": " + Flags.filterBasedEventQueryApi());
        pw.println("    " + Flags.FLAG_DISABLE_IDLE_CHECK
                + ": " + Flags.disableIdleCheck());

        final int[] userIds;
        synchronized (mLock) {