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

Commit 57e69442 authored by Your Name's avatar Your Name Committed by Jacob Hobbie
Browse files

Adding a timeout for active-unlock

Adding a timer for active-unlock. This timer should interact smoothly
with the timer for extend unlock. That means that if there is a timer
for extend unlock that expires while the active unlock timer is running,
it should set the phone back into a trustable state. If there is an
extend unlock timer when the active-unlock timer expires it should
prevent active-unlocking but allow extend unlock to continue.

Test: manual
Fixes: 215391978

Change-Id: Ia0ccf7ecc9dacf9f4a7a913c7fce8532e6a1ece1
Merged-In: Ia0ccf7ecc9dacf9f4a7a913c7fce8532e6a1ece1
(cherry picked from commit 2410cfc0)
parent 9492d508
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.trust;

import static android.service.trust.TrustAgentService.FLAG_GRANT_TRUST_DISPLAY_MESSAGE;
import static android.service.trust.TrustAgentService.FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE;

import android.annotation.TargetApi;
import android.app.AlarmManager;
@@ -158,7 +159,7 @@ public class TrustAgentWrapper {
                    mMessage = (CharSequence) msg.obj;
                    int flags = msg.arg1;
                    mDisplayTrustGrantedMessage = (flags & FLAG_GRANT_TRUST_DISPLAY_MESSAGE) != 0;
                    if ((flags & TrustAgentService.FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) != 0) {
                    if ((flags & FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) != 0) {
                        mWaitingForTrustableDowngrade = true;
                    } else {
                        mWaitingForTrustableDowngrade = false;
@@ -638,6 +639,11 @@ public class TrustAgentWrapper {
        return mTrustable && mManagingTrust && !mTrustDisabledByDpm;
    }

    /** Set the trustagent as not trustable */
    public void setUntrustable() {
        mTrustable = false;
    }

    public boolean isManagingTrust() {
        return mManagingTrust && !mTrustDisabledByDpm;
    }
+230 −40

File changed.

Preview size limit exceeded, changes collapsed.