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

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

Merge cherrypicks of [3089203, 3089096] into oc-m2-release

Change-Id: I9e73f762959592435a556ffc0a2da8b37b0275ac
parents a0d70baa a1442ce6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ public abstract class ActivityManagerInternal {
    /**
     * Allow DeviceIdleController to tell us about what apps are whitelisted.
     */
    public abstract void setDeviceIdleWhitelist(int[] appids);
    public abstract void setDeviceIdleWhitelist(int[] userAppids, int[] allAppids);

    /**
     * Update information about which app IDs are on the temp whitelist.
+12 −2
Original line number Diff line number Diff line
@@ -252,8 +252,10 @@ public class AppOpsManager {
    public static final int OP_INSTANT_APP_START_FOREGROUND = 68;
    /** @hide Answer incoming phone calls */
    public static final int OP_ANSWER_PHONE_CALLS = 69;
    /** @hide Run jobs when in background */
    public static final int OP_RUN_ANY_IN_BACKGROUND = 70;
    /** @hide */
    public static final int _NUM_OP = 70;
    public static final int _NUM_OP = 71;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -492,7 +494,8 @@ public class AppOpsManager {
            OP_REQUEST_INSTALL_PACKAGES,
            OP_PICTURE_IN_PICTURE,
            OP_INSTANT_APP_START_FOREGROUND,
            OP_ANSWER_PHONE_CALLS
            OP_ANSWER_PHONE_CALLS,
            OP_RUN_ANY_IN_BACKGROUND,
    };

    /**
@@ -570,6 +573,7 @@ public class AppOpsManager {
            OPSTR_PICTURE_IN_PICTURE,
            OPSTR_INSTANT_APP_START_FOREGROUND,
            OPSTR_ANSWER_PHONE_CALLS,
            null, // OP_RUN_ANY_IN_BACKGROUND
    };

    /**
@@ -647,6 +651,7 @@ public class AppOpsManager {
            "PICTURE_IN_PICTURE",
            "INSTANT_APP_START_FOREGROUND",
            "ANSWER_PHONE_CALLS",
            "RUN_ANY_IN_BACKGROUND",
    };

    /**
@@ -724,6 +729,7 @@ public class AppOpsManager {
            null, // no permission for entering picture-in-picture on hide
            Manifest.permission.INSTANT_APP_FOREGROUND_SERVICE,
            Manifest.permission.ANSWER_PHONE_CALLS,
            null, // no permission for OP_RUN_ANY_IN_BACKGROUND
    };

    /**
@@ -802,6 +808,7 @@ public class AppOpsManager {
            null, // ENTER_PICTURE_IN_PICTURE_ON_HIDE
            null, // INSTANT_APP_START_FOREGROUND
            null, // ANSWER_PHONE_CALLS
            null, // OP_RUN_ANY_IN_BACKGROUND
    };

    /**
@@ -879,6 +886,7 @@ public class AppOpsManager {
            false, // ENTER_PICTURE_IN_PICTURE_ON_HIDE
            false, // INSTANT_APP_START_FOREGROUND
            false, // ANSWER_PHONE_CALLS
            false, // OP_RUN_ANY_IN_BACKGROUND
    };

    /**
@@ -955,6 +963,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ALLOWED,  // OP_PICTURE_IN_PICTURE
            AppOpsManager.MODE_DEFAULT,  // OP_INSTANT_APP_START_FOREGROUND
            AppOpsManager.MODE_ALLOWED, // ANSWER_PHONE_CALLS
            AppOpsManager.MODE_ALLOWED,  // OP_RUN_ANY_IN_BACKGROUND
    };

    /**
@@ -1035,6 +1044,7 @@ public class AppOpsManager {
            false, // OP_PICTURE_IN_PICTURE
            false,
            false, // ANSWER_PHONE_CALLS
            false, // OP_RUN_ANY_IN_BACKGROUND
    };

    /**
+1 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ interface IActivityManager {
    int getLaunchedFromUid(in IBinder activityToken);
    void unstableProviderDied(in IBinder connection);
    boolean isIntentSenderAnActivity(in IIntentSender sender);
    boolean isIntentSenderAForegroundService(in IIntentSender sender);
    int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
            int requestCode, int flags, in ProfilerInfo profilerInfo,
+16 −4
Original line number Diff line number Diff line
@@ -20,18 +20,17 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.Intent;
import android.content.IIntentReceiver;
import android.content.IIntentSender;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.os.Looper;
import android.os.RemoteException;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.AndroidException;

@@ -1010,6 +1009,19 @@ public final class PendingIntent implements Parcelable {
        }
    }

    /**
     * @hide
     * Check whether this PendingIntent will launch a foreground service
     */
    public boolean isForegroundService() {
        try {
            return ActivityManager.getService()
                    .isIntentSenderAForegroundService(mTarget);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     * Return the Intent of this PendingIntent.
+11 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.util.MemoryIntArray;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.ArrayUtils;
@@ -1847,6 +1848,13 @@ public final class Settings {
                if (makeDefault) {
                    arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
                }

                // Log all EBS relevant config changes.
                if (Global.LOW_POWER_MODE_TRIGGER_LEVEL.equals(name)
                        || name.startsWith(Settings.Global.BATTERY_SAVER_CONSTANTS)) {
                    Slog.w("XXX", "Detected write: " + mCallSetCommand + ", " + name + ", args=" + arg, new RuntimeException("HERE"));
                }

                IContentProvider cp = mProviderHolder.getProvider(cr);
                cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
            } catch (RemoteException e) {
@@ -9347,6 +9355,9 @@ public final class Settings {
         */
        public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";

        /** @hide */
        public static final String BATTERY_SAVER_USE_RED_BAR = "battery_saver_use_red_bar";

        /**
         * Battery anomaly detection specific settings
         * This is encoded as a key=value list, separated by commas.
Loading