am a87826c3: Merge "Fix face unlock for multiple users" into jb-mr1-dev
* commit 'a87826c345dbd692a86a340691cf7471a2505809': Fix face unlock for multiple users
This commit is contained in:
@@ -20,6 +20,7 @@ import com.android.internal.R;
|
|||||||
import com.android.internal.telephony.ITelephony;
|
import com.android.internal.telephony.ITelephony;
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
|
|
||||||
|
import android.app.ActivityManagerNative;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
@@ -225,7 +226,11 @@ public class LockPatternUtils {
|
|||||||
|
|
||||||
public int getCurrentUser() {
|
public int getCurrentUser() {
|
||||||
if (Process.myUid() == Process.SYSTEM_UID) {
|
if (Process.myUid() == Process.SYSTEM_UID) {
|
||||||
return mCurrentUserId;
|
try {
|
||||||
|
return ActivityManagerNative.getDefault().getCurrentUser().id;
|
||||||
|
} catch (RemoteException re) {
|
||||||
|
return mCurrentUserId;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new SecurityException("Only the system process can get the current user");
|
throw new SecurityException("Only the system process can get the current user");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,8 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback {
|
|||||||
// This must show before bind to guarantee that Face Unlock has a place to display
|
// This must show before bind to guarantee that Face Unlock has a place to display
|
||||||
show(SERVICE_STARTUP_VIEW_TIMEOUT);
|
show(SERVICE_STARTUP_VIEW_TIMEOUT);
|
||||||
if (!mBoundToService) {
|
if (!mBoundToService) {
|
||||||
Log.d(TAG, "Binding to Face Unlock service");
|
Log.d(TAG, "Binding to Face Unlock service for user="
|
||||||
|
+ mLockPatternUtils.getCurrentUser());
|
||||||
mContext.bindService(new Intent(IFaceLockInterface.class.getName()),
|
mContext.bindService(new Intent(IFaceLockInterface.class.getName()),
|
||||||
mConnection,
|
mConnection,
|
||||||
Context.BIND_AUTO_CREATE,
|
Context.BIND_AUTO_CREATE,
|
||||||
|
|||||||
Reference in New Issue
Block a user