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

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

Snap for 10094917 from db4214ef to udc-qpr1-release

Change-Id: I9042dd938d66205a4c5505dea5f16e6ad6db592c
parents 6ea4abd4 db4214ef
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4124,6 +4124,10 @@ public class JobSchedulerService extends com.android.server.SystemService
                if (namespace.isEmpty()) {
                    throw new IllegalArgumentException("namespace cannot be empty");
                }
                if (namespace.length() > 1000) {
                    throw new IllegalArgumentException(
                            "namespace cannot be more than 1000 characters");
                }
                namespace = namespace.intern();
            }
            return namespace;
+15 −0
Original line number Diff line number Diff line
@@ -4432,6 +4432,21 @@ public class ActivityManager {
        forceStopPackageAsUser(packageName, mContext.getUserId());
    }

    /**
     * Similar to {@link #forceStopPackageAsUser(String, int)} but will also stop the package even
     * when the user is in the stopping state.
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.FORCE_STOP_PACKAGES)
    public void forceStopPackageAsUserEvenWhenStopping(String packageName, @UserIdInt int userId) {
        try {
            getService().forceStopPackageEvenWhenStopping(packageName, userId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Sets the current locales of the device. Calling app must have the permission
     * {@code android.permission.CHANGE_CONFIGURATION} and
+1 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ interface IActivityManager {
    boolean registerForegroundServiceObserver(in IForegroundServiceObserver callback);
    @UnsupportedAppUsage
    void forceStopPackage(in String packageName, int userId);
    void forceStopPackageEvenWhenStopping(in String packageName, int userId);
    boolean killPids(in int[] pids, in String reason, boolean secure);
    @UnsupportedAppUsage
    List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
+24 −14
Original line number Diff line number Diff line
@@ -2887,8 +2887,9 @@ public class Notification implements Parcelable
                visitor.accept(person.getIconUri());
            }
            final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
                    extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS);
            final RemoteInputHistoryItem[] history = extras.getParcelableArray(
                    Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
                    RemoteInputHistoryItem.class);
            if (history != null) {
                for (int i = 0; i < history.length; i++) {
                    RemoteInputHistoryItem item = history[i];
@@ -2900,7 +2901,8 @@ public class Notification implements Parcelable
        }
        if (isStyle(MessagingStyle.class) && extras != null) {
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES,
                    Parcelable.class);
            if (!ArrayUtils.isEmpty(messages)) {
                for (MessagingStyle.Message message : MessagingStyle.Message
                        .getMessagesFromBundleArray(messages)) {
@@ -2913,7 +2915,8 @@ public class Notification implements Parcelable
                }
            }
            final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
            final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES,
                    Parcelable.class);
            if (!ArrayUtils.isEmpty(historic)) {
                for (MessagingStyle.Message message : MessagingStyle.Message
                        .getMessagesFromBundleArray(historic)) {
@@ -2925,14 +2928,16 @@ public class Notification implements Parcelable
                    }
                }
            }
            visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON, Icon.class));
        }
        if (isStyle(CallStyle.class) & extras != null) {
            Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON);
            Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON, Person.class);
            if (callPerson != null) {
                visitor.accept(callPerson.getIconUri());
            }
            visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON));
            visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON, Icon.class));
        }
        if (mBubbleMetadata != null) {
@@ -3407,7 +3412,7 @@ public class Notification implements Parcelable
     * separate object, replace it with the field's version to avoid holding duplicate copies.
     */
    private void fixDuplicateExtra(@Nullable Parcelable original, @NonNull String extraName) {
        if (original != null && extras.getParcelable(extraName) != null) {
        if (original != null && extras.getParcelable(extraName, Parcelable.class) != null) {
            extras.putParcelable(extraName, original);
        }
    }
@@ -7084,7 +7089,8 @@ public class Notification implements Parcelable
     */
    public boolean hasImage() {
        if (isStyle(MessagingStyle.class) && extras != null) {
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES,
                    Parcelable.class);
            if (!ArrayUtils.isEmpty(messages)) {
                for (MessagingStyle.Message m : MessagingStyle.Message
                        .getMessagesFromBundleArray(messages)) {
@@ -8286,15 +8292,18 @@ public class Notification implements Parcelable
        protected void restoreFromExtras(Bundle extras) {
            super.restoreFromExtras(extras);
            mUser = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
            if (mUser == null) {
            Person user = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
            if (user == null) {
                CharSequence displayName = extras.getCharSequence(EXTRA_SELF_DISPLAY_NAME);
                mUser = new Person.Builder().setName(displayName).build();
            } else {
                mUser = user;
            }
            mConversationTitle = extras.getCharSequence(EXTRA_CONVERSATION_TITLE);
            Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
            Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES, Parcelable.class);
            mMessages = Message.getMessagesFromBundleArray(messages);
            Parcelable[] histMessages = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
            Parcelable[] histMessages = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES,
                    Parcelable.class);
            mHistoricMessages = Message.getMessagesFromBundleArray(histMessages);
            mIsGroupConversation = extras.getBoolean(EXTRA_IS_GROUP_CONVERSATION);
            mUnreadMessageCount = extras.getInt(EXTRA_CONVERSATION_UNREAD_MESSAGE_COUNT);
@@ -11962,7 +11971,8 @@ public class Notification implements Parcelable
                if (b == null) {
                    return null;
                }
                Parcelable[] parcelableMessages = b.getParcelableArray(KEY_MESSAGES);
                Parcelable[] parcelableMessages = b.getParcelableArray(KEY_MESSAGES,
                        Parcelable.class);
                String[] messages = null;
                if (parcelableMessages != null) {
                    String[] tmp = new String[parcelableMessages.length];
@@ -12299,7 +12309,7 @@ public class Notification implements Parcelable
    @Nullable
    private static <T extends Parcelable> T[] getParcelableArrayFromBundle(
            Bundle bundle, String key, Class<T> itemClass) {
        final Parcelable[] array = bundle.getParcelableArray(key);
        final Parcelable[] array = bundle.getParcelableArray(key, Parcelable.class);
        final Class<?> arrayClass = Array.newInstance(itemClass, 0).getClass();
        if (arrayClass.isInstance(array) || array == null) {
            return (T[]) array;
+119 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.annotation.IntDef;
import android.os.Parcel;
import android.os.Parcelable;

@@ -24,19 +25,132 @@ import android.os.Parcelable;
 * {@hide}
 */
public final class ProcessMemoryState implements Parcelable {
    /**
     * The type of the component this process is hosting;
     * this means not hosting any components (cached).
     */
    public static final int HOSTING_COMPONENT_TYPE_EMPTY =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_EMPTY;

    /**
     * The type of the component this process is hosting;
     * this means it's a system process.
     */
    public static final int HOSTING_COMPONENT_TYPE_SYSTEM =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_SYSTEM;

    /**
     * The type of the component this process is hosting;
     * this means it's a persistent process.
     */
    public static final int HOSTING_COMPONENT_TYPE_PERSISTENT =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_PERSISTENT;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting a backup/restore agent.
     */
    public static final int HOSTING_COMPONENT_TYPE_BACKUP =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_BACKUP;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting an instrumentation.
     */
    public static final int HOSTING_COMPONENT_TYPE_INSTRUMENTATION =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_INSTRUMENTATION;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting an activity.
     */
    public static final int HOSTING_COMPONENT_TYPE_ACTIVITY =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_ACTIVITY;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting a broadcast receiver.
     */
    public static final int HOSTING_COMPONENT_TYPE_BROADCAST_RECEIVER =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_BROADCAST_RECEIVER;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting a content provider.
     */
    public static final int HOSTING_COMPONENT_TYPE_PROVIDER =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_PROVIDER;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting a started service.
     */
    public static final int HOSTING_COMPONENT_TYPE_STARTED_SERVICE =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_STARTED_SERVICE;

    /**
     * The type of the component this process is hosting;
     * this means it's hosting a foreground service.
     */
    public static final int HOSTING_COMPONENT_TYPE_FOREGROUND_SERVICE =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_FOREGROUND_SERVICE;

    /**
     * The type of the component this process is hosting;
     * this means it's being bound via a service binding.
     */
    public static final int HOSTING_COMPONENT_TYPE_BOUND_SERVICE =
            AppProtoEnums.HOSTING_COMPONENT_TYPE_BOUND_SERVICE;

    /**
     * The type of the component this process is hosting.
     * @hide
     */
    @IntDef(flag = true, prefix = { "HOSTING_COMPONENT_TYPE_" }, value = {
            HOSTING_COMPONENT_TYPE_EMPTY,
            HOSTING_COMPONENT_TYPE_SYSTEM,
            HOSTING_COMPONENT_TYPE_PERSISTENT,
            HOSTING_COMPONENT_TYPE_BACKUP,
            HOSTING_COMPONENT_TYPE_INSTRUMENTATION,
            HOSTING_COMPONENT_TYPE_ACTIVITY,
            HOSTING_COMPONENT_TYPE_BROADCAST_RECEIVER,
            HOSTING_COMPONENT_TYPE_PROVIDER,
            HOSTING_COMPONENT_TYPE_STARTED_SERVICE,
            HOSTING_COMPONENT_TYPE_FOREGROUND_SERVICE,
            HOSTING_COMPONENT_TYPE_BOUND_SERVICE,
    })
    public @interface HostingComponentType {}

    public final int uid;
    public final int pid;
    public final String processName;
    public final int oomScore;
    public final boolean hasForegroundServices;

    /**
     * The types of the components this process is hosting at the moment this snapshot is taken.
     *
     * Its value is the combination of {@link HostingComponentType}.
     */
    public final int mHostingComponentTypes;

    /**
     * The historical types of the components this process is or was hosting since it's born.
     *
     * Its value is the combination of {@link HostingComponentType}.
     */
    public final int mHistoricalHostingComponentTypes;

    public ProcessMemoryState(int uid, int pid, String processName, int oomScore,
            boolean hasForegroundServices) {
            boolean hasForegroundServices, int hostingComponentTypes,
            int historicalHostingComponentTypes) {
        this.uid = uid;
        this.pid = pid;
        this.processName = processName;
        this.oomScore = oomScore;
        this.hasForegroundServices = hasForegroundServices;
        this.mHostingComponentTypes = hostingComponentTypes;
        this.mHistoricalHostingComponentTypes = historicalHostingComponentTypes;
    }

    private ProcessMemoryState(Parcel in) {
@@ -45,6 +159,8 @@ public final class ProcessMemoryState implements Parcelable {
        processName = in.readString();
        oomScore = in.readInt();
        hasForegroundServices = in.readInt() == 1;
        mHostingComponentTypes = in.readInt();
        mHistoricalHostingComponentTypes = in.readInt();
    }

    public static final @android.annotation.NonNull Creator<ProcessMemoryState> CREATOR = new Creator<ProcessMemoryState>() {
@@ -71,5 +187,7 @@ public final class ProcessMemoryState implements Parcelable {
        parcel.writeString(processName);
        parcel.writeInt(oomScore);
        parcel.writeInt(hasForegroundServices ? 1 : 0);
        parcel.writeInt(mHostingComponentTypes);
        parcel.writeInt(mHistoricalHostingComponentTypes);
    }
}
Loading