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

Commit c57550c9 authored by Steve Statia's avatar Steve Statia
Browse files

Fix to hide the Satellite SOS system notification during satelltie overlay mode.

Stops the user from being able to see the silent notification and
disable the overlay mode.

Bug: 349195999
Test: manually testing the notificaiton being visible in the
notifications.

Change-Id: I685ce43d605195769d2f0cc1cd8ab7124b7d0928
parent 2094a139
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
        if (changed && noSystemOverlayPermission) {
            if (mAlertWindowSurfaces.isEmpty()) {
                cancelAlertWindowNotification();
            } else if (mAlertWindowNotification == null) {
            } else if (mAlertWindowNotification == null && !isSatellitePointingUiPackage()) {
                mAlertWindowNotification = new AlertWindowNotification(mService, mPackageName);
                if (mShowingAlertWindowNotificationAllowed) {
                    mAlertWindowNotification.post();
@@ -836,6 +836,16 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
        }
    }

    // TODO b/349195999 - short term solution to not show the satellite pointing ui notification.
    private boolean isSatellitePointingUiPackage() {
        if (mPackageName == null || !mPackageName.equals(mService.mContext.getString(
            com.android.internal.R.string.config_pointing_ui_package))) {
            return false;
        }
        return ActivityTaskManagerService.checkPermission(
            android.Manifest.permission.SATELLITE_COMMUNICATION, mPid, mUid) == PERMISSION_GRANTED;
    }

    void setShowingAlertWindowNotificationAllowed(boolean allowed) {
        mShowingAlertWindowNotificationAllowed = allowed;
        if (mAlertWindowNotification != null) {
@@ -891,6 +901,9 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
                pw.print(" mClientDead="); pw.print(mClientDead);
                pw.print(" mSurfaceSession="); pw.println(mSurfaceSession);
        pw.print(prefix); pw.print("mPackageName="); pw.println(mPackageName);
        if (isSatellitePointingUiPackage()) {
            pw.print(prefix); pw.println("mIsSatellitePointingUiPackage=true");
        }
    }

    @Override