Skip to content

Commit 36dec4e

Browse files
Amith YamasaniAndroid (Google) Code Review
authored andcommitted
Merge "Fixes a bug in migration of lock settings to LockSettingsService."
2 parents 1ade5ae + 7ab8c4a commit 36dec4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/java/android/provider/Settings.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import android.os.BatteryManager;
3838
import android.os.Bundle;
3939
import android.os.IBinder;
40+
import android.os.Process;
4041
import android.os.RemoteException;
4142
import android.os.ServiceManager;
4243
import android.os.SystemProperties;
@@ -2260,6 +2261,7 @@ public static final class Secure extends NameValueTable {
22602261

22612262
private static ILockSettings sLockSettings = null;
22622263

2264+
private static boolean sIsSystemProcess;
22632265
private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
22642266
static {
22652267
MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
@@ -2283,8 +2285,10 @@ public synchronized static String getString(ContentResolver resolver, String nam
22832285
if (sLockSettings == null) {
22842286
sLockSettings = ILockSettings.Stub.asInterface(
22852287
(IBinder) ServiceManager.getService("lock_settings"));
2288+
sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
22862289
}
2287-
if (sLockSettings != null && MOVED_TO_LOCK_SETTINGS.contains(name)) {
2290+
if (sLockSettings != null && !sIsSystemProcess
2291+
&& MOVED_TO_LOCK_SETTINGS.contains(name)) {
22882292
try {
22892293
return sLockSettings.getString(name, "0", UserId.getCallingUserId());
22902294
} catch (RemoteException re) {

0 commit comments

Comments
 (0)