summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Yoshida <gyoshida@google.com>2019-08-28 16:08:34 -0700
committerGrant Yoshida <gyoshida@google.com>2019-09-03 22:52:04 +0000
commitf52e4322f85cdf725686bc6a54219968cf8fab4b (patch)
tree40fe50525ddf17e5fb0ae7514d2e48539093d24f
parent9f4af42319b1854f001a89f613abca83a1d7952f (diff)
downloaddevice_google_vrservices-f52e4322f85cdf725686bc6a54219968cf8fab4b.tar.gz
device_google_vrservices-f52e4322f85cdf725686bc6a54219968cf8fab4b.tar.bz2
device_google_vrservices-f52e4322f85cdf725686bc6a54219968cf8fab4b.zip
Add a custom overlay for SetupWizardOverlay, SetupWizardOverlayXr.
This fixes a hang when the setup wizard checks for OTA updates. For now, all the overlay does is disable the OTA update step. Bug: 137600556 Test: Ran SetupWizardOverlay with GSI XR. Change-Id: I1b268388d6fb67840eac98e5f8ce543d09f74a31
-rw-r--r--xr/packages/overlays/SetupWizardOverlayXr/Android.mk31
-rw-r--r--xr/packages/overlays/SetupWizardOverlayXr/AndroidManifest.xml26
-rw-r--r--xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script.xml62
-rw-r--r--xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script_connect_and_update_flow.xml61
-rw-r--r--xr/products/experimental_google_xr.mk1
5 files changed, 181 insertions, 0 deletions
diff --git a/xr/packages/overlays/SetupWizardOverlayXr/Android.mk b/xr/packages/overlays/SetupWizardOverlayXr/Android.mk
new file mode 100644
index 0000000..4c84e18
--- /dev/null
+++ b/xr/packages/overlays/SetupWizardOverlayXr/Android.mk
@@ -0,0 +1,31 @@
+#
+# Copyright 2019, 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.
+#
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_CERTIFICATE := platform
+LOCAL_OVERRIDES_PACKAGES := SetupWizardOverlay
+
+LOCAL_PRODUCT_MODULE := true
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_PACKAGE_NAME := SetupWizardOverlayXr
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_RRO_PACKAGE)
diff --git a/xr/packages/overlays/SetupWizardOverlayXr/AndroidManifest.xml b/xr/packages/overlays/SetupWizardOverlayXr/AndroidManifest.xml
new file mode 100644
index 0000000..fa7b0ba
--- /dev/null
+++ b/xr/packages/overlays/SetupWizardOverlayXr/AndroidManifest.xml
@@ -0,0 +1,26 @@
+<!--
+/**
+ * Copyright (c) 2019, 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.
+ */
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.google.android.apps.vr.setupwizard.overlay"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="com.google.android.apps.vr.setupwizard"
+ android:targetName="SetupWizardOverlayXr"
+ android:isStatic="true"
+ android:priority="1"/>
+</manifest>
diff --git a/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script.xml b/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script.xml
new file mode 100644
index 0000000..5ec8fa0
--- /dev/null
+++ b/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- This file is a modified version of
+ "google3/java/com/google/android/apps/vr/setupwizard/res/raw/wizard_script.xml"
+ that is customized for GSI XR.
+-->
+<WizardScript xmlns:wizard="http://schemas.android.com/apk/res/com.google.android.setupwizard"
+ wizard:version="2">
+
+ <!-- Preliminary setup for OEMs -->
+ <WizardAction
+ id="oem_pre_setup"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_PRE_SETUP;end">
+ <result wizard:action="wait_for_unlock"/>
+ </WizardAction>
+
+ <!-- This step waits for the device to be unlocked from a decryption point of view. Even if we
+ don't support encryption the device might take a little bit of time to get out of direct boot
+ mode. This step waits until direct boot is no longer needed. -->
+ <WizardAction id="wait_for_unlock"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.CHECK_USER_UNLOCK;end">
+ </WizardAction>
+
+ <!-- Controller Turn-on screen. -->
+ <WizardAction id="controller"
+ wizard:uri="intent:#Intent;action=com.google.android.apps.vr.setupwizard.CONTROLLER_TURN_ON;end">
+ </WizardAction>
+
+ <!-- Welcome screen with language selection [RECOMMENDED, CUSTOMIZABLE] -->
+ <WizardAction id="welcome"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.WELCOME;end">
+ </WizardAction>
+
+ <!-- Network selection and packages update [REQUIRED, CUSTOMIZABLE] -->
+ <WizardAction id="connect_and_update"
+ wizard:script="android.resource://com.google.android.apps.vr.setupwizard/raw/wizard_script_connect_and_update_flow">
+ <!-- AIO setup requires network connection. If no network, stay on the same page -->
+ <result wizard:name="no_connection"
+ wizard:resultCode="1"
+ wizard:action="oem_post_setup" />
+ </WizardAction>
+
+ <!-- Set up as a new device [REQUIRED, CUSTOMIZABLE] -->
+ <WizardAction id="setup_as_new_flow"
+ wizard:script="android.resource://com.google.android.apps.vr.setupwizard/raw/wizard_script_setup_as_new_flow">
+ <result wizard:action="oem_post_setup" />
+ </WizardAction>
+
+ <!-- Set up as zero touch enabled device -->
+ <WizardAction id="zero_touch"
+ wizard:script="android.resource://com.google.android.apps.vr.setupwizard/raw/wizard_script_zero_touch_flow">
+ <result wizard:name="dpm_user_complete" wizard:resultCode="111"/>
+ </WizardAction>
+
+ <!-- OEM completion [CUSTOMIZABLE] -->
+ <WizardAction id="oem_post_setup"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_POST_SETUP;end" />
+
+ <!-- Leave Setup Wizard [REQUIRED] -->
+ <WizardAction id="exit"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.EXIT;end" />
+</WizardScript>
diff --git a/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script_connect_and_update_flow.xml b/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script_connect_and_update_flow.xml
new file mode 100644
index 0000000..5990ba7
--- /dev/null
+++ b/xr/packages/overlays/SetupWizardOverlayXr/res/raw/wizard_script_connect_and_update_flow.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is a modified version of
+ "google3/java/com/google/android/apps/vr/setupwizard/res/raw/wizard_script_connect_and_update_flow.xml"
+ that is customized for GSI XR.
+
+ Current changes:
+ * The OTA update is skipped, because currently it hangs: b/137600556
+-->
+
+<WizardScript xmlns:wizard="http://schemas.android.com/apk/res/com.google.android.setupwizard"
+ wizard:firstAction="network_settings">
+
+ <!-- Network selection, Users must be given the opportunity to set up an internet connection,
+ using the given screens or a custom flow. -->
+ <WizardAction id="network_settings"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.NETWORK_SETTINGS;end">
+ <result wizard:name="see_all_wifi"
+ wizard:resultCode="102"
+ wizard:action="wifi_settings" />
+ <result wizard:action="captive_portal" />
+ </WizardAction>
+
+ <!-- Wi-Fi setup -->
+ <WizardAction id="wifi_settings"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.WIFI_SETTINGS;end">
+ <result wizard:action="captive_portal" />
+ </WizardAction>
+
+ <!-- Resolve captive portal access, and wait for check-in [REQUIRED] -->
+ <WizardAction id="captive_portal"
+ wizard:uri="intent:#Intent;action=com.android.setupwizard.CAPTIVE_PORTAL;end">
+ <result wizard:action="gms_checkin" />
+ </WizardAction>
+
+ <WizardAction id="gms_checkin"
+ wizard:uri="intent:#Intent;action=com.google.android.setupwizard.GMS_CHECKIN;end">
+ <result wizard:action="oem_post_setup" />
+ </WizardAction>
+
+ <!-- Update system packages [REQUIRED] -->
+ <WizardAction id="ota_update"
+ wizard:uri="intent:#Intent;action=com.google.android.setupwizard.OTA_UPDATE;end">
+ <result wizard:name="skip"
+ wizard:resultCode="1"
+ wizard:action="early_update" />
+ <result wizard:action="system_update" />
+ </WizardAction>
+
+ <!-- System update should cause a reboot, but if it returns unexpectedly, continue on to
+ early update -->
+ <WizardAction id="system_update"
+ wizard:uri="intent:#Intent;action=android.settings.SYSTEM_UPDATE_SETTINGS;end">
+ <result wizard:action="early_update" />
+ </WizardAction>
+
+ <!-- Update other important packages [REQUIRED] -->
+ <WizardAction id="early_update"
+ wizard:uri="intent:#Intent;action=com.google.android.setupwizard.EARLY_UPDATE;end" />
+ <result wizard:action="zero_touch" />
+</WizardScript>
diff --git a/xr/products/experimental_google_xr.mk b/xr/products/experimental_google_xr.mk
index b04e997..9070be1 100644
--- a/xr/products/experimental_google_xr.mk
+++ b/xr/products/experimental_google_xr.mk
@@ -41,6 +41,7 @@ PRODUCT_COPY_FILES += \
# XR/VR prebuilt packages
PRODUCT_PACKAGES += \
SetupWizardOverlay \
+ SetupWizardOverlayXr \
VrHome \
VrInputMethodIme \
VrHeadsetPowerPolicy \