Merge "Accessibility: Set the title of the dream activity to the label of the current dream." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
13f4c58deb
@@ -19,6 +19,7 @@ package android.service.dreams;
|
|||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ import com.android.internal.R;
|
|||||||
*/
|
*/
|
||||||
public class DreamActivity extends Activity {
|
public class DreamActivity extends Activity {
|
||||||
static final String EXTRA_CALLBACK = "binder";
|
static final String EXTRA_CALLBACK = "binder";
|
||||||
|
static final String EXTRA_DREAM_TITLE = "title";
|
||||||
|
|
||||||
public DreamActivity() {}
|
public DreamActivity() {}
|
||||||
|
|
||||||
@@ -51,6 +53,11 @@ public class DreamActivity extends Activity {
|
|||||||
public void onCreate(@Nullable Bundle bundle) {
|
public void onCreate(@Nullable Bundle bundle) {
|
||||||
super.onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
|
|
||||||
|
final String title = getIntent().getStringExtra(EXTRA_DREAM_TITLE);
|
||||||
|
if (!TextUtils.isEmpty(title)) {
|
||||||
|
setTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
DreamService.DreamServiceWrapper callback =
|
DreamService.DreamServiceWrapper callback =
|
||||||
(DreamService.DreamServiceWrapper) getIntent().getIBinderExtra(EXTRA_CALLBACK);
|
(DreamService.DreamServiceWrapper) getIntent().getIBinderExtra(EXTRA_CALLBACK);
|
||||||
|
|
||||||
|
|||||||
@@ -1280,6 +1280,9 @@ public class DreamService extends Service implements Window.Callback {
|
|||||||
i.setPackage(getApplicationContext().getPackageName());
|
i.setPackage(getApplicationContext().getPackageName());
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
i.putExtra(DreamActivity.EXTRA_CALLBACK, mDreamServiceWrapper);
|
i.putExtra(DreamActivity.EXTRA_CALLBACK, mDreamServiceWrapper);
|
||||||
|
final ServiceInfo serviceInfo = fetchServiceInfo(this,
|
||||||
|
new ComponentName(this, getClass()));
|
||||||
|
i.putExtra(DreamActivity.EXTRA_DREAM_TITLE, fetchDreamLabel(this, serviceInfo));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!ActivityTaskManager.getService().startDreamActivity(i)) {
|
if (!ActivityTaskManager.getService().startDreamActivity(i)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user