summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pat Plunkett <patplunkett@google.com> 2018-08-09 09:44:13 -0700
committer Patrick Plunkett <patplunkett@google.com> 2018-08-14 23:29:54 +0000
commit741a690bebe870a7c2bbb5a51871fc19317cfa9b (patch)
treeacfefe8d619fc544d1744dd4107f2d2bc5e6daec
parente69a4919feb8e5327995115ecaf5176848303e33 (diff)
Remove libdvr platform library
In order to decrease boot class path pollution, let's move the VR specific DVR native libraries into a public OEM library, which can be directly loaded by 3P apps instead of needing to be loaded through frameworks. Bug: 111911841 Test: "lunch taimen_xr-userdebug; m -j64", side-load updated VrCore: no regressions in booting directly to VR. Change-Id: I1d40bcbafef0d54b3bf3a8ff574e77ae394435e9
-rw-r--r--vr/Android.bp41
-rw-r--r--vr/com.google.vr.platform.xml20
-rw-r--r--vr/dvr_library_loader.cpp25
-rw-r--r--vr/java/com/google/vr/platform/DeviceInfo.java21
-rw-r--r--vr/java/com/google/vr/platform/Dvr.java25
5 files changed, 0 insertions, 132 deletions
diff --git a/vr/Android.bp b/vr/Android.bp
deleted file mode 100644
index 775ec968f59d..000000000000
--- a/vr/Android.bp
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Library to perform dlopen on the actual shared library.
-cc_library_shared {
- name: "libdvr_loader",
- owner: "google",
- srcs: ["dvr_library_loader.cpp"],
- cflags: [
- "-Wall",
- "-Werror",
- ],
-}
-
-// Java platform library for vr stuff.
-java_library {
- name: "com.google.vr.platform",
- installable: true,
- owner: "google",
- required: [
- "libdvr_loader",
- "libdvr",
- ],
- srcs: ["java/**/*.java"],
-}
-
-prebuilt_etc_xml {
- name: "com.google.vr.platform.xml",
- src: "com.google.vr.platform.xml",
-}
diff --git a/vr/com.google.vr.platform.xml b/vr/com.google.vr.platform.xml
deleted file mode 100644
index 952b4763b123..000000000000
--- a/vr/com.google.vr.platform.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<permissions>
- <library name="com.google.vr.platform"
- file="/system/framework/com.google.vr.platform.jar" />
-</permissions>
diff --git a/vr/dvr_library_loader.cpp b/vr/dvr_library_loader.cpp
deleted file mode 100644
index 0b4298a100a9..000000000000
--- a/vr/dvr_library_loader.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <dlfcn.h>
-#include <jni.h>
-
-#include <string>
-
-extern "C" {
-
-JNIEXPORT jlong JNICALL
-Java_com_google_vr_platform_Dvr_nativeLoadLibrary(
- JNIEnv* env, jclass, jstring java_library) {
- if (!java_library)
- return 0;
-
- // Convert the Java String object to a C++ null-terminated string.
- const char* data = env->GetStringUTFChars(java_library, NULL);
- size_t size = env->GetStringUTFLength(java_library);
- std::string library(data, size);
- env->ReleaseStringUTFChars(java_library, data);
-
- // Return the handle to the requested library.
- return reinterpret_cast<jlong>(
- dlopen(library.c_str(), RTLD_NOW | RTLD_LOCAL));
-}
-
-} // extern "C"
diff --git a/vr/java/com/google/vr/platform/DeviceInfo.java b/vr/java/com/google/vr/platform/DeviceInfo.java
deleted file mode 100644
index 6a4617d4624d..000000000000
--- a/vr/java/com/google/vr/platform/DeviceInfo.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.google.vr.platform;
-
-import android.annotation.UnsupportedAppUsage;
-import android.os.SystemProperties;
-
-/**
- * Class to get information about the vr device.
- * @hide
- */
-public class DeviceInfo {
-
- private static final String VR_MODE_BOOT = "ro.boot.vr";
-
- /**
- * Returns true if this device boots directly in VR mode.
- */
- @UnsupportedAppUsage
- public static boolean getVrBoot() {
- return SystemProperties.getBoolean(VR_MODE_BOOT, false);
- }
-}
diff --git a/vr/java/com/google/vr/platform/Dvr.java b/vr/java/com/google/vr/platform/Dvr.java
deleted file mode 100644
index 41dcd8741ffb..000000000000
--- a/vr/java/com/google/vr/platform/Dvr.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.google.vr.platform;
-
-import android.annotation.UnsupportedAppUsage;
-
-/**
- * Class to load the dvr api.
- * @hide
- */
-public class Dvr {
- /**
- * Opens a shared library containing the dvr api and returns the handle to it.
- *
- * @return A Long object describing the handle returned by dlopen.
- */
- @UnsupportedAppUsage
- public static Long loadLibrary() {
- // Load a thin JNI library that runs dlopen on request.
- System.loadLibrary("dvr_loader");
-
- // Performs dlopen on the library and returns the handle.
- return nativeLoadLibrary("libdvr.so");
- }
-
- private static native long nativeLoadLibrary(String library);
-}