From d070e89396e250782c015bc993bcae6e7e03af7a Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Fri, 7 Jan 2011 20:50:37 -0800 Subject: Make AppWidgetService handle components enabling and disabling. Change-Id: Ie6b75cb90be38bbce694ccf2d5a342d7f0172fa4 --- tests/StatusBar/AndroidManifest.xml | 1 + .../src/com/android/statusbartest/PowerTest.java | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'tests/StatusBar') diff --git a/tests/StatusBar/AndroidManifest.xml b/tests/StatusBar/AndroidManifest.xml index ddb756b..81442bf 100644 --- a/tests/StatusBar/AndroidManifest.xml +++ b/tests/StatusBar/AndroidManifest.xml @@ -5,6 +5,7 @@ + diff --git a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java index 92d5bee..31a1cf5 100644 --- a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java @@ -26,6 +26,8 @@ import android.os.IBinder; import android.os.IPowerManager; import android.widget.ListView; import android.content.Intent; +import android.content.ComponentName; +import android.content.pm.PackageManager; import android.app.Notification; import android.app.NotificationManager; import android.app.StatusBarManager; @@ -66,6 +68,24 @@ public class PowerTest extends TestActivity return mTests; } private Test[] mTests = new Test[] { + new Test("Enable settings widget") { + public void run() { + PackageManager pm = getPackageManager(); + pm.setComponentEnabledSetting(new ComponentName("com.android.settings", + "com.android.settings.widget.SettingsAppWidgetProvider"), + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0); + + } + }, + new Test("Disable settings widget") { + public void run() { + PackageManager pm = getPackageManager(); + pm.setComponentEnabledSetting(new ComponentName("com.android.settings", + "com.android.settings.widget.SettingsAppWidgetProvider"), + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); + + } + }, new Test("Enable proximity") { public void run() { mProx.acquire(); -- cgit v1.1