Loading apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ public class ZipFilePerfTest { BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { ZipFile zf = new ZipFile(mFile); state.pauseTiming(); zf.close(); state.resumeTiming(); } } Loading core/java/com/android/internal/os/BatteryStatsImpl.java +6 −3 Original line number Diff line number Diff line Loading @@ -4503,10 +4503,13 @@ public class BatteryStatsImpl extends BatteryStats { for (Map.Entry<HistoryTag, Integer> entry: mHistoryTagPool.entrySet()) { entry.setValue(entry.getValue() | TAG_FIRST_OCCURRENCE_FLAG); } // Make a copy of mHistoryCur. HistoryItem copy = new HistoryItem(); copy.setTo(cur); // startRecordingHistory will reset mHistoryCur. startRecordingHistory(elapsedRealtimeMs, uptimeMs, false); HistoryItem newItem = new HistoryItem(); newItem.setTo(cur); addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_UPDATE, newItem); // Add the copy into history buffer. addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_UPDATE, copy); return; } Loading core/tests/coretests/src/com/android/internal/os/BatteryStatsHistoryIteratorTest.java +9 −7 Original line number Diff line number Diff line Loading @@ -154,19 +154,21 @@ public class BatteryStatsHistoryIteratorTest { for (int i = 0; i < eventCount; i++) { String name = "a" + (i % 10); do { assertThat(iterator.next(item)).isTrue(); // Skip a blank event inserted at the start of every buffer if (item.eventCode == BatteryStats.HistoryItem.EVENT_NONE) { assertThat(iterator.next(item)).isTrue(); } } while (item.cmd != BatteryStats.HistoryItem.CMD_UPDATE || item.eventCode == BatteryStats.HistoryItem.EVENT_NONE); assertThat(item.eventCode).isEqualTo(BatteryStats.HistoryItem.EVENT_ALARM | BatteryStats.HistoryItem.EVENT_FLAG_START); assertThat(item.eventTag.string).isEqualTo(name); do { assertThat(iterator.next(item)).isTrue(); if (item.eventCode == BatteryStats.HistoryItem.EVENT_NONE) { assertThat(iterator.next(item)).isTrue(); } } while (item.cmd != BatteryStats.HistoryItem.CMD_UPDATE || item.eventCode == BatteryStats.HistoryItem.EVENT_NONE); assertThat(item.eventCode).isEqualTo(BatteryStats.HistoryItem.EVENT_ALARM | BatteryStats.HistoryItem.EVENT_FLAG_FINISH); assertThat(item.eventTag.string).isEqualTo(name); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +10 −0 Original line number Diff line number Diff line Loading @@ -485,6 +485,8 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, */ private IRemoteAnimationRunner mKeyguardExitAnimationRunner; private CentralSurfaces mCentralSurfaces; private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener = new DeviceConfig.OnPropertiesChangedListener() { @Override Loading Loading @@ -845,6 +847,13 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, + mOccluded); } @Override public void onLaunchAnimationEnd(boolean launchIsFullScreen) { if (launchIsFullScreen) { mCentralSurfaces.instantCollapseNotificationPanel(); } } @NonNull @Override public ViewGroup getLaunchContainer() { Loading Loading @@ -2846,6 +2855,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, @Nullable PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { mCentralSurfaces = centralSurfaces; mKeyguardViewControllerLazy.get().registerCentralSurfaces( centralSurfaces, panelView, Loading packages/SystemUI/src/com/android/systemui/media/MediaData.kt +17 −1 Original line number Diff line number Diff line Loading @@ -216,4 +216,20 @@ data class MediaDeviceData /** Unique id for this device */ val id: String? = null ) ) { /** * Check whether [MediaDeviceData] objects are equal in all fields except the icon. The icon * is ignored because it can change by reference frequently depending on the device type's * implementation, but this is not usually relevant unless other info has changed */ fun equalsWithoutIcon(other: MediaDeviceData?): Boolean { if (other == null) { return false } return enabled == other.enabled && name == other.name && intent == other.intent && id == other.id } } Loading
apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ public class ZipFilePerfTest { BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { ZipFile zf = new ZipFile(mFile); state.pauseTiming(); zf.close(); state.resumeTiming(); } } Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +6 −3 Original line number Diff line number Diff line Loading @@ -4503,10 +4503,13 @@ public class BatteryStatsImpl extends BatteryStats { for (Map.Entry<HistoryTag, Integer> entry: mHistoryTagPool.entrySet()) { entry.setValue(entry.getValue() | TAG_FIRST_OCCURRENCE_FLAG); } // Make a copy of mHistoryCur. HistoryItem copy = new HistoryItem(); copy.setTo(cur); // startRecordingHistory will reset mHistoryCur. startRecordingHistory(elapsedRealtimeMs, uptimeMs, false); HistoryItem newItem = new HistoryItem(); newItem.setTo(cur); addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_UPDATE, newItem); // Add the copy into history buffer. addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_UPDATE, copy); return; } Loading
core/tests/coretests/src/com/android/internal/os/BatteryStatsHistoryIteratorTest.java +9 −7 Original line number Diff line number Diff line Loading @@ -154,19 +154,21 @@ public class BatteryStatsHistoryIteratorTest { for (int i = 0; i < eventCount; i++) { String name = "a" + (i % 10); do { assertThat(iterator.next(item)).isTrue(); // Skip a blank event inserted at the start of every buffer if (item.eventCode == BatteryStats.HistoryItem.EVENT_NONE) { assertThat(iterator.next(item)).isTrue(); } } while (item.cmd != BatteryStats.HistoryItem.CMD_UPDATE || item.eventCode == BatteryStats.HistoryItem.EVENT_NONE); assertThat(item.eventCode).isEqualTo(BatteryStats.HistoryItem.EVENT_ALARM | BatteryStats.HistoryItem.EVENT_FLAG_START); assertThat(item.eventTag.string).isEqualTo(name); do { assertThat(iterator.next(item)).isTrue(); if (item.eventCode == BatteryStats.HistoryItem.EVENT_NONE) { assertThat(iterator.next(item)).isTrue(); } } while (item.cmd != BatteryStats.HistoryItem.CMD_UPDATE || item.eventCode == BatteryStats.HistoryItem.EVENT_NONE); assertThat(item.eventCode).isEqualTo(BatteryStats.HistoryItem.EVENT_ALARM | BatteryStats.HistoryItem.EVENT_FLAG_FINISH); assertThat(item.eventTag.string).isEqualTo(name); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +10 −0 Original line number Diff line number Diff line Loading @@ -485,6 +485,8 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, */ private IRemoteAnimationRunner mKeyguardExitAnimationRunner; private CentralSurfaces mCentralSurfaces; private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener = new DeviceConfig.OnPropertiesChangedListener() { @Override Loading Loading @@ -845,6 +847,13 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, + mOccluded); } @Override public void onLaunchAnimationEnd(boolean launchIsFullScreen) { if (launchIsFullScreen) { mCentralSurfaces.instantCollapseNotificationPanel(); } } @NonNull @Override public ViewGroup getLaunchContainer() { Loading Loading @@ -2846,6 +2855,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, @Nullable PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { mCentralSurfaces = centralSurfaces; mKeyguardViewControllerLazy.get().registerCentralSurfaces( centralSurfaces, panelView, Loading
packages/SystemUI/src/com/android/systemui/media/MediaData.kt +17 −1 Original line number Diff line number Diff line Loading @@ -216,4 +216,20 @@ data class MediaDeviceData /** Unique id for this device */ val id: String? = null ) ) { /** * Check whether [MediaDeviceData] objects are equal in all fields except the icon. The icon * is ignored because it can change by reference frequently depending on the device type's * implementation, but this is not usually relevant unless other info has changed */ fun equalsWithoutIcon(other: MediaDeviceData?): Boolean { if (other == null) { return false } return enabled == other.enabled && name == other.name && intent == other.intent && id == other.id } }