From b58e2005abc5482a744963e6a8a1c986d0839fc8 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Wed, 20 Aug 2014 10:55:12 -0700 Subject: [PATCH] Fixed a Settings dialog crash. + Fixed a bug where Settings would crash when trying to open paired bluetooth device settings after device orientation change. Bug: 16972564 Change-Id: I0e93551ae7d8f21711d85093756fc33b62f59b24 --- .../android/settings/bluetooth/DeviceProfilesSettings.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java index ea43badebfc..8b0c3572915 100755 --- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java +++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java @@ -135,8 +135,10 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment mCachedDevice = cachedDevice; mCachedDevice.registerCallback(this); - addPreferencesForProfiles(); - refresh(); + if (isResumed()) { + addPreferencesForProfiles(); + refresh(); + } } private void addPreferencesForProfiles() {