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

Commit 2d710ce5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8595445 from c7c60d5e to tm-release

Change-Id: I9c9d7013b65effd15a31bd5571a8f7e04e046047
parents a0e622d5 c7c60d5e
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -166,7 +166,16 @@ public final class OutputConfiguration implements Parcelable {
     * {@link #TIMESTAMP_BASE_MONOTONIC}, which is roughly the same time base as
     * {@link android.os.SystemClock#uptimeMillis}.</li>
     * <li> For all other cases, the timestamp base is {@link #TIMESTAMP_BASE_SENSOR}, the same
     * as what's specified by {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE}.</li>
     * as what's specified by {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE}.
     * <ul><li> For a SurfaceTexture output surface, the camera system re-spaces the delivery
     * of output frames based on image readout intervals, reducing viewfinder jitter. The timestamps
     * of images remain to be {@link #TIMESTAMP_BASE_SENSOR}.</li></ul></li>
     *
     * <p>Note that the reduction of frame jitter for SurfaceView and SurfaceTexture comes with
     * slight increase in photon-to-photon latency, which is the time from when photons hit the
     * scene to when the corresponding pixels show up on the screen. If the photon-to-photon latency
     * is more important than the smoothness of viewfinder, {@link #TIMESTAMP_BASE_SENSOR} should be
     * used instead.</p>
     *
     * @see #TIMESTAMP_BASE_CHOREOGRAPHER_SYNCED
     * @see #TIMESTAMP_BASE_MONOTONIC
+53 −1
Original line number Diff line number Diff line
@@ -1530,6 +1530,8 @@ public class ActivityManagerService extends IActivityManager.Stub
    // Encapsulates the global setting "hidden_api_blacklist_exemptions"
    final HiddenApiSettings mHiddenApiBlacklist;
    final SdkSandboxSettings mSdkSandboxSettings;
    private final PlatformCompat mPlatformCompat;
    PackageManagerInternal mPackageManagerInt;
@@ -2235,6 +2237,53 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    /**
     * Handles settings related to the enforcement of SDK sandbox restrictions.
     */
    static class SdkSandboxSettings implements DeviceConfig.OnPropertiesChangedListener {
        private final Context mContext;
        private final Object mLock = new Object();
        @GuardedBy("mLock")
        private boolean mEnforceBroadcastReceiverRestrictions;
        /**
         * Property to enforce broadcast receiver restrictions for SDK sandbox processes. If the
         * value of this property is {@code true}, the restrictions will be enforced.
         */
        public static final String ENFORCE_BROADCAST_RECEIVER_RESTRICTIONS =
                "enforce_broadcast_receiver_restrictions";
        SdkSandboxSettings(Context context) {
            mContext = context;
        }
        void registerObserver() {
            synchronized (mLock) {
                mEnforceBroadcastReceiverRestrictions = DeviceConfig.getBoolean(
                        DeviceConfig.NAMESPACE_SDK_SANDBOX,
                        ENFORCE_BROADCAST_RECEIVER_RESTRICTIONS, false);
                DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SDK_SANDBOX,
                        mContext.getMainExecutor(), this);
            }
        }
        @Override
        public void onPropertiesChanged(DeviceConfig.Properties properties) {
            synchronized (mLock) {
                mEnforceBroadcastReceiverRestrictions = properties.getBoolean(
                        ENFORCE_BROADCAST_RECEIVER_RESTRICTIONS, false);
            }
        }
        boolean isBroadcastReceiverRestrictionsEnforced() {
            synchronized (mLock) {
                return mEnforceBroadcastReceiverRestrictions;
            }
        }
    }
    AppOpsManager getAppOpsManager() {
        if (mAppOpsManager == null) {
            mAppOpsManager = mContext.getSystemService(AppOpsManager.class);
@@ -2287,6 +2336,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        mProcStartHandlerThread = null;
        mProcStartHandler = null;
        mHiddenApiBlacklist = null;
        mSdkSandboxSettings = null;
        mFactoryTest = FACTORY_TEST_OFF;
        mUgmInternal = LocalServices.getService(UriGrantsManagerInternal.class);
        mInternal = new LocalService();
@@ -2406,6 +2456,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        mAtmInternal = LocalServices.getService(ActivityTaskManagerInternal.class);
        mHiddenApiBlacklist = new HiddenApiSettings(mHandler, mContext);
        mSdkSandboxSettings = new SdkSandboxSettings(mContext);
        Watchdog.getInstance().addMonitor(this);
        Watchdog.getInstance().addThread(mHandler);
@@ -7911,6 +7962,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        final boolean alwaysFinishActivities =
                Settings.Global.getInt(resolver, ALWAYS_FINISH_ACTIVITIES, 0) != 0;
        mHiddenApiBlacklist.registerObserver();
        mSdkSandboxSettings.registerObserver();
        mPlatformCompat.registerContentObserver();
        mAppProfiler.retrieveSettings();
@@ -12940,7 +12992,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        // Allow Sandbox process to register only unexported receivers.
        if ((flags & Context.RECEIVER_NOT_EXPORTED) != 0) {
            enforceNotIsolatedCaller("registerReceiver");
        } else {
        } else if (mSdkSandboxSettings.isBroadcastReceiverRestrictionsEnforced()) {
            enforceNotIsolatedOrSdkSandboxCaller("registerReceiver");
        }
        ArrayList<Intent> stickyIntents = null;