Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -35031,6 +35031,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; } api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37574,6 +37574,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; } api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -35093,6 +35093,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; } core/java/android/service/vr/IVrListener.aidl +4 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.service.vr; import android.content.ComponentName; /** @hide */ oneway interface IVrListener { void focusedActivityChanged(in ComponentName component); } core/java/android/service/vr/VrListenerService.java +43 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,10 @@ import android.app.Service; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; /** * A service that is bound from the system while running in virtual reality (VR) mode. Loading Loading @@ -55,19 +58,53 @@ public abstract class VrListenerService extends Service { @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION) public static final String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; /** * @hide */ public static class VrListenerBinder extends IVrListener.Stub { private final Handler mHandler; private static final int MSG_ON_CURRENT_VR_ACTIVITY_CHANGED = 1; private final IVrListener.Stub mBinder = new IVrListener.Stub() { @Override public void focusedActivityChanged(ComponentName component) { mHandler.obtainMessage(MSG_ON_CURRENT_VR_ACTIVITY_CHANGED, component).sendToTarget(); } }; private final VrListenerBinder mBinder = new VrListenerBinder(); private final class VrListenerHandler extends Handler { public VrListenerHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_ON_CURRENT_VR_ACTIVITY_CHANGED: { VrListenerService.this.onCurrentVrActivityChanged((ComponentName) msg.obj); } break; } } } @Override public IBinder onBind(Intent intent) { return mBinder; } public VrListenerService() { mHandler = new VrListenerHandler(Looper.getMainLooper()); } /** * Called when the current activity using VR mode is changed. * <p/> * This will be called immediately when this service is initially bound, but is * not guaranteed to be called before onUnbind. * * @param component the {@link ComponentName} of the new current VR activity. */ public void onCurrentVrActivityChanged(ComponentName component) { // Override to implement } /** * Check if the given package is available to be enabled/disabled in VR mode settings. * Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -35031,6 +35031,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; }
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37574,6 +37574,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; }
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -35093,6 +35093,7 @@ package android.service.vr { ctor public VrListenerService(); method public static final boolean isVrModePackageEnabled(android.content.Context, android.content.ComponentName); method public android.os.IBinder onBind(android.content.Intent); method public void onCurrentVrActivityChanged(android.content.ComponentName); field public static final java.lang.String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; }
core/java/android/service/vr/IVrListener.aidl +4 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ package android.service.vr; import android.content.ComponentName; /** @hide */ oneway interface IVrListener { void focusedActivityChanged(in ComponentName component); }
core/java/android/service/vr/VrListenerService.java +43 −6 Original line number Diff line number Diff line Loading @@ -23,7 +23,10 @@ import android.app.Service; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; /** * A service that is bound from the system while running in virtual reality (VR) mode. Loading Loading @@ -55,19 +58,53 @@ public abstract class VrListenerService extends Service { @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION) public static final String SERVICE_INTERFACE = "android.service.vr.VrListenerService"; /** * @hide */ public static class VrListenerBinder extends IVrListener.Stub { private final Handler mHandler; private static final int MSG_ON_CURRENT_VR_ACTIVITY_CHANGED = 1; private final IVrListener.Stub mBinder = new IVrListener.Stub() { @Override public void focusedActivityChanged(ComponentName component) { mHandler.obtainMessage(MSG_ON_CURRENT_VR_ACTIVITY_CHANGED, component).sendToTarget(); } }; private final VrListenerBinder mBinder = new VrListenerBinder(); private final class VrListenerHandler extends Handler { public VrListenerHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_ON_CURRENT_VR_ACTIVITY_CHANGED: { VrListenerService.this.onCurrentVrActivityChanged((ComponentName) msg.obj); } break; } } } @Override public IBinder onBind(Intent intent) { return mBinder; } public VrListenerService() { mHandler = new VrListenerHandler(Looper.getMainLooper()); } /** * Called when the current activity using VR mode is changed. * <p/> * This will be called immediately when this service is initially bound, but is * not guaranteed to be called before onUnbind. * * @param component the {@link ComponentName} of the new current VR activity. */ public void onCurrentVrActivityChanged(ComponentName component) { // Override to implement } /** * Check if the given package is available to be enabled/disabled in VR mode settings. * Loading