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

Commit 605a2a26 authored by Makoto Onuki's avatar Makoto Onuki Committed by android-build-team Robot
Browse files

Revert "Don't defer FGS notification if it's already shown"

Revert "Verify behavior when FGS uses existing notification"

Revert submission 14414063-fgs-defer-fixes

Reason for revert: b/187373264
Reverted Changes:
I081a3cc88:Don't defer FGS notification if it's already shown...
I083583550:Verify behavior when FGS uses existing notificatio...

Bug: 187373264

Change-Id: I82edba69c583791ec603107b3407ce7a5efe83a0
(cherry picked from commit 94badc52)
parent 7cbf9094
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -155,7 +155,6 @@ import com.android.server.AppStateTracker;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.am.ActivityManagerService.ItemMatcher;
import com.android.server.notification.NotificationManagerInternal;
import com.android.server.uri.NeededUriGrants;
import com.android.server.wm.ActivityServiceConnectionsHolder;

@@ -1977,17 +1976,6 @@ public final class ActiveServices {
            // DeviceConfig element has been set
            showNow = isLegacyApp && mAm.mConstants.mFlagFgsNotificationDeferralApiGated;
        }
        if (!showNow) {
            // did we already show it?
            showNow = r.mFgsNotificationShown;
        }
        if (!showNow) {
            // Is the notification already showing for any reason?
            final NotificationManagerInternal nmi =
                    LocalServices.getService(NotificationManagerInternal.class);
            showNow = nmi.isNotificationShown(r.appInfo.packageName, null,
                    r.foregroundId, UserHandle.getUserId(uid));
        }
        if (!showNow) {
            // has the app forced deferral?
            if (!r.foregroundNoti.isForegroundDisplayForceDeferred()) {
+0 −3
Original line number Diff line number Diff line
@@ -30,9 +30,6 @@ public interface NotificationManagerInternal {
    void cancelNotification(String pkg, String basePkg, int callingUid, int callingPid,
            String tag, int id, int userId);

    /** is the given notification currently showing? */
    boolean isNotificationShown(String pkg, String tag, int notificationId, int userId);

    void removeForegroundServiceFlagFromNotification(String pkg, int notificationId, int userId);

    void onConversationRemoved(String pkg, int uid, Set<String> shortcuts);
+0 −7
Original line number Diff line number Diff line
@@ -6047,13 +6047,6 @@ public class NotificationManagerService extends SystemService {
            cancelNotificationInternal(pkg, opPkg, callingUid, callingPid, tag, id, userId);
        }

        @Override
        public boolean isNotificationShown(String pkg, String tag, int notificationId, int userId) {
            synchronized (mNotificationLock) {
                return findNotificationLocked(pkg, tag, notificationId, userId) != null;
            }
        }

        @Override
        public void removeForegroundServiceFlagFromNotification(String pkg, int notificationId,
                int userId) {