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

Commit 132dffbc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Animate starting work challenge from work lock"

parents 68945f3d 5d59242c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ interface IActivityManager {
     */
    void swapDockedAndFullscreenStack();
    void notifyLockedProfile(int userId);
    void startConfirmDeviceCredentialIntent(in Intent intent);
    void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
    void sendIdleJobTrigger();
    int sendIntentSender(in IIntentSender target, int code, in Intent intent,
            in String resolvedType, in IIntentReceiver finishedReceiver,
+17 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard;

import static android.app.ActivityManager.TaskDescription;
import static android.app.ActivityManager.StackId;

import android.annotation.ColorInt;
import android.annotation.UserIdInt;
@@ -31,6 +32,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -160,9 +162,23 @@ public class WorkLockActivity extends Activity {

        credential.putExtra(Intent.EXTRA_INTENT, target.getIntentSender());
        try {
            ActivityManager.getService().startConfirmDeviceCredentialIntent(credential);
            ActivityManager.getService().startConfirmDeviceCredentialIntent(credential,
                    getChallengeOptions().toBundle());
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to start confirm credential intent", e);
        }
    }

    private ActivityOptions getChallengeOptions() {
        // If we are taking up the whole screen, just use the default animation of clipping the
        // credentials activity into the entire foreground.
        if (!isInMultiWindowMode()) {
            return ActivityOptions.makeBasic();
        }

        // Otherwise, animate the transition from this part of the screen to fullscreen
        // using our own decor as the starting position.
        final View view = getWindow().getDecorView();
        return ActivityOptions.makeScaleUpAnimation(view, 0, 0, view.getWidth(), view.getHeight());
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -2041,7 +2041,8 @@ public abstract class BaseStatusBar extends SystemUI implements
                Intent.EXTRA_INTENT,
                callBackPendingIntent.getIntentSender());
        try {
            ActivityManager.getService().startConfirmDeviceCredentialIntent(newIntent);
            ActivityManager.getService().startConfirmDeviceCredentialIntent(newIntent,
                    null /*options*/);
        } catch (RemoteException ex) {
            // ignore
        }
+2 −2
Original line number Diff line number Diff line
@@ -12050,12 +12050,12 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    @Override
    public void startConfirmDeviceCredentialIntent(Intent intent) {
    public void startConfirmDeviceCredentialIntent(Intent intent, Bundle options) {
        enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "startConfirmDeviceCredentialIntent");
        synchronized (this) {
            final long ident = Binder.clearCallingIdentity();
            try {
                mActivityStarter.startConfirmCredentialIntent(intent);
                mActivityStarter.startConfirmCredentialIntent(intent, options);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
+5 −5
Original line number Diff line number Diff line
@@ -648,18 +648,18 @@ class ActivityStarter {
                    null);
            credential.putExtra(Intent.EXTRA_INTENT, new IntentSender(target));
            // Show confirm credentials activity.
            startConfirmCredentialIntent(credential);
            startConfirmCredentialIntent(credential, null);
        }
    }

    void startConfirmCredentialIntent(Intent intent) {
    void startConfirmCredentialIntent(Intent intent, Bundle optionsBundle) {
        intent.addFlags(FLAG_ACTIVITY_NEW_TASK |
                FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |
                FLAG_ACTIVITY_TASK_ON_HOME);
        final ActivityOptions options = ActivityOptions.makeBasic();
        ActivityOptions options = (optionsBundle != null ? new ActivityOptions(optionsBundle)
                        : ActivityOptions.makeBasic());
        options.setLaunchTaskId(mSupervisor.getHomeActivity().task.taskId);
        mService.mContext.startActivityAsUser(intent, options.toBundle(),
                UserHandle.CURRENT);
        mService.mContext.startActivityAsUser(intent, options.toBundle(), UserHandle.CURRENT);
    }

    final int startActivityMayWait(IApplicationThread caller, int callingUid,