Merge "Fixing an Active Unlock security vulnerability." into tm-qpr-dev
This commit is contained in:
@@ -107,6 +107,7 @@ public class TrustAgentWrapper {
|
|||||||
// Trust state
|
// Trust state
|
||||||
private boolean mTrusted;
|
private boolean mTrusted;
|
||||||
private boolean mWaitingForTrustableDowngrade = false;
|
private boolean mWaitingForTrustableDowngrade = false;
|
||||||
|
private boolean mWithinSecurityLockdownWindow = false;
|
||||||
private boolean mTrustable;
|
private boolean mTrustable;
|
||||||
private CharSequence mMessage;
|
private CharSequence mMessage;
|
||||||
private boolean mDisplayTrustGrantedMessage;
|
private boolean mDisplayTrustGrantedMessage;
|
||||||
@@ -160,6 +161,7 @@ public class TrustAgentWrapper {
|
|||||||
mDisplayTrustGrantedMessage = (flags & FLAG_GRANT_TRUST_DISPLAY_MESSAGE) != 0;
|
mDisplayTrustGrantedMessage = (flags & FLAG_GRANT_TRUST_DISPLAY_MESSAGE) != 0;
|
||||||
if ((flags & FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) != 0) {
|
if ((flags & FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) != 0) {
|
||||||
mWaitingForTrustableDowngrade = true;
|
mWaitingForTrustableDowngrade = true;
|
||||||
|
setSecurityWindowTimer();
|
||||||
} else {
|
} else {
|
||||||
mWaitingForTrustableDowngrade = false;
|
mWaitingForTrustableDowngrade = false;
|
||||||
}
|
}
|
||||||
@@ -452,6 +454,9 @@ public class TrustAgentWrapper {
|
|||||||
if (mBound) {
|
if (mBound) {
|
||||||
scheduleRestart();
|
scheduleRestart();
|
||||||
}
|
}
|
||||||
|
if (mWithinSecurityLockdownWindow) {
|
||||||
|
mTrustManagerService.lockUser(mUserId);
|
||||||
|
}
|
||||||
// mTrustDisabledByDpm maintains state
|
// mTrustDisabledByDpm maintains state
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -673,6 +678,22 @@ public class TrustAgentWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setSecurityWindowTimer() {
|
||||||
|
mWithinSecurityLockdownWindow = true;
|
||||||
|
long expiration = SystemClock.elapsedRealtime() + (15 * 1000); // timer for 15 seconds
|
||||||
|
mAlarmManager.setExact(
|
||||||
|
AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||||
|
expiration,
|
||||||
|
TAG,
|
||||||
|
new AlarmManager.OnAlarmListener() {
|
||||||
|
@Override
|
||||||
|
public void onAlarm() {
|
||||||
|
mWithinSecurityLockdownWindow = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Handler.getMain());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isManagingTrust() {
|
public boolean isManagingTrust() {
|
||||||
return mManagingTrust && !mTrustDisabledByDpm;
|
return mManagingTrust && !mTrustDisabledByDpm;
|
||||||
}
|
}
|
||||||
@@ -691,7 +712,6 @@ public class TrustAgentWrapper {
|
|||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
mHandler.removeMessages(MSG_RESTART_TIMEOUT);
|
mHandler.removeMessages(MSG_RESTART_TIMEOUT);
|
||||||
|
|
||||||
if (!mBound) {
|
if (!mBound) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user