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

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

Snap for 8852680 from 3fce0b03 to tm-qpr1-release

Change-Id: I4d3e0b7fde361ed85d9f260d51de30fa39374a32
parents 7356fadf 3fce0b03
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.LongArrayQueue;
@@ -334,12 +335,18 @@ public class AlarmManagerService extends SystemService {
            "REORDER_ALARMS_FOR_TARE",
    });

    BroadcastOptions mOptsWithFgs = BroadcastOptions.makeBasic();
    BroadcastOptions mOptsWithFgsForAlarmClock = BroadcastOptions.makeBasic();
    BroadcastOptions mOptsWithoutFgs = BroadcastOptions.makeBasic();
    BroadcastOptions mOptsTimeBroadcast = BroadcastOptions.makeBasic();
    BroadcastOptions mOptsWithFgs = makeBasicAlarmBroadcastOptions();
    BroadcastOptions mOptsWithFgsForAlarmClock = makeBasicAlarmBroadcastOptions();
    BroadcastOptions mOptsWithoutFgs = makeBasicAlarmBroadcastOptions();
    BroadcastOptions mOptsTimeBroadcast = makeBasicAlarmBroadcastOptions();
    ActivityOptions mActivityOptsRestrictBal = ActivityOptions.makeBasic();
    BroadcastOptions mBroadcastOptsRestrictBal = BroadcastOptions.makeBasic();
    BroadcastOptions mBroadcastOptsRestrictBal = makeBasicAlarmBroadcastOptions();

    private static BroadcastOptions makeBasicAlarmBroadcastOptions() {
        final BroadcastOptions b = BroadcastOptions.makeBasic();
        b.setAlarmBroadcast(true);
        return b;
    }

    // TODO(b/172085676): Move inside alarm store.
    private final SparseArray<AlarmManager.AlarmClockInfo> mNextAlarmClockForUser =
@@ -2299,7 +2306,11 @@ public class AlarmManagerService extends SystemService {
                                + " reached for uid: " + UserHandle.formatUid(callingUid)
                                + ", callingPackage: " + callingPackage;
                Slog.w(TAG, errorMsg);
                if (callingUid != Process.SYSTEM_UID) {
                    throw new IllegalStateException(errorMsg);
                } else {
                    EventLog.writeEvent(0x534e4554, "234441463", -1, errorMsg);
                }
            }
            setImplLocked(type, triggerAtTime, triggerElapsed, windowLength, interval, operation,
                    directReceiver, listenerTag, flags, workSource, alarmClock, callingUid,
+2 −2
Original line number Diff line number Diff line
@@ -5956,7 +5956,7 @@ package android.location {
    method public int getEphemerisSource();
    method @FloatRange public double getIonoDelayMeters();
    method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
    method @IntRange(from=0, to=255) public int getIssueOfDataEphemeris();
    method @IntRange(from=0, to=1023) public int getIssueOfDataEphemeris();
    method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
    method @IntRange(from=0) public long getTimeOfClockSeconds();
    method @IntRange(from=0) public long getTimeOfEphemerisSeconds();
@@ -5984,7 +5984,7 @@ package android.location {
    method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int);
    method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
    method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int);
    method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=255) int);
    method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=1023) int);
    method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
    method @NonNull public android.location.SatellitePvt.Builder setTimeOfClockSeconds(@IntRange(from=0) long);
    method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemerisSeconds(@IntRange(from=0) long);
