Skip to content

Commit c224f76

Browse files
committed
Add a default Dreams component.
Currently set to DeskClock's screensaver, but since it's a (private) string in f/b/c/r/r/values/config.xml any product could overlay this. Bug: 5611008 Change-Id: I7a4623c9c667a6cff8ed80ad600a8a4460bfafb7
1 parent 481ffa5 commit c224f76

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

core/res/res/values/config.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,4 +741,7 @@
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>
744747
</resources>

packages/SystemUI/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
<!-- handle dock insertion, launch screensaver instead -->
5050
<activity android:name=".DreamsDockLauncher"
51+
android:theme="@android:style/Theme.Dialog"
5152
android:label="@string/dreams_dock_launcher">
5253
<intent-filter>
5354
<action android:name="android.intent.action.MAIN" />
@@ -124,7 +125,7 @@
124125
<intent-filter>
125126
<action android:name="android.intent.action.MAIN" />
126127
<category android:name="android.intent.category.DEFAULT" />
127-
<category android:name="android.intent.category.DREAM" />
128+
<!-- <category android:name="android.intent.category.DREAM" />-->
128129
</intent-filter>
129130
</activity>
130131
</application>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ protected void onCreate (Bundle icicle) {
1818
try {
1919
String component = Settings.Secure.getString(
2020
getContentResolver(), Settings.Secure.DREAM_COMPONENT);
21+
if (component == null) {
22+
component = getResources().getString(com.android.internal.R.string.config_defaultDreamComponent);
23+
}
2124
if (component != null) {
2225
ComponentName cn = ComponentName.unflattenFromString(component);
2326
Intent zzz = new Intent(Intent.ACTION_MAIN)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,6 +3409,9 @@ public void run() {
34093409
try {
34103410
String component = Settings.Secure.getString(
34113411
mContext.getContentResolver(), Settings.Secure.DREAM_COMPONENT);
3412+
if (component == null) {
3413+
component = mContext.getResources().getString(R.string.config_defaultDreamComponent);
3414+
}
34123415
if (component != null) {
34133416
ComponentName cn = ComponentName.unflattenFromString(component);
34143417
Intent intent = new Intent(Intent.ACTION_MAIN)

0 commit comments

Comments
 (0)