summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Paul Lawrence <paullawrence@google.com> 2014-09-25 18:33:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-09-25 18:33:54 +0000
commit99cee61cbc8ed1ec5514639f9fdac656b5e4934b (patch)
treeec8e391fb26f6f5ca581bde48983a6034f808491
parentf099e7c2144aba7d429b29a006729e61353d06fe (diff)
parent3a5a0be61ec7ea08884c80817c226f7cfe531a67 (diff)
Merge "Fix pause when setting pin/pattern/password" into lmp-dev
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 71607244bb6b..1a2d6ce6cea7 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -28,6 +28,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
+import android.os.AsyncTask;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -718,25 +719,31 @@ public class LockPatternUtils {
}
/** Update the encryption password if it is enabled **/
- private void updateEncryptionPassword(int type, String password) {
+ private void updateEncryptionPassword(final int type, final String password) {
DevicePolicyManager dpm = getDevicePolicyManager();
if (dpm.getStorageEncryptionStatus(getCurrentOrCallingUserId())
!= DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE) {
return;
}
- IBinder service = ServiceManager.getService("mount");
+ final IBinder service = ServiceManager.getService("mount");
if (service == null) {
Log.e(TAG, "Could not find the mount service to update the encryption password");
return;
}
- IMountService mountService = IMountService.Stub.asInterface(service);
- try {
- mountService.changeEncryptionPassword(type, password);
- } catch (RemoteException e) {
- Log.e(TAG, "Error changing encryption password", e);
- }
+ new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... dummy) {
+ IMountService mountService = IMountService.Stub.asInterface(service);
+ try {
+ mountService.changeEncryptionPassword(type, password);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error changing encryption password", e);
+ }
+ return null;
+ }
+ }.execute();
}
/**