Accessibility: Set the title of the dream activity to the label of the
current dream. Fixed: 228274765 Test: locally on device Change-Id: I95f77ccd5b58b2162946731e274cf55f26162e12
This commit is contained in:
@@ -19,6 +19,7 @@ package android.service.dreams;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
@@ -44,6 +45,7 @@ import com.android.internal.R;
|
||||
*/
|
||||
public class DreamActivity extends Activity {
|
||||
static final String EXTRA_CALLBACK = "binder";
|
||||
static final String EXTRA_DREAM_TITLE = "title";
|
||||
|
||||
public DreamActivity() {}
|
||||
|
||||
@@ -51,6 +53,11 @@ public class DreamActivity extends Activity {
|
||||
public void onCreate(@Nullable Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
final String title = getIntent().getStringExtra(EXTRA_DREAM_TITLE);
|
||||
if (!TextUtils.isEmpty(title)) {
|
||||
setTitle(title);
|
||||
}
|
||||
|
||||
DreamService.DreamServiceWrapper callback =
|
||||
(DreamService.DreamServiceWrapper) getIntent().getIBinderExtra(EXTRA_CALLBACK);
|
||||
|
||||
|
||||
@@ -1280,6 +1280,9 @@ public class DreamService extends Service implements Window.Callback {
|
||||
i.setPackage(getApplicationContext().getPackageName());
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
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 {
|
||||
if (!ActivityTaskManager.getService().startDreamActivity(i)) {
|
||||
|
||||
Reference in New Issue
Block a user