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

Commit 55bed957 authored by Ruben Brunk's avatar Ruben Brunk Committed by Android (Google) Code Review
Browse files

Merge "Add a framework service tracking VR mode state."

parents 1d0d4d3c dd18a0b6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3538,6 +3538,7 @@ package android.app {
    method public deprecated void setTitleColor(int);
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrMode(boolean);
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
@@ -8993,6 +8994,7 @@ package android.content.pm {
    field public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 8; // 0x8
    field public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 8192; // 0x2000
    field public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 4; // 0x4
    field public static final int FLAG_ENABLE_VR_MODE = 32768; // 0x8000
    field public static final int FLAG_EXCLUDE_FROM_RECENTS = 32; // 0x20
    field public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 256; // 0x100
    field public static final int FLAG_FINISH_ON_TASK_LAUNCH = 2; // 0x2
@@ -9556,6 +9558,7 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
    field public static final java.lang.String FEATURE_USB_HOST = "android.hardware.usb.host";
    field public static final java.lang.String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";
    field public static final java.lang.String FEATURE_VR_MODE = "android.software.vr.mode";
    field public static final java.lang.String FEATURE_WATCH = "android.hardware.type.watch";
    field public static final java.lang.String FEATURE_WEBVIEW = "android.software.webview";
    field public static final java.lang.String FEATURE_WIFI = "android.hardware.wifi";
@@ -33258,6 +33261,7 @@ package android.service.notification {
    method public final void requestInterruptionFilter(int);
    method public final void requestListenerHints(int);
    method public final void setNotificationsShown(java.lang.String[]);
    field public static final java.lang.String CATEGORY_VR_NOTIFICATIONS = "android.intent.category.vr.notifications";
    field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
    field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
    field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
+4 −0
Original line number Diff line number Diff line
@@ -3643,6 +3643,7 @@ package android.app {
    method public deprecated void setTitleColor(int);
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrMode(boolean);
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
@@ -9261,6 +9262,7 @@ package android.content.pm {
    field public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 8; // 0x8
    field public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 8192; // 0x2000
    field public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 4; // 0x4
    field public static final int FLAG_ENABLE_VR_MODE = 32768; // 0x8000
    field public static final int FLAG_EXCLUDE_FROM_RECENTS = 32; // 0x20
    field public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 256; // 0x100
    field public static final int FLAG_FINISH_ON_TASK_LAUNCH = 2; // 0x2
@@ -9872,6 +9874,7 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
    field public static final java.lang.String FEATURE_USB_HOST = "android.hardware.usb.host";
    field public static final java.lang.String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";
    field public static final java.lang.String FEATURE_VR_MODE = "android.software.vr.mode";
    field public static final java.lang.String FEATURE_WATCH = "android.hardware.type.watch";
    field public static final java.lang.String FEATURE_WEBVIEW = "android.software.webview";
    field public static final java.lang.String FEATURE_WIFI = "android.hardware.wifi";
@@ -35406,6 +35409,7 @@ package android.service.notification {
    method public final void setNotificationsShown(java.lang.String[]);
    method public final void setOnNotificationPostedTrim(int);
    method public void unregisterAsSystemService() throws android.os.RemoteException;
    field public static final java.lang.String CATEGORY_VR_NOTIFICATIONS = "android.intent.category.vr.notifications";
    field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
    field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
    field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
+4 −0
Original line number Diff line number Diff line
@@ -3538,6 +3538,7 @@ package android.app {
    method public deprecated void setTitleColor(int);
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrMode(boolean);
    method public boolean shouldShowRequestPermissionRationale(java.lang.String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
@@ -8993,6 +8994,7 @@ package android.content.pm {
    field public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 8; // 0x8
    field public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 8192; // 0x2000
    field public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 4; // 0x4
    field public static final int FLAG_ENABLE_VR_MODE = 32768; // 0x8000
    field public static final int FLAG_EXCLUDE_FROM_RECENTS = 32; // 0x20
    field public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 256; // 0x100
    field public static final int FLAG_FINISH_ON_TASK_LAUNCH = 2; // 0x2
@@ -9556,6 +9558,7 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
    field public static final java.lang.String FEATURE_USB_HOST = "android.hardware.usb.host";
    field public static final java.lang.String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";
    field public static final java.lang.String FEATURE_VR_MODE = "android.software.vr.mode";
    field public static final java.lang.String FEATURE_WATCH = "android.hardware.type.watch";
    field public static final java.lang.String FEATURE_WEBVIEW = "android.software.webview";
    field public static final java.lang.String FEATURE_WIFI = "android.hardware.wifi";
@@ -33260,6 +33263,7 @@ package android.service.notification {
    method public final void requestInterruptionFilter(int);
    method public final void requestListenerHints(int);
    method public final void setNotificationsShown(java.lang.String[]);
    field public static final java.lang.String CATEGORY_VR_NOTIFICATIONS = "android.intent.category.vr.notifications";
    field public static final int HINT_HOST_DISABLE_EFFECTS = 1; // 0x1
    field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
    field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
+16 −0
Original line number Diff line number Diff line
@@ -6037,6 +6037,22 @@ public class Activity extends ContextThemeWrapper
        }
    }

    /**
     * Enable or disable virtual reality (VR) mode.
     *
     * <p>VR mode is a hint to Android system services to switch to modes optimized for
     * high-performance stereoscopic rendering.</p>
     *
     * @param enabled {@code true} to enable this mode.
     */
    public void setVrMode(boolean enabled) {
        try {
            ActivityManagerNative.getDefault().setVrMode(mToken, enabled);
        } catch (RemoteException e) {
            // pass
        }
    }

    /**
     * Start an action mode of the default type {@link ActionMode#TYPE_PRIMARY}.
     *
+20 −0
Original line number Diff line number Diff line
@@ -2766,6 +2766,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            reply.writeNoException();
            return true;
        }
        case SET_VR_MODE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            final IBinder token = data.readStrongBinder();
            final boolean enable = data.readInt() == 1;
            setVrMode(token, enable);
            reply.writeNoException();
            return true;
        }
        }

        return super.onTransact(code, data, reply, flags);
@@ -5896,6 +5904,18 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }

    public void setVrMode(IBinder token, boolean enabled) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeStrongBinder(token);
        data.writeInt(enabled ? 1 : 0);
        mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    @Override
    public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
        Parcel data = Parcel.obtain();
Loading