diff options
author | Joe Onorato <joeo@google.com> | 2011-01-07 20:50:37 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2011-01-10 17:26:39 -0800 |
commit | d070e89396e250782c015bc993bcae6e7e03af7a (patch) | |
tree | 283098f3bef7b236ba1f0d1a1a6e17978b5ef8ee /tests/StatusBar | |
parent | a85a91573af97a76ab08ffd5f8558b73283e1faa (diff) | |
download | frameworks_base-d070e89396e250782c015bc993bcae6e7e03af7a.zip frameworks_base-d070e89396e250782c015bc993bcae6e7e03af7a.tar.gz frameworks_base-d070e89396e250782c015bc993bcae6e7e03af7a.tar.bz2 |
Make AppWidgetService handle components enabling and disabling.
Change-Id: Ie6b75cb90be38bbce694ccf2d5a342d7f0172fa4
Diffstat (limited to 'tests/StatusBar')
-rw-r--r-- | tests/StatusBar/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/PowerTest.java | 20 |
2 files changed, 21 insertions, 0 deletions
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 @@ <uses-permission android:name="android.permission.STATUS_BAR" /> <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" /> <uses-permission android:name="android.permission.VIBRATE" /> + <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" /> <application> <activity android:name="StatusBarTest" android:label="_StatusBar"> 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(); |