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

Commit 706da809 authored by Michael W's avatar Michael W Committed by Bruno Martins
Browse files

Trust: Request removal of the notification when disabling the preference

* Right now, nothing requests the removal of the notification
* This means, that disabling the preference still leaves us with the
  notification
* By notifying the service of the user action, the notification gets
  cancelled properly

Change-Id: I26d23f3dde582dbc923faaa558d5f0bf00d49035
parent 52734f04
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018-2019 The LineageOS Project
 * Copyright (C) 2018-2020 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -229,8 +229,12 @@ public class TrustPreferences extends SettingsPreferenceFragment {
        int original = LineageSettings.Secure.getInt(getContext().getContentResolver(),
                LineageSettings.Secure.TRUST_WARNINGS, TrustInterface.TRUST_WARN_MAX_VALUE);
        int newValue = value ? (original | feature) : (original & ~feature);
        return LineageSettings.Secure.putInt(getContext().getContentResolver(),
        boolean success = LineageSettings.Secure.putInt(getContext().getContentResolver(),
                LineageSettings.Secure.TRUST_WARNINGS, newValue);
        if (success && !value) {
            mInterface.removeNotificationForFeature(feature);
        }
        return success;
    }