Skip to content

Commit 2a40d0d

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge "Put screensavers back in the icebox for now. DO NOT MERGE." into ics-mr1
2 parents 41a5774 + d2b22a8 commit 2a40d0d

File tree

7 files changed

+1
-269
lines changed

7 files changed

+1
-269
lines changed

core/java/android/provider/Settings.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4019,28 +4019,6 @@ public static final String getBluetoothInputDevicePriorityKey(String address) {
40194019
public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
40204020
"setup_prepaid_detection_redir_host";
40214021

4022-
/**
4023-
* Whether the screensaver is enabled.
4024-
* @hide
4025-
*/
4026-
public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
4027-
4028-
/**
4029-
* The user's chosen screensaver component.
4030-
*
4031-
* This component will be launched by the PhoneWindowManager after a timeout when not on
4032-
* battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
4033-
* @hide
4034-
*/
4035-
public static final String SCREENSAVER_COMPONENT = "screensaver_component";
4036-
4037-
/**
4038-
* Whether the screensaver should be automatically launched when the device is inserted
4039-
* into a (desk) dock.
4040-
* @hide
4041-
*/
4042-
public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
4043-
40444022
/** {@hide} */
40454023
public static final String NETSTATS_ENABLED = "netstats_enabled";
40464024
/** {@hide} */

core/res/res/values/config.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,4 @@
741741
<string name="config_wimaxServiceClassname"></string>
742742
<!-- Name of the wimax state tracker clas -->
743743
<string name="config_wimaxStateTrackerClassname"></string>
744-
745-
<!-- Name of screensaver components to look for if none has been chosen by the user -->
746-
<string name="config_defaultDreamComponent">com.google.android.deskclock/com.android.deskclock.Screensaver</string>
747744
</resources>

packages/SystemUI/AndroidManifest.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,6 @@
4646
</intent-filter>
4747
</receiver>
4848

49-
<!-- should you need to launch the screensaver, this is a good way to do it -->
50-
<activity android:name=".DreamsDockLauncher"
51-
android:theme="@android:style/Theme.Dialog"
52-
android:label="@string/dreams_dock_launcher">
53-
<intent-filter>
54-
<action android:name="android.intent.action.MAIN" />
55-
<category android:name="android.intent.category.DEFAULT" />
56-
</intent-filter>
57-
</activity>
58-
59-
<!-- launch screensaver on (desk) dock event -->
60-
<receiver android:name=".DreamsDockLauncher$DockEventReceiver"
61-
android:exported="true"
62-
>
63-
<intent-filter>
64-
<action android:name="android.intent.action.DOCK_EVENT" />
65-
</intent-filter>
66-
</receiver>
67-
68-
6949
<activity android:name=".usb.UsbStorageActivity"
7050
android:label="@*android:string/usb_storage_activity_title"
7151
android:excludeFromRecents="true">

packages/SystemUI/res/values/strings.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,4 @@
362362

363363
<!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
364364
<string name="accessibility_clear_all">Clear all notifications.</string>
365-
366-
<!-- Description of the desk dock action that invokes the Android Dreams screen saver feature -->
367-
<string name="dreams_dock_launcher">Activate screen saver</string>
368365
</resources>

packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
164164
static final boolean ENABLE_CAR_DOCK_HOME_CAPTURE = true;
165165
static final boolean ENABLE_DESK_DOCK_HOME_CAPTURE = false;
166166

167-
// Should screen savers use their own timeout, or the SCREEN_OFF_TIMEOUT?
168-
static final boolean SEPARATE_TIMEOUT_FOR_SCREEN_SAVER = false;
169-
170167
static final int LONG_PRESS_POWER_NOTHING = 0;
171168
static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1;
172169
static final int LONG_PRESS_POWER_SHUT_OFF = 2;
@@ -423,12 +420,6 @@ public void handleMotion(MotionEvent event, InputQueue.FinishedCallback finished
423420
int mLockScreenTimeout;
424421
boolean mLockScreenTimerActive;
425422

426-
// visual screen saver support
427-
int mScreenSaverTimeout = 0;
428-
boolean mScreenSaverEnabledByUser = false;
429-
boolean mScreenSaverMayRun = true; // false if a wakelock is held
430-
boolean mPluggedIn;
431-
432423
// Behavior of ENDCALL Button. (See Settings.System.END_BUTTON_BEHAVIOR.)
433424
int mEndcallBehavior;
434425

@@ -491,12 +482,6 @@ void observe() {
491482
Settings.Secure.DEFAULT_INPUT_METHOD), false, this);
492483
resolver.registerContentObserver(Settings.System.getUriFor(
493484
"fancy_rotation_anim"), false, this);
494-
resolver.registerContentObserver(Settings.Secure.getUriFor(
495-
Settings.Secure.SCREENSAVER_ENABLED), false, this);
496-
if (SEPARATE_TIMEOUT_FOR_SCREEN_SAVER) {
497-
resolver.registerContentObserver(Settings.Secure.getUriFor(
498-
"screensaver_timeout"), false, this);
499-
} // otherwise SCREEN_OFF_TIMEOUT will do nicely
500485
updateSettings();
501486
}
502487

