Merge "Don\'t save a rule without a name." into nyc-dev am: 257355afde am: b6dfee89f7
am: c776852e03
* commit 'c776852e03ed60f9bdde2a38e39b76010247f6b0':
Don't save a rule without a name.
Change-Id: I873acd02fdb3486865ca3bbe00c394447bf0d4e6
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.notification;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
@@ -51,6 +52,9 @@ public abstract class ZenRuleNameDialog {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final String newName = trimmedText();
|
||||
if (TextUtils.isEmpty(newName)) {
|
||||
return;
|
||||
}
|
||||
if (!mIsNew && mOriginalRuleName != null
|
||||
&& mOriginalRuleName.equals(newName)) {
|
||||
return; // no change to an existing rule, just dismiss
|
||||
|
||||
Reference in New Issue
Block a user