diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-02-11 15:56:03 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-02-11 16:58:20 +0800 |
commit | 832878cac1a136b1952de51cc2417d4e18188403 (patch) | |
tree | 120a14ed403d3a6e891b9a59ca9c9f81fb20ab35 | |
parent | 81dc74774d2f48a14fd2099882e2e91e4979c9d6 (diff) | |
download | android_packages_apps_CertInstaller-832878cac1a136b1952de51cc2417d4e18188403.tar.gz android_packages_apps_CertInstaller-832878cac1a136b1952de51cc2417d4e18188403.tar.bz2 android_packages_apps_CertInstaller-832878cac1a136b1952de51cc2417d4e18188403.zip |
Fix two certinstaller bugs.
+ Certinstaller does not handle key pair correctly when keystore is locked.
http://b/issue?id=2351926
+ Certinstaller crashes when installing from SD card where the "download"
folder does not exist.
+ Remove redundant res IDs.
-rw-r--r-- | res/layout/name_credential_dialog.xml | 6 | ||||
-rw-r--r-- | src/com/android/certinstaller/CertFile.java | 11 | ||||
-rw-r--r-- | src/com/android/certinstaller/CertInstaller.java | 9 |
3 files changed, 16 insertions, 10 deletions
diff --git a/res/layout/name_credential_dialog.xml b/res/layout/name_credential_dialog.xml index 15a3527..21588ff 100644 --- a/res/layout/name_credential_dialog.xml +++ b/res/layout/name_credential_dialog.xml @@ -31,8 +31,7 @@ android:textStyle="bold" android:visibility="gone" /> - <TextView android:id="@+id/credential_name_title" - android:layout_width="match_parent" + <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/credential_name" /> <EditText android:id="@+id/credential_name" @@ -40,8 +39,7 @@ android:layout_height="wrap_content" android:singleLine="True"/> - <TextView android:id="@+id/credential_info_title" - android:layout_width="match_parent" + <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/credential_info" /> <TextView android:id="@+id/credential_info" diff --git a/src/com/android/certinstaller/CertFile.java b/src/com/android/certinstaller/CertFile.java index baeca8e..8e63794 100644 --- a/src/com/android/certinstaller/CertFile.java +++ b/src/com/android/certinstaller/CertFile.java @@ -102,9 +102,16 @@ public class CertFile extends PreferenceActivity implements FileFilter { protected List<File> getAllCertFiles() { List<File> allFiles = new ArrayList<File>(); File root = Environment.getExternalStorageDirectory(); + File download = new File(root, DOWNLOAD_DIR); - Collections.addAll(allFiles, download.listFiles(this)); - Collections.addAll(allFiles, root.listFiles(this)); + if (download != null) { + File[] files = download.listFiles(this); + if (files != null) Collections.addAll(allFiles, files); + } + + File[] files = root.listFiles(this); + if (files != null) Collections.addAll(allFiles, files); + return allFiles; } diff --git a/src/com/android/certinstaller/CertInstaller.java b/src/com/android/certinstaller/CertInstaller.java index f06d9bc..fb64124 100644 --- a/src/com/android/certinstaller/CertInstaller.java +++ b/src/com/android/certinstaller/CertInstaller.java @@ -101,8 +101,11 @@ public class CertInstaller extends Activity protected void onResume() { super.onResume(); - mState = STATE_RUNNING; - if (mNextAction != null) mNextAction.run(this); + if (mState == STATE_INIT) { + mState = STATE_RUNNING; + } else { + if (mNextAction != null) mNextAction.run(this); + } } private boolean needsKeyStoreAccess() { @@ -316,8 +319,6 @@ public class CertInstaller extends Activity View view = View.inflate(this, R.layout.name_credential_dialog, null); mView.setView(view); - mView.setText(R.id.credential_name_title, R.string.credential_name); - mView.setText(R.id.credential_info_title, R.string.credential_info); mView.setText(R.id.credential_info, mCredentials.getDescription(this).toString()); |