summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2018-03-05 19:39:21 +0000
committerWinson Chung <winsonc@google.com>2018-03-05 19:39:21 +0000
commit1054d4e8f2c690689ab3289826eebdcd00cb59af (patch)
treefe21e0db577a62912dbda25a338646b14e5eadb6 /tests
parentf502e5faecbd460ad3b8258168c5812cbaa34c4e (diff)
downloadandroid_packages_apps_Trebuchet-1054d4e8f2c690689ab3289826eebdcd00cb59af.tar.gz
android_packages_apps_Trebuchet-1054d4e8f2c690689ab3289826eebdcd00cb59af.tar.bz2
android_packages_apps_Trebuchet-1054d4e8f2c690689ab3289826eebdcd00cb59af.zip
Revert "Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets""
This reverts commit f502e5faecbd460ad3b8258168c5812cbaa34c4e. Reason for revert: Reverting post-build Change-Id: I09eb292dbbbe37ffaf3abc477aa2ddb5700093b8
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidManifest-common.xml11
-rw-r--r--tests/res/xml/appwidget_hidden.xml11
-rw-r--r--tests/res/xml/appwidget_with_config.xml1
-rw-r--r--tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java23
4 files changed, 46 insertions, 0 deletions
diff --git a/tests/AndroidManifest-common.xml b/tests/AndroidManifest-common.xml
index 0a2914772..a54268af0 100644
--- a/tests/AndroidManifest-common.xml
+++ b/tests/AndroidManifest-common.xml
@@ -33,6 +33,17 @@
android:resource="@xml/appwidget_no_config" />
</receiver>
+
+ <receiver
+ android:name="com.android.launcher3.testcomponent.AppWdigetHidden"
+ android:label="Hidden widget">
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+ </intent-filter>
+ <meta-data android:name="android.appwidget.provider"
+ android:resource="@xml/appwidget_hidden" />
+ </receiver>
+
<receiver
android:name="com.android.launcher3.testcomponent.AppWidgetWithConfig"
android:label="With Config">
diff --git a/tests/res/xml/appwidget_hidden.xml b/tests/res/xml/appwidget_hidden.xml
new file mode 100644
index 000000000..6f0e0066f
--- /dev/null
+++ b/tests/res/xml/appwidget_hidden.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appwidget-provider
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:minWidth="180dp"
+ android:minHeight="110dp"
+ android:updatePeriodMillis="86400000"
+ android:initialLayout="@layout/test_layout_appwidget_blue"
+ android:resizeMode="horizontal|vertical"
+ android:widgetFeatures="hide_from_picker"
+ android:widgetCategory="home_screen">
+</appwidget-provider> \ No newline at end of file
diff --git a/tests/res/xml/appwidget_with_config.xml b/tests/res/xml/appwidget_with_config.xml
index 3e96c6f2f..840368987 100644
--- a/tests/res/xml/appwidget_with_config.xml
+++ b/tests/res/xml/appwidget_with_config.xml
@@ -7,5 +7,6 @@
android:initialLayout="@layout/test_layout_appwidget_blue"
android:configure="com.android.launcher3.testcomponent.WidgetConfigActivity"
android:resizeMode="horizontal|vertical"
+ android:widgetFeatures="reconfigurable"
android:widgetCategory="home_screen">
</appwidget-provider> \ No newline at end of file
diff --git a/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java b/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java
new file mode 100644
index 000000000..83492bfd2
--- /dev/null
+++ b/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2018 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.android.launcher3.testcomponent;
+
+import android.appwidget.AppWidgetProvider;
+
+/**
+ * A simple app widget without any configuration screen and is hidden in picker.
+ */
+public class AppWidgetHidden extends AppWidgetProvider { }