+33 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public class BroadcastOptions extends ComponentOptions {
    private String[] mRequireNoneOfPermissions;
    private long mRequireCompatChangeId = CHANGE_INVALID;
    private boolean mRequireCompatChangeEnabled = true;
    private boolean mIsAlarmBroadcast = false;
    private long mIdForResponseEvent;

    /**
@@ -148,6 +149,13 @@ public class BroadcastOptions extends ComponentOptions {
    private static final String KEY_REQUIRE_COMPAT_CHANGE_ENABLED =
            "android:broadcast.requireCompatChangeEnabled";

    /**
     * Corresponds to {@link #setAlarmBroadcast(boolean)}
     * @hide
     */
    public static final String KEY_ALARM_BROADCAST =
            "android:broadcast.is_alarm";

    /**
     * @hide
     * @deprecated Use {@link android.os.PowerExemptionManager#
@@ -207,6 +215,7 @@ public class BroadcastOptions extends ComponentOptions {
        mRequireCompatChangeId = opts.getLong(KEY_REQUIRE_COMPAT_CHANGE_ID, CHANGE_INVALID);
        mRequireCompatChangeEnabled = opts.getBoolean(KEY_REQUIRE_COMPAT_CHANGE_ENABLED, true);
        mIdForResponseEvent = opts.getLong(KEY_ID_FOR_RESPONSE_EVENT);
        mIsAlarmBroadcast = opts.getBoolean(KEY_ALARM_BROADCAST, false);
    }

    /**
@@ -498,6 +507,27 @@ public class BroadcastOptions extends ComponentOptions {
        mRequireCompatChangeEnabled = true;
    }

    /**
     * When set, this broadcast will be understood as having originated from an
     * alarm going off.  Only the OS itself can use this option; uses by other
     * senders will be ignored.
     * @hide
     *
     * @param senderIsAlarm Whether the broadcast is alarm-triggered.
     */
    public void setAlarmBroadcast(boolean senderIsAlarm) {
        mIsAlarmBroadcast = senderIsAlarm;
    }

    /**
     * Did this broadcast originate from an alarm triggering?
     * @return true if this broadcast is an alarm message, false otherwise
     * @hide
     */
    public boolean isAlarmBroadcast() {
        return mIsAlarmBroadcast;
    }

    /** {@hide} */
    public long getRequireCompatChangeId() {
        return mRequireCompatChangeId;
@@ -560,6 +590,9 @@ public class BroadcastOptions extends ComponentOptions {
            b.putInt(KEY_TEMPORARY_APP_ALLOWLIST_REASON_CODE, mTemporaryAppAllowlistReasonCode);
            b.putString(KEY_TEMPORARY_APP_ALLOWLIST_REASON, mTemporaryAppAllowlistReason);
        }
        if (mIsAlarmBroadcast) {
            b.putBoolean(KEY_ALARM_BROADCAST, true);
        }
        if (mMinManifestReceiverApiLevel != 0) {
            b.putInt(KEY_MIN_MANIFEST_RECEIVER_API_LEVEL, mMinManifestReceiverApiLevel);
        }
+39 −0
Original line number Diff line number Diff line
@@ -783,6 +783,17 @@ public class Instrumentation {
            return null;
        }

        /**
         * This is called after starting an Activity and provides the result code that defined in
         * {@link ActivityManager}, like {@link ActivityManager#START_SUCCESS}.
         *
         * @param result the result code that returns after starting an Activity.
         * @param bOptions the bundle generated from {@link ActivityOptions} that originally
         *                 being used to start the Activity.
         * @hide
         */
        public void onStartActivityResult(int result, @NonNull Bundle bOptions) {}

        final boolean match(Context who,
                            Activity activity,
                            Intent intent) {
@@ -1344,6 +1355,28 @@ public class Instrumentation {
        return apk.getAppFactory();
    }

    /**
     * This should be called before {@link #checkStartActivityResult(int, Object)}, because
     * exceptions might be thrown while checking the results.
     */
    private void notifyStartActivityResult(int result, @Nullable Bundle options) {
        if (mActivityMonitors == null) {
            return;
        }
        synchronized (mSync) {
            final int size = mActivityMonitors.size();
            for (int i = 0; i < size; i++) {
                final ActivityMonitor am = mActivityMonitors.get(i);
                if (am.ignoreMatchingSpecificIntents()) {
                    if (options == null) {
                        options = ActivityOptions.makeBasic().toBundle();
                    }
                    am.onStartActivityResult(result, options);
                }
            }
        }
    }

    private void prePerformCreate(Activity activity) {
        if (mWaitingActivities != null) {
            synchronized (mSync) {
@@ -1802,6 +1835,7 @@ public class Instrumentation {
                    who.getOpPackageName(), who.getAttributionTag(), intent,
                    intent.resolveTypeIfNeeded(who.getContentResolver()), token,
                    target != null ? target.mEmbeddedID : null, requestCode, 0, null, options);
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
            throw new RuntimeException("Failure from system", e);
@@ -1876,6 +1910,7 @@ public class Instrumentation {
            int result = ActivityTaskManager.getService().startActivities(whoThread,
                    who.getOpPackageName(), who.getAttributionTag(), intents, resolvedTypes,
                    token, options, userId);
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intents[0]);
            return result;
        } catch (RemoteException e) {
@@ -1947,6 +1982,7 @@ public class Instrumentation {
                    who.getOpPackageName(), who.getAttributionTag(), intent,
                    intent.resolveTypeIfNeeded(who.getContentResolver()), token, target,
                    requestCode, 0, null, options);
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
            throw new RuntimeException("Failure from system", e);
@@ -2017,6 +2053,7 @@ public class Instrumentation {
                    who.getOpPackageName(), who.getAttributionTag(), intent,
                    intent.resolveTypeIfNeeded(who.getContentResolver()), token, resultWho,
                    requestCode, 0, null, options, user.getIdentifier());
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
            throw new RuntimeException("Failure from system", e);
@@ -2068,6 +2105,7 @@ public class Instrumentation {
                            token, target != null ? target.mEmbeddedID : null,
                            requestCode, 0, null, options,
                            ignoreTargetSecurity, userId);
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
            throw new RuntimeException("Failure from system", e);
@@ -2115,6 +2153,7 @@ public class Instrumentation {
            int result = appTask.startActivity(whoThread.asBinder(), who.getOpPackageName(),
                    who.getAttributionTag(), intent,
                    intent.resolveTypeIfNeeded(who.getContentResolver()), options);
            notifyStartActivityResult(result, options);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
            throw new RuntimeException("Failure from system", e);
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.view;

import android.content.ComponentName;
import android.view.InsetsSourceControl;
import android.view.InsetsState;
import android.view.InsetsVisibilities;
@@ -30,10 +31,11 @@ oneway interface IDisplayWindowInsetsController {
    /**
     * Called when top focused window changes to determine whether or not to take over insets
     * control. Won't be called if config_remoteInsetsControllerControlsSystemBars is false.
     * @param packageName: Passes the top package name
     * @param component: Passes the top application component in the focused window.
     * @param requestedVisibilities The insets visibilities requested by the focussed window.
     */
    void topFocusedWindowChanged(String packageName, in InsetsVisibilities insetsVisibilities);
    void topFocusedWindowChanged(in ComponentName component,
            in InsetsVisibilities insetsVisibilities);

    /**
     * @see IWindow#insetsChanged
Loading