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

Commit 4b8a8624 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Made sure smart actions now launch also inline same as activity launches" into qt-dev

am: 899e3ee0

Change-Id: I1f7bea78e1a2b7f78dafa1ef150e1ce072fd64a0
parents 08ebfee8 899e3ee0
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.systemui.plugins;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.Intent;
import android.view.View;


import com.android.systemui.plugins.annotations.ProvidesInterface;
import com.android.systemui.plugins.annotations.ProvidesInterface;


@@ -32,12 +33,19 @@ public interface ActivityStarter {
    void startPendingIntentDismissingKeyguard(PendingIntent intent);
    void startPendingIntentDismissingKeyguard(PendingIntent intent);


    /**
    /**
     * Similar to {@link #startPendingIntentDismissingKeyguard(PendingIntent, Runnable)}, but allows
     * Similar to {@link #startPendingIntentDismissingKeyguard(PendingIntent)}, but allows
     * you to specify the callback that is executed on the UI thread after the intent is sent.
     * you to specify the callback that is executed on the UI thread after the intent is sent.
     */
     */
    void startPendingIntentDismissingKeyguard(PendingIntent intent,
    void startPendingIntentDismissingKeyguard(PendingIntent intent,
            Runnable intentSentUiThreadCallback);
            Runnable intentSentUiThreadCallback);


    /**
     * Similar to {@link #startPendingIntentDismissingKeyguard(PendingIntent, Runnable)}, but also
     * specifies an associated view that should be used for the activity launch animation.
     */
    void startPendingIntentDismissingKeyguard(PendingIntent intent,
            Runnable intentSentUiThreadCallback, View associatedView);

    /**
    /**
     * The intent flag can be specified in startActivity().
     * The intent flag can be specified in startActivity().
     */
     */
+11 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ package com.android.systemui;


import android.app.PendingIntent;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.Intent;
import android.view.View;


import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.ActivityStarter;


@@ -52,6 +53,16 @@ public class ActivityStarterDelegate implements ActivityStarter {
        mActualStarter.startPendingIntentDismissingKeyguard(intent, intentSentCallback);
        mActualStarter.startPendingIntentDismissingKeyguard(intent, intentSentCallback);
    }
    }


    @Override
    public void startPendingIntentDismissingKeyguard(PendingIntent intent,
            Runnable intentSentCallback, View associatedView) {
        if (mActualStarter == null) {
            return;
        }
        mActualStarter.startPendingIntentDismissingKeyguard(intent, intentSentCallback,
                associatedView);
    }

    @Override
    @Override
    public void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade,
    public void startActivity(Intent intent, boolean onlyProvisioned, boolean dismissShade,
            int flags) {
            int flags) {
+5 −3
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.RemoteAnimationTarget;
import android.view.SyncRtSurfaceTransactionApplier;
import android.view.SyncRtSurfaceTransactionApplier;
import android.view.SyncRtSurfaceTransactionApplier.SurfaceParams;
import android.view.SyncRtSurfaceTransactionApplier.SurfaceParams;
import android.view.View;


import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.systemui.Interpolators;
import com.android.systemui.Interpolators;
@@ -79,11 +80,12 @@ public class ActivityLaunchAnimator {
    }
    }


    public RemoteAnimationAdapter getLaunchAnimation(
    public RemoteAnimationAdapter getLaunchAnimation(
            ExpandableNotificationRow sourceNotification, boolean occluded) {
            View sourceView, boolean occluded) {
        if (!mCallback.areLaunchAnimationsEnabled() || occluded) {
        if (!(sourceView instanceof ExpandableNotificationRow) || !mCallback.areLaunchAnimationsEnabled() || occluded) {
            return null;
            return null;
        }
        }
        AnimationRunner animationRunner = new AnimationRunner(sourceNotification);
        AnimationRunner animationRunner = new AnimationRunner(
                (ExpandableNotificationRow) sourceView);
        return new RemoteAnimationAdapter(animationRunner, ANIMATION_DURATION,
        return new RemoteAnimationAdapter(animationRunner, ANIMATION_DURATION,
                ANIMATION_DURATION - 150 /* statusBarTransitionDelay */);
                ANIMATION_DURATION - 150 /* statusBarTransitionDelay */);
    }
    }
