diff options
author | Daniel Sandler <dsandler@android.com> | 2011-12-01 06:29:53 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-01 06:29:53 -0800 |
commit | 2a40d0d92b208021b492e9af3d944720cbf269fc (patch) | |
tree | 0fed812542ce9f29c2c329bfb8d360f7984e0b53 /packages/SystemUI | |
parent | 41a5774a99215025628b83db54c45f84b876678e (diff) | |
parent | d2b22a885a79d537c79e98257647cc120bde2998 (diff) | |
download | frameworks_base-2a40d0d92b208021b492e9af3d944720cbf269fc.zip frameworks_base-2a40d0d92b208021b492e9af3d944720cbf269fc.tar.gz frameworks_base-2a40d0d92b208021b492e9af3d944720cbf269fc.tar.bz2 |
Merge "Put screensavers back in the icebox for now. DO NOT MERGE." into ics-mr1
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/AndroidManifest.xml | 20 | ||||
-rw-r--r-- | packages/SystemUI/res/values/strings.xml | 3 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java | 78 |
3 files changed, 0 insertions, 101 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index e937587..ec08e6c 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -46,26 +46,6 @@ </intent-filter> </receiver> - <!-- should you need to launch the screensaver, this is a good way to do it --> - <activity android:name=".DreamsDockLauncher" - android:theme="@android:style/Theme.Dialog" - android:label="@string/dreams_dock_launcher"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </activity> - - <!-- launch screensaver on (desk) dock event --> - <receiver android:name=".DreamsDockLauncher$DockEventReceiver" - android:exported="true" - > - <intent-filter> - <action android:name="android.intent.action.DOCK_EVENT" /> - </intent-filter> - </receiver> - - <activity android:name=".usb.UsbStorageActivity" android:label="@*android:string/usb_storage_activity_title" android:excludeFromRecents="true"> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index fc81f8e..2c1473b 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -362,7 +362,4 @@ <!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_clear_all">Clear all notifications.</string> - - <!-- Description of the desk dock action that invokes the Android Dreams screen saver feature --> - <string name="dreams_dock_launcher">Activate screen saver</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java b/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java deleted file mode 100644 index 1db2a7f..0000000 --- a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.android.systemui; - -import android.app.Activity; -import android.content.BroadcastReceiver; -import android.content.ComponentName; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.provider.Settings; -import android.util.Slog; - -public class DreamsDockLauncher extends Activity { - private static final String TAG = "DreamsDockLauncher"; - - // Launch the screen saver if started as an activity. - @Override - protected void onCreate (Bundle icicle) { - super.onCreate(icicle); - launchDream(this); - finish(); - } - - private static void launchDream(Context context) { - try { - String component = Settings.Secure.getString( - context.getContentResolver(), Settings.Secure.SCREENSAVER_COMPONENT); - if (component == null) { - component = context.getResources().getString( - com.android.internal.R.string.config_defaultDreamComponent); - } - if (component != null) { - // dismiss the notification shade, recents, etc. - context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); - - ComponentName cn = ComponentName.unflattenFromString(component); - Intent zzz = new Intent(Intent.ACTION_MAIN) - .setComponent(cn) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS - | Intent.FLAG_ACTIVITY_NO_USER_ACTION - | Intent.FLAG_FROM_BACKGROUND - | Intent.FLAG_ACTIVITY_NO_HISTORY - ); - Slog.v(TAG, "Starting screen saver on dock event: " + component); - context.startActivity(zzz); - } else { - Slog.e(TAG, "Couldn't start screen saver: none selected"); - } - } catch (android.content.ActivityNotFoundException exc) { - // no screensaver? give up - Slog.e(TAG, "Couldn't start screen saver: none installed"); - } - } - - // Trap low-level dock events and launch the screensaver. - public static class DockEventReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - final boolean activateOnDock = 0 != Settings.Secure.getInt( - context.getContentResolver(), - Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK, 1); - - if (!activateOnDock) return; - - if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction())) { - Bundle extras = intent.getExtras(); - int state = extras - .getInt(Intent.EXTRA_DOCK_STATE, Intent.EXTRA_DOCK_STATE_UNDOCKED); - if (state == Intent.EXTRA_DOCK_STATE_DESK - || state == Intent.EXTRA_DOCK_STATE_LE_DESK - || state == Intent.EXTRA_DOCK_STATE_HE_DESK) { - launchDream(context); - } - } - } - } -} |