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

Commit 5355e859 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Don't let apps permanently delete channels.

Test: manual
Change-Id: Ia2582e3b4213f0b77579af2ff94f79b08e5d1a91
parent c9842c16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ interface INotificationManager
{
    void cancelAllNotifications(String pkg, int userId);

    void clearData(String pkg, int uid);
    void clearData(String pkg, int uid, boolean fromApp);
    void enqueueToast(String pkg, ITransientNotification callback, int duration);
    void cancelToast(String pkg, ITransientNotification callback);
    void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
+1 −1
Original line number Diff line number Diff line
@@ -5570,7 +5570,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                // Reset notification settings.
                INotificationManager inm = NotificationManager.getService();
                inm.clearData(packageName, pkgUidF);
                inm.clearData(packageName, pkgUidF, uid == pkgUidF);
            } catch (RemoteException e) {
            }
        } finally {
+5 −3
Original line number Diff line number Diff line
@@ -1698,7 +1698,7 @@ public class NotificationManagerService extends SystemService {


        @Override
        public void clearData(String packageName, int uid) throws RemoteException {
        public void clearData(String packageName, int uid, boolean fromApp) throws RemoteException {
            checkCallerIsSystem();

            // Cancel posted notifications
@@ -1713,8 +1713,10 @@ public class NotificationManagerService extends SystemService {
            mConditionProviders.onPackagesChanged(true, new String[] {packageName});

            // Reset notification preferences
            if (!fromApp) {
                mRankingHelper.onPackagesChanged(true, UserHandle.getCallingUserId(),
                        new String[]{packageName}, new int[]{uid});
            }

            savePolicyFile();
        }