Skip to content

Commit a87826c

Browse files
Amith YamasaniAndroid (Google) Code Review
authored andcommitted
Merge "Fix face unlock for multiple users" into jb-mr1-dev
2 parents 4cb846b + 4b4b954 commit a87826c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.android.internal.telephony.ITelephony;
2121
import com.google.android.collect.Lists;
2222

23+
import android.app.ActivityManagerNative;
2324
import android.app.admin.DevicePolicyManager;
2425
import android.content.BroadcastReceiver;
2526
import android.content.ContentResolver;
@@ -225,7 +226,11 @@ public void setCurrentUser(int userId) {
225226

226227
public int getCurrentUser() {
227228
if (Process.myUid() == Process.SYSTEM_UID) {
228-
return mCurrentUserId;
229+
try {
230+
return ActivityManagerNative.getDefault().getCurrentUser().id;
231+
} catch (RemoteException re) {
232+
return mCurrentUserId;
233+
}
229234
} else {
230235
throw new SecurityException("Only the system process can get the current user");
231236
}

policy/src/com/android/internal/policy/impl/keyguard/FaceUnlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public boolean start() {
153153
// This must show before bind to guarantee that Face Unlock has a place to display
154154
show(SERVICE_STARTUP_VIEW_TIMEOUT);
155155
if (!mBoundToService) {
156-
Log.d(TAG, "Binding to Face Unlock service");
156+
Log.d(TAG, "Binding to Face Unlock service for user="
157+
+ mLockPatternUtils.getCurrentUser());
157158
mContext.bindService(new Intent(IFaceLockInterface.class.getName()),
158159
mConnection,
159160
Context.BIND_AUTO_CREATE,

0 commit comments

Comments
 (0)