@@ -804,14 +789,6 @@ public void init(Context context, IWindowManager windowManager,
804789
Intent.EXTRA_DOCK_STATE_UNDOCKED);
805790
}
806791

807-
// watch the plug to know whether to trigger the screen saver
808-
filter = new IntentFilter();
809-
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
810-
intent = context.registerReceiver(mPowerReceiver, filter);
811-
if (intent != null) {
812-
mPluggedIn = (0 != intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0));
813-
}
814-
815792
mVibrator = new Vibrator();
816793
mLongPressVibePattern = getLongIntArray(mContext.getResources(),
817794
com.android.internal.R.array.config_longPressVibePattern);
@@ -960,23 +937,6 @@ public void updateSettings() {
960937
mHasSoftInput = hasSoftInput;
961938
updateRotation = true;
962939
}
963-
964-
mScreenSaverEnabledByUser = 0 != Settings.Secure.getInt(resolver,
965-
Settings.Secure.SCREENSAVER_ENABLED, 1);
966-
967-
if (SEPARATE_TIMEOUT_FOR_SCREEN_SAVER) {
968-
mScreenSaverTimeout = Settings.Secure.getInt(resolver,
969-
"screensaver_timeout", 0);
970-
} else {
971-
mScreenSaverTimeout = Settings.System.getInt(resolver,
972-
Settings.System.SCREEN_OFF_TIMEOUT, 0);
973-
if (mScreenSaverTimeout > 0) {
974-
// We actually want to activate the screensaver just before the
975-
// power manager's screen timeout
976-
mScreenSaverTimeout -= 5000;
977-
}
978-
}
979-
updateScreenSaverTimeoutLocked();
980940
}
981941
if (updateRotation) {
982942
updateRotation(true);
@@ -3028,15 +2988,6 @@ public void onReceive(Context context, Intent intent) {
30282988
}
30292989
};
30302990

3031-
BroadcastReceiver mPowerReceiver = new BroadcastReceiver() {
3032-
public void onReceive(Context context, Intent intent) {
3033-
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {
3034-
mPluggedIn = (0 != intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0));
3035-
if (localLOGV) Log.v(TAG, "BATTERY_CHANGED: " + intent + " plugged=" + mPluggedIn);
3036-
}
3037-
}
3038-
};
3039-
30402991
/** {@inheritDoc} */
30412992
public void screenTurnedOff(int why) {
30422993
EventLog.writeEvent(70000, 0);
@@ -3048,7 +2999,6 @@ public void screenTurnedOff(int why) {
30482999
synchronized (mLock) {
30493000
updateOrientationListenerLp();
30503001
updateLockScreenTimeout();
3051-
updateScreenSaverTimeoutLocked();
30523002
}
30533003
}
30543004

@@ -3095,7 +3045,6 @@ public void screenTurningOn(final ScreenOnListener screenOnListener) {
30953045
mScreenOnEarly = true;
30963046
updateOrientationListenerLp();
30973047
updateLockScreenTimeout();
3098-
updateScreenSaverTimeoutLocked();
30993048
}
31003049
}
31013050

