Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a47967b8 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge \\"Allow LockPatternUtils usage on non-looper threads\\" into nyc-mr1-dev am: feaa2bfb

am: 1642d8df

Change-Id: I0bfc272cef3cee1e76f1b3bc5f8f0908bd24f2e5
parents 7c43bcb6 1642d8df
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public class LockPatternUtils {
    private DevicePolicyManager mDevicePolicyManager;
    private ILockSettings mLockSettingsService;
    private UserManager mUserManager;
    private final Handler mHandler = new Handler();
    private final Handler mHandler;

    /**
     * Use {@link TrustManager#isTrustUsuallyManaged(int)}.
@@ -231,6 +231,9 @@ public class LockPatternUtils {
    public LockPatternUtils(Context context) {
        mContext = context;
        mContentResolver = context.getContentResolver();

        Looper looper = Looper.myLooper();
        mHandler = looper != null ? new Handler(looper) : null;
    }

    private ILockSettings getLockSettings() {
@@ -1512,6 +1515,10 @@ public class LockPatternUtils {
        if (callback == null) {
            return null;
        } else {
            if (mHandler == null) {
                throw new IllegalStateException("Must construct LockPatternUtils on a looper thread"
                        + " to use progress callbacks.");
            }
            return new ICheckCredentialProgressCallback.Stub() {

                @Override