From 070b31216aa2a2031f70e485ceac3440b079929f Mon Sep 17 00:00:00 2001 From: Alex Vakulenko Date: Fri, 25 Aug 2017 17:44:36 -0700 Subject: [PATCH] Fix crash in developer settings when backup is not available When backup feature is disabled, Developer Settings dialog does not come up due to a crash. Disable Backup Password option in the preference screen. Bug: 64725174 Test: Developer settings dialog comes up and Backup password is disabled on Polaris Change-Id: I4f4546c4e97d2e5128ec65c0532691d9799b4c8f --- .../development/DevelopmentSettings.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/com/android/settings/development/DevelopmentSettings.java b/src/com/android/settings/development/DevelopmentSettings.java index b442449640b..d05991c3cf8 100644 --- a/src/com/android/settings/development/DevelopmentSettings.java +++ b/src/com/android/settings/development/DevelopmentSettings.java @@ -892,14 +892,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment } private void updatePasswordSummary() { - try { - if (mBackupManager.hasBackupPassword()) { - mPassword.setSummary(R.string.local_backup_password_summary_change); - } else { - mPassword.setSummary(R.string.local_backup_password_summary_none); + mPassword.setEnabled(mBackupManager != null); + if (mBackupManager != null) { + try { + if (mBackupManager.hasBackupPassword()) { + mPassword.setSummary(R.string.local_backup_password_summary_change); + } else { + mPassword.setSummary(R.string.local_backup_password_summary_none); + } + } catch (RemoteException e) { + // Not much we can do here } - } catch (RemoteException e) { - // Not much we can do here } }