diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-10-07 12:14:45 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2014-10-07 12:14:45 -0700 |
commit | d00bb5edcfc8ee5c2026f66785b703b388314b22 (patch) | |
tree | 8eca016216872e5aaf34f33e690b83ca96d619aa /tests/SharedLibrary | |
parent | a80aba70728c2843df94474dbd7829dadb77855f (diff) |
Load shared library dependencies for AppWidgets
PackageManager and AppWidgetHostServiceImpl should
be loading the resources of any shared libraries being
used by the app, as they have references in their Widgets
or application icons/labels, etc.
Bug:17668152
Change-Id: I359662334edb125d7570089916727df4eeba02bb
Diffstat (limited to 'tests/SharedLibrary')
5 files changed, 79 insertions, 0 deletions
diff --git a/tests/SharedLibrary/client/AndroidManifest.xml b/tests/SharedLibrary/client/AndroidManifest.xml index a39c7540ceff..d1167fa7322f 100644 --- a/tests/SharedLibrary/client/AndroidManifest.xml +++ b/tests/SharedLibrary/client/AndroidManifest.xml @@ -25,5 +25,13 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> + + <receiver android:name="DependentAppwidgetProvider"> + <intent-filter> + <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> + </intent-filter> + <meta-data android:name="android.appwidget.provider" + android:resource="@xml/dependent_appwidget_info" /> + </receiver> </application> </manifest> diff --git a/tests/SharedLibrary/client/res/layout/dependent_appwidget.xml b/tests/SharedLibrary/client/res/layout/dependent_appwidget.xml new file mode 100644 index 000000000000..13beafac9a02 --- /dev/null +++ b/tests/SharedLibrary/client/res/layout/dependent_appwidget.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <TextView android:id="@+id/label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@com.google.android.test.shared_library:string/shared_string" + style="@com.google.android.test.shared_library:style/CodeFont"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@com.google.android.test.shared_library:drawable/size_48x48"/> +</LinearLayout> diff --git a/tests/SharedLibrary/client/res/xml/dependent_appwidget_info.xml b/tests/SharedLibrary/client/res/xml/dependent_appwidget_info.xml new file mode 100644 index 000000000000..452e01008e99 --- /dev/null +++ b/tests/SharedLibrary/client/res/xml/dependent_appwidget_info.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 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. +--> + +<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" + android:minWidth="40dp" + android:minHeight="40dp" + android:updatePeriodMillis="0" + android:initialLayout="@layout/dependent_appwidget" + android:resizeMode="horizontal|vertical" /> diff --git a/tests/SharedLibrary/client/src/com/google/android/test/lib_client/DependentAppwidgetProvider.java b/tests/SharedLibrary/client/src/com/google/android/test/lib_client/DependentAppwidgetProvider.java new file mode 100644 index 000000000000..4e9b26b13d73 --- /dev/null +++ b/tests/SharedLibrary/client/src/com/google/android/test/lib_client/DependentAppwidgetProvider.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2013 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.test.lib_client; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class DependentAppwidgetProvider extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + + } +} diff --git a/tests/SharedLibrary/lib/res/values/public.xml b/tests/SharedLibrary/lib/res/values/public.xml index 37b1ec9da8ca..23d307e03a2d 100644 --- a/tests/SharedLibrary/lib/res/values/public.xml +++ b/tests/SharedLibrary/lib/res/values/public.xml @@ -13,5 +13,7 @@ <public type="attr" name="zip" id="0x00010005" /> <public type="attr" name="country" id="0x00010006" /> + <public type="drawable" name="size_48x48" id="0x00030000" /> + <public type="array" name="animals" id="0x02050000" /> </resources> |