aboutsummaryrefslogtreecommitdiff
path: root/doze
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-03-29 17:40:24 +0200
committerMister Oyster <oysterized@gmail.com>2017-04-07 15:41:18 +0200
commita9de76965d6e17ffd9627cd829098e5e3baf9b26 (patch)
tree65f62847bf2193e013e6f824659f228a54cd0f3a /doze
parent73188c4afe13a32bd4c34b6829aeed1b2654f06d (diff)
Doze: Perform operations as current user
* System processes should use the 'AsUser' variant of some methods Change-Id: Ic2457950b1f0e9f29f4fb06ef38f00dd919ad8f7
Diffstat (limited to 'doze')
-rw-r--r--doze/src/com/cyanogenmod/settings/doze/Utils.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/doze/src/com/cyanogenmod/settings/doze/Utils.java b/doze/src/com/cyanogenmod/settings/doze/Utils.java
index ef22157..5f57ff0 100644
--- a/doze/src/com/cyanogenmod/settings/doze/Utils.java
+++ b/doze/src/com/cyanogenmod/settings/doze/Utils.java
@@ -42,12 +42,14 @@ public final class Utils {
protected static void startService(Context context) {
if (DEBUG) Log.d(TAG, "Starting service");
- context.startService(new Intent(context, DozeService.class));
+ context.startServiceAsUser(new Intent(context, DozeService.class),
+ UserHandle.CURRENT);
}
protected static void stopService(Context context) {
if (DEBUG) Log.d(TAG, "Stopping service");
- context.stopService(new Intent(context, DozeService.class));
+ context.stopServiceAsUser(new Intent(context, DozeService.class),
+ UserHandle.CURRENT);
}
protected static boolean isDozeEnabled(Context context) {