summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-01-21 17:54:53 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-01-21 17:54:53 -0800
commitd4237f884a1e7aa7a73d8133896c3bea1c369234 (patch)
tree29ecd1786e3606fa1d3087fd9eca9725a8e8116c
parent2197f83b6b8eed12d73c0ba249816d6e2af97ec3 (diff)
parent942feaa2eff1153564b98a01f644083c1b58cf2d (diff)
downloadpackages_apps_settings-d4237f884a1e7aa7a73d8133896c3bea1c369234.zip
packages_apps_settings-d4237f884a1e7aa7a73d8133896c3bea1c369234.tar.gz
packages_apps_settings-d4237f884a1e7aa7a73d8133896c3bea1c369234.tar.bz2
am 942feaa2: am 6ff80dcf: Fix #2377870 : NPE in Dock settings
Merge commit '942feaa2eff1153564b98a01f644083c1b58cf2d' * commit '942feaa2eff1153564b98a01f644083c1b58cf2d': Fix #2377870 : NPE in Dock settings
-rw-r--r--src/com/android/settings/DockSettings.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/DockSettings.java b/src/com/android/settings/DockSettings.java
index 5cf8a7e..fe9aeb7 100644
--- a/src/com/android/settings/DockSettings.java
+++ b/src/com/android/settings/DockSettings.java
@@ -72,6 +72,9 @@ public class DockSettings extends PreferenceActivity {
private void initDockSettings() {
mAudioSettings = findPreference(KEY_AUDIO_SETTINGS);
+ if (mAudioSettings != null) {
+ mAudioSettings.setSummary(R.string.dock_audio_summary_none);
+ }
}
private void handleDockChange(Intent intent) {
@@ -104,7 +107,9 @@ public class DockSettings extends PreferenceActivity {
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mAudioSettings) {
- int dockState = mDockIntent.getIntExtra(Intent.EXTRA_DOCK_STATE, 0);
+ int dockState = mDockIntent != null
+ ? mDockIntent.getIntExtra(Intent.EXTRA_DOCK_STATE, 0)
+ : Intent.EXTRA_DOCK_STATE_UNDOCKED;
if (dockState == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
showDialog(DIALOG_NOT_DOCKED);
} else {