Merge "Improve event time crash logging" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
16c6737def
@@ -5693,6 +5693,7 @@ public final class PowerManagerService extends SystemService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (eventTime > now) {
|
if (eventTime > now) {
|
||||||
|
Slog.e(TAG, "Event time " + eventTime + " cannot be newer than " + now);
|
||||||
throw new IllegalArgumentException("event time must not be in the future");
|
throw new IllegalArgumentException("event time must not be in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5708,7 +5709,9 @@ public final class PowerManagerService extends SystemService
|
|||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
public void wakeUp(long eventTime, @WakeReason int reason, String details,
|
public void wakeUp(long eventTime, @WakeReason int reason, String details,
|
||||||
String opPackageName) {
|
String opPackageName) {
|
||||||
if (eventTime > mClock.uptimeMillis()) {
|
final long now = mClock.uptimeMillis();
|
||||||
|
if (eventTime > now) {
|
||||||
|
Slog.e(TAG, "Event time " + eventTime + " cannot be newer than " + now);
|
||||||
throw new IllegalArgumentException("event time must not be in the future");
|
throw new IllegalArgumentException("event time must not be in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5760,7 +5763,9 @@ public final class PowerManagerService extends SystemService
|
|||||||
|
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
public void nap(long eventTime) {
|
public void nap(long eventTime) {
|
||||||
if (eventTime > mClock.uptimeMillis()) {
|
final long now = mClock.uptimeMillis();
|
||||||
|
if (eventTime > now) {
|
||||||
|
Slog.e(TAG, "Event time " + eventTime + " cannot be newer than " + now);
|
||||||
throw new IllegalArgumentException("event time must not be in the future");
|
throw new IllegalArgumentException("event time must not be in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6525,7 +6530,9 @@ public final class PowerManagerService extends SystemService
|
|||||||
|
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
public void boostScreenBrightness(long eventTime) {
|
public void boostScreenBrightness(long eventTime) {
|
||||||
|
final long now = mClock.uptimeMillis();
|
||||||
if (eventTime > mClock.uptimeMillis()) {
|
if (eventTime > mClock.uptimeMillis()) {
|
||||||
|
Slog.e(TAG, "Event time " + eventTime + " cannot be newer than " + now);
|
||||||
throw new IllegalArgumentException("event time must not be in the future");
|
throw new IllegalArgumentException("event time must not be in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6684,7 +6691,9 @@ public final class PowerManagerService extends SystemService
|
|||||||
|
|
||||||
@RequiresPermission(android.Manifest.permission.DEVICE_POWER)
|
@RequiresPermission(android.Manifest.permission.DEVICE_POWER)
|
||||||
private void goToSleepInternal(IntArray groupIds, long eventTime, int reason, int flags) {
|
private void goToSleepInternal(IntArray groupIds, long eventTime, int reason, int flags) {
|
||||||
if (eventTime > mClock.uptimeMillis()) {
|
final long now = mClock.uptimeMillis();
|
||||||
|
if (eventTime > now) {
|
||||||
|
Slog.e(TAG, "Event time " + eventTime + " cannot be newer than " + now);
|
||||||
throw new IllegalArgumentException("event time must not be in the future");
|
throw new IllegalArgumentException("event time must not be in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user