DND ixD changes
- Subtext in Settings > Sound updated - new icons for automatic dnd rules - no toast when toggling on/off dnd rules - dnd dialog has a warning if dnd will cause user to miss next alarm Test: make ROBOTEST_FILTER=ZenModePreferenceControllerTest RunSettingsRoboTests -j40 Fixes: 72494029 Fixes: 72655216 Fixes: 72655609 Change-Id: I9d86d82529079f35e362f93e10914f0a60229cd8
This commit is contained in:
@@ -22,7 +22,6 @@ import android.content.Context;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.widget.Switch;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.applications.LayoutPreference;
|
||||
@@ -36,14 +35,11 @@ public class ZenAutomaticRuleSwitchPreferenceController extends
|
||||
private static final String KEY = "zen_automatic_rule_switch";
|
||||
private AutomaticZenRule mRule;
|
||||
private String mId;
|
||||
private Toast mEnabledToast;
|
||||
private int mToastTextResource;
|
||||
private SwitchBar mSwitchBar;
|
||||
|
||||
public ZenAutomaticRuleSwitchPreferenceController(Context context, Fragment parent,
|
||||
int toastTextResource, Lifecycle lifecycle) {
|
||||
Lifecycle lifecycle) {
|
||||
super(context, KEY, parent, lifecycle);
|
||||
mToastTextResource = toastTextResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,16 +88,5 @@ public class ZenAutomaticRuleSwitchPreferenceController extends
|
||||
if (enabled == mRule.isEnabled()) return;
|
||||
mRule.setEnabled(enabled);
|
||||
mBackend.setZenRule(mId, mRule);
|
||||
if (enabled) {
|
||||
final int toastText = mToastTextResource;
|
||||
if (toastText != 0) {
|
||||
mEnabledToast = Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT);
|
||||
mEnabledToast.show();
|
||||
}
|
||||
} else {
|
||||
if (mEnabledToast != null) {
|
||||
mEnabledToast.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user