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

Commit 35992973 authored by Chloris Kuo's avatar Chloris Kuo
Browse files

Fix settings crash when enhanced notification shown in search results

init NotificationBackend in constructor and set isSliceable to false in
search result since the NAS enabling logic is required and is in the
parent fragment ConfigureNotificationSettings.

Bug: 237251075
Test: test manually on device
Change-Id: I9082d6eda27784cf378a0d06304b5fc1e2ae6d7f
(cherry picked from commit 26ce9a98)
parent ea3f9f33
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ public class ConfigureNotificationSettings extends DashboardFragment implements
        mNotificationAssistantPreferenceController =
                use(NotificationAssistantPreferenceController.class);
        mNotificationAssistantPreferenceController.setFragment(this);
        mNotificationAssistantPreferenceController.setBackend(new NotificationBackend());
    }

    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
+7 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class NotificationAssistantPreferenceController extends TogglePreferenceC
    public NotificationAssistantPreferenceController(Context context) {
        super(context, KEY_NAS);
        mUserManager = UserManager.get(context);
        mNotificationBackend = new NotificationBackend();
    }

    @Override
@@ -101,4 +102,9 @@ public class NotificationAssistantPreferenceController extends TogglePreferenceC
    void setBackend(NotificationBackend backend) {
        mNotificationBackend = backend;
    }

    @Override
    public boolean isSliceable() {
        return (mFragment != null && mFragment instanceof ConfigureNotificationSettings);
    }
}