Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3b9bf55 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Move zen rule deletion

To a non-exported component

Test: manually delete a rule in Settings
Fixes: 233607507
Change-Id: I6c4ac930eb62a2068582021d0ad16b93fbc9bdd3
parent 9f2d4554
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -50,16 +50,6 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
    private String[] mDeleteDialogRuleIds;
    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
    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
        ZenServiceListing serviceListing = new ZenServiceListing(getContext(), CONFIG);
+1 −3
Original line number Diff line number Diff line
@@ -103,8 +103,7 @@ public class ZenRuleButtonsPreferenceController extends AbstractZenModePreferenc
                    new ZenDeleteRuleDialog.PositiveClickListener() {
                        @Override
                        public void onOk(String id) {
                            Bundle bundle = new Bundle();
                            bundle.putString(ZenModeAutomationSettings.DELETE, id);
                            mBackend.removeZenRule(id);
                            mMetricsFeatureProvider.action(mContext,
                                    SettingsEnums.ACTION_ZEN_DELETE_RULE_OK);
                            new SubSettingLauncher(mContext)
@@ -112,7 +111,6 @@ public class ZenRuleButtonsPreferenceController extends AbstractZenModePreferenc
                                    .setDestination(ZenModeAutomationSettings.class.getName())
                                    .setSourceMetricsCategory(MetricsProto.MetricsEvent
                                            .NOTIFICATION_ZEN_MODE_AUTOMATION)
                                    .setArguments(bundle)
                                    .launch();
                        }
            });