Loading core/java/android/os/BatteryStats.java +8 −1 Original line number Diff line number Diff line Loading @@ -604,6 +604,7 @@ public abstract class BatteryStats implements Parcelable { public static final byte CMD_CURRENT_TIME = 5; public static final byte CMD_OVERFLOW = 6; public static final byte CMD_RESET = 7; public static final byte CMD_SHUTDOWN = 8; public byte cmd = CMD_NULL; Loading Loading @@ -3529,6 +3530,11 @@ public abstract class BatteryStats implements Parcelable { pw.println(DateFormat.format("yyyy-MM-dd-HH-mm-ss", rec.currentTime).toString()); } } else if (rec.cmd == HistoryItem.CMD_SHUTDOWN) { if (checkin) { pw.print(":"); } pw.println("SHUTDOWN"); } else if (rec.cmd == HistoryItem.CMD_OVERFLOW) { if (checkin) { pw.print(":"); Loading Loading @@ -3849,7 +3855,8 @@ public abstract class BatteryStats implements Parcelable { if (histStart >= 0 && !printed) { if (rec.cmd == HistoryItem.CMD_CURRENT_TIME || rec.cmd == HistoryItem.CMD_RESET || rec.cmd == HistoryItem.CMD_START) { || rec.cmd == HistoryItem.CMD_START || rec.cmd == HistoryItem.CMD_SHUTDOWN) { printed = true; hprinter.printNextItem(pw, rec, baseTime, checkin, (flags&DUMP_VERBOSE) != 0); Loading core/java/com/android/internal/content/PackageMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.Uri; import android.os.Handler; import android.os.Looper; import android.os.UserHandle; import android.util.Slog; import com.android.internal.os.BackgroundThread; import java.util.HashSet; Loading Loading @@ -279,8 +280,8 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { mChangeUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); if (mChangeUserId == UserHandle.USER_NULL) { throw new IllegalArgumentException( "Intent broadcast does not contain user handle: " + intent); Slog.w("PackageMonitor", "Intent broadcast does not contain user handle: " + intent); return; } onBeginPackageChanges(); Loading core/java/com/android/internal/os/BatteryStatsImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -6955,6 +6955,17 @@ public final class BatteryStatsImpl extends BatteryStats { } } private void recordShutdownLocked(final long elapsedRealtimeMs, final long uptimeMs) { if (mRecordingHistory) { mHistoryCur.currentTime = System.currentTimeMillis(); mLastRecordedClockTime = mHistoryCur.currentTime; mLastRecordedClockRealtime = elapsedRealtimeMs; addHistoryBufferLocked(elapsedRealtimeMs, uptimeMs, HistoryItem.CMD_SHUTDOWN, mHistoryCur); mHistoryCur.currentTime = 0; } } // This should probably be exposed in the API, though it's not critical private static final int BATTERY_PLUGGED_NONE = 0; Loading Loading @@ -7627,6 +7638,7 @@ public final class BatteryStatsImpl extends BatteryStats { } public void shutdownLocked() { recordShutdownLocked(SystemClock.elapsedRealtime(), SystemClock.uptimeMillis()); writeSyncLocked(); mShuttingDown = true; } Loading services/core/java/com/android/server/notification/NotificationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,9 @@ public class NotificationManagerService extends SystemService { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action == null) { return; } boolean queryRestart = false; boolean queryRemove = false; Loading services/core/java/com/android/server/pm/UserManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,9 @@ public class UserManagerService extends IUserManager.Stub { checkManageUsersPermission("get the profile parent"); synchronized (mPackagesLock) { UserInfo profile = getUserInfoLocked(userHandle); if (profile == null) { return null; } int parentUserId = profile.profileGroupId; if (parentUserId == UserInfo.NO_PROFILE_GROUP_ID) { return null; Loading Loading
core/java/android/os/BatteryStats.java +8 −1 Original line number Diff line number Diff line Loading @@ -604,6 +604,7 @@ public abstract class BatteryStats implements Parcelable { public static final byte CMD_CURRENT_TIME = 5; public static final byte CMD_OVERFLOW = 6; public static final byte CMD_RESET = 7; public static final byte CMD_SHUTDOWN = 8; public byte cmd = CMD_NULL; Loading Loading @@ -3529,6 +3530,11 @@ public abstract class BatteryStats implements Parcelable { pw.println(DateFormat.format("yyyy-MM-dd-HH-mm-ss", rec.currentTime).toString()); } } else if (rec.cmd == HistoryItem.CMD_SHUTDOWN) { if (checkin) { pw.print(":"); } pw.println("SHUTDOWN"); } else if (rec.cmd == HistoryItem.CMD_OVERFLOW) { if (checkin) { pw.print(":"); Loading Loading @@ -3849,7 +3855,8 @@ public abstract class BatteryStats implements Parcelable { if (histStart >= 0 && !printed) { if (rec.cmd == HistoryItem.CMD_CURRENT_TIME || rec.cmd == HistoryItem.CMD_RESET || rec.cmd == HistoryItem.CMD_START) { || rec.cmd == HistoryItem.CMD_START || rec.cmd == HistoryItem.CMD_SHUTDOWN) { printed = true; hprinter.printNextItem(pw, rec, baseTime, checkin, (flags&DUMP_VERBOSE) != 0); Loading
core/java/com/android/internal/content/PackageMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.net.Uri; import android.os.Handler; import android.os.Looper; import android.os.UserHandle; import android.util.Slog; import com.android.internal.os.BackgroundThread; import java.util.HashSet; Loading Loading @@ -279,8 +280,8 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { mChangeUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); if (mChangeUserId == UserHandle.USER_NULL) { throw new IllegalArgumentException( "Intent broadcast does not contain user handle: " + intent); Slog.w("PackageMonitor", "Intent broadcast does not contain user handle: " + intent); return; } onBeginPackageChanges(); Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -6955,6 +6955,17 @@ public final class BatteryStatsImpl extends BatteryStats { } } private void recordShutdownLocked(final long elapsedRealtimeMs, final long uptimeMs) { if (mRecordingHistory) { mHistoryCur.currentTime = System.currentTimeMillis(); mLastRecordedClockTime = mHistoryCur.currentTime; mLastRecordedClockRealtime = elapsedRealtimeMs; addHistoryBufferLocked(elapsedRealtimeMs, uptimeMs, HistoryItem.CMD_SHUTDOWN, mHistoryCur); mHistoryCur.currentTime = 0; } } // This should probably be exposed in the API, though it's not critical private static final int BATTERY_PLUGGED_NONE = 0; Loading Loading @@ -7627,6 +7638,7 @@ public final class BatteryStatsImpl extends BatteryStats { } public void shutdownLocked() { recordShutdownLocked(SystemClock.elapsedRealtime(), SystemClock.uptimeMillis()); writeSyncLocked(); mShuttingDown = true; } Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,9 @@ public class NotificationManagerService extends SystemService { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action == null) { return; } boolean queryRestart = false; boolean queryRemove = false; Loading
services/core/java/com/android/server/pm/UserManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -320,6 +320,9 @@ public class UserManagerService extends IUserManager.Stub { checkManageUsersPermission("get the profile parent"); synchronized (mPackagesLock) { UserInfo profile = getUserInfoLocked(userHandle); if (profile == null) { return null; } int parentUserId = profile.profileGroupId; if (parentUserId == UserInfo.NO_PROFILE_GROUP_ID) { return null; Loading