diff options
author | Paul Lawrence <paullawrence@google.com> | 2014-03-18 10:59:18 -0700 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2014-04-01 13:47:01 -0700 |
commit | 9ac2d81d9fd155240e02284894148c6dcbe486ec (patch) | |
tree | bb47279a870087ac89ed8e9b773647a2162a5883 /src/com/android/settings/CryptKeeper.java | |
parent | 61ac531286b215bea5fdaab823bc83be086e7193 (diff) | |
download | packages_apps_Settings-9ac2d81d9fd155240e02284894148c6dcbe486ec.zip packages_apps_Settings-9ac2d81d9fd155240e02284894148c6dcbe486ec.tar.gz packages_apps_Settings-9ac2d81d9fd155240e02284894148c6dcbe486ec.tar.bz2 |
Show OwnerInfo on CryptKeeper screen
Depends on framework change from
https://googleplex-android-review.git.corp.google.com/#/c/435138/
Bug 13526708
Change-Id: I16189b629b5515ec5175e05155ba4ec0c27d22fb
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r-- | src/com/android/settings/CryptKeeper.java | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 8050c47..1efe98f 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -367,23 +367,39 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList setContentView(R.layout.crypt_keeper_progress); encryptionProgressInit(); } else if (mValidationComplete || isDebugView(FORCE_VIEW_PASSWORD)) { - final IMountService service = getMountService(); - int type = StorageManager.CRYPT_TYPE_PASSWORD; - try { - type = service.getPasswordType(); - } catch (Exception e) { - Log.e(TAG, "Error while getting type - showing default dialog" + e); - } + new AsyncTask<Void, Void, Void>() { + int type = StorageManager.CRYPT_TYPE_PASSWORD; + String owner_info; - if(type == StorageManager.CRYPT_TYPE_PIN) { - setContentView(R.layout.crypt_keeper_pin_entry); - } else if (type == StorageManager.CRYPT_TYPE_PATTERN) { - setContentView(R.layout.crypt_keeper_pattern_entry); - setBackFunctionality(false); - } else { - setContentView(R.layout.crypt_keeper_password_entry); - } - passwordEntryInit(); + @Override + public Void doInBackground(Void... v) { + try { + final IMountService service = getMountService(); + type = service.getPasswordType(); + owner_info = service.getField("OwnerInfo"); + } catch (Exception e) { + Log.e(TAG, "Error calling mount service " + e); + } + + return null; + } + + @Override + public void onPostExecute(java.lang.Void v) { + if(type == StorageManager.CRYPT_TYPE_PIN) { + setContentView(R.layout.crypt_keeper_pin_entry); + } else if (type == StorageManager.CRYPT_TYPE_PATTERN) { + setContentView(R.layout.crypt_keeper_pattern_entry); + setBackFunctionality(false); + } else { + setContentView(R.layout.crypt_keeper_password_entry); + } + + final TextView status = (TextView) findViewById(R.id.owner_info); + status.setText(owner_info); + passwordEntryInit(); + } + }.execute(); } else if (!mValidationRequested) { // We're supposed to be encrypted, but no validation has been done. new ValidationTask().execute((Void[]) null); |