diff options
Diffstat (limited to 'tests/gadgets/GadgetProviderTest')
6 files changed, 0 insertions, 140 deletions
diff --git a/tests/gadgets/GadgetProviderTest/Android.mk b/tests/gadgets/GadgetProviderTest/Android.mk deleted file mode 100644 index b9bfcdb..0000000 --- a/tests/gadgets/GadgetProviderTest/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := user - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_PACKAGE_NAME := GadgetProvider -LOCAL_CERTIFICATE := platform - -include $(BUILD_PACKAGE) diff --git a/tests/gadgets/GadgetProviderTest/AndroidManifest.xml b/tests/gadgets/GadgetProviderTest/AndroidManifest.xml deleted file mode 100644 index 47a7a2e..0000000 --- a/tests/gadgets/GadgetProviderTest/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,0 @@ -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.tests.gadgetprovider"> - <uses-permission android:name="android.permission.VIBRATE" /> - - <application> - <receiver android:name="TestGadgetProvider"> - <intent-filter> - <action android:name="android.gadget.action.GADGET_UPDATE" /> - </intent-filter> - <meta-data android:name="android.gadget.provider" android:resource="@xml/gadget_info" /> - </receiver> - </application> -</manifest> diff --git a/tests/gadgets/GadgetProviderTest/res/layout/test_gadget.xml b/tests/gadgets/GadgetProviderTest/res/layout/test_gadget.xml deleted file mode 100644 index e0a416e..0000000 --- a/tests/gadgets/GadgetProviderTest/res/layout/test_gadget.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2006 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. ---> - -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/oh_hai_text" - android:layout_width="150dp" - android:layout_height="150dp" - android:text="@string/oh_hai" - android:background="#8fff" - android:textColor="#000" - android:textStyle="bold" -/> - diff --git a/tests/gadgets/GadgetProviderTest/res/values/strings.xml b/tests/gadgets/GadgetProviderTest/res/values/strings.xml deleted file mode 100644 index e07725f..0000000 --- a/tests/gadgets/GadgetProviderTest/res/values/strings.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 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. ---> - -<resources> - <string name="gadget_view_title">Gadget Test</string> - <string name="add_gadget">Add Gadget</string> - <string name="oh_hai">Oh hai.</string> - <string name="delete_gadget">Delete</string> -</resources> - diff --git a/tests/gadgets/GadgetProviderTest/res/xml/gadget_info.xml b/tests/gadgets/GadgetProviderTest/res/xml/gadget_info.xml deleted file mode 100644 index 33cc2e3..0000000 --- a/tests/gadgets/GadgetProviderTest/res/xml/gadget_info.xml +++ /dev/null @@ -1,7 +0,0 @@ -<gadget-provider xmlns:android="http://schemas.android.com/apk/res/android" - android:minWidth="150dp" - android:minHeight="150dp" - android:updatePeriodMillis="2000" - android:initialLayout="@layout/test_gadget" - > -</gadget-provider> diff --git a/tests/gadgets/GadgetProviderTest/src/com/android/tests/gadgetprovider/TestGadgetProvider.java b/tests/gadgets/GadgetProviderTest/src/com/android/tests/gadgetprovider/TestGadgetProvider.java deleted file mode 100644 index b81575f..0000000 --- a/tests/gadgets/GadgetProviderTest/src/com/android/tests/gadgetprovider/TestGadgetProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2008 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.tests.gadgetprovider; - -import android.content.BroadcastReceiver; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.gadget.GadgetManager; -import android.os.Bundle; -import android.os.SystemClock; -import android.util.Log; -import android.widget.RemoteViews; - -public class TestGadgetProvider extends BroadcastReceiver { - - static final String TAG = "TestGadgetProvider"; - - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - Log.d(TAG, "intent=" + intent); - - if (GadgetManager.ACTION_GADGET_ENABLED.equals(action)) { - Log.d(TAG, "ENABLED"); - } - else if (GadgetManager.ACTION_GADGET_DISABLED.equals(action)) { - Log.d(TAG, "DISABLED"); - } - else if (GadgetManager.ACTION_GADGET_UPDATE.equals(action)) { - Log.d(TAG, "UPDATE"); - Bundle extras = intent.getExtras(); - int[] gadgetIds = extras.getIntArray(GadgetManager.EXTRA_GADGET_IDS); - - GadgetManager gm = GadgetManager.getInstance(context); - RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.test_gadget); - views.setTextViewText(R.id.oh_hai_text, "hai: " + SystemClock.elapsedRealtime()); - if (false) { - gm.updateGadget(gadgetIds, views); - } else { - gm.updateGadget(new ComponentName("com.android.tests.gadgetprovider", - "com.android.tests.gadgetprovider.TestGadgetProvider"), views); - } - } - } -} - |