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

Commit ee8d8fdc authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6646601 from ffde9e22 to rvc-qpr1-release

Change-Id: Ic0e168037fd4af605bf23bf2b02b6c4caf086050
parents b6b014cd ffde9e22
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -587,6 +587,8 @@ message Atom {
        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
                10083 [(module) = "framework"];
        DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
        GeneralExternalStorageAccessStats general_external_storage_access_stats =
            10085 [(module) = "mediaprovider"];
    }

    // DO NOT USE field numbers above 100,000 in AOSP.
@@ -4553,6 +4555,31 @@ message VmsClientConnectionStateChanged {
    optional State state  = 2;
}

message MimeTypes {
    repeated string mime_types = 1;
}

/**
 * Logs statistics regarding accesses to external storage.
 * All stats are normalized for one day period.
 *
 * Logged from:
 *   packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
 */
message GeneralExternalStorageAccessStats {
    optional int32 uid = 1 [(is_uid) = true];
    // Total number of accesses like creation, open, delete and rename/update.
    // Includes file path and ContentResolver accesses
    optional uint32 total_accesses = 2;
    // Number of file path accesses, as opposed to file path and ContentResolver.
    optional uint32 file_path_accesses = 3;
    // Number of accesses on secondary volumes like SD cards.
    // Includes file path and ContentResolver accesses
    optional uint32 secondary_storage_accesses = 4;
    // Comma-separated list of mime types that were accessed.
    optional MimeTypes mime_types_accessed = 5;
}

/**
 * Logs when MediaProvider has successfully finished scanning a storage volume.
 *
+3 −0
Original line number Diff line number Diff line
@@ -342,6 +342,9 @@ public class TestDrive {
                    .addPullAtomPackages(PullAtomPackages.newBuilder()
                            .setAtomId(Atom.TRAIN_INFO_FIELD_NUMBER)
                            .addPackages("AID_STATSD"))
                    .addPullAtomPackages(PullAtomPackages.newBuilder()
                            .setAtomId(Atom.GENERAL_EXTERNAL_STORAGE_ACCESS_STATS_FIELD_NUMBER)
                            .addPackages("com.google.android.providers.media.module"))
                    .setHashStringsInMetricReport(false);
        }
    }
+12 −0
Original line number Diff line number Diff line
@@ -757,6 +757,12 @@
      "group": "WM_DEBUG_BOOT",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "-547111355": {
      "message": "hideIme Control target: %s ",
      "level": "DEBUG",
      "group": "WM_DEBUG_IME",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "-545190927": {
      "message": "<<< CLOSE TRANSACTION animate",
      "level": "INFO",
@@ -1087,6 +1093,12 @@
      "group": "WM_ERROR",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "95216706": {
      "message": "hideIme target: %s ",
      "level": "DEBUG",
      "group": "WM_DEBUG_IME",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    "95281111": {
      "message": "Attempted to get IME flag of a display that does not exist: %d",
      "level": "WARN",
+53 −7
Original line number Diff line number Diff line
@@ -124,8 +124,26 @@ class Bubble implements BubbleViewProvider {
    private int mNotificationId;
    private int mAppUid = -1;

    /**
     * A bubble is created and can be updated. This intent is updated until the user first
     * expands the bubble. Once the user has expanded the contents, we ignore the intent updates
     * to prevent restarting the intent & possibly altering UI state in the activity in front of
     * the user.
     *
     * Once the bubble is overflowed, the activity is finished and updates to the
     * notification are respected. Typically an update to an overflowed bubble would result in
     * that bubble being added back to the stack anyways.
     */
    @Nullable
    private PendingIntent mIntent;
    private boolean mIntentActive;
    @Nullable
    private PendingIntent.CancelListener mIntentCancelListener;

    /**
     * Sent when the bubble & notification are no longer visible to the user (i.e. no
     * notification in the shade, no bubble in the stack or overflow).
     */
    @Nullable
    private PendingIntent mDeleteIntent;

@@ -150,13 +168,19 @@ class Bubble implements BubbleViewProvider {
        mShowBubbleUpdateDot = false;
    }

    /** Used in tests when no UI is required. */
    @VisibleForTesting(visibility = PRIVATE)
    Bubble(@NonNull final NotificationEntry e,
            @Nullable final BubbleController.NotificationSuppressionChangedListener listener) {
            @Nullable final BubbleController.NotificationSuppressionChangedListener listener,
            final BubbleController.PendingIntentCanceledListener intentCancelListener) {
        Objects.requireNonNull(e);
        mKey = e.getKey();
        mSuppressionListener = listener;
        mIntentCancelListener = intent -> {
            if (mIntent != null) {
                mIntent.unregisterCancelListener(mIntentCancelListener);
            }
            intentCancelListener.onPendingIntentCanceled(this);
        };
        setEntry(e);
    }

