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

Commit 1336a806 authored by Daniel Nicoara's avatar Daniel Nicoara
Browse files

Remove controller connection API

No longer need the proxy since VR Window Manager is in VrCore.

Bug: 36506799, 37542947
Test: Compiled and ran in VR on device.
Change-Id: Id5b5f34a1ad2b6da263527463d63777d40f18085
parent 07672353
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -6,8 +6,6 @@ import android.content.ComponentName;
import android.os.RemoteException;
import android.service.vr.IVrManager;

import java.io.FileDescriptor;

/**
 * Used to control aspects of a devices Virtual Reality (VR) capabilities.
 * <p>
@@ -63,32 +61,4 @@ public class VrManager {
            e.rethrowFromSystemServer();
        }
    }

    /**
     * Initiate connection for system controller data.
     *
     * @param fd Controller data file descriptor.
     *
     * {@hide}
     */
    public void connectController(FileDescriptor fd) {
        try {
            mService.connectController(fd);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /**
     * Sever connection for system controller data.
     *
     * {@hide}
     */
    public void disconnectController() {
        try {
            mService.disconnectController();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }
}
+0 −12
Original line number Diff line number Diff line
@@ -86,17 +86,5 @@ interface IVrManager {
     * currently, else return the display id of the virtual display
     */
    int getVr2dDisplayId();

    /**
     * Initiate connection for system controller data.
     *
     * @param fd Controller data file descriptor.
     */
    void connectController(in FileDescriptor fd);

    /**
     * Sever connection for system controller data.
     */
    void disconnectController();
}
+0 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ LOCAL_SRC_FILES += \
    ../../../../system/netd/server/binder/android/net/INetd.aidl \
    ../../../../system/netd/server/binder/android/net/metrics/INetdEventListener.aidl \
    ../../../native/cmds/installd/binder/android/os/IInstalld.aidl \
    ../../../native/services/vr/vr_window_manager/aidl/android/service/vr/IVrWindowManager.aidl \

LOCAL_AIDL_INCLUDES += \
    system/netd/server/binder
+0 −30
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.NotificationListenerService;
@@ -47,7 +46,6 @@ import android.service.vr.IPersistentVrStateCallbacks;
import android.service.vr.IVrListener;
import android.service.vr.IVrManager;
import android.service.vr.IVrStateCallbacks;
import android.service.vr.IVrWindowManager;
import android.service.vr.VrListenerService;
import android.text.TextUtils;
import android.util.ArrayMap;
@@ -439,18 +437,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC
            return VrManagerService.this.getVr2dDisplayId();
        }

        @Override
        public void connectController(FileDescriptor fd) throws android.os.RemoteException {
            enforceCallerPermission(Manifest.permission.RESTRICTED_VR_ACCESS);
            VrManagerService.this.connectController(fd);
        }

        @Override
        public void disconnectController() throws android.os.RemoteException {
            enforceCallerPermission(Manifest.permission.RESTRICTED_VR_ACCESS);
            VrManagerService.this.disconnectController();
        }

        @Override
        protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
            if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
@@ -1184,20 +1170,4 @@ public class VrManagerService extends SystemService implements EnabledComponentC
            return mVrModeEnabled;
        }
    }

    private void connectController(FileDescriptor fd) throws android.os.RemoteException {
        // TODO(b/36506799): move vr_wm code to VrCore and remove this.
        IVrWindowManager remote =
                IVrWindowManager.Stub.asInterface(
                        ServiceManager.getService(IVrWindowManager.SERVICE_NAME));
        remote.connectController(fd);
    }

    private void disconnectController() throws android.os.RemoteException {
        // TODO(b/36506799): move vr_wm code to VrCore and remove this.
        IVrWindowManager remote =
                IVrWindowManager.Stub.asInterface(
                        ServiceManager.getService(IVrWindowManager.SERVICE_NAME));
        remote.disconnectController();
    }
}