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

Commit f915700b authored by Steve Statia's avatar Steve Statia Committed by Android (Google) Code Review
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
parents 979b9bee c57550c9
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