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

Commit de2ea835 authored by Steven Thomas's avatar Steven Thomas Committed by Android (Google) Code Review
Browse files

Merge "Add remote callbacks for persistent vr mode"

parents a540460e 504c6d67
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ LOCAL_SRC_FILES += \
	core/java/android/service/notification/IStatusBarNotificationHolder.aidl \
	core/java/android/service/notification/IConditionListener.aidl \
	core/java/android/service/notification/IConditionProvider.aidl \
	core/java/android/service/vr/IPersistentVrStateCallbacks.aidl \
	core/java/android/service/vr/IVrListener.aidl \
	core/java/android/service/vr/IVrManager.aidl \
	core/java/android/service/vr/IVrStateCallbacks.aidl \
+8 −15
Original line number Diff line number Diff line
/**
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (c) 2017, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -13,19 +13,12 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.vr;

/**
 * Listener for state changes to persistent VR mode.
 *
 * @hide Only for use within system server.
 */
public abstract class PersistentVrStateListener {
package android.service.vr;

/** @hide */
oneway interface IPersistentVrStateCallbacks {

    void onPersistentVrStateChanged(in boolean enabled);

  /**
   * Called when the Persistent VR mode state changes.
   *
   * @param enabled {@code true} if persistent VR mode is enabled.
   */
    public abstract void onPersistentVrStateChanged(boolean enabled);
}
+15 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.service.vr;

import android.service.vr.IVrStateCallbacks;
import android.service.vr.IPersistentVrStateCallbacks;

/** @hide */
interface IVrManager {
@@ -35,6 +36,20 @@ interface IVrManager {
     */
    void unregisterListener(in IVrStateCallbacks cb);

    /**
     * Add a callback to be notified when persistent VR mode state changes.
     *
     * @param cb the callback instance to add.
     */
    void registerPersistentVrStateListener(in IPersistentVrStateCallbacks cb);

    /**
     * Remove the callack from the current set of registered callbacks.
     *
     * @param cb the callback to remove.
     */
    void unregisterPersistentVrStateListener(in IPersistentVrStateCallbacks cb);

    /**
     * Return current VR mode state.
     *
+3 −3
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ import android.provider.Settings;
import android.service.dreams.DreamManagerInternal;
import android.service.dreams.DreamService;
import android.service.dreams.IDreamManager;
import android.service.vr.IPersistentVrStateCallbacks;
import android.speech.RecognizerIntent;
import android.telecom.TelecomManager;
import android.util.DisplayMetrics;
@@ -236,7 +237,6 @@ import com.android.server.policy.keyguard.KeyguardStateMonitor.StateCallback;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.wm.AppTransition;
import com.android.server.vr.VrManagerInternal;
import com.android.server.vr.PersistentVrStateListener;

import java.io.File;
import java.io.FileReader;
@@ -999,8 +999,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }
    MyOrientationListener mOrientationListener;

    final PersistentVrStateListener mPersistentVrModeListener =
            new PersistentVrStateListener() {
    final IPersistentVrStateCallbacks mPersistentVrModeListener =
            new IPersistentVrStateCallbacks.Stub() {
        @Override
        public void onPersistentVrStateChanged(boolean enabled) {
            mPersistentVrModeEnabled = enabled;
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.server.vr;

import android.annotation.NonNull;
import android.content.ComponentName;
import android.service.vr.IPersistentVrStateCallbacks;

/**
 * Service for accessing the VR mode manager.
@@ -101,5 +102,5 @@ public abstract class VrManagerInternal {
    /**
     * Adds listener that reports state changes to persistent VR mode.
     */
    public abstract void addPersistentVrModeStateListener(PersistentVrStateListener listener);
    public abstract void addPersistentVrModeStateListener(IPersistentVrStateCallbacks listener);
}
Loading