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

Commit f2b3e42b authored by Matt Casey's avatar Matt Casey Committed by Android (Google) Code Review
Browse files

Merge "Make editor invocation from long screenshots honor preferred editor." into main

parents 96383c45 a51d95a4
Loading
Loading
Loading
Loading
+42 −19
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.screenshot.scroll;

import static com.android.systemui.shared.Flags.usePreferredImageEditor;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.ComponentName;
@@ -354,6 +356,26 @@ public class LongScreenshotActivity extends Activity {
                    mActionIntentCreator.createEdit(uri),
                    mScreenshotUserHandle, false,
                    /* activityOptions */ null, /* transitionCoordinator */ null);
        } else {
            if (usePreferredImageEditor()) {
                Intent intent = mActionIntentCreator.createEdit(uri);
                Bundle options = null;

                if (intent.getComponent() != null) {
                    // Modify intent for shared transition if we're opening a specific editor.
                    intent.removeFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    intent.removeFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    mTransitionView.setImageBitmap(mOutputBitmap);
                    mTransitionView.setVisibility(View.VISIBLE);
                    mTransitionView.setTransitionName(
                            ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME);
                    options = ActivityOptions.makeSceneTransitionAnimation(this, mTransitionView,
                            ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME).toBundle();
                    // TODO: listen for transition completing instead of finishing onStop
                    mTransitionStarted = true;
                }

                startActivity(intent, options);
            } else {
                String editorPackage = getString(R.string.config_screenshotEditor);
                Intent intent = new Intent(Intent.ACTION_EDIT);
@@ -377,6 +399,7 @@ public class LongScreenshotActivity extends Activity {
                startActivity(intent, options);
            }
        }
    }

    private void doShare(Uri uri) {
        Intent shareIntent = mActionIntentCreator.createShare(uri);