diff options
149 files changed, 2194 insertions, 135 deletions
diff --git a/apps/SetupCustomizer/Android.mk b/apps/SetupCustomizer/Android.mk deleted file mode 100644 index 9312a36..0000000 --- a/apps/SetupCustomizer/Android.mk +++ /dev/null @@ -1,13 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/priv-app - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := TvSetupCustomizer - -LOCAL_SDK_VERSION := current - -include $(BUILD_PACKAGE) diff --git a/apps/SetupCustomizer/AndroidManifest.xml b/apps/SetupCustomizer/AndroidManifest.xml deleted file mode 100644 index bdd31ff..0000000 --- a/apps/SetupCustomizer/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.google.android.tvsetup.partnercustomizer"> - - <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> - <uses-permission android:name="android.permission.INTERNET" /> - - <application android:label="@string/app_label"> - - <receiver android:name=".PartnerReceiver"> - <intent-filter> - <action android:name="com.google.android.tvsetup.action.PARTNER_CUSTOMIZATION" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - - <intent-filter> - <action android:name="android.intent.action.PACKAGE_ADDED" /> - <action android:name="android.intent.action.PACKAGE_REMOVED" /> - <data android:scheme="package"/> - </intent-filter> - </receiver> - </application> -</manifest> diff --git a/apps/SetupCustomizer/proguard-project.txt b/apps/SetupCustomizer/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/apps/SetupCustomizer/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/apps/SetupCustomizer/res/drawable-xhdpi/welcome_background.png b/apps/SetupCustomizer/res/drawable-xhdpi/welcome_background.png Binary files differdeleted file mode 100644 index 2f2533a..0000000 --- a/apps/SetupCustomizer/res/drawable-xhdpi/welcome_background.png +++ /dev/null diff --git a/apps/SetupCustomizer/res/values-de/strings.xml b/apps/SetupCustomizer/res/values-de/strings.xml deleted file mode 100644 index 2794b47..0000000 --- a/apps/SetupCustomizer/res/values-de/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ -<resources> - <!-- Welcome message --> - <string name="welcome_message">a really really long welcome message, because german</string> -</resources> diff --git a/apps/SetupCustomizer/res/values-en-rCA/strings.xml b/apps/SetupCustomizer/res/values-en-rCA/strings.xml deleted file mode 100644 index 2b19782..0000000 --- a/apps/SetupCustomizer/res/values-en-rCA/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ -<resources> - <!-- Welcome message --> - <string name="welcome_message">welcome_message, eh?</string> -</resources> diff --git a/apps/SetupCustomizer/res/values/bools.xml b/apps/SetupCustomizer/res/values/bools.xml deleted file mode 100644 index 4e19b14..0000000 --- a/apps/SetupCustomizer/res/values/bools.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2012-2014 Google Inc. All Rights Reserved. --> -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - - <!-- Display "SKIP" in network selection screen --> - <bool name="show_skip_network">true</bool> - - <!-- Allow user to skip Google signin at signin setup step --> - <bool name="show_skip_signin">true</bool> - - <!-- Show wifi WPS option at top of list --> - <bool name="show_wps_at_top">true</bool> - - <!-- Prevent users from returning to the pre-setup oem customization hook --> - <bool name="prevent_prehook_replay">true</bool> -</resources> diff --git a/apps/SetupCustomizer/res/values/dimens.xml b/apps/SetupCustomizer/res/values/dimens.xml deleted file mode 100644 index 6907661..0000000 --- a/apps/SetupCustomizer/res/values/dimens.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2012-2014 Google Inc. All Rights Reserved. --> -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - - <!-- Max width for welcome text (default: 536dp) --> - <dimen name="welcome_message_max_width">400dp</dimen> - - <!-- Offset (positive or negative) for the welcome message (default: 0) --> - <dimen name="welcome_message_offset">-100dp</dimen> - -</resources> diff --git a/apps/SetupCustomizer/res/values/strings.xml b/apps/SetupCustomizer/res/values/strings.xml deleted file mode 100644 index f53fb11..0000000 --- a/apps/SetupCustomizer/res/values/strings.xml +++ /dev/null @@ -1,11 +0,0 @@ -<resources> - - <string name="app_label">SetupCustomizer</string> - - <!-- Welcome message --> - <string name="welcome_message">welcome_message</string> - - <!-- Custom wallpaper [DO NOT TRANSLATE] --> - <string name="setup_wallpaper_component" translatable="false">com.android.systemui/com.android.systemui.ImageWallpaper</string> - -</resources> diff --git a/apps/SetupCustomizer/src/com/android/tvsetup/partnercustomizer/PartnerReceiver.java b/apps/SetupCustomizer/src/com/android/tvsetup/partnercustomizer/PartnerReceiver.java deleted file mode 100644 index cf8efd9..0000000 --- a/apps/SetupCustomizer/src/com/android/tvsetup/partnercustomizer/PartnerReceiver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -package com.google.android.tvsetup.partnercustomizer; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -/** - * This class allows the system/setup app to find the partner customization package. - * - * Package must be a system app to be used for partner customization. - */ -public class PartnerReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - } -} diff --git a/apps/LeanbackCustomizer/Android.mk b/apps/tv/LeanbackCustomizer/Android.mk index fb4f41c..fb4f41c 100644 --- a/apps/LeanbackCustomizer/Android.mk +++ b/apps/tv/LeanbackCustomizer/Android.mk diff --git a/apps/LeanbackCustomizer/AndroidManifest.xml b/apps/tv/LeanbackCustomizer/AndroidManifest.xml index e931ca2..e931ca2 100644 --- a/apps/LeanbackCustomizer/AndroidManifest.xml +++ b/apps/tv/LeanbackCustomizer/AndroidManifest.xml diff --git a/apps/LeanbackCustomizer/proguard-project.txt b/apps/tv/LeanbackCustomizer/proguard-project.txt index f2fe155..f2fe155 100644 --- a/apps/LeanbackCustomizer/proguard-project.txt +++ b/apps/tv/LeanbackCustomizer/proguard-project.txt diff --git a/apps/LeanbackCustomizer/res/drawable-hdpi/ic_bundled_tuner_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-hdpi/ic_bundled_tuner_banner.png Binary files differindex 520c6e8..520c6e8 100644 --- a/apps/LeanbackCustomizer/res/drawable-hdpi/ic_bundled_tuner_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-hdpi/ic_bundled_tuner_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-hdpi/ic_launcher.png b/apps/tv/LeanbackCustomizer/res/drawable-hdpi/ic_launcher.png Binary files differindex eb9dfe2..eb9dfe2 100644 --- a/apps/LeanbackCustomizer/res/drawable-hdpi/ic_launcher.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-hdpi/ic_launcher.png diff --git a/apps/LeanbackCustomizer/res/drawable-mdpi/ic_bundled_tuner_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-mdpi/ic_bundled_tuner_banner.png Binary files differindex 785e3fc..785e3fc 100644 --- a/apps/LeanbackCustomizer/res/drawable-mdpi/ic_bundled_tuner_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-mdpi/ic_bundled_tuner_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-mdpi/ic_launcher.png b/apps/tv/LeanbackCustomizer/res/drawable-mdpi/ic_launcher.png Binary files differindex d8e46f3..d8e46f3 100644 --- a/apps/LeanbackCustomizer/res/drawable-mdpi/ic_launcher.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-mdpi/ic_launcher.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/bg_custom.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/bg_custom.png Binary files differindex a14fcc7..a14fcc7 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/bg_custom.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/bg_custom.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_bundled_tuner_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_bundled_tuner_banner.png Binary files differindex d7deb0e..d7deb0e 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_bundled_tuner_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_bundled_tuner_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_launcher.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_launcher.png Binary files differindex e4e79c9..e4e79c9 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_launcher.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_launcher.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_play_movies_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_play_movies_banner.png Binary files differindex 0e25c62..0e25c62 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_play_movies_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_play_movies_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_ted_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_ted_banner.png Binary files differindex dd34536..dd34536 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_ted_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_ted_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_apps.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_apps.png Binary files differindex c0073e3..c0073e3 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_apps.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_apps.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_custom.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_custom.png Binary files differindex ec9ab2b..ec9ab2b 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_custom.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_custom.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_games.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_games.png Binary files differindex d473e4e..d473e4e 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_games.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_games.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_settings.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_settings.png Binary files differindex ed43296..ed43296 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_title_settings.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_title_settings.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_try_play_movies_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_try_play_movies_banner.png Binary files differindex 567d130..567d130 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_try_play_movies_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_try_play_movies_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_try_ted_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_try_ted_banner.png Binary files differindex 6f96f25..6f96f25 100644 --- a/apps/LeanbackCustomizer/res/drawable-xhdpi/ic_try_ted_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xhdpi/ic_try_ted_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xxhdpi/ic_bundled_tuner_banner.png b/apps/tv/LeanbackCustomizer/res/drawable-xxhdpi/ic_bundled_tuner_banner.png Binary files differindex 93f1df6..93f1df6 100644 --- a/apps/LeanbackCustomizer/res/drawable-xxhdpi/ic_bundled_tuner_banner.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xxhdpi/ic_bundled_tuner_banner.png diff --git a/apps/LeanbackCustomizer/res/drawable-xxhdpi/ic_launcher.png b/apps/tv/LeanbackCustomizer/res/drawable-xxhdpi/ic_launcher.png Binary files differindex 53ced36..53ced36 100644 --- a/apps/LeanbackCustomizer/res/drawable-xxhdpi/ic_launcher.png +++ b/apps/tv/LeanbackCustomizer/res/drawable-xxhdpi/ic_launcher.png diff --git a/apps/LeanbackCustomizer/res/values/colors.xml b/apps/tv/LeanbackCustomizer/res/values/colors.xml index 810e40e..810e40e 100644 --- a/apps/LeanbackCustomizer/res/values/colors.xml +++ b/apps/tv/LeanbackCustomizer/res/values/colors.xml diff --git a/apps/LeanbackCustomizer/res/values/config.xml b/apps/tv/LeanbackCustomizer/res/values/config.xml index 868bb1d..868bb1d 100644 --- a/apps/LeanbackCustomizer/res/values/config.xml +++ b/apps/tv/LeanbackCustomizer/res/values/config.xml diff --git a/apps/LeanbackCustomizer/res/values/strings.xml b/apps/tv/LeanbackCustomizer/res/values/strings.xml index c9e9889..c9e9889 100644 --- a/apps/LeanbackCustomizer/res/values/strings.xml +++ b/apps/tv/LeanbackCustomizer/res/values/strings.xml diff --git a/apps/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/PartnerReceiver.java b/apps/tv/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/PartnerReceiver.java index daef196..daef196 100644 --- a/apps/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/PartnerReceiver.java +++ b/apps/tv/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/PartnerReceiver.java diff --git a/apps/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/TestActivity.java b/apps/tv/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/TestActivity.java index 6ae07ef..6ae07ef 100644 --- a/apps/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/TestActivity.java +++ b/apps/tv/LeanbackCustomizer/src/com/google/android/leanbacklauncher/partnercustomizer/TestActivity.java diff --git a/apps/LeanbackWidget/Android.mk b/apps/tv/LeanbackWidget/Android.mk index 7209b52..7209b52 100644 --- a/apps/LeanbackWidget/Android.mk +++ b/apps/tv/LeanbackWidget/Android.mk diff --git a/apps/LeanbackWidget/AndroidManifest.xml b/apps/tv/LeanbackWidget/AndroidManifest.xml index 9474560..9474560 100644 --- a/apps/LeanbackWidget/AndroidManifest.xml +++ b/apps/tv/LeanbackWidget/AndroidManifest.xml diff --git a/apps/LeanbackWidget/proguard-project.txt b/apps/tv/LeanbackWidget/proguard-project.txt index f2fe155..f2fe155 100644 --- a/apps/LeanbackWidget/proguard-project.txt +++ b/apps/tv/LeanbackWidget/proguard-project.txt diff --git a/apps/LeanbackWidget/res/drawable-hdpi/ic_launcher.png b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_launcher.png Binary files differindex eb9dfe2..eb9dfe2 100644 --- a/apps/LeanbackWidget/res/drawable-hdpi/ic_launcher.png +++ b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_launcher.png diff --git a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_ethernet_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_ethernet_not_connected.png Binary files differindex df02569..df02569 100644 --- a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_ethernet_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_ethernet_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_no_internet.png b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_no_internet.png Binary files differindex 1b891de..1b891de 100644 --- a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_no_internet.png +++ b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_no_internet.png diff --git a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_not_connected.png Binary files differindex d6d4a30..d6d4a30 100644 --- a/apps/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-hdpi/ic_widget_wifi_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-mdpi/ic_launcher.png b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_launcher.png Binary files differindex d8e46f3..d8e46f3 100644 --- a/apps/LeanbackWidget/res/drawable-mdpi/ic_launcher.png +++ b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_launcher.png diff --git a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_ethernet_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_ethernet_not_connected.png Binary files differindex ece1478..ece1478 100644 --- a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_ethernet_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_ethernet_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_no_internet.png b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_no_internet.png Binary files differindex 5054b40..5054b40 100644 --- a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_no_internet.png +++ b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_no_internet.png diff --git a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_not_connected.png Binary files differindex ad53107..ad53107 100644 --- a/apps/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-mdpi/ic_widget_wifi_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-xhdpi/ic_launcher.png b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_launcher.png Binary files differindex e4e79c9..e4e79c9 100644 --- a/apps/LeanbackWidget/res/drawable-xhdpi/ic_launcher.png +++ b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_launcher.png diff --git a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_ethernet_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_ethernet_not_connected.png Binary files differindex 5d0bfb9..5d0bfb9 100644 --- a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_ethernet_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_ethernet_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_no_internet.png b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_no_internet.png Binary files differindex 909d020..909d020 100644 --- a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_no_internet.png +++ b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_no_internet.png diff --git a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_not_connected.png Binary files differindex c892b26..c892b26 100644 --- a/apps/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-xhdpi/ic_widget_wifi_not_connected.png diff --git a/apps/LeanbackWidget/res/drawable-xxhdpi/ic_launcher.png b/apps/tv/LeanbackWidget/res/drawable-xxhdpi/ic_launcher.png Binary files differindex 53ced36..53ced36 100644 --- a/apps/LeanbackWidget/res/drawable-xxhdpi/ic_launcher.png +++ b/apps/tv/LeanbackWidget/res/drawable-xxhdpi/ic_launcher.png diff --git a/apps/LeanbackWidget/res/drawable-xxhdpi/ic_widget_ethernet_not_connected.png b/apps/tv/LeanbackWidget/res/drawable-xxhdpi/ic_widget_ethernet_not_connected.png Binary files differindex edb5a69..edb5a69 100644 --- a/apps/LeanbackWidget/res/drawable-xxhdpi/ic_widget_ethernet_not_connected.png +++ b/apps/tv/LeanbackWidget/res/drawable-xxhdpi/ic_widget_ethernet_not_connected.png diff --git a/apps/LeanbackWidget/res/layout/clock_widget.xml b/apps/tv/LeanbackWidget/res/layout/clock_widget.xml index 3ceb63e..3ceb63e 100644 --- a/apps/LeanbackWidget/res/layout/clock_widget.xml +++ b/apps/tv/LeanbackWidget/res/layout/clock_widget.xml diff --git a/apps/LeanbackWidget/res/values/colors.xml b/apps/tv/LeanbackWidget/res/values/colors.xml index bcc3a80..bcc3a80 100644 --- a/apps/LeanbackWidget/res/values/colors.xml +++ b/apps/tv/LeanbackWidget/res/values/colors.xml diff --git a/apps/LeanbackWidget/res/values/config.xml b/apps/tv/LeanbackWidget/res/values/config.xml index 9e4f1ba..9e4f1ba 100644 --- a/apps/LeanbackWidget/res/values/config.xml +++ b/apps/tv/LeanbackWidget/res/values/config.xml diff --git a/apps/LeanbackWidget/res/values/dimens.xml b/apps/tv/LeanbackWidget/res/values/dimens.xml index fe1728f..fe1728f 100644 --- a/apps/LeanbackWidget/res/values/dimens.xml +++ b/apps/tv/LeanbackWidget/res/values/dimens.xml diff --git a/apps/LeanbackWidget/res/values/strings.xml b/apps/tv/LeanbackWidget/res/values/strings.xml index 4f733a4..4f733a4 100644 --- a/apps/LeanbackWidget/res/values/strings.xml +++ b/apps/tv/LeanbackWidget/res/values/strings.xml diff --git a/apps/LeanbackWidget/res/xml/clock_widget_info.xml b/apps/tv/LeanbackWidget/res/xml/clock_widget_info.xml index a877df8..a877df8 100644 --- a/apps/LeanbackWidget/res/xml/clock_widget_info.xml +++ b/apps/tv/LeanbackWidget/res/xml/clock_widget_info.xml diff --git a/apps/LeanbackWidget/src/com/google/android/leanbacklauncher/partnerwidget/ClockWidgetProvider.java b/apps/tv/LeanbackWidget/src/com/google/android/leanbacklauncher/partnerwidget/ClockWidgetProvider.java index 77a2851..77a2851 100644 --- a/apps/LeanbackWidget/src/com/google/android/leanbacklauncher/partnerwidget/ClockWidgetProvider.java +++ b/apps/tv/LeanbackWidget/src/com/google/android/leanbacklauncher/partnerwidget/ClockWidgetProvider.java diff --git a/apps/tv/SetupCustomizationSample/.gitignore b/apps/tv/SetupCustomizationSample/.gitignore new file mode 100644 index 0000000..09b993d --- /dev/null +++ b/apps/tv/SetupCustomizationSample/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/apps/tv/SetupCustomizationSample/app/.gitignore b/apps/tv/SetupCustomizationSample/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/apps/tv/SetupCustomizationSample/app/build.gradle b/apps/tv/SetupCustomizationSample/app/build.gradle new file mode 100644 index 0000000..f4df956 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 26 + defaultConfig { + applicationId "com.google.android.tv.setup.customizationsample" + minSdkVersion 21 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + lintOptions { + abortOnError false + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:leanback-v17:26.1.0' + implementation 'com.android.support:appcompat-v7:26.1.0' +} diff --git a/apps/tv/SetupCustomizationSample/app/proguard-rules.pro b/apps/tv/SetupCustomizationSample/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/apps/tv/SetupCustomizationSample/app/src/main/AndroidManifest.xml b/apps/tv/SetupCustomizationSample/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..274f199 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/AndroidManifest.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.google.android.tv.setup.customizationsample"> + + <uses-feature + android:name="android.hardware.touchscreen" + android:required="false" /> + <uses-feature + android:name="android.software.leanback" + android:required="true" /> + + <uses-permission android:name="com.android.setupwizard.permission.SETUP" /> + <uses-permission android:name="android.permission.REBOOT" /> + + <application + android:label="TV Setup Customization Sample" + android:theme="@style/AppTheme"> + + + <!-- This Receiver marks this app as being eligible to provide resources which influence + the behavior and look of TV Setup. --> + <receiver android:name=".PartnerReceiver"> + <intent-filter> + <action android:name="com.google.android.tvsetup.action.PARTNER_CUSTOMIZATION" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </receiver> + + + <!-- HOOK Activity examples --> + + <activity + android:name=".HookBeginActivity" + android:label="Partner Hook: Begin (Priority 5)" + android:screenOrientation="landscape"> + <intent-filter android:priority="5"> + <action android:name="com.android.setupwizard.action.HOOK_BEGIN" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookBegin2Activity" + android:label="Partner Hook: Begin (Priority 4)" + android:screenOrientation="landscape"> + <intent-filter android:priority="4"> + <action android:name="com.android.setupwizard.action.HOOK_BEGIN" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookPostNetworkActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: Post-Network" + > + <intent-filter> + <action android:name="com.android.setupwizard.action.HOOK_POST_NETWORK" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookPostNetworkFollowupActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: Post-Network Follow-up" + android:exported="true" + > + </activity> + + + <activity + android:name=".HookEndActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: End" + > + <intent-filter> + <action android:name="com.android.setupwizard.action.HOOK_END" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <!-- Implements the delegate-network-to-partner action. --> + <activity + android:name=".NetworkDelegationActivity" + android:screenOrientation="landscape" + android:label="Network Delegation" + > + <intent-filter> + <action android:name="com.android.net.GET_CONNECTED" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + </application> + +</manifest> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java new file mode 100644 index 0000000..a8939d3 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java @@ -0,0 +1,201 @@ +package com.google.android.tv.setup.customizationsample; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.util.LinkedHashMap; + +public abstract class BaseActivity extends Activity { + + private static final String TAG = "SetupCustomization"; + + private ImageView iv0; + private TextView tv0; + private TextView tv1; + private TextView tv2; + + private LinkedHashMap<Integer,Runnable> keyRunnables; + private LinkedHashMap<Integer,String> keyDescriptions; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(null); + setContentView(R.layout.activity_base_layout); + + keyRunnables = new LinkedHashMap<>(); + keyDescriptions = new LinkedHashMap<>(); + + iv0 = findViewById(R.id.image0); + tv0 = findViewById(R.id.tv0); + tv1 = findViewById(R.id.tv1); + tv2 = findViewById(R.id.tv2); + + tv0.setText(getTitle()); + + populateIncomingExtrasView(); + + // tv1 left open for subclasses - see showText1() + // tv2 left open for subclasses - see showText2() + } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if (isFinishing()) { + return super.onKeyUp(keyCode, event); + } + for (int candidateKeyCode : keyRunnables.keySet()) { + if (candidateKeyCode == keyCode) { + return reactToKey(candidateKeyCode); + } + } + return super.onKeyUp(keyCode, event); + } + + protected void log(String message) { + Log.d(TAG, message); + } + + protected void registerKeyHandlerResultCancelledBack() { + Intent intent = new Intent().putExtra(Constants.USER_INITIATED, true); + registerKeyHandler(KeyEvent.KEYCODE_BACK, null, Activity.RESULT_CANCELED, intent); + } + + protected void registerKeyHandlerResultCancelledCrashDpadLeft() { + registerKeyHandler(KeyEvent.KEYCODE_DPAD_LEFT, "as if a crash occurred", Activity.RESULT_CANCELED, null); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum, String[] booleanExtrasToSend) { + final Intent intent = new Intent(); + for (String booleanExtraToSend : booleanExtrasToSend) { + intent.putExtra(booleanExtraToSend, true); + } + registerKeyHandlerResultOk(keyCode, addendum, intent); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum) { + final Intent intent = new Intent(); + registerKeyHandlerResultOk(keyCode, addendum, intent); + } + + protected void registerKeyHandlerResultOkDpadCenterBoring() { + final Intent intent = new Intent(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "complete without doing anything interesting", intent); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum, final Intent intent) { + registerKeyHandler(keyCode, addendum, Activity.RESULT_OK, intent); + } + + protected void showDrawable(int drawableResourceId) { + iv0.setVisibility(View.VISIBLE); + iv0.setImageResource(drawableResourceId); + } + + protected void showText1(String text) { + tv1.setText(text); + } + + protected void showText2(String text) { + tv2.setText(text); + } + + private void registerKeyHandler(int keyCode, String addendum, final int resultCode, final Intent intent) { + StringBuilder message = new StringBuilder(); + message.append("finish() and send " + resultCodeAsString(resultCode)); + if (addendum != null) { + message.append(" - ").append(addendum); + } + if (intent != null) { + Bundle bundle = intent.getExtras(); + if (bundle != null) { + message.append(" ("); + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + message.append(key).append('=').append(value).append(','); + } + message.append(')'); + } + } + keyRunnables.put(keyCode, new Runnable() { + @Override + public void run() { + setResult(resultCode, intent); + finish(); + } + }); + keyDescriptions.put(keyCode, message.toString()); + populateKeyHandlerViews(); + } + + private void populateKeyHandlerViews() { + LinearLayout llLeft = findViewById(R.id.ll_keyHandler1); + llLeft.removeAllViews(); + LinearLayout llRight = findViewById(R.id.ll_keyHandler2); + llRight.removeAllViews(); + for (Integer code : keyRunnables.keySet()) { + String keyStr = KeyEvent.keyCodeToString(code); + if (keyStr.startsWith("KEYCODE_")) { + keyStr = keyStr.substring("KEYCODE_".length()); + } + if (keyStr.startsWith("DPAD_")) { + keyStr = keyStr.substring("DPAD_".length()); + } + keyStr = keyStr + ":"; + TextView tvKey = (TextView) getLayoutInflater().inflate(R.layout.key_item, llLeft, false); + tvKey.setText(keyStr); + tvKey.setTextColor(0xFF00FFFF); + llLeft.addView(tvKey); + + TextView tvVal = (TextView) getLayoutInflater().inflate(R.layout.key_item, llRight, false); + tvVal.setText(keyDescriptions.get(code)); + llRight.addView(tvVal); + } + } + + private void populateIncomingExtrasView() { + LinearLayout llLeft = findViewById(R.id.ll_incomingExtra1); + llLeft.removeAllViews(); + LinearLayout llRight = findViewById(R.id.ll_incomingExtra2); + llRight.removeAllViews(); + Bundle bundle = getIntent().getExtras(); + if (bundle != null) { + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + TextView tvKey = (TextView) getLayoutInflater().inflate(R.layout.key_item, llLeft, false); + tvKey.setText(key); + tvKey.setTextColor(0xFF00FF00); + llLeft.addView(tvKey); + TextView tvVal = (TextView) getLayoutInflater().inflate(R.layout.key_item, llRight, false); + tvVal.setText(value.toString()); + llRight.addView(tvVal); + } + } + } + + private boolean reactToKey(int candidateKeyCode) { + try { + keyRunnables.get(candidateKeyCode).run(); + log(keyDescriptions.get(candidateKeyCode)); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + private static String resultCodeAsString(int resultCode) { + if (resultCode == Activity.RESULT_OK) { + return "RESULT_OK"; + } + if (resultCode == Activity.RESULT_CANCELED) { + return "RESULT_CANCELLED"; + } + return String.valueOf(resultCode); + } +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java new file mode 100644 index 0000000..84e652b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java @@ -0,0 +1,9 @@ +package com.google.android.tv.setup.customizationsample; + +public class Constants { + + public static final String PARTNER_HANDLED_NETWORK = "partner_handled_network"; + public static final String PARTNER_HANDLED_NETWORK_USER_SKIPPED = "user_skipped_network_setup"; + + public static final String USER_INITIATED = "user_initiated"; +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java new file mode 100644 index 0000000..9561638 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java @@ -0,0 +1,23 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_BEGIN Activity that illustrates the partner_handled_network extra. + */ +public class HookBegin2Activity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOkDpadCenterBoring(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "as if the partner handled network setup", new String[] {Constants.PARTNER_HANDLED_NETWORK}); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_UP, "as if the partner handles network setup but the user chose not to set up a network", new String[] {Constants.PARTNER_HANDLED_NETWORK,Constants.PARTNER_HANDLED_NETWORK_USER_SKIPPED}); + } +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java new file mode 100644 index 0000000..dd64d8c --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java @@ -0,0 +1,19 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +/** + * A HOOK_BEGIN Activity that does nothing but allow finish(). + */ +public class HookBeginActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java new file mode 100644 index 0000000..a77b2f9 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java @@ -0,0 +1,20 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +/** + * A HOOK_END Activity that does nothing but allow finish(). + */ +public class HookEndActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java new file mode 100644 index 0000000..3394cfd --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java @@ -0,0 +1,29 @@ +package com.google.android.tv.setup.customizationsample; + +import android.content.Intent; +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_POST_NETWORK Activity which simulates checking for a system upgrade. + */ +public class HookPostNetworkActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Here we pretend that we are checking if an upgrade is available. + // We do not make visible any UI elements; instead we allow Android TV Setup's "Please wait" + // step to show under us while we figure out if an upgrade is available. That way there are + // fewer transitions which is especially useful in case we have nothing important to do. + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "with no follow-up Activity"); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "with a follow-up Activity", new Intent(getApplicationContext(), HookPostNetworkFollowupActivity.class)); + } +} + + diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java new file mode 100644 index 0000000..ee1dc9b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java @@ -0,0 +1,25 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_POST_NETWORK follow-up Activity, which simulates performing a system upgrade. + */ +public class HookPostNetworkFollowupActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.download); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOkDpadCenterBoring(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "simulate an upgrade by doing a reboot (this is a very weak simulation of an upgrade)"); + } +} + + diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java new file mode 100644 index 0000000..0b0c0cd --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java @@ -0,0 +1,24 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A network delegation Activity, which simulates presenting a get-me-connected user interface. + */ +public class NetworkDelegationActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.home_internet); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "as if the user set up a network"); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "as if the user chose to not set up a network", new String[] {Constants.PARTNER_HANDLED_NETWORK_USER_SKIPPED}); + } +} + + diff --git a/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java new file mode 100644 index 0000000..340d270 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java @@ -0,0 +1,17 @@ +package com.google.android.tv.setup.customizationsample; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +/** + * This no-op BroadcastReceiver marks this application as a provider of partner resources for + * Android TV Setup. See AndroidManifest.xml for more details. + */ +public class PartnerReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + // Do nothing. + } +} diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/download.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/download.png Binary files differnew file mode 100644 index 0000000..ab2a1ea --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/download.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/home_internet.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/home_internet.png Binary files differnew file mode 100644 index 0000000..99d86e4 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/home_internet.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hook.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hook.png Binary files differnew file mode 100644 index 0000000..f7c7add --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hook.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hotword_graphic.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hotword_graphic.png Binary files differnew file mode 100644 index 0000000..6e1513b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/hotword_graphic.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_0.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_0.png Binary files differnew file mode 100644 index 0000000..a522985 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_0.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_1.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_1.png Binary files differnew file mode 100644 index 0000000..19c0c75 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/tutorial_image_1.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/welcome_background.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/welcome_background.png Binary files differnew file mode 100644 index 0000000..7dd9c92 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-xhdpi/welcome_background.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png Binary files differnew file mode 100644 index 0000000..a12e02b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png Binary files differnew file mode 100644 index 0000000..912c702 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png Binary files differnew file mode 100644 index 0000000..1a3685f --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/layout/activity_base_layout.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/layout/activity_base_layout.xml new file mode 100644 index 0000000..a66d2a7 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/layout/activity_base_layout.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> + + <ImageView + android:id="@+id/image0" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|top" + android:layout_marginTop="60dp" + android:visibility="gone" + /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_gravity="left|bottom" + > + + <TextView + android:id="@+id/tv2" + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + tools:text="some more test text" + /> + + <TextView + android:id="@+id/tv1" + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + tools:text="some more test text" + /> + + <!-- Key Handlers --> + <TextView + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:text="Key Handlers" + /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="30dp" + > + + <LinearLayout + android:id="@+id/ll_keyHandler1" + android:orientation="vertical" + android:gravity="right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + > + </LinearLayout> + + <LinearLayout + android:id="@+id/ll_keyHandler2" + android:orientation="vertical" + android:layout_gravity="left" + android:gravity="left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="6dp" + > + </LinearLayout> + + </LinearLayout> + + <!-- Incoming Extras --> + <TextView + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:text="Incoming Extras" + /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="30dp" + > + <LinearLayout + android:id="@+id/ll_incomingExtra1" + android:orientation="vertical" + android:gravity="right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + > + </LinearLayout> + <LinearLayout + android:id="@+id/ll_incomingExtra2" + android:orientation="vertical" + android:layout_gravity="left" + android:gravity="left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="6dp" + > + </LinearLayout> + </LinearLayout> + + <TextView + android:id="@+id/tv0" + style="@style/MyTextViewStyleLarge" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:layout_marginBottom="20dp" + tools:text="Some test title text" + /> + + </LinearLayout> + +</FrameLayout> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/layout/key_item.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/layout/key_item.xml new file mode 100644 index 0000000..d694372 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/layout/key_item.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/tv" + style="@style/MyTextViewStyleSmall" + /> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/values-zh/config.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/values-zh/config.xml new file mode 100644 index 0000000..2441911 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/values-zh/config.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <!--<string name="welcome_message">你好</string>--> + + <!--<string name="hotword_description_appendage">Hotwording 很熱!</string>--> + + + <!--<string name="tutorial_title0">恐龍好可怕</string>--> + <!--<string name="tutorial_description0">要小心,否則你可能會被吃掉</string>--> + + <!--<string name="tutorial_title1">這部電影很棒</string>--> + <!--<string name="tutorial_description1">小孩子喜歡恐龍玩具</string>--> + +</resources> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/values/config.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/values/config.xml new file mode 100644 index 0000000..47841f7 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/values/config.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + + <!-- Whether to allow backing into the HOOK_BEGIN activities. --> + <!--<bool name="allow_hook_replay"></bool>--> + + + <!-- Whether to allow background music to play. --> + <!-- <bool name="play_background_music"></bool> --> + + + <!-- Whether to allow background movie to play. --> + <!-- <bool name="play_background_movie"></bool> --> + + + <!-- Whether to allow the welcome (locale picker) to be shown. --> + <!--<bool name="show_welcome"></bool>--> + + + <!-- Whether to show the your-device-has-been-upgraded step in the case of a post-provisioned-upgrade run. --> + <!--<bool name="show_welcome_post_provisioned_upgrade"></bool>--> + + + <!-- Provide a list of locales to show atop the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<string-array name="preferred_locales"><item></item></string-array>--> + + + <!-- Provide a welcome string to display on the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<string name="welcome_message"></string>--> + + + <!-- Provide the android:maxWidth attribute for the welcome string on the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<dimen name="welcome_message_max_width"></dimen>--> + + + <!-- Provide the y offset for the welcome string on the default locale picker. A negative value + means lift the View upward; a positive value means push it downward. + Relevant only if the default locale picker is shown. --> + <!--<dimen name="welcome_message_offset"></dimen>--> + + + <!-- Whether to present the device-to-device bootstrap (QuickSetup) flow. --> + <!--<bool name="show_quicksetup"></bool>--> + + + <!-- Whether to allow the user to skip the default Network step. --> + <!--<bool name="show_skip_network"></bool>--> + + + <!-- Whether to allow the user to skip the Google Account Sign-in step. --> + <!--<bool name="show_skip_signin"></bool>--> + + + <!-- Whether to show the set-device-name step. --> + <!--<bool name="show_set_device_name"></bool>--> + + + <!-- Whether to show the assistant hotword step during Setup. + This is only relevant if the device supports hotwording. --> + <!--<bool name="show_assistant_hotword"></bool>--> + + + <!-- Provide a partner-specific string for the hotword step. + This is only relevant if the hotwording step gets shown. --> + <!--<string name="hotword_description_appendage"></string>--> + + + <!-- Whether the tutorials step should be shown in the case of a post-provisioned-upgrade run. --> + <!--<bool name="show_tutorial_post_provisioned_upgrade"></bool>--> + + + <!-- Tutorial resources + <array name="tutorial_drawables"> + <item>@drawable/tutorial_image_0</item> + <item>@drawable/tutorial_image_1</item> + </array> + + <string-array name="tutorial_titles"> + <item>@string/tutorial_title0</item> + <item>@string/tutorial_title1</item> + </string-array> + + <string-array name="tutorial_descriptions"> + <item>@string/tutorial_description0</item> + <item>@string/tutorial_description1</item> + </string-array> + + <string name="tutorial_title0">Dinosaurs are scary</string> + <string name="tutorial_description0">Do not mess with them, or you might get eaten. Be aware!</string> + + <string name="tutorial_title1">This movie was great</string> + <string name="tutorial_description1">Be sure to purchase lots of merchandise</string> + --> + +</resources> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/values/strings.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..25fe7ea --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ +<resources> + + +</resources> diff --git a/apps/tv/SetupCustomizationSample/app/src/main/res/values/styles.xml b/apps/tv/SetupCustomizationSample/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..4b19c7b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/app/src/main/res/values/styles.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="AppTheme" parent="@style/Theme.Leanback"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowIsTranslucent">true</item> + <item name="android:windowShowWallpaper">false</item> + </style> + + <style name="AppThemeOpaque" parent="@style/Theme.Leanback"> + <item name="android:windowBackground">@android:color/holo_blue_light</item> + </style> + + <style name="MyTextViewStyle"> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">left</item> + <item name="android:textColor">@android:color/white</item> + <item name="android:textSize">12sp</item> + </style> + + <style name="MyTextViewStyleSmall" parent="@style/MyTextViewStyle"> + <item name="android:textSize">10sp</item> + </style> + + <style name="MyTextViewStyleLarge" parent="@style/MyTextViewStyle"> + <item name="android:textSize">24sp</item> + </style> + +</resources> diff --git a/apps/tv/SetupCustomizationSample/build.gradle b/apps/tv/SetupCustomizationSample/build.gradle new file mode 100644 index 0000000..e6b32bc --- /dev/null +++ b/apps/tv/SetupCustomizationSample/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.0.1' + + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/apps/tv/SetupCustomizationSample/gradle.properties b/apps/tv/SetupCustomizationSample/gradle.properties new file mode 100644 index 0000000..aac7c9b --- /dev/null +++ b/apps/tv/SetupCustomizationSample/gradle.properties @@ -0,0 +1,17 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true diff --git a/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.jar b/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 0000000..13372ae --- /dev/null +++ b/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.jar diff --git a/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.properties b/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..e03ba59 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed May 09 12:57:15 PDT 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/apps/tv/SetupCustomizationSample/gradlew b/apps/tv/SetupCustomizationSample/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/apps/tv/SetupCustomizationSample/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/apps/tv/SetupCustomizationSample/settings.gradle b/apps/tv/SetupCustomizationSample/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/apps/tv/SetupCustomizationSample/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/apps/tv/SetupValidation/.gitignore b/apps/tv/SetupValidation/.gitignore new file mode 100644 index 0000000..09b993d --- /dev/null +++ b/apps/tv/SetupValidation/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/apps/tv/SetupValidation/app/.gitignore b/apps/tv/SetupValidation/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/apps/tv/SetupValidation/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/apps/tv/SetupValidation/app/build.gradle b/apps/tv/SetupValidation/app/build.gradle new file mode 100644 index 0000000..f4df956 --- /dev/null +++ b/apps/tv/SetupValidation/app/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 26 + defaultConfig { + applicationId "com.google.android.tv.setup.customizationsample" + minSdkVersion 21 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + lintOptions { + abortOnError false + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:leanback-v17:26.1.0' + implementation 'com.android.support:appcompat-v7:26.1.0' +} diff --git a/apps/tv/SetupValidation/app/proguard-rules.pro b/apps/tv/SetupValidation/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/apps/tv/SetupValidation/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/apps/tv/SetupValidation/app/src/main/AndroidManifest.xml b/apps/tv/SetupValidation/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..43424fe --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/AndroidManifest.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.google.android.tv.setup.customizationsample"> + + <uses-feature + android:name="android.hardware.touchscreen" + android:required="false" /> + <uses-feature + android:name="android.software.leanback" + android:required="true" /> + + <uses-permission android:name="com.android.setupwizard.permission.SETUP" /> + <uses-permission android:name="android.permission.REBOOT" /> + + <application + android:label="TV Setup Customization Sample" + android:theme="@style/AppTheme"> + + + <!-- This Receiver marks this app as being eligible to provide resources which influence + the behavior and look of TV Setup. --> + <receiver android:name=".PartnerReceiver"> + <intent-filter> + <action android:name="com.google.android.tvsetup.action.PARTNER_CUSTOMIZATION" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </receiver> + + + <!-- HOOK Activity examples --> + + <activity + android:name=".HookBeginActivity" + android:label="Partner Hook: Begin (Priority 5)" + android:screenOrientation="landscape"> + <intent-filter android:priority="5"> + <action android:name="com.android.setupwizard.action.HOOK_BEGIN" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookBegin2Activity" + android:label="Partner Hook: Begin (Priority 4)" + android:screenOrientation="landscape"> + <intent-filter android:priority="4"> + <action android:name="com.android.setupwizard.action.HOOK_BEGIN" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookPostNetworkActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: Post-Network" + > + <intent-filter> + <action android:name="com.android.setupwizard.action.HOOK_POST_NETWORK" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookPostNetworkFollowupActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: Post-Network Follow-up" + android:exported="true" + > + </activity> + + + <activity + android:name=".HookEndActivity" + android:screenOrientation="landscape" + android:label="Partner Hook: End" + > + <intent-filter> + <action android:name="com.android.setupwizard.action.HOOK_END" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <!-- Implements the delegate-network-to-partner action. --> + <activity + android:name=".NetworkDelegationActivity" + android:screenOrientation="landscape" + android:label="Network Delegation" + > + <intent-filter> + <action android:name="com.android.net.GET_CONNECTED" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <activity + android:name=".HookPostWelcomeActivity" + android:label="Partner Hook: Post-Welcome" + android:screenOrientation="landscape"> + <intent-filter android:priority="4"> + <action android:name="com.android.setupwizard.action.HOOK_POST_WELCOME" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <!-- A simple opaque Activity --> + <activity + android:name=".OpaqueActivity" + android:screenOrientation="landscape" + android:label="Opaque Activity" + android:exported="true" + android:theme="@style/AppThemeOpaque" + > + </activity> + + + <!-- A simple transparent Activity --> + <activity + android:name=".TransparentActivity" + android:screenOrientation="landscape" + android:label="Transparent Activity" + android:exported="true" + > + </activity> + + + <!-- Implements a pre-Enrollment action (which is normally handled by Katniss). We say + 'pre-Enrollment' because the actual enrollment Activity is a device-specific Activity; the + design calls for the Katniss implementation of this action to redirect to that device- + specific Activity (which we do not attempt here with MockHotwordEnrollmentActivity)--> + <activity + android:name=".MockHotwordEnrollmentActivity" + android:screenOrientation="landscape" + android:label="Mock Hotword Enrollment" + > + <intent-filter> + <action android:name="com.google.android.katniss.action.ATV_SETUP_ENROLL_HOTWORD" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + + <!-- Implements a delegate-to-Katniss action. --> + <activity + android:name=".MockKatnissActivity" + android:screenOrientation="landscape" + android:label="Mock Katniss" + > + <intent-filter> + <action android:name="com.google.android.katniss.action.ATV_SETUP" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + + </application> + +</manifest> diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java new file mode 100644 index 0000000..a8939d3 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/BaseActivity.java @@ -0,0 +1,201 @@ +package com.google.android.tv.setup.customizationsample; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.util.LinkedHashMap; + +public abstract class BaseActivity extends Activity { + + private static final String TAG = "SetupCustomization"; + + private ImageView iv0; + private TextView tv0; + private TextView tv1; + private TextView tv2; + + private LinkedHashMap<Integer,Runnable> keyRunnables; + private LinkedHashMap<Integer,String> keyDescriptions; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(null); + setContentView(R.layout.activity_base_layout); + + keyRunnables = new LinkedHashMap<>(); + keyDescriptions = new LinkedHashMap<>(); + + iv0 = findViewById(R.id.image0); + tv0 = findViewById(R.id.tv0); + tv1 = findViewById(R.id.tv1); + tv2 = findViewById(R.id.tv2); + + tv0.setText(getTitle()); + + populateIncomingExtrasView(); + + // tv1 left open for subclasses - see showText1() + // tv2 left open for subclasses - see showText2() + } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if (isFinishing()) { + return super.onKeyUp(keyCode, event); + } + for (int candidateKeyCode : keyRunnables.keySet()) { + if (candidateKeyCode == keyCode) { + return reactToKey(candidateKeyCode); + } + } + return super.onKeyUp(keyCode, event); + } + + protected void log(String message) { + Log.d(TAG, message); + } + + protected void registerKeyHandlerResultCancelledBack() { + Intent intent = new Intent().putExtra(Constants.USER_INITIATED, true); + registerKeyHandler(KeyEvent.KEYCODE_BACK, null, Activity.RESULT_CANCELED, intent); + } + + protected void registerKeyHandlerResultCancelledCrashDpadLeft() { + registerKeyHandler(KeyEvent.KEYCODE_DPAD_LEFT, "as if a crash occurred", Activity.RESULT_CANCELED, null); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum, String[] booleanExtrasToSend) { + final Intent intent = new Intent(); + for (String booleanExtraToSend : booleanExtrasToSend) { + intent.putExtra(booleanExtraToSend, true); + } + registerKeyHandlerResultOk(keyCode, addendum, intent); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum) { + final Intent intent = new Intent(); + registerKeyHandlerResultOk(keyCode, addendum, intent); + } + + protected void registerKeyHandlerResultOkDpadCenterBoring() { + final Intent intent = new Intent(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "complete without doing anything interesting", intent); + } + + protected void registerKeyHandlerResultOk(int keyCode, String addendum, final Intent intent) { + registerKeyHandler(keyCode, addendum, Activity.RESULT_OK, intent); + } + + protected void showDrawable(int drawableResourceId) { + iv0.setVisibility(View.VISIBLE); + iv0.setImageResource(drawableResourceId); + } + + protected void showText1(String text) { + tv1.setText(text); + } + + protected void showText2(String text) { + tv2.setText(text); + } + + private void registerKeyHandler(int keyCode, String addendum, final int resultCode, final Intent intent) { + StringBuilder message = new StringBuilder(); + message.append("finish() and send " + resultCodeAsString(resultCode)); + if (addendum != null) { + message.append(" - ").append(addendum); + } + if (intent != null) { + Bundle bundle = intent.getExtras(); + if (bundle != null) { + message.append(" ("); + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + message.append(key).append('=').append(value).append(','); + } + message.append(')'); + } + } + keyRunnables.put(keyCode, new Runnable() { + @Override + public void run() { + setResult(resultCode, intent); + finish(); + } + }); + keyDescriptions.put(keyCode, message.toString()); + populateKeyHandlerViews(); + } + + private void populateKeyHandlerViews() { + LinearLayout llLeft = findViewById(R.id.ll_keyHandler1); + llLeft.removeAllViews(); + LinearLayout llRight = findViewById(R.id.ll_keyHandler2); + llRight.removeAllViews(); + for (Integer code : keyRunnables.keySet()) { + String keyStr = KeyEvent.keyCodeToString(code); + if (keyStr.startsWith("KEYCODE_")) { + keyStr = keyStr.substring("KEYCODE_".length()); + } + if (keyStr.startsWith("DPAD_")) { + keyStr = keyStr.substring("DPAD_".length()); + } + keyStr = keyStr + ":"; + TextView tvKey = (TextView) getLayoutInflater().inflate(R.layout.key_item, llLeft, false); + tvKey.setText(keyStr); + tvKey.setTextColor(0xFF00FFFF); + llLeft.addView(tvKey); + + TextView tvVal = (TextView) getLayoutInflater().inflate(R.layout.key_item, llRight, false); + tvVal.setText(keyDescriptions.get(code)); + llRight.addView(tvVal); + } + } + + private void populateIncomingExtrasView() { + LinearLayout llLeft = findViewById(R.id.ll_incomingExtra1); + llLeft.removeAllViews(); + LinearLayout llRight = findViewById(R.id.ll_incomingExtra2); + llRight.removeAllViews(); + Bundle bundle = getIntent().getExtras(); + if (bundle != null) { + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + TextView tvKey = (TextView) getLayoutInflater().inflate(R.layout.key_item, llLeft, false); + tvKey.setText(key); + tvKey.setTextColor(0xFF00FF00); + llLeft.addView(tvKey); + TextView tvVal = (TextView) getLayoutInflater().inflate(R.layout.key_item, llRight, false); + tvVal.setText(value.toString()); + llRight.addView(tvVal); + } + } + } + + private boolean reactToKey(int candidateKeyCode) { + try { + keyRunnables.get(candidateKeyCode).run(); + log(keyDescriptions.get(candidateKeyCode)); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + + private static String resultCodeAsString(int resultCode) { + if (resultCode == Activity.RESULT_OK) { + return "RESULT_OK"; + } + if (resultCode == Activity.RESULT_CANCELED) { + return "RESULT_CANCELLED"; + } + return String.valueOf(resultCode); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java new file mode 100644 index 0000000..84e652b --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/Constants.java @@ -0,0 +1,9 @@ +package com.google.android.tv.setup.customizationsample; + +public class Constants { + + public static final String PARTNER_HANDLED_NETWORK = "partner_handled_network"; + public static final String PARTNER_HANDLED_NETWORK_USER_SKIPPED = "user_skipped_network_setup"; + + public static final String USER_INITIATED = "user_initiated"; +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java new file mode 100644 index 0000000..9561638 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBegin2Activity.java @@ -0,0 +1,23 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_BEGIN Activity that illustrates the partner_handled_network extra. + */ +public class HookBegin2Activity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOkDpadCenterBoring(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "as if the partner handled network setup", new String[] {Constants.PARTNER_HANDLED_NETWORK}); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_UP, "as if the partner handles network setup but the user chose not to set up a network", new String[] {Constants.PARTNER_HANDLED_NETWORK,Constants.PARTNER_HANDLED_NETWORK_USER_SKIPPED}); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java new file mode 100644 index 0000000..dd64d8c --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookBeginActivity.java @@ -0,0 +1,19 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +/** + * A HOOK_BEGIN Activity that does nothing but allow finish(). + */ +public class HookBeginActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java new file mode 100644 index 0000000..a77b2f9 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookEndActivity.java @@ -0,0 +1,20 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +/** + * A HOOK_END Activity that does nothing but allow finish(). + */ +public class HookEndActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java new file mode 100644 index 0000000..3394cfd --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkActivity.java @@ -0,0 +1,29 @@ +package com.google.android.tv.setup.customizationsample; + +import android.content.Intent; +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_POST_NETWORK Activity which simulates checking for a system upgrade. + */ +public class HookPostNetworkActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Here we pretend that we are checking if an upgrade is available. + // We do not make visible any UI elements; instead we allow Android TV Setup's "Please wait" + // step to show under us while we figure out if an upgrade is available. That way there are + // fewer transitions which is especially useful in case we have nothing important to do. + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "with no follow-up Activity"); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "with a follow-up Activity", new Intent(getApplicationContext(), HookPostNetworkFollowupActivity.class)); + } +} + + diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java new file mode 100644 index 0000000..ee1dc9b --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostNetworkFollowupActivity.java @@ -0,0 +1,25 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_POST_NETWORK follow-up Activity, which simulates performing a system upgrade. + */ +public class HookPostNetworkFollowupActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.download); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOkDpadCenterBoring(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "simulate an upgrade by doing a reboot (this is a very weak simulation of an upgrade)"); + } +} + + diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostWelcomeActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostWelcomeActivity.java new file mode 100644 index 0000000..718363e --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/HookPostWelcomeActivity.java @@ -0,0 +1,23 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A HOOK_POST_WELCOME Activity. + */ +public class HookPostWelcomeActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.hook); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOkDpadCenterBoring(); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "as if the partner handled network setup", new String[] {Constants.PARTNER_HANDLED_NETWORK}); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_UP, "as if the partner handles network setup but the user chose not to set up a network", new String[] {Constants.PARTNER_HANDLED_NETWORK,Constants.PARTNER_HANDLED_NETWORK_USER_SKIPPED}); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockHotwordEnrollmentActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockHotwordEnrollmentActivity.java new file mode 100644 index 0000000..58a33fd --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockHotwordEnrollmentActivity.java @@ -0,0 +1,15 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +public class MockHotwordEnrollmentActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.hotword_enrollment); + + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockKatnissActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockKatnissActivity.java new file mode 100644 index 0000000..ffb86e6 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/MockKatnissActivity.java @@ -0,0 +1,15 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +public class MockKatnissActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.mock_katniss); + + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java new file mode 100644 index 0000000..0b0c0cd --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/NetworkDelegationActivity.java @@ -0,0 +1,24 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; +import android.view.KeyEvent; + +/** + * A network delegation Activity, which simulates presenting a get-me-connected user interface. + */ +public class NetworkDelegationActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + showDrawable(R.drawable.home_internet); + + registerKeyHandlerResultCancelledBack(); + registerKeyHandlerResultCancelledCrashDpadLeft(); + + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "as if the user set up a network"); + registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "as if the user chose to not set up a network", new String[] {Constants.PARTNER_HANDLED_NETWORK_USER_SKIPPED}); + } +} + + diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/OpaqueActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/OpaqueActivity.java new file mode 100644 index 0000000..34385da --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/OpaqueActivity.java @@ -0,0 +1,15 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +public class OpaqueActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.opaque_tile); + + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java new file mode 100644 index 0000000..340d270 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/PartnerReceiver.java @@ -0,0 +1,17 @@ +package com.google.android.tv.setup.customizationsample; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +/** + * This no-op BroadcastReceiver marks this application as a provider of partner resources for + * Android TV Setup. See AndroidManifest.xml for more details. + */ +public class PartnerReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + // Do nothing. + } +} diff --git a/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/TransparentActivity.java b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/TransparentActivity.java new file mode 100644 index 0000000..c06a66f --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/customizationsample/TransparentActivity.java @@ -0,0 +1,15 @@ +package com.google.android.tv.setup.customizationsample; + +import android.os.Bundle; + +public class TransparentActivity extends BaseActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + showDrawable(R.drawable.opaque_tile); + + registerKeyHandlerResultOkDpadCenterBoring(); + } +} diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/download.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/download.png Binary files differnew file mode 100644 index 0000000..ab2a1ea --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/download.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/home_internet.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/home_internet.png Binary files differnew file mode 100644 index 0000000..99d86e4 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/home_internet.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hook.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hook.png Binary files differnew file mode 100644 index 0000000..f7c7add --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hook.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_enrollment.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_enrollment.png Binary files differnew file mode 100644 index 0000000..c61f013 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_enrollment.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_graphic.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_graphic.png Binary files differnew file mode 100644 index 0000000..6e1513b --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/hotword_graphic.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/mock_katniss.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/mock_katniss.png Binary files differnew file mode 100644 index 0000000..b83bddf --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/mock_katniss.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/opaque_tile.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/opaque_tile.png Binary files differnew file mode 100644 index 0000000..ffe417c --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/opaque_tile.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_0.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_0.png Binary files differnew file mode 100644 index 0000000..a522985 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_0.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_1.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_1.png Binary files differnew file mode 100644 index 0000000..19c0c75 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/tutorial_image_1.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/welcome_background.png b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/welcome_background.png Binary files differnew file mode 100644 index 0000000..7dd9c92 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-xhdpi/welcome_background.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png Binary files differnew file mode 100644 index 0000000..a12e02b --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/hotword_graphic.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png Binary files differnew file mode 100644 index 0000000..912c702 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_0.png diff --git a/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png Binary files differnew file mode 100644 index 0000000..1a3685f --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/drawable-zh-xhdpi/tutorial_image_1.png diff --git a/apps/tv/SetupValidation/app/src/main/res/layout/activity_base_layout.xml b/apps/tv/SetupValidation/app/src/main/res/layout/activity_base_layout.xml new file mode 100644 index 0000000..a66d2a7 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/layout/activity_base_layout.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> + + <ImageView + android:id="@+id/image0" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|top" + android:layout_marginTop="60dp" + android:visibility="gone" + /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_gravity="left|bottom" + > + + <TextView + android:id="@+id/tv2" + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + tools:text="some more test text" + /> + + <TextView + android:id="@+id/tv1" + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + tools:text="some more test text" + /> + + <!-- Key Handlers --> + <TextView + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:text="Key Handlers" + /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="30dp" + > + + <LinearLayout + android:id="@+id/ll_keyHandler1" + android:orientation="vertical" + android:gravity="right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + > + </LinearLayout> + + <LinearLayout + android:id="@+id/ll_keyHandler2" + android:orientation="vertical" + android:layout_gravity="left" + android:gravity="left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="6dp" + > + </LinearLayout> + + </LinearLayout> + + <!-- Incoming Extras --> + <TextView + style="@style/MyTextViewStyle" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:text="Incoming Extras" + /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="30dp" + > + <LinearLayout + android:id="@+id/ll_incomingExtra1" + android:orientation="vertical" + android:gravity="right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + > + </LinearLayout> + <LinearLayout + android:id="@+id/ll_incomingExtra2" + android:orientation="vertical" + android:layout_gravity="left" + android:gravity="left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="6dp" + > + </LinearLayout> + </LinearLayout> + + <TextView + android:id="@+id/tv0" + style="@style/MyTextViewStyleLarge" + android:layout_marginTop="20dp" + android:layout_marginLeft="20dp" + android:layout_marginBottom="20dp" + tools:text="Some test title text" + /> + + </LinearLayout> + +</FrameLayout> diff --git a/apps/tv/SetupValidation/app/src/main/res/layout/key_item.xml b/apps/tv/SetupValidation/app/src/main/res/layout/key_item.xml new file mode 100644 index 0000000..d694372 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/layout/key_item.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/tv" + style="@style/MyTextViewStyleSmall" + /> diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching.mp4 Binary files differnew file mode 100644 index 0000000..07a217e --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching_already_bonded.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching_already_bonded.mp4 Binary files differnew file mode 100644 index 0000000..9150f5d --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_01_searching_already_bonded.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_02_tran_01.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_02_tran_01.mp4 Binary files differnew file mode 100644 index 0000000..80a550a --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_02_tran_01.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_03_instruction.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_03_instruction.mp4 Binary files differnew file mode 100644 index 0000000..40d367d --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_03_instruction.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_04_tran_02.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_04_tran_02.mp4 Binary files differnew file mode 100644 index 0000000..2915d80 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_04_tran_02.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_05_connecting.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_05_connecting.mp4 Binary files differnew file mode 100644 index 0000000..293b8b8 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_05_connecting.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_06_success.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_06_success.mp4 Binary files differnew file mode 100644 index 0000000..d6a0bc7 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_06_success.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/btpair_07_error.mp4 b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_07_error.mp4 Binary files differnew file mode 100644 index 0000000..5afd580 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/btpair_07_error.mp4 diff --git a/apps/tv/SetupValidation/app/src/main/res/raw/remote_pairing.xml b/apps/tv/SetupValidation/app/src/main/res/raw/remote_pairing.xml new file mode 100644 index 0000000..6a38cec --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/raw/remote_pairing.xml @@ -0,0 +1,30 @@ +<remote-pairing type="video"> + <prepaired-searching> + <item name="btpair_01_searching" count="0" /> + </prepaired-searching> + <prepaired-await-select> + <item name="btpair_01_searching_already_bonded" count="0" /> + </prepaired-await-select> + <initial-scan> + <item name="btpair_01_searching" count="3" /> + <item name="btpair_02_tran_01" count="1" /> + <item name="btpair_03_instruction" count="0" /> + </initial-scan> + <prepaired-initial-scan> + <item name="btpair_02_tran_01" count="1" /> + <item name="btpair_03_instruction" count="0" /> + </prepaired-initial-scan> + <rescan> + <item name="btpair_03_instruction" count="0" /> + </rescan> + <bond> + <item name="btpair_04_tran_02" count="1" /> + <item name="btpair_05_connecting" count="0" /> + </bond> + <success> + <item name="btpair_06_success" count="1" /> + </success> + <error> + <item name="btpair_07_error" count="1" /> + </error> +</remote-pairing> diff --git a/apps/tv/SetupValidation/app/src/main/res/values-zh/config.xml b/apps/tv/SetupValidation/app/src/main/res/values-zh/config.xml new file mode 100644 index 0000000..2441911 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/values-zh/config.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <!--<string name="welcome_message">你好</string>--> + + <!--<string name="hotword_description_appendage">Hotwording 很熱!</string>--> + + + <!--<string name="tutorial_title0">恐龍好可怕</string>--> + <!--<string name="tutorial_description0">要小心,否則你可能會被吃掉</string>--> + + <!--<string name="tutorial_title1">這部電影很棒</string>--> + <!--<string name="tutorial_description1">小孩子喜歡恐龍玩具</string>--> + +</resources> diff --git a/apps/tv/SetupValidation/app/src/main/res/values/config.xml b/apps/tv/SetupValidation/app/src/main/res/values/config.xml new file mode 100644 index 0000000..47841f7 --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/values/config.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + + <!-- Whether to allow backing into the HOOK_BEGIN activities. --> + <!--<bool name="allow_hook_replay"></bool>--> + + + <!-- Whether to allow background music to play. --> + <!-- <bool name="play_background_music"></bool> --> + + + <!-- Whether to allow background movie to play. --> + <!-- <bool name="play_background_movie"></bool> --> + + + <!-- Whether to allow the welcome (locale picker) to be shown. --> + <!--<bool name="show_welcome"></bool>--> + + + <!-- Whether to show the your-device-has-been-upgraded step in the case of a post-provisioned-upgrade run. --> + <!--<bool name="show_welcome_post_provisioned_upgrade"></bool>--> + + + <!-- Provide a list of locales to show atop the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<string-array name="preferred_locales"><item></item></string-array>--> + + + <!-- Provide a welcome string to display on the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<string name="welcome_message"></string>--> + + + <!-- Provide the android:maxWidth attribute for the welcome string on the default locale picker. + Relevant only if the default locale picker is shown. --> + <!--<dimen name="welcome_message_max_width"></dimen>--> + + + <!-- Provide the y offset for the welcome string on the default locale picker. A negative value + means lift the View upward; a positive value means push it downward. + Relevant only if the default locale picker is shown. --> + <!--<dimen name="welcome_message_offset"></dimen>--> + + + <!-- Whether to present the device-to-device bootstrap (QuickSetup) flow. --> + <!--<bool name="show_quicksetup"></bool>--> + + + <!-- Whether to allow the user to skip the default Network step. --> + <!--<bool name="show_skip_network"></bool>--> + + + <!-- Whether to allow the user to skip the Google Account Sign-in step. --> + <!--<bool name="show_skip_signin"></bool>--> + + + <!-- Whether to show the set-device-name step. --> + <!--<bool name="show_set_device_name"></bool>--> + + + <!-- Whether to show the assistant hotword step during Setup. + This is only relevant if the device supports hotwording. --> + <!--<bool name="show_assistant_hotword"></bool>--> + + + <!-- Provide a partner-specific string for the hotword step. + This is only relevant if the hotwording step gets shown. --> + <!--<string name="hotword_description_appendage"></string>--> + + + <!-- Whether the tutorials step should be shown in the case of a post-provisioned-upgrade run. --> + <!--<bool name="show_tutorial_post_provisioned_upgrade"></bool>--> + + + <!-- Tutorial resources + <array name="tutorial_drawables"> + <item>@drawable/tutorial_image_0</item> + <item>@drawable/tutorial_image_1</item> + </array> + + <string-array name="tutorial_titles"> + <item>@string/tutorial_title0</item> + <item>@string/tutorial_title1</item> + </string-array> + + <string-array name="tutorial_descriptions"> + <item>@string/tutorial_description0</item> + <item>@string/tutorial_description1</item> + </string-array> + + <string name="tutorial_title0">Dinosaurs are scary</string> + <string name="tutorial_description0">Do not mess with them, or you might get eaten. Be aware!</string> + + <string name="tutorial_title1">This movie was great</string> + <string name="tutorial_description1">Be sure to purchase lots of merchandise</string> + --> + +</resources> diff --git a/apps/tv/SetupValidation/app/src/main/res/values/strings.xml b/apps/tv/SetupValidation/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..25fe7ea --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ +<resources> + + +</resources> diff --git a/apps/tv/SetupValidation/app/src/main/res/values/styles.xml b/apps/tv/SetupValidation/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..4b19c7b --- /dev/null +++ b/apps/tv/SetupValidation/app/src/main/res/values/styles.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="AppTheme" parent="@style/Theme.Leanback"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowIsTranslucent">true</item> + <item name="android:windowShowWallpaper">false</item> + </style> + + <style name="AppThemeOpaque" parent="@style/Theme.Leanback"> + <item name="android:windowBackground">@android:color/holo_blue_light</item> + </style> + + <style name="MyTextViewStyle"> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">left</item> + <item name="android:textColor">@android:color/white</item> + <item name="android:textSize">12sp</item> + </style> + + <style name="MyTextViewStyleSmall" parent="@style/MyTextViewStyle"> + <item name="android:textSize">10sp</item> + </style> + + <style name="MyTextViewStyleLarge" parent="@style/MyTextViewStyle"> + <item name="android:textSize">24sp</item> + </style> + +</resources> diff --git a/apps/tv/SetupValidation/build.gradle b/apps/tv/SetupValidation/build.gradle new file mode 100644 index 0000000..e6b32bc --- /dev/null +++ b/apps/tv/SetupValidation/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.0.1' + + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/apps/tv/SetupValidation/gradle.properties b/apps/tv/SetupValidation/gradle.properties new file mode 100644 index 0000000..aac7c9b --- /dev/null +++ b/apps/tv/SetupValidation/gradle.properties @@ -0,0 +1,17 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true diff --git a/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.jar b/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 0000000..13372ae --- /dev/null +++ b/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.jar diff --git a/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.properties b/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..e03ba59 --- /dev/null +++ b/apps/tv/SetupValidation/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed May 09 12:57:15 PDT 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/apps/tv/SetupValidation/gradlew b/apps/tv/SetupValidation/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/apps/tv/SetupValidation/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/apps/tv/SetupValidation/settings.gradle b/apps/tv/SetupValidation/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/apps/tv/SetupValidation/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/overlays/location/frameworks/base/core/res/res/values/config.xml b/overlays/location/frameworks/base/core/res/res/values/config.xml index 7d93c43..b9d0dd5 100644 --- a/overlays/location/frameworks/base/core/res/res/values/config.xml +++ b/overlays/location/frameworks/base/core/res/res/values/config.xml @@ -32,4 +32,9 @@ <item>com.google.android.gms</item> <item>com.android.location.fused</item> </string-array> + + <!-- Sets the package name for location extra packages --> + <string-array name="config_locationExtraPackageNames" translatable="false"> + <item>com.google.android.gms.location.history</item> + </string-array> </resources> |