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

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

Remove experimental immersive mode support. DO NOT MERGE

Bug: 2949215

Change-Id: I7d998ef571ef7e149bb96261430e92150b80b77d
parent 7046bd92
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -26633,17 +26633,6 @@
 visibility="public"
>
</field>
<field name="FLAG_HIGH_PRIORITY"
 type="int"
 transient="false"
 volatile="false"
 value="128"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FLAG_INSISTENT"
 type="int"
 transient="false"
@@ -46071,17 +46060,6 @@
 visibility="public"
>
</field>
<field name="FLAG_IMMERSIVE"
 type="int"
 transient="false"
 volatile="false"
 value="512"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FLAG_MULTIPROCESS"
 type="int"
 transient="false"
+0 −42
Original line number Diff line number Diff line
@@ -3740,48 +3740,6 @@ public class Activity extends ContextThemeWrapper
        return null;
    }

    /**
     * Bit indicating that this activity is "immersive" and should not be
     * interrupted by notifications if possible.
     *
     * This value is initially set by the manifest property
     * <code>android:immersive</code> but may be changed at runtime by
     * {@link #setImmersive}.
     *
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @hide
     */
    public boolean isImmersive() {
        try {
            return ActivityManagerNative.getDefault().isImmersive(mToken);
        } catch (RemoteException e) {
            return false;
        }
    }

    /**
     * Adjust the current immersive mode setting.
     * 
     * Note that changing this value will have no effect on the activity's
     * {@link android.content.pm.ActivityInfo} structure; that is, if
     * <code>android:immersive</code> is set to <code>true</code>
     * in the application's manifest entry for this activity, the {@link
     * android.content.pm.ActivityInfo#flags ActivityInfo.flags} member will
     * always have its {@link android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * FLAG_IMMERSIVE} bit set.
     *
     * @see #isImmersive
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @hide
     */
    public void setImmersive(boolean i) {
        try {
            ActivityManagerNative.getDefault().setImmersive(mToken, i);
        } catch (RemoteException e) {
            // pass
        }
    }

    // ------------------ Internal API ------------------
    
    final void setParent(Activity parent) {
+0 −66
Original line number Diff line number Diff line
@@ -1261,32 +1261,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            return true;
        }

        case IS_IMMERSIVE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            IBinder token = data.readStrongBinder();
            boolean isit = isImmersive(token);
            reply.writeNoException();
            reply.writeInt(isit ? 1 : 0);
            return true;
        }

        case SET_IMMERSIVE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            IBinder token = data.readStrongBinder();
            boolean imm = data.readInt() == 1;
            setImmersive(token, imm);
            reply.writeNoException();
            return true;
        }
        
        case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            boolean isit = isTopActivityImmersive();
            reply.writeNoException();
            reply.writeInt(isit ? 1 : 0);
            return true;
        }

        case CRASH_APPLICATION_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            int uid = data.readInt();
@@ -2858,46 +2832,6 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    }
    
    public void setImmersive(IBinder token, boolean immersive)
            throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(token);
        data.writeInt(immersive ? 1 : 0);
        mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    public boolean isImmersive(IBinder token)
            throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(token);
        mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
        reply.readException();
        boolean res = reply.readInt() == 1;
        data.recycle();
        reply.recycle();
        return res;
    }

    public boolean isTopActivityImmersive()
            throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
        reply.readException();
        boolean res = reply.readInt() == 1;
        data.recycle();
        reply.recycle();
        return res;
    }

    public void crashApplication(int uid, int initialPid, String packageName,
            String message) throws RemoteException {
        Parcel data = Parcel.obtain();
+0 −4
Original line number Diff line number Diff line
@@ -311,10 +311,6 @@ public interface IActivityManager extends IInterface {
    
    public void finishHeavyWeightApp() throws RemoteException;

    public void setImmersive(IBinder token, boolean immersive) throws RemoteException;
    public boolean isImmersive(IBinder token) throws RemoteException;
    public boolean isTopActivityImmersive() throws RemoteException;
    
    public void crashApplication(int uid, int initialPid, String packageName,
            String message) throws RemoteException;
    
+0 −13
Original line number Diff line number Diff line
@@ -112,8 +112,6 @@ public class Notification implements Parcelable
     * An intent to launch instead of posting the notification to the status bar. Only for use with
     * extremely high-priority notifications demanding the user's attention, such as an incoming
     * call (handled in the core Android Phone app with a full-screen Activity).
     * Use with {@link #FLAG_HIGH_PRIORITY} to ensure that this notification will reach the user
     * even when other notifications are suppressed.
     */
    public PendingIntent fullScreenIntent;

@@ -273,14 +271,6 @@ public class Notification implements Parcelable
     */
    public static final int FLAG_FOREGROUND_SERVICE = 0x00000040;

    /**
     * Bit to be bitwise-ored into the {@link #flags} field that should be set if this notification
     * represents a high-priority event that may be shown to the user even if notifications are
     * otherwise unavailable (that is, when the status bar is hidden). This flag is ideally used
     * in conjunction with {@link #fullScreenIntent}.
     */
    public static final int FLAG_HIGH_PRIORITY = 0x00000080;

    public int flags;

    /**
@@ -549,9 +539,6 @@ public class Notification implements Parcelable
        sb.append(Integer.toHexString(this.defaults));
        sb.append(",flags=0x");
        sb.append(Integer.toHexString(this.flags));
        if ((this.flags & FLAG_HIGH_PRIORITY) != 0) {
            sb.append("!!!1!one!");
        }
        sb.append(")");
        return sb.toString();
    }
Loading