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

Commit fb970e92 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Notification.fullScreenIntent support.

Bug: 2911617
Change-Id: I1b4cd6ff0f760bad721a3a8eed61209b44b64c02
parent 2338f48d
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ import com.android.systemui.statusbar.*;
import com.android.systemui.R;

public class TabletStatusBarService extends StatusBarService {
    public static final boolean DEBUG = true;
    public static final boolean DEBUG = false;
    public static final String TAG = "TabletStatusBar";


@@ -234,8 +234,27 @@ public class TabletStatusBarService extends StatusBarService {
    public void addNotification(IBinder key, StatusBarNotification notification) {
        if (DEBUG) Slog.d(TAG, "addNotification(" + key + " -> " + notification + ")");
        addNotificationViews(key, notification);

        boolean immersive = false;
        try {
            immersive = ActivityManagerNative.getDefault().isTopActivityImmersive();
            Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
        } catch (RemoteException ex) {
        }
        if (immersive) {
            // TODO: immersive mode popups for tablet
        } else if (notification.notification.fullScreenIntent != null) {
            // not immersive & a full-screen alert should be shown
            Slog.d(TAG, "Notification has fullScreenIntent and activity is not immersive;"
                    + " sending fullScreenIntent");
            try {
                notification.notification.fullScreenIntent.send();
            } catch (PendingIntent.CanceledException e) {
            }
        } else {
            // tick()
        }
    }

    public void updateNotification(IBinder key, StatusBarNotification notification) {
        if (DEBUG) Slog.d(TAG, "updateNotification(" + key + " -> " + notification + ") // TODO");