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

Commit 867db499 authored by Steve Statia's avatar Steve Statia Committed by Automerger Merge Worker
Browse files

Merge "Fix to hide the Satellite SOS system notification during satelltie...

Merge "Fix to hide the Satellite SOS system notification during satelltie overlay mode." into 24D1-dev am: f915700b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/28050662



Change-Id: I68d1c8e0e06fdc6db39111522f5370096b5a524f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e8db42a9 f915700b
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -799,7 +799,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();
@@ -814,6 +814,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) {
@@ -869,6 +879,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