Skip to content

Commit fddedc9

Browse files
John SpurlockAndroid (Google) Code Review
authored andcommitted
Merge "Dream metadata now specified using an xml-resource." into jb-mr1-dev
2 parents d48478e + f41f505 commit fddedc9

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

api/current.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20332,7 +20332,6 @@ package android.service.dreams {
2033220332
method public boolean isInteractive();
2033320333
method public boolean isLowProfile();
2033420334
method public boolean isScreenBright();
20335-
method protected deprecated void lightsOut();
2033620335
method public void onActionModeFinished(android.view.ActionMode);
2033720336
method public void onActionModeStarted(android.view.ActionMode);
2033820337
method public void onAttachedToWindow();
@@ -20360,7 +20359,7 @@ package android.service.dreams {
2036020359
field public static final java.lang.String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED";
2036120360
field public static final java.lang.String ACTION_DREAMING_STOPPED = "android.intent.action.DREAMING_STOPPED";
2036220361
field public static final java.lang.String CATEGORY_DREAM = "android.intent.category.DREAM";
20363-
field public static final java.lang.String METADATA_NAME_CONFIG_ACTIVITY = "android.service.dreams.config_activity";
20362+
field public static final java.lang.String DREAM_META_DATA = "android.service.dream";
2036420363
}
2036520364

2036620365
}

core/java/android/service/dreams/Dream.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
* <category android:name="android.intent.category.DREAM" />
6060
* </intent-filter>
6161
*
62-
* <!-- Point to configuration activity for this dream (optional) -->
62+
* <!-- Point to additional information for this dream (optional) -->
6363
* <meta-data
64-
* android:name="android.service.dreams.config_activity"
65-
* android:value="com.example.mypackage/com.example.mypackage.MyDreamSettingsActivity" />
64+
* android:name="android.service.dream"
65+
* android:resource="@xml/my_dream" />
6666
* </service>
6767
* }
6868
* </pre>
@@ -81,12 +81,12 @@ public class Dream extends Service implements Window.Callback {
8181
"android.intent.category.DREAM";
8282

8383
/**
84-
* Service meta-data key for declaring an optional configuration activity.
85-
*
86-
* @see Dream
87-
* */
88-
public static final String METADATA_NAME_CONFIG_ACTIVITY =
89-
"android.service.dreams.config_activity";
84+
* Name under which a Dream publishes information about itself.
85+
* This meta-data must reference an XML resource containing
86+
* a <code>&lt;{@link android.R.styleable#Dream dream}&gt;</code>
87+
* tag.
88+
*/
89+
public static final String DREAM_META_DATA = "android.service.dream";
9090

9191
/**
9292
* Broadcast Action: Sent after the system starts dreaming.
@@ -361,13 +361,6 @@ public View findViewById(int id) {
361361
return getWindow().findViewById(id);
362362
}
363363

364-
/** FIXME remove once platform dreams are updated */
365-
@Deprecated
366-
protected void lightsOut() {
367-
setLowProfile(true);
368-
setFullscreen(true);
369-
}
370-
371364
/**
372365
* Marks this dream as interactive to receive input events.
373366
*

core/res/res/values/attrs.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5305,6 +5305,19 @@
53055305
<attr name="description" />
53065306
</declare-styleable>
53075307

5308+
<!-- Use <code>dream</code> as the root tag of the XML resource that
5309+
describes an
5310+
{@link android.service.dreams.Dream}, which is
5311+
referenced from its
5312+
{@link android.service.dreams.Dream#DREAM_META_DATA}
5313+
meta-data entry. Described here are the attributes that can be
5314+
included in that tag. -->
5315+
<declare-styleable name="Dream">
5316+
<!-- Component name of an activity that allows the user to modify
5317+
the settings for this dream. -->
5318+
<attr name="settingsActivity" />
5319+
</declare-styleable>
5320+
53085321
<!-- =============================== -->
53095322
<!-- Accounts package class attributes -->
53105323
<!-- =============================== -->

0 commit comments

Comments
 (0)