am f52a4482: Merge "Add a default Dreams component." into ics-mr1

* commit 'f52a4482dd3ca336f84fc6c533ea4a99a72b23dd':
  Add a default Dreams component.
This commit is contained in:
Daniel Sandler
2011-11-16 17:16:54 -08:00
committed by Android Git Automerger
4 changed files with 11 additions and 1 deletions

View File

@@ -741,4 +741,7 @@
<string name="config_wimaxServiceClassname"></string> <string name="config_wimaxServiceClassname"></string>
<!-- Name of the wimax state tracker clas --> <!-- Name of the wimax state tracker clas -->
<string name="config_wimaxStateTrackerClassname"></string> <string name="config_wimaxStateTrackerClassname"></string>
<!-- Name of screensaver components to look for if none has been chosen by the user -->
<string name="config_defaultDreamComponent">com.google.android.deskclock/com.android.deskclock.Screensaver</string>
</resources> </resources>

View File

@@ -48,6 +48,7 @@
<!-- handle dock insertion, launch screensaver instead --> <!-- handle dock insertion, launch screensaver instead -->
<activity android:name=".DreamsDockLauncher" <activity android:name=".DreamsDockLauncher"
android:theme="@android:style/Theme.Dialog"
android:label="@string/dreams_dock_launcher"> android:label="@string/dreams_dock_launcher">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -124,7 +125,7 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.DREAM" /> <!-- <category android:name="android.intent.category.DREAM" />-->
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>

View File

@@ -18,6 +18,9 @@ public class DreamsDockLauncher extends Activity {
try { try {
String component = Settings.Secure.getString( String component = Settings.Secure.getString(
getContentResolver(), Settings.Secure.DREAM_COMPONENT); getContentResolver(), Settings.Secure.DREAM_COMPONENT);
if (component == null) {
component = getResources().getString(com.android.internal.R.string.config_defaultDreamComponent);
}
if (component != null) { if (component != null) {
ComponentName cn = ComponentName.unflattenFromString(component); ComponentName cn = ComponentName.unflattenFromString(component);
Intent zzz = new Intent(Intent.ACTION_MAIN) Intent zzz = new Intent(Intent.ACTION_MAIN)

View File

@@ -3420,6 +3420,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
try { try {
String component = Settings.Secure.getString( String component = Settings.Secure.getString(
mContext.getContentResolver(), Settings.Secure.DREAM_COMPONENT); mContext.getContentResolver(), Settings.Secure.DREAM_COMPONENT);
if (component == null) {
component = mContext.getResources().getString(R.string.config_defaultDreamComponent);
}
if (component != null) { if (component != null) {
ComponentName cn = ComponentName.unflattenFromString(component); ComponentName cn = ComponentName.unflattenFromString(component);
Intent intent = new Intent(Intent.ACTION_MAIN) Intent intent = new Intent(Intent.ACTION_MAIN)