From: Sean hoyt Date: Tue, 17 Jan 2017 07:13:21 +0000 (+0000) Subject: samsung: doze: specify a qualified user to send the pulse broadcast X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1c7c30e5d986faeafb9c3f089f60d539850484d;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung.git 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 --- diff --git a/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java b/doze/src/com/cyanogenmod/settings/device/SamsungDozeService.java index 149f84b..b748a71 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() {