diff options
author | Ruchi Kandoi <kandoiruchi@google.com> | 2014-04-01 17:39:20 -0700 |
---|---|---|
committer | Ruchi Kandoi <kandoiruchi@google.com> | 2014-04-04 20:24:16 +0000 |
commit | f20a5eb279035d462e1f5d9895f4eb66cc152215 (patch) | |
tree | 9201efaeab6f8407f83c6921ca80b38f59c666ff /services/core/java/com | |
parent | 0a0454fdcc7aeac6e57f9466da8f39bcf5f3f6ec (diff) | |
download | frameworks_base-f20a5eb279035d462e1f5d9895f4eb66cc152215.zip frameworks_base-f20a5eb279035d462e1f5d9895f4eb66cc152215.tar.gz frameworks_base-f20a5eb279035d462e1f5d9895f4eb66cc152215.tar.bz2 |
PowerManager: add powerHint method
Add powerHint method to IPowerManager for passing power hints from other
processes.
Change-Id: Ic596ace2ed1796a6da4cddb2163dcc4536115e55
Diffstat (limited to 'services/core/java/com')
-rw-r--r-- | services/core/java/com/android/server/power/PowerManagerService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 80c3c8e..b85a506 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -406,6 +406,7 @@ public final class PowerManagerService extends com.android.server.SystemService private static native void nativeReleaseSuspendBlocker(String name); private static native void nativeSetInteractive(boolean enable); private static native void nativeSetAutoSuspend(boolean enable); + private static native void nativeSendPowerHint(int hintId, int data); public PowerManagerService(Context context) { super(context); @@ -2548,6 +2549,12 @@ public final class PowerManagerService extends com.android.server.SystemService } @Override // Binder call + public void powerHint(int hintId, int data) { + mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); + nativeSendPowerHint(hintId, data); + } + + @Override // Binder call public void acquireWakeLock(IBinder lock, int flags, String tag, String packageName, WorkSource ws, String historyTag) { if (lock == null) { |