Merge "Null-pointer check when updating name of ZenRule." into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
268c6c6ca6
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.notification;
|
package com.android.settings.notification;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.AutomaticZenRule;
|
import android.app.AutomaticZenRule;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@@ -262,8 +263,14 @@ public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateRuleName() {
|
private void updateRuleName() {
|
||||||
getActivity().setTitle(mRule.getName());
|
Activity activity = getActivity();
|
||||||
mRuleName.setSummary(mRule.getName());
|
if (activity != null) {
|
||||||
|
activity.setTitle(mRule.getName());
|
||||||
|
mRuleName.setSummary(mRule.getName());
|
||||||
|
} else {
|
||||||
|
if (DEBUG) Log.d(TAG, "updateRuleName - activity title and mRuleName "
|
||||||
|
+ "not updated; getActivity() returned null");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AutomaticZenRule getZenRule() {
|
private AutomaticZenRule getZenRule() {
|
||||||
|
Reference in New Issue
Block a user