[automerger] DO NOT MERGE Fix mTrustManager NPE am: a381c4ced3 am: 30a705874a am: 85727109f0
Change-Id: I80463ee5315c2672e812659192b227c8271e9113
This commit is contained in:
@@ -249,7 +249,7 @@ public class KeyguardManager {
|
|||||||
*/
|
*/
|
||||||
public boolean isDeviceLocked(int userId) {
|
public boolean isDeviceLocked(int userId) {
|
||||||
try {
|
try {
|
||||||
return mTrustManager.isDeviceLocked(userId);
|
return getTrustManager().isDeviceLocked(userId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -274,12 +274,20 @@ public class KeyguardManager {
|
|||||||
*/
|
*/
|
||||||
public boolean isDeviceSecure(int userId) {
|
public boolean isDeviceSecure(int userId) {
|
||||||
try {
|
try {
|
||||||
return mTrustManager.isDeviceSecure(userId);
|
return getTrustManager().isDeviceSecure(userId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private synchronized ITrustManager getTrustManager() {
|
||||||
|
if (mTrustManager == null) {
|
||||||
|
mTrustManager = ITrustManager.Stub.asInterface(
|
||||||
|
ServiceManager.getService(Context.TRUST_SERVICE));
|
||||||
|
}
|
||||||
|
return mTrustManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD}
|
* @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD}
|
||||||
* and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED}
|
* and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED}
|
||||||
|
|||||||
Reference in New Issue
Block a user