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

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

Snap for 4799153 from 3d00f35c to pi-release

Change-Id: I5ea3599d72f5834226fdcd4e5e9cafd217cd9ccf
parents 7ba07578 3d00f35c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -384,16 +384,16 @@ package android.app {

  public final class StatsManager {
    method public void addConfig(long, byte[]) throws android.app.StatsManager.StatsUnavailableException;
    method public boolean addConfiguration(long, byte[]);
    method public byte[] getData(long);
    method public byte[] getMetadata();
    method public deprecated boolean addConfiguration(long, byte[]);
    method public deprecated byte[] getData(long);
    method public deprecated byte[] getMetadata();
    method public byte[] getReports(long) throws android.app.StatsManager.StatsUnavailableException;
    method public byte[] getStatsMetadata() throws android.app.StatsManager.StatsUnavailableException;
    method public void removeConfig(long) throws android.app.StatsManager.StatsUnavailableException;
    method public boolean removeConfiguration(long);
    method public deprecated boolean removeConfiguration(long);
    method public void setBroadcastSubscriber(android.app.PendingIntent, long, long) throws android.app.StatsManager.StatsUnavailableException;
    method public boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
    method public boolean setDataFetchOperation(long, android.app.PendingIntent);
    method public deprecated boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
    method public deprecated boolean setDataFetchOperation(long, android.app.PendingIntent);
    method public void setFetchReportsOperation(android.app.PendingIntent, long) throws android.app.StatsManager.StatsUnavailableException;
    field public static final java.lang.String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
    field public static final java.lang.String EXTRA_STATS_BROADCAST_SUBSCRIBER_COOKIES = "android.app.extra.STATS_BROADCAST_SUBSCRIBER_COOKIES";
+96 −0

File changed.

Preview size limit exceeded, changes collapsed.

+66 −5
Original line number Diff line number Diff line
@@ -4922,7 +4922,8 @@ public class Notification implements Parcelable

            CharSequence[] replyText = mN.extras.getCharSequenceArray(EXTRA_REMOTE_INPUT_HISTORY);
            if (!p.ambient && validRemoteInput && replyText != null
                    && replyText.length > 0 && !TextUtils.isEmpty(replyText[0])) {
                    && replyText.length > 0 && !TextUtils.isEmpty(replyText[0])
                    && p.maxRemoteInputHistory > 0) {
                boolean showSpinner = mN.extras.getBoolean(EXTRA_SHOW_REMOTE_INPUT_SPINNER);
                big.setViewVisibility(R.id.notification_material_reply_container, View.VISIBLE);
                big.setViewVisibility(R.id.notification_material_reply_text_1_container,
@@ -4937,13 +4938,15 @@ public class Notification implements Parcelable
                        ColorStateList.valueOf(
                                isColorized() ? getPrimaryTextColor() : resolveContrastColor()));

                if (replyText.length > 1 && !TextUtils.isEmpty(replyText[1])) {
                if (replyText.length > 1 && !TextUtils.isEmpty(replyText[1])
                        && p.maxRemoteInputHistory > 1) {
                    big.setViewVisibility(R.id.notification_material_reply_text_2, View.VISIBLE);
                    big.setTextViewText(R.id.notification_material_reply_text_2,
                            processTextSpans(replyText[1]));
                    setTextViewColorSecondary(big, R.id.notification_material_reply_text_2);

                    if (replyText.length > 2 && !TextUtils.isEmpty(replyText[2])) {
                    if (replyText.length > 2 && !TextUtils.isEmpty(replyText[2])
                            && p.maxRemoteInputHistory > 2) {
                        big.setViewVisibility(
                                R.id.notification_material_reply_text_3, View.VISIBLE);
                        big.setTextViewText(R.id.notification_material_reply_text_3,
@@ -5106,7 +5109,13 @@ public class Notification implements Parcelable
                return null;
            }

            return applyStandardTemplateWithActions(getBigBaseLayoutResource(), null /* result */);
            // We only want at most a single remote input history to be shown here, otherwise
            // the content would become squished.
            StandardTemplateParams p = mParams.reset().fillTextsFrom(this)
                    .setMaxRemoteInputHistory(1);
            return applyStandardTemplateWithActions(getBigBaseLayoutResource(),
                    p,
                    null /* result */);
        }

        /**
@@ -5975,6 +5984,12 @@ public class Notification implements Parcelable
     * object.
     */
    public static abstract class Style {

        /**
         * The number of items allowed simulatanously in the remote input history.
         * @hide
         */
        static final int MAX_REMOTE_INPUT_HISTORY_LINES = 3;
        private CharSequence mBigContentTitle;

        /**
@@ -7376,7 +7391,14 @@ public class Notification implements Parcelable
                return messages;
            }

            static Message getMessageFromBundle(Bundle bundle) {
            /**
             * @return The message that is stored in the bundle or null if the message couldn't be
             * resolved.
             *
             * @hide
             */
            @Nullable
            public static Message getMessageFromBundle(Bundle bundle) {
                try {
                    if (!bundle.containsKey(KEY_TEXT) || !bundle.containsKey(KEY_TIMESTAMP)) {
                        return null;
@@ -7434,6 +7456,11 @@ public class Notification implements Parcelable
     * @see Notification#bigContentView
     */
    public static class InboxStyle extends Style {

        /**
         * The number of lines of remote input history allowed until we start reducing lines.
         */
        private static final int NUMBER_OF_HISTORY_ALLOWED_UNTIL_REDUCTION = 1;
        private ArrayList<CharSequence> mTexts = new ArrayList<CharSequence>(5);

        public InboxStyle() {
@@ -7533,6 +7560,28 @@ public class Notification implements Parcelable
            if (mBuilder.mActions.size() > 0) {
                maxRows--;
            }
            CharSequence[] remoteInputHistory = mBuilder.mN.extras.getCharSequenceArray(
                    EXTRA_REMOTE_INPUT_HISTORY);
            if (remoteInputHistory != null
                    && remoteInputHistory.length > NUMBER_OF_HISTORY_ALLOWED_UNTIL_REDUCTION) {
                // Let's remove some messages to make room for the remote input history.
                // 1 is always able to fit, but let's remove them if they are 2 or 3
                int numRemoteInputs = Math.min(remoteInputHistory.length,
                        MAX_REMOTE_INPUT_HISTORY_LINES);
                int totalNumRows = mTexts.size() + numRemoteInputs
                        - NUMBER_OF_HISTORY_ALLOWED_UNTIL_REDUCTION;
                if (totalNumRows > maxRows) {
                    int overflow = totalNumRows - maxRows;
                    if (mTexts.size() > maxRows) {
                        // Heuristic: if the Texts don't fit anyway, we'll rather drop the last
                        // few messages, even with the remote input
                        maxRows -= overflow;
                    } else  {
                        // otherwise we drop the first messages
                        i = overflow;
                    }
                }
            }
            while (i < mTexts.size() && i < maxRows) {
                CharSequence str = mTexts.get(i);
                if (!TextUtils.isEmpty(str)) {
@@ -9603,6 +9652,7 @@ public class Notification implements Parcelable
        CharSequence title;
        CharSequence text;
        CharSequence headerTextSecondary;
        int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES;
        boolean hideLargeIcon;
        boolean hideReplyIcon;

@@ -9612,6 +9662,7 @@ public class Notification implements Parcelable
            title = null;
            text = null;
            headerTextSecondary = null;
            maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES;
            return this;
        }

@@ -9663,5 +9714,15 @@ public class Notification implements Parcelable
            this.text = b.processLegacyText(text, ambient);
            return this;
        }

        /**
         * Set the maximum lines of remote input history lines allowed.
         * @param maxRemoteInputHistory The number of lines.
         * @return The builder for method chaining.
         */
        public StandardTemplateParams setMaxRemoteInputHistory(int maxRemoteInputHistory) {
            this.maxRemoteInputHistory = maxRemoteInputHistory;
            return this;
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class ResourcesManager {
    /**
     * The ApkAssets we are caching and intend to hold strong references to.
     */
    private final LruCache<ApkKey, ApkAssets> mLoadedApkAssets = new LruCache<>(15);
    private final LruCache<ApkKey, ApkAssets> mLoadedApkAssets = new LruCache<>(3);

    /**
     * The ApkAssets that are being referenced in the wild that we can reuse, even if they aren't
+12 −10
Original line number Diff line number Diff line
@@ -115,8 +115,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * TODO: Temporary for backwards compatibility. Remove.
     * @deprecated Use {@link #addConfig(long, byte[])}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public boolean addConfiguration(long configKey, byte[] config) {
@@ -149,8 +150,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * TODO: Temporary for backwards compatibility. Remove.
     * @deprecated Use {@link #removeConfig(long)}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public boolean removeConfiguration(long configKey) {
@@ -216,8 +218,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * TODO: Temporary for backwards compatibility. Remove.
     * @deprecated Use {@link #setBroadcastSubscriber(PendingIntent, long, long)}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public boolean setBroadcastSubscriber(
@@ -268,8 +271,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * TODO: Temporary for backwards compatibility. Remove.
     * @deprecated Use {@link #setFetchReportsOperation(PendingIntent, long)}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public boolean setDataFetchOperation(long configKey, PendingIntent pendingIntent) {
@@ -304,8 +308,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * TODO: Temporary for backwards compatibility. Remove.
     * @deprecated Use {@link #getReports(long)}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public @Nullable byte[] getData(long configKey) {
@@ -339,12 +344,9 @@ public final class StatsManager {
        }
    }

    // TODO: Temporary for backwards compatibility. Remove.
    /**
     * Clients can request metadata for statsd. Will contain stats across all configurations but not
     * the actual metrics themselves (metrics must be collected via {@link #getReports(long)}.
     * This getter is not destructive and will not reset any metrics/counters.
     *
     * @return Serialized StatsdStatsReport proto. Returns null on failure (eg, if statsd crashed).
     * @deprecated Use {@link #getStatsMetadata()}
     */
    @RequiresPermission(allOf = { DUMP, PACKAGE_USAGE_STATS })
    public @Nullable byte[] getMetadata() {
Loading