From f1c7c30e5d986faeafb9c3f089f60d539850484d Mon Sep 17 00:00:00 2001 From: Sean hoyt Date: Tue, 17 Jan 2017 07:13:21 +0000 Subject: [PATCH] samsung: doze: specify a qualified user to send the pulse broadcast Should fix this: W/ContextImpl(3700): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:877 android.content.ContextWrapper.sendBroadcast:421 com.cyanogenmod.settings.device.SamsungDozeService.launchDozePulse:151 com.cyanogenmod.settings.device.SamsungDozeService.-wrap1:-1 com.cyanogenmod.settings.device.SamsungDozeService$SamsungProximitySensor.onSensorChanged:81 Change-Id: I680a57c9010d06719c3bd014001b00353f8e12fd --- .../com/cyanogenmod/settings/device/SamsungDozeService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java b/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java index 149f84b1..b748a715 100644 --- a/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java +++ b/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java @@ -28,6 +28,7 @@ import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.IBinder; import android.os.PowerManager; +import android.os.UserHandle; import android.preference.PreferenceManager; import android.provider.Settings; import android.util.Log; @@ -144,7 +145,8 @@ public class SamsungDozeService extends Service { } private void launchDozePulse() { - mContext.sendBroadcast(new Intent(DOZE_INTENT)); + mContext.sendBroadcastAsUser(new Intent(DOZE_INTENT), + new UserHandle(UserHandle.USER_CURRENT)); } private boolean isInteractive() {