Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e6248a7 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Accessibility: Set the title of the dream activity to the label of the...

Merge "Accessibility: Set the title of the dream activity to the label of the current dream." into tm-qpr-dev
parents 5e880217 894e25c3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);

+3 −0
Original line number Diff line number Diff line
@@ -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)) {