diff options
18 files changed, 129 insertions, 45 deletions
diff --git a/cmds/svc/src/com/android/commands/svc/PowerCommand.java b/cmds/svc/src/com/android/commands/svc/PowerCommand.java index da8586c..2754f2d 100644 --- a/cmds/svc/src/com/android/commands/svc/PowerCommand.java +++ b/cmds/svc/src/com/android/commands/svc/PowerCommand.java @@ -70,7 +70,7 @@ public class PowerCommand extends Svc.Command { if (val != 0) { // if the request is not to set it to false, wake up the screen so that // it can stay on as requested - pm.wakeUp(SystemClock.uptimeMillis()); + pm.wakeUp(SystemClock.uptimeMillis(), "PowerCommand", null); } pm.setStayOnSetting(val); } diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index bf3bfae..849253b 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -233,8 +233,10 @@ public class AppOpsManager { public static final int OP_READ_EXTERNAL_STORAGE = 59; /** @hide Write external storage. */ public static final int OP_WRITE_EXTERNAL_STORAGE = 60; + /** @hide Turned on the screen. */ + public static final int OP_TURN_SCREEN_ON = 61; /** @hide */ - public static final int _NUM_OP = 61; + public static final int _NUM_OP = 62; /** Access to coarse location information. */ public static final String OPSTR_COARSE_LOCATION = "android:coarse_location"; @@ -393,7 +395,8 @@ public class AppOpsManager { OP_READ_CELL_BROADCASTS, OP_MOCK_LOCATION, OP_READ_EXTERNAL_STORAGE, - OP_WRITE_EXTERNAL_STORAGE + OP_WRITE_EXTERNAL_STORAGE, + OP_TURN_SCREEN_ON, }; /** @@ -461,7 +464,8 @@ public class AppOpsManager { OPSTR_READ_CELL_BROADCASTS, OPSTR_MOCK_LOCATION, OPSTR_READ_EXTERNAL_STORAGE, - OPSTR_WRITE_EXTERNAL_STORAGE + OPSTR_WRITE_EXTERNAL_STORAGE, + null, }; /** @@ -528,8 +532,9 @@ public class AppOpsManager { "BODY_SENSORS", "READ_CELL_BROADCASTS", "MOCK_LOCATION", - "OPSTR_READ_EXTERNAL_STORAGE", - "OPSTR_WRITE_EXTERNAL_STORAGE", + "READ_EXTERNAL_STORAGE", + "WRITE_EXTERNAL_STORAGE", + "TURN_ON_SCREEN", }; /** @@ -598,6 +603,7 @@ public class AppOpsManager { null, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, + null, // no permission for turning the screen on }; /** @@ -666,7 +672,8 @@ public class AppOpsManager { null, // READ_CELL_BROADCASTS null, // MOCK_LOCATION null, // READ_EXTERNAL_STORAGE - null // WRITE_EXTERNAL_STORAGE + null, // WRITE_EXTERNAL_STORAGE + null, // TURN_ON_SCREEN }; /** @@ -734,7 +741,8 @@ public class AppOpsManager { false, // READ_CELL_BROADCASTS false, // MOCK_LOCATION false, // READ_EXTERNAL_STORAGE - false // WRITE_EXTERNAL_STORAGE + false, // WRITE_EXTERNAL_STORAGE + false, // TURN_ON_SCREEN }; /** @@ -801,7 +809,8 @@ public class AppOpsManager { AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ERRORED, // OP_MOCK_LOCATION AppOpsManager.MODE_ALLOWED, - AppOpsManager.MODE_ALLOWED + AppOpsManager.MODE_ALLOWED, + AppOpsManager.MODE_ALLOWED, // OP_TURN_ON_SCREEN }; /** @@ -872,7 +881,8 @@ public class AppOpsManager { false, false, false, - false + false, + false, }; /** diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 452e4d5..ecb7f5a 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -1195,9 +1195,11 @@ public abstract class BatteryStats implements Parcelable { public static final int EVENT_PACKAGE_ACTIVE = 0x0010; // Event for a package being on the temporary whitelist. public static final int EVENT_TEMP_WHITELIST = 0x0011; + // Event for the screen waking up. + public static final int EVENT_SCREEN_WAKE_UP = 0x0012; // Number of event types. - public static final int EVENT_COUNT = 0x0012; + public static final int EVENT_COUNT = 0x0013; // Mask to extract out only the type part of the event. public static final int EVENT_TYPE_MASK = ~(EVENT_FLAG_START|EVENT_FLAG_FINISH); @@ -1858,12 +1860,14 @@ public abstract class BatteryStats implements Parcelable { public static final String[] HISTORY_EVENT_NAMES = new String[] { "null", "proc", "fg", "top", "sync", "wake_lock_in", "job", "user", "userfg", "conn", - "active", "pkginst", "pkgunin", "alarm", "stats", "inactive", "active", "tmpwhitelist" + "active", "pkginst", "pkgunin", "alarm", "stats", "inactive", "active", "tmpwhitelist", + "screenwake", }; public static final String[] HISTORY_EVENT_CHECKIN_NAMES = new String[] { "Enl", "Epr", "Efg", "Etp", "Esy", "Ewl", "Ejb", "Eur", "Euf", "Ecn", - "Eac", "Epi", "Epu", "Eal", "Est", "Eai", "Eaa", "Etw" + "Eac", "Epi", "Epu", "Eal", "Est", "Eai", "Eaa", "Etw", + "Esw", }; /** diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 804d3d0..0f37ac7 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -37,7 +37,7 @@ interface IPowerManager boolean isWakeLockLevelSupported(int level); void userActivity(long time, int event, int flags); - void wakeUp(long time); + void wakeUp(long time, String reason, String opPackageName); void goToSleep(long time, int reason, int flags); void nap(long time); boolean isInteractive(); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 6ef1cd0..9a1a03e 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -658,7 +658,17 @@ public final class PowerManager { */ public void wakeUp(long time) { try { - mService.wakeUp(time); + mService.wakeUp(time, "wakeUp", mContext.getOpPackageName()); + } catch (RemoteException e) { + } + } + + /** + * @hide + */ + public void wakeUp(long time, String reason) { + try { + mService.wakeUp(time, reason, mContext.getOpPackageName()); } catch (RemoteException e) { } } diff --git a/core/java/android/service/dreams/Sandman.java b/core/java/android/service/dreams/Sandman.java index 5f5b079..eeb340b 100644 --- a/core/java/android/service/dreams/Sandman.java +++ b/core/java/android/service/dreams/Sandman.java @@ -92,7 +92,8 @@ public final class Sandman { // be awake by the time this happens. Otherwise the dream may not start. PowerManager powerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE); - powerManager.wakeUp(SystemClock.uptimeMillis()); + powerManager.wakeUp(SystemClock.uptimeMillis(), + "android.service.dreams:DREAM"); } else { Slog.i(TAG, "Activating dream by user request."); } diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl index 6f0cec6..3cddbf6 100644 --- a/core/java/com/android/internal/app/IBatteryStats.aidl +++ b/core/java/com/android/internal/app/IBatteryStats.aidl @@ -83,6 +83,7 @@ interface IBatteryStats { void noteScreenState(int state); void noteScreenBrightness(int brightness); void noteUserActivity(int uid, int event); + void noteWakeUp(String reason, int reasonUid); void noteInteractive(boolean interactive); void noteConnectivityChanged(int type, String extra); void noteMobileRadioPowerState(int powerState, long timestampNs); diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index ae2cbad..60f47d6 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -3122,6 +3122,13 @@ public final class BatteryStatsImpl extends BatteryStats { } } + public void noteWakeUpLocked(String reason, int reasonUid) { + final long elapsedRealtime = SystemClock.elapsedRealtime(); + final long uptime = SystemClock.uptimeMillis(); + addHistoryEventLocked(elapsedRealtime, uptime, HistoryItem.EVENT_SCREEN_WAKE_UP, + reason, reasonUid); + } + public void noteInteractiveLocked(boolean interactive) { if (mInteractive != interactive) { final long elapsedRealtime = SystemClock.elapsedRealtime(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 88aa071..1e78f66 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3907,7 +3907,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public void wakeUpIfDozing(long time, MotionEvent event) { if (mDozing && mDozeScrimController.isPulsing()) { PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); - pm.wakeUp(time); + pm.wakeUp(time, "com.android.systemui:NODOZE"); mScreenOnComingFromTouch = true; mScreenOnTouchLocation = new PointF(event.getX(), event.getY()); mNotificationPanel.setTouchDisabled(false); diff --git a/services/core/java/com/android/server/DockObserver.java b/services/core/java/com/android/server/DockObserver.java index 41ce25d..5388f10 100644 --- a/services/core/java/com/android/server/DockObserver.java +++ b/services/core/java/com/android/server/DockObserver.java @@ -134,7 +134,8 @@ final class DockObserver extends SystemService { if (mAllowTheaterModeWakeFromDock || Settings.Global.getInt(getContext().getContentResolver(), Settings.Global.THEATER_MODE_ON, 0) == 0) { - mPowerManager.wakeUp(SystemClock.uptimeMillis()); + mPowerManager.wakeUp(SystemClock.uptimeMillis(), + "android.server:DOCK"); } updateLocked(); } diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java index 13b75ab..4b0b924 100644 --- a/services/core/java/com/android/server/am/BatteryStatsService.java +++ b/services/core/java/com/android/server/am/BatteryStatsService.java @@ -493,6 +493,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub } } + public void noteWakeUp(String reason, int reasonUid) { + enforceCallingPermission(); + synchronized (mStats) { + mStats.noteWakeUpLocked(reason, reasonUid); + } + } + public void noteInteractive(boolean interactive) { enforceCallingPermission(); synchronized (mStats) { diff --git a/services/core/java/com/android/server/dreams/DreamManagerService.java b/services/core/java/com/android/server/dreams/DreamManagerService.java index 458928f..8813a61 100644 --- a/services/core/java/com/android/server/dreams/DreamManagerService.java +++ b/services/core/java/com/android/server/dreams/DreamManagerService.java @@ -648,7 +648,8 @@ public final class DreamManagerService extends SystemService { if (mCurrentDreamName != null && mCurrentDreamCanDoze && !mCurrentDreamName.equals(getDozeComponent())) { // May have updated the doze component, wake up - mPowerManager.wakeUp(SystemClock.uptimeMillis()); + mPowerManager.wakeUp(SystemClock.uptimeMillis(), + "android.server.dreams:SYSPROP"); } } } diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java index 4d8d105..a71dfcd 100644 --- a/services/core/java/com/android/server/fingerprint/FingerprintService.java +++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java @@ -565,7 +565,8 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe // For fingerprint devices that support touch-to-wake, this will ensure the device // wakes up and turns the screen on when fingerprint is authenticated. if (mIsKeyguard && authenticated) { - mPowerManager.wakeUp(SystemClock.uptimeMillis()); + mPowerManager.wakeUp(SystemClock.uptimeMillis(), + "android.server.fingerprint:AUTH"); } return result; } diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java index c37f619..cfc5f7d 100644 --- a/services/core/java/com/android/server/hdmi/HdmiControlService.java +++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java @@ -1969,7 +1969,7 @@ public final class HdmiControlService extends SystemService { void wakeUp() { assertRunOnServiceThread(); mWakeUpMessageReceived = true; - mPowerManager.wakeUp(SystemClock.uptimeMillis()); + mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.server.hdmi:WAKE"); // PowerManger will send the broadcast Intent.ACTION_SCREEN_ON and after this gets // the intent, the sequence will continue at onWakeUp(). } diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 9e41f70..978ed51 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -753,7 +753,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { synchronized (mLock) { if (shouldEnableWakeGestureLp()) { performHapticFeedbackLw(null, HapticFeedbackConstants.VIRTUAL_KEY, false); - wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromWakeGesture); + wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromWakeGesture, + "android.policy:GESTURE"); } } } @@ -4691,7 +4692,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { updateRotation(true); if (lidOpen) { - wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromLidSwitch); + wakeUp(SystemClock.uptimeMillis(), mAllowTheaterModeWakeFromLidSwitch, + "android.policy:LID"); } else if (!mLidControlsSleep) { mPowerManager.userActivity(SystemClock.uptimeMillis(), false); } @@ -4713,7 +4715,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { } else { intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA); } - wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromCameraLens); + wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromCameraLens, + "android.policy:CAMERA_COVER"); startActivityAsUser(intent, UserHandle.CURRENT_OR_SELF); } mCameraLensCoverState = lensCoverState; @@ -4892,7 +4895,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (isValidGlobalKey(keyCode) && mGlobalKeyManager.shouldHandleGlobalKey(keyCode, event)) { if (isWakeKey) { - wakeUp(event.getEventTime(), mAllowTheaterModeWakeFromKey); + wakeUp(event.getEventTime(), mAllowTheaterModeWakeFromKey, "android.policy:KEY"); } return result; } @@ -5123,7 +5126,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if (isWakeKey) { - wakeUp(event.getEventTime(), mAllowTheaterModeWakeFromKey); + wakeUp(event.getEventTime(), mAllowTheaterModeWakeFromKey, "android.policy:KEY"); } return result; @@ -5184,7 +5187,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public int interceptMotionBeforeQueueingNonInteractive(long whenNanos, int policyFlags) { if ((policyFlags & FLAG_WAKE) != 0) { - if (wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion)) { + if (wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotion, + "android.policy:MOTION")) { return 0; } } @@ -5197,7 +5201,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // there will be no dream to intercept the touch and wake into ambient. The device should // wake up in this case. if (isTheaterModeEnabled() && (policyFlags & FLAG_WAKE) != 0) { - wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotionWhenNotDreaming); + wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotionWhenNotDreaming, + "android.policy:MOTION"); } return 0; @@ -5493,10 +5498,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { } private void wakeUpFromPowerKey(long eventTime) { - wakeUp(eventTime, mAllowTheaterModeWakeFromPowerKey); + wakeUp(eventTime, mAllowTheaterModeWakeFromPowerKey, "android.policy:POWER"); } - private boolean wakeUp(long wakeTime, boolean wakeInTheaterMode) { + private boolean wakeUp(long wakeTime, boolean wakeInTheaterMode, String reason) { final boolean theaterModeEnabled = isTheaterModeEnabled(); if (!wakeInTheaterMode && theaterModeEnabled) { return false; @@ -5507,7 +5512,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Global.THEATER_MODE_ON, 0); } - mPowerManager.wakeUp(wakeTime); + mPowerManager.wakeUp(wakeTime, reason); return true; } diff --git a/services/core/java/com/android/server/power/Notifier.java b/services/core/java/com/android/server/power/Notifier.java index d21c6d2..c5ad7fe 100644 --- a/services/core/java/com/android/server/power/Notifier.java +++ b/services/core/java/com/android/server/power/Notifier.java @@ -472,6 +472,26 @@ final class Notifier { } /** + * Called when the screen has turned on. + */ + public void onWakeUp(String reason, int reasonUid, String opPackageName, int opUid) { + if (DEBUG) { + Slog.d(TAG, "onWakeUp: event=" + reason + ", reasonUid=" + reasonUid + + " opPackageName=" + opPackageName + " opUid=" + opUid); + } + + try { + mBatteryStats.noteWakeUp(reason, reasonUid); + if (opPackageName != null) { + mAppOps.noteOperation(AppOpsManager.OP_TURN_SCREEN_ON, opUid, opPackageName); + } + } catch (RemoteException ex) { + // Ignore + } + + } + + /** * Called when wireless charging has started so as to provide user feedback. */ public void onWirelessChargingStarted() { diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 3f59755..88476ce 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -830,7 +830,18 @@ public final class PowerManagerService extends SystemService private void applyWakeLockFlagsOnAcquireLocked(WakeLock wakeLock, int uid) { if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0 && isScreenLock(wakeLock)) { - wakeUpNoUpdateLocked(SystemClock.uptimeMillis(), uid); + String opPackageName; + int opUid; + if (wakeLock.mWorkSource != null && wakeLock.mWorkSource.getName(0) != null) { + opPackageName = wakeLock.mWorkSource.getName(0); + opUid = wakeLock.mWorkSource.get(0); + } else { + opPackageName = wakeLock.mPackageName; + opUid = wakeLock.mWorkSource != null ? wakeLock.mWorkSource.get(0) + : wakeLock.mOwnerUid; + } + wakeUpNoUpdateLocked(SystemClock.uptimeMillis(), wakeLock.mTag, opUid, + opPackageName, opUid); } } @@ -1042,17 +1053,19 @@ public final class PowerManagerService extends SystemService return false; } - private void wakeUpInternal(long eventTime, int uid) { + private void wakeUpInternal(long eventTime, String reason, int uid, String opPackageName, + int opUid) { synchronized (mLock) { - if (wakeUpNoUpdateLocked(eventTime, uid)) { + if (wakeUpNoUpdateLocked(eventTime, reason, uid, opPackageName, opUid)) { updatePowerStateLocked(); } } } - private boolean wakeUpNoUpdateLocked(long eventTime, int uid) { + private boolean wakeUpNoUpdateLocked(long eventTime, String reason, int reasonUid, + String opPackageName, int opUid) { if (DEBUG_SPEW) { - Slog.d(TAG, "wakeUpNoUpdateLocked: eventTime=" + eventTime + ", uid=" + uid); + Slog.d(TAG, "wakeUpNoUpdateLocked: eventTime=" + eventTime + ", uid=" + reasonUid); } if (eventTime < mLastSleepTime || mWakefulness == WAKEFULNESS_AWAKE @@ -1064,21 +1077,22 @@ public final class PowerManagerService extends SystemService try { switch (mWakefulness) { case WAKEFULNESS_ASLEEP: - Slog.i(TAG, "Waking up from sleep (uid " + uid +")..."); + Slog.i(TAG, "Waking up from sleep (uid " + reasonUid +")..."); break; case WAKEFULNESS_DREAMING: - Slog.i(TAG, "Waking up from dream (uid " + uid +")..."); + Slog.i(TAG, "Waking up from dream (uid " + reasonUid +")..."); break; case WAKEFULNESS_DOZING: - Slog.i(TAG, "Waking up from dozing (uid " + uid +")..."); + Slog.i(TAG, "Waking up from dozing (uid " + reasonUid +")..."); break; } mLastWakeTime = eventTime; setWakefulnessLocked(WAKEFULNESS_AWAKE, 0); + mNotifier.onWakeUp(reason, reasonUid, opPackageName, opUid); userActivityNoUpdateLocked( - eventTime, PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, uid); + eventTime, PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, reasonUid); } finally { Trace.traceEnd(Trace.TRACE_TAG_POWER); } @@ -1334,7 +1348,8 @@ public final class PowerManagerService extends SystemService final long now = SystemClock.uptimeMillis(); if (shouldWakeUpWhenPluggedOrUnpluggedLocked(wasPowered, oldPlugType, dockedOnWirelessCharger)) { - wakeUpNoUpdateLocked(now, Process.SYSTEM_UID); + wakeUpNoUpdateLocked(now, "android.server.power:POWER", Process.SYSTEM_UID, + mContext.getOpPackageName(), Process.SYSTEM_UID); } userActivityNoUpdateLocked( now, PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, Process.SYSTEM_UID); @@ -1788,7 +1803,8 @@ public final class PowerManagerService extends SystemService PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, 0, Process.SYSTEM_UID); updatePowerStateLocked(); } else { - wakeUpNoUpdateLocked(SystemClock.uptimeMillis(), Process.SYSTEM_UID); + wakeUpNoUpdateLocked(SystemClock.uptimeMillis(), "android.server.power:DREAM", + Process.SYSTEM_UID, mContext.getOpPackageName(), Process.SYSTEM_UID); updatePowerStateLocked(); } } else if (wakefulness == WAKEFULNESS_DOZING) { @@ -3136,7 +3152,7 @@ public final class PowerManagerService extends SystemService } @Override // Binder call - public void wakeUp(long eventTime) { + public void wakeUp(long eventTime, String reason, String opPackageName) { if (eventTime > SystemClock.uptimeMillis()) { throw new IllegalArgumentException("event time must not be in the future"); } @@ -3147,7 +3163,7 @@ public final class PowerManagerService extends SystemService final int uid = Binder.getCallingUid(); final long ident = Binder.clearCallingIdentity(); try { - wakeUpInternal(eventTime, uid); + wakeUpInternal(eventTime, reason, uid, opPackageName, uid); } finally { Binder.restoreCallingIdentity(ident); } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index ec566bc..05c111c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -10307,7 +10307,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_VISIBILITY || DEBUG_POWER) { Slog.v(TAG, "Turning screen on after layout!"); } - mPowerManager.wakeUp(SystemClock.uptimeMillis()); + mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.server.wm:TURN_ON"); } mTurnOnScreen = false; } |