@@ -238,6 +262,10 @@ class Bubble implements BubbleViewProvider {
            mExpandedView = null;
        }
        mIconView = null;
        if (mIntent != null) {
            mIntent.unregisterCancelListener(mIntentCancelListener);
        }
        mIntentActive = false;
    }

    void setPendingIntentCanceled() {
@@ -371,11 +399,24 @@ class Bubble implements BubbleViewProvider {
            mDesiredHeight = entry.getBubbleMetadata().getDesiredHeight();
            mDesiredHeightResId = entry.getBubbleMetadata().getDesiredHeightResId();
            mIcon = entry.getBubbleMetadata().getIcon();

            if (!mIntentActive || mIntent == null) {
                if (mIntent != null) {
                    mIntent.unregisterCancelListener(mIntentCancelListener);
                }
                mIntent = entry.getBubbleMetadata().getIntent();
                if (mIntent != null) {
                    mIntent.registerCancelListener(mIntentCancelListener);
                }
            } else if (mIntent != null && entry.getBubbleMetadata().getIntent() == null) {
                // Was an intent bubble now it's a shortcut bubble... still unregister the listener
                mIntent.unregisterCancelListener(mIntentCancelListener);
                mIntent = null;
            }
            mDeleteIntent = entry.getBubbleMetadata().getDeleteIntent();
        }
        mIsImportantConversation =
                entry.getChannel() == null ? false : entry.getChannel().isImportantConversation();
                entry.getChannel() != null && entry.getChannel().isImportantConversation();
    }

    @Nullable
@@ -395,10 +436,15 @@ class Bubble implements BubbleViewProvider {
    }

    /**
     * @return if the bubble was ever expanded
     * Sets if the intent used for this bubble is currently active (i.e. populating an
     * expanded view, expanded or not).
     */
    boolean getWasAccessed() {
        return mLastAccessed != 0L;
    void setIntentActive() {
        mIntentActive = true;
    }

    boolean isIntentActive() {
        return mIntentActive;
    }

    /**
+23 −17
Original line number Diff line number Diff line
@@ -262,6 +262,16 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        void onBubbleNotificationSuppressionChange(Bubble bubble);
    }

    /**
     * Listener to be notified when a pending intent has been canceled for a bubble.
     */
    public interface PendingIntentCanceledListener {
        /**
         * Called when the pending intent for a bubble has been canceled.
         */
        void onPendingIntentCanceled(Bubble bubble);
    }

    /**
     * Callback for when the BubbleController wants to interact with the notification pipeline to:
     * - Remove a previously bubbled notification
@@ -390,6 +400,18 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
                }
            }
        });
        mBubbleData.setPendingIntentCancelledListener(bubble -> {
            if (bubble.getBubbleIntent() == null) {
                return;
            }
            if (bubble.isIntentActive()) {
                bubble.setPendingIntentCanceled();
                return;
            }
            mHandler.post(
                    () -> removeBubble(bubble.getKey(),
                            BubbleController.DISMISS_INVALID_INTENT));
        });

        mNotificationEntryManager = entryManager;
        mNotificationGroupManager = groupManager;
@@ -1101,23 +1123,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        // Lazy init stack view when a bubble is created
        ensureStackViewCreated();
        bubble.setInflateSynchronously(mInflateSynchronously);
        bubble.inflate(
                b -> {
                    mBubbleData.notificationEntryUpdated(b, suppressFlyout,
                            showInShade);
                    if (bubble.getBubbleIntent() == null) {
                        return;
                    }
                    bubble.getBubbleIntent().registerCancelListener(pendingIntent -> {
                        if (bubble.getWasAccessed()) {
                            bubble.setPendingIntentCanceled();
                            return;
                        }
                        mHandler.post(
                                () -> removeBubble(bubble.getKey(),
                                        BubbleController.DISMISS_INVALID_INTENT));
                    });
                },
        bubble.inflate(b -> mBubbleData.notificationEntryUpdated(b, suppressFlyout, showInShade),
                mContext, mStackView, mBubbleIconFactory, false /* skipInflation */);
    }

Loading