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

Commit e68aa7a0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9257771 from a8fd186b to tm-qpr2-release

Change-Id: Ifb2480b2819b871079075cdf33d6e549eb273b81
parents cf763956 a8fd186b
Loading
Loading
Loading
Loading
+30 −2
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ public final class ContentCaptureManager {
    private final Object mLock = new Object();

    @NonNull
    private final Context mContext;
    private final StrippedContext mContext;

    @NonNull
    private final IContentCaptureManager mService;
@@ -413,10 +413,38 @@ public final class ContentCaptureManager {
        ComponentName contentCaptureClientGetComponentName();
    }

    /** @hide */
    static class StrippedContext {
        final String mPackageName;
        final String mContext;
        final @UserIdInt int mUserId;

        private StrippedContext(Context context) {
            mPackageName = context.getPackageName();
            mContext = context.toString();
            mUserId = context.getUserId();
        }

        @Override
        public String toString() {
            return mContext;
        }

        public String getPackageName() {
            return mPackageName;
        }

        @UserIdInt
        public int getUserId() {
            return mUserId;
        }
    }

    /** @hide */
    public ContentCaptureManager(@NonNull Context context,
            @NonNull IContentCaptureManager service, @NonNull ContentCaptureOptions options) {
        mContext = Objects.requireNonNull(context, "context cannot be null");
        Objects.requireNonNull(context, "context cannot be null");
        mContext = new StrippedContext(context);
        mService = Objects.requireNonNull(service, "service cannot be null");
        mOptions = Objects.requireNonNull(options, "options cannot be null");

+2 −3
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UiThread;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ParceledListSlice;
import android.graphics.Insets;
import android.graphics.Rect;
@@ -103,7 +102,7 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
    private final AtomicBoolean mDisabled = new AtomicBoolean(false);

    @NonNull
    private final Context mContext;
    private final ContentCaptureManager.StrippedContext mContext;

    @NonNull
    private final ContentCaptureManager mManager;
@@ -197,7 +196,7 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        }
    }

    protected MainContentCaptureSession(@NonNull Context context,
    protected MainContentCaptureSession(@NonNull ContentCaptureManager.StrippedContext context,
            @NonNull ContentCaptureManager manager, @NonNull Handler handler,
            @NonNull IContentCaptureManager systemServerInterface) {
        mContext = context;
+3 −0
Original line number Diff line number Diff line
@@ -1098,6 +1098,9 @@ public class ResolverActivity extends Activity implements
    @Override // ResolverListCommunicator
    public final void onPostListReady(ResolverListAdapter listAdapter, boolean doPostProcessing,
            boolean rebuildCompleted) {
        if (isDestroyed()) {
            return;
        }
        if (isAutolaunching()) {
            return;
        }
+12 −6
Original line number Diff line number Diff line
@@ -1921,6 +1921,12 @@
      "group": "WM_DEBUG_STATES",
      "at": "com\/android\/server\/wm\/TaskFragment.java"
    },
    "-240296576": {
      "message": "handleAppTransitionReady: displayId=%d appTransition={%s} openingApps=[%s] closingApps=[%s] transit=%s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_APP_TRANSITIONS",
      "at": "com\/android\/server\/wm\/AppTransitionController.java"
    },
    "-237664290": {
      "message": "Pause the recording session on display %s",
      "level": "VERBOSE",
@@ -2023,12 +2029,6 @@
      "group": "WM_DEBUG_CONTENT_RECORDING",
      "at": "com\/android\/server\/wm\/ContentRecorder.java"
    },
    "-134793542": {
      "message": "handleAppTransitionReady: displayId=%d appTransition={%s} excludeLauncherFromAnimation=%b openingApps=[%s] closingApps=[%s] transit=%s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_APP_TRANSITIONS",
      "at": "com\/android\/server\/wm\/AppTransitionController.java"
    },
    "-134091882": {
      "message": "Screenshotting Activity %s",
      "level": "VERBOSE",
@@ -2569,6 +2569,12 @@
      "group": "WM_ERROR",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "323235828": {
      "message": "Delaying app transition for recents animation to finish",
      "level": "VERBOSE",
      "group": "WM_DEBUG_APP_TRANSITIONS",
      "at": "com\/android\/server\/wm\/AppTransitionController.java"
    },
    "327461496": {
      "message": "Complete pause: %s",
      "level": "VERBOSE",
+47 −15
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;

import static com.android.wm.shell.bubbles.Bubble.KEY_APP_BUBBLE;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_CONTROLLER;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_GESTURE;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES;
@@ -37,7 +38,6 @@ import static com.android.wm.shell.bubbles.Bubbles.DISMISS_NO_LONGER_BUBBLE;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_PACKAGE_REMOVED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_SHORTCUT_REMOVED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_USER_CHANGED;
import static com.android.wm.shell.floating.FloatingTasksController.SHOW_FLOATING_TASKS_AS_BUBBLES;

import android.annotation.NonNull;
import android.annotation.UserIdInt;
@@ -150,6 +150,9 @@ public class BubbleController implements ConfigurationChangeListener {

    private final ShellExecutor mBackgroundExecutor;

    // Whether or not we should show bubbles pinned at the bottom of the screen.
    private boolean mIsBubbleBarEnabled;

    private BubbleLogger mLogger;
    private BubbleData mBubbleData;
    @Nullable private BubbleStackView mStackView;
@@ -210,7 +213,6 @@ public class BubbleController implements ConfigurationChangeListener {
    /** Drag and drop controller to register listener for onDragStarted. */
    private DragAndDropController mDragAndDropController;

  
    public BubbleController(Context context,
            ShellInit shellInit,
            ShellCommandHandler shellCommandHandler,
@@ -526,6 +528,12 @@ public class BubbleController implements ConfigurationChangeListener {
        mDataRepository.removeBubblesForUser(removedUserId, parentUserId);
    }

    // TODO(b/256873975): Should pass this into the constructor once flags are available to shell.
    /** Sets whether the bubble bar is enabled (i.e. bubbles pinned to bottom on large screens). */
    public void setBubbleBarEnabled(boolean enabled) {
        mIsBubbleBarEnabled = enabled;
    }

    /** Whether this userId belongs to the current user. */
    private boolean isCurrentProfile(int userId) {
        return userId == UserHandle.USER_ALL
@@ -591,7 +599,8 @@ public class BubbleController implements ConfigurationChangeListener {
            }
            mStackView.setUnbubbleConversationCallback(mSysuiProxy::onUnbubbleConversation);
        }
        if (SHOW_FLOATING_TASKS_AS_BUBBLES && mBubblePositioner.isLargeScreen()) {

        if (mIsBubbleBarEnabled && mBubblePositioner.isLargeScreen()) {
            mBubblePositioner.setUsePinnedLocation(true);
        } else {
            mBubblePositioner.setUsePinnedLocation(false);
@@ -959,14 +968,18 @@ public class BubbleController implements ConfigurationChangeListener {
    }

    /**
     * Adds a bubble for a specific intent. These bubbles are <b>not</b> backed by a notification
     * and remain until the user dismisses the bubble or bubble stack. Only one intent bubble
     * is supported at a time.
     * Adds and expands bubble for a specific intent. These bubbles are <b>not</b> backed by a n
     * otification and remain until the user dismisses the bubble or bubble stack. Only one intent
     * bubble is supported at a time.
     *
     * @param intent the intent to display in the bubble expanded view.
     */
    public void addAppBubble(Intent intent) {
    public void showAppBubble(Intent intent) {
        if (intent == null || intent.getPackage() == null) return;

        PackageManager packageManager = getPackageManagerForUser(mContext, mCurrentUserId);
        if (!isResizableActivity(intent, packageManager, KEY_APP_BUBBLE)) return;

        Bubble b = new Bubble(intent, UserHandle.of(mCurrentUserId), mMainExecutor);
        b.setShouldAutoExpand(true);
        inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false);
@@ -1489,18 +1502,23 @@ public class BubbleController implements ConfigurationChangeListener {
        }
        PackageManager packageManager = getPackageManagerForUser(
                context, entry.getStatusBarNotification().getUser().getIdentifier());
        ActivityInfo info =
                intent.getIntent().resolveActivityInfo(packageManager, 0);
        return isResizableActivity(intent.getIntent(), packageManager, entry.getKey());
    }

    static boolean isResizableActivity(Intent intent, PackageManager packageManager, String key) {
        if (intent == null) {
            Log.w(TAG, "Unable to send as bubble: " + key + " null intent");
            return false;
        }
        ActivityInfo info = intent.resolveActivityInfo(packageManager, 0);
        if (info == null) {
            Log.w(TAG, "Unable to send as bubble, "
                    + entry.getKey() + " couldn't find activity info for intent: "
                    + intent);
            Log.w(TAG, "Unable to send as bubble: " + key
                    + " couldn't find activity info for intent: " + intent);
            return false;
        }
        if (!ActivityInfo.isResizeableMode(info.resizeMode)) {
            Log.w(TAG, "Unable to send as bubble, "
                    + entry.getKey() + " activity is not resizable for intent: "
                    + intent);
            Log.w(TAG, "Unable to send as bubble: " + key
                    + " activity is not resizable for intent: " + intent);
            return false;
        }
        return true;
@@ -1673,6 +1691,13 @@ public class BubbleController implements ConfigurationChangeListener {
            });
        }

        @Override
        public void showAppBubble(Intent intent) {
            mMainExecutor.execute(() -> {
                BubbleController.this.showAppBubble(intent);
            });
        }

        @Override
        public boolean handleDismissalInterception(BubbleEntry entry,
                @Nullable List<BubbleEntry> children, IntConsumer removeCallback,
@@ -1783,6 +1808,13 @@ public class BubbleController implements ConfigurationChangeListener {
            });
        }

        @Override
        public void setBubbleBarEnabled(boolean enabled) {
            mMainExecutor.execute(() -> {
                BubbleController.this.setBubbleBarEnabled(enabled);
            });
        }

        @Override
        public void onNotificationPanelExpandedChanged(boolean expanded) {
            mMainExecutor.execute(
Loading