Merge "Move zen rule deletion" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7ab7c1d6f8
@@ -50,16 +50,6 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
|||||||
private String[] mDeleteDialogRuleIds;
|
private String[] mDeleteDialogRuleIds;
|
||||||
private boolean[] mDeleteDialogChecked;
|
private boolean[] mDeleteDialogChecked;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Context context) {
|
|
||||||
super.onAttach(context);
|
|
||||||
Bundle bundle = getArguments();
|
|
||||||
if (bundle != null && bundle.containsKey(DELETE)) {
|
|
||||||
mBackend.removeZenRule(bundle.getString(DELETE));
|
|
||||||
bundle.remove(DELETE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||||
ZenServiceListing serviceListing = new ZenServiceListing(getContext(), CONFIG);
|
ZenServiceListing serviceListing = new ZenServiceListing(getContext(), CONFIG);
|
||||||
|
@@ -103,8 +103,7 @@ public class ZenRuleButtonsPreferenceController extends AbstractZenModePreferenc
|
|||||||
new ZenDeleteRuleDialog.PositiveClickListener() {
|
new ZenDeleteRuleDialog.PositiveClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onOk(String id) {
|
public void onOk(String id) {
|
||||||
Bundle bundle = new Bundle();
|
mBackend.removeZenRule(id);
|
||||||
bundle.putString(ZenModeAutomationSettings.DELETE, id);
|
|
||||||
mMetricsFeatureProvider.action(mContext,
|
mMetricsFeatureProvider.action(mContext,
|
||||||
SettingsEnums.ACTION_ZEN_DELETE_RULE_OK);
|
SettingsEnums.ACTION_ZEN_DELETE_RULE_OK);
|
||||||
new SubSettingLauncher(mContext)
|
new SubSettingLauncher(mContext)
|
||||||
@@ -112,7 +111,6 @@ public class ZenRuleButtonsPreferenceController extends AbstractZenModePreferenc
|
|||||||
.setDestination(ZenModeAutomationSettings.class.getName())
|
.setDestination(ZenModeAutomationSettings.class.getName())
|
||||||
.setSourceMetricsCategory(MetricsProto.MetricsEvent
|
.setSourceMetricsCategory(MetricsProto.MetricsEvent
|
||||||
.NOTIFICATION_ZEN_MODE_AUTOMATION)
|
.NOTIFICATION_ZEN_MODE_AUTOMATION)
|
||||||
.setArguments(bundle)
|
|
||||||
.launch();
|
.launch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user