+12 −3
Original line number Original line Diff line number Diff line
@@ -593,6 +593,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                updateScrimController();
                updateScrimController();
            };
            };
    private ActivityIntentHelper mActivityIntentHelper;
    private ActivityIntentHelper mActivityIntentHelper;
    private ShadeController mShadeController;


    @Override
    @Override
    public void onActiveStateChanged(int code, int uid, String packageName, boolean active) {
    public void onActiveStateChanged(int code, int uid, String packageName, boolean active) {
@@ -1062,7 +1063,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        final StatusBarRemoteInputCallback mStatusBarRemoteInputCallback =
        final StatusBarRemoteInputCallback mStatusBarRemoteInputCallback =
                (StatusBarRemoteInputCallback) Dependency.get(
                (StatusBarRemoteInputCallback) Dependency.get(
                        NotificationRemoteInputManager.Callback.class);
                        NotificationRemoteInputManager.Callback.class);
        final ShadeController shadeController = Dependency.get(ShadeController.class);
        mShadeController = Dependency.get(ShadeController.class);
        final ActivityStarter activityStarter = Dependency.get(ActivityStarter.class);
        final ActivityStarter activityStarter = Dependency.get(ActivityStarter.class);


        mNotificationActivityStarter = new StatusBarNotificationActivityStarter(mContext,
        mNotificationActivityStarter = new StatusBarNotificationActivityStarter(mContext,
@@ -1070,7 +1071,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                mHeadsUpManager, activityStarter, mActivityLaunchAnimator,
                mHeadsUpManager, activityStarter, mActivityLaunchAnimator,
                mBarService, mStatusBarStateController, mKeyguardManager, mDreamManager,
                mBarService, mStatusBarStateController, mKeyguardManager, mDreamManager,
                mRemoteInputManager, mStatusBarRemoteInputCallback, mGroupManager,
                mRemoteInputManager, mStatusBarRemoteInputCallback, mGroupManager,
                mLockscreenUserManager, shadeController, mKeyguardMonitor,
                mLockscreenUserManager, mShadeController, mKeyguardMonitor,
                mNotificationInterruptionStateProvider, mMetricsLogger,
                mNotificationInterruptionStateProvider, mMetricsLogger,
                new LockPatternUtils(mContext), Dependency.get(MAIN_HANDLER),
                new LockPatternUtils(mContext), Dependency.get(MAIN_HANDLER),
                Dependency.get(BG_HANDLER), mActivityIntentHelper, mBubbleController);
                Dependency.get(BG_HANDLER), mActivityIntentHelper, mBubbleController);
@@ -4344,6 +4345,13 @@ public class StatusBar extends SystemUI implements DemoMode,
    @Override
    @Override
    public void startPendingIntentDismissingKeyguard(
    public void startPendingIntentDismissingKeyguard(
            final PendingIntent intent, @Nullable final Runnable intentSentUiThreadCallback) {
            final PendingIntent intent, @Nullable final Runnable intentSentUiThreadCallback) {
        startPendingIntentDismissingKeyguard(intent, intentSentUiThreadCallback, null /* row */);
    }

    @Override
    public void startPendingIntentDismissingKeyguard(
            final PendingIntent intent, @Nullable final Runnable intentSentUiThreadCallback,
            View associatedView) {
        final boolean afterKeyguardGone = intent.isActivity()
        final boolean afterKeyguardGone = intent.isActivity()
                && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(),
                && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(),
                mLockscreenUserManager.getCurrentUserId());
                mLockscreenUserManager.getCurrentUserId());
@@ -4351,7 +4359,8 @@ public class StatusBar extends SystemUI implements DemoMode,
        executeActionDismissingKeyguard(() -> {
        executeActionDismissingKeyguard(() -> {
            try {
            try {
                intent.send(null, 0, null, null, null, null, getActivityOptions(
                intent.send(null, 0, null, null, null, null, getActivityOptions(
                        null /* animationAdapter */));
                        mActivityLaunchAnimator.getLaunchAnimation(associatedView,
                                mShadeController.isOccluded())));
            } catch (PendingIntent.CanceledException e) {
            } catch (PendingIntent.CanceledException e) {
                // the stack trace isn't very helpful here.
                // the stack trace isn't very helpful here.
                // Just log the exception message.
                // Just log the exception message.
+1 −1
Original line number Original line Diff line number Diff line
@@ -349,7 +349,7 @@ public class SmartReplyView extends ViewGroup {
                            smartReplyController.smartActionClicked(
                            smartReplyController.smartActionClicked(
                                    entry, actionIndex, action, smartActions.fromAssistant);
                                    entry, actionIndex, action, smartActions.fromAssistant);
                            headsUpManager.removeNotification(entry.key, true);
                            headsUpManager.removeNotification(entry.key, true);
                        });
                        }, entry.getRow());
        if (useDelayedOnClickListener) {
        if (useDelayedOnClickListener) {
            onClickListener = new DelayedOnClickListener(onClickListener,
            onClickListener = new DelayedOnClickListener(onClickListener,
                    smartReplyView.mConstants.getOnClickInitDelay());
                    smartReplyView.mConstants.getOnClickInitDelay());
Loading