@@ -3490,85 +3439,6 @@ public void userActivity() {
34903439
mHandler.postDelayed(mScreenLockTimeout, mLockScreenTimeout);
34913440
}
34923441
}
3493-
3494-
synchronized (mLock) {
3495-
// Only posts messages; holds no additional locks.
3496-
updateScreenSaverTimeoutLocked();
3497-
}
3498-
}
3499-
3500-
Runnable mScreenSaverActivator = new Runnable() {
3501-
public void run() {
3502-
if (!(mScreenSaverMayRun && mScreenOnEarly)) {
3503-
Log.w(TAG, "mScreenSaverActivator ran, but the screensaver should not be showing. Who's driving this thing?");
3504-
return;
3505-
}
3506-
if (!mPluggedIn) {
3507-
if (localLOGV) Log.v(TAG, "mScreenSaverActivator: not running screen saver when not plugged in");
3508-
return;
3509-
}
3510-
// Quick fix for automation tests.
3511-
// The correct fix is to move this triggering logic to PowerManager, where more complete
3512-
// information about wakelocks (including StayOnWhilePluggedIn) is available.
3513-
if (Settings.System.getInt(mContext.getContentResolver(),
3514-
Settings.System.STAY_ON_WHILE_PLUGGED_IN,
3515-
BatteryManager.BATTERY_PLUGGED_AC) != 0) {
3516-
Log.v(TAG, "mScreenSaverActivator: not running screen saver when STAY_ON_WHILE_PLUGGED_IN");
3517-
return;
3518-
}
3519-
3520-
if (localLOGV) Log.v(TAG, "mScreenSaverActivator entering dreamland");
3521-
3522-
try {
3523-
String component = Settings.Secure.getString(
3524-
mContext.getContentResolver(), Settings.Secure.SCREENSAVER_COMPONENT);
3525-
if (component == null) {
3526-
component = mContext.getResources().getString(R.string.config_defaultDreamComponent);
3527-
}
3528-
if (component != null) {
3529-
// dismiss the notification shade, recents, etc.
3530-
mContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)
3531-
.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT));
3532-
3533-
ComponentName cn = ComponentName.unflattenFromString(component);
3534-
Intent intent = new Intent(Intent.ACTION_MAIN)
3535-
.setComponent(cn)
3536-
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
3537-
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
3538-
| Intent.FLAG_ACTIVITY_NO_USER_ACTION
3539-
| Intent.FLAG_FROM_BACKGROUND
3540-
| Intent.FLAG_ACTIVITY_NO_HISTORY
3541-
);
3542-
mContext.startActivity(intent);
3543-
} else {
3544-
Log.e(TAG, "Couldn't start screen saver: none selected");
3545-
}
3546-
} catch (android.content.ActivityNotFoundException exc) {
3547-
// no screensaver? give up
3548-
Log.e(TAG, "Couldn't start screen saver: none installed");
3549-
}
3550-
}
3551-
};
3552-
3553-
// Must call while holding mLock
3554-
private void updateScreenSaverTimeoutLocked() {
3555-
if (mScreenSaverActivator == null) return;
3556-
3557-
mHandler.removeCallbacks(mScreenSaverActivator);
3558-
if (mScreenSaverEnabledByUser && mScreenSaverMayRun && mScreenOnEarly && mScreenSaverTimeout > 0) {
3559-
if (localLOGV)
3560-
Log.v(TAG, "scheduling screensaver for " + mScreenSaverTimeout + "ms from now");
3561-
mHandler.postDelayed(mScreenSaverActivator, mScreenSaverTimeout);
3562-
} else {
3563-
if (localLOGV) {
3564-
if (!mScreenSaverEnabledByUser || mScreenSaverTimeout == 0)
3565-
Log.v(TAG, "screen saver disabled by user");
3566-
else if (!mScreenOnEarly)
3567-
Log.v(TAG, "screen saver disabled while screen off");
3568-
else
3569-
Log.v(TAG, "screen saver disabled by wakelock");
3570-
}
3571-
}
35723442
}
35733443

35743444
Runnable mScreenLockTimeout = new Runnable() {
@@ -3774,11 +3644,6 @@ public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean al
37743644
}
37753645

37763646
public void screenOnStartedLw() {
3777-
// The window manager has just grabbed a wake lock. This is our cue to disable the screen
3778-
// saver.
3779-
synchronized (mLock) {
3780-
mScreenSaverMayRun = false;
3781-
}
37823647
}
37833648

37843649
public void screenOnStoppedLw() {
@@ -3787,13 +3652,6 @@ public void screenOnStoppedLw() {
37873652
long curTime = SystemClock.uptimeMillis();
37883653
mPowerManager.userActivity(curTime, false, LocalPowerManager.OTHER_EVENT);
37893654
}
3790-
3791-
synchronized (mLock) {
3792-
// even if the keyguard is up, now that all the wakelocks have been released, we
3793-
// should re-enable the screen saver
3794-
mScreenSaverMayRun = true;
3795-
updateScreenSaverTimeoutLocked();
3796-
}
37973655
}
37983656
}
37993657

services/java/com/android/server/UiModeManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class UiModeManagerService extends IUiModeManager.Stub {
6565

6666
// Enable launching of applications when entering the dock.
6767
private static final boolean ENABLE_LAUNCH_CAR_DOCK_APP = true;
68-
private static final boolean ENABLE_LAUNCH_DESK_DOCK_APP = false;
68+
private static final boolean ENABLE_LAUNCH_DESK_DOCK_APP = true;
6969

7070
private static final int MSG_UPDATE_TWILIGHT = 0;
7171
private static final int MSG_ENABLE_LOCATION_UPDATES = 1;

0 commit comments

Comments
 (0)