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

Commit 9750237b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8741289 from 94f1ce55 to tm-qpr1-release

Change-Id: If25407ba16f4075bed427325f7bebd54fb526e34
parents b5edf155 94f1ce55
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -5894,16 +5894,16 @@ public final class ActivityThread extends ClientTransactionHandler

        final boolean movedToDifferentDisplay = isDifferentDisplay(activity.getDisplayId(),
                displayId);
        final Configuration currentConfig = activity.mCurrentConfig;
        final int diff = currentConfig.diffPublicOnly(newConfig);
        final boolean hasPublicConfigChange = diff != 0;
        final Configuration currentResConfig = activity.getResources().getConfiguration();
        final int diff = currentResConfig.diffPublicOnly(newConfig);
        final boolean hasPublicResConfigChange = diff != 0;
        final ActivityClientRecord r = getActivityClient(activityToken);
        // TODO(b/173090263): Use diff instead after the improvement of AssetManager and
        // ResourcesImpl constructions.
        final boolean shouldUpdateResources = hasPublicConfigChange
                || shouldUpdateResources(activityToken, currentConfig, newConfig, amOverrideConfig,
                movedToDifferentDisplay, hasPublicConfigChange);
        final boolean shouldReportChange = shouldReportChange(diff, currentConfig, newConfig,
        final boolean shouldUpdateResources = hasPublicResConfigChange
                || shouldUpdateResources(activityToken, currentResConfig, newConfig,
                amOverrideConfig, movedToDifferentDisplay, hasPublicResConfigChange);
        final boolean shouldReportChange = shouldReportChange(activity.mCurrentConfig, newConfig,
                r != null ? r.mSizeConfigurations : null,
                activity.mActivityInfo.getRealConfigChanged());
        // Nothing significant, don't proceed with updating and reporting.
@@ -5927,9 +5927,6 @@ public final class ActivityThread extends ClientTransactionHandler
                amOverrideConfig, contextThemeWrapperOverrideConfig);
        mResourcesManager.updateResourcesForActivity(activityToken, finalOverrideConfig, displayId);

        activity.mConfigChangeFlags = 0;
        activity.mCurrentConfig = new Configuration(newConfig);

        // Apply the ContextThemeWrapper override if necessary.
        // NOTE: Make sure the configurations are not modified, as they are treated as immutable
        // in many places.
@@ -5940,8 +5937,10 @@ public final class ActivityThread extends ClientTransactionHandler
            activity.dispatchMovedToDisplay(displayId, configToReport);
        }

        activity.mConfigChangeFlags = 0;
        if (shouldReportChange) {
            activity.mCalled = false;
            activity.mCurrentConfig = new Configuration(newConfig);
            activity.onConfigurationChanged(configToReport);
            if (!activity.mCalled) {
                throw new SuperNotCalledException("Activity " + activity.getLocalClassName() +
@@ -5956,8 +5955,6 @@ public final class ActivityThread extends ClientTransactionHandler
     * Returns {@code true} if {@link Activity#onConfigurationChanged(Configuration)} should be
     * dispatched.
     *
     * @param publicDiff Usually computed by {@link Configuration#diffPublicOnly(Configuration)}.
     *                   This parameter is to prevent we compute it again.
     * @param currentConfig The current configuration cached in {@link Activity#mCurrentConfig}.
     *                      It is {@code null} before the first config update from the server side.
     * @param newConfig The updated {@link Configuration}
@@ -5966,9 +5963,10 @@ public final class ActivityThread extends ClientTransactionHandler
     * @return {@code true} if the config change should be reported to the Activity
     */
    @VisibleForTesting
    public static boolean shouldReportChange(int publicDiff, @Nullable Configuration currentConfig,
    public static boolean shouldReportChange(@Nullable Configuration currentConfig,
            @NonNull Configuration newConfig, @Nullable SizeConfigurationBuckets sizeBuckets,
            int handledConfigChanges) {
        final int publicDiff = currentConfig.diffPublicOnly(newConfig);
        // Don't report the change if there's no public diff between current and new config.
        if (publicDiff == 0) {
            return false;
+2 −1
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ public final class FullyManagedDeviceProvisioningParams implements Parcelable {
         * Sets a {@link PersistableBundle} that contains admin-specific extras.
         */
        @NonNull
        //TODO(b/235783053) The adminExtras parameter is actually @Nullable.
        public Builder setAdminExtras(@NonNull PersistableBundle adminExtras) {
            mAdminExtras = adminExtras != null
                    ? new PersistableBundle(adminExtras)
@@ -333,7 +334,7 @@ public final class FullyManagedDeviceProvisioningParams implements Parcelable {
                    mLocalTime,
                    mLocale,
                    mDeviceOwnerCanGrantSensorsPermissions,
                    mAdminExtras,
                    mAdminExtras != null ? mAdminExtras : new PersistableBundle(),
                    mDemoDevice);
        }
    }
+2 −1
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ public final class ManagedProfileProvisioningParams implements Parcelable {
         * Sets a {@link Bundle} that contains admin-specific extras.
         */
        @NonNull
        //TODO(b/235783053) The adminExtras parameter is actually @Nullable.
        public Builder setAdminExtras(@NonNull PersistableBundle adminExtras) {
            mAdminExtras = adminExtras != null
                    ? new PersistableBundle(adminExtras)
@@ -274,7 +275,7 @@ public final class ManagedProfileProvisioningParams implements Parcelable {
                    mLeaveAllSystemAppsEnabled,
                    mOrganizationOwnedProvisioning,
                    mKeepingAccountOnMigration,
                    mAdminExtras);
                    mAdminExtras != null ? mAdminExtras : new PersistableBundle());
        }
    }

+3 −3
Original line number Diff line number Diff line
@@ -892,9 +892,9 @@ public abstract class CameraDevice implements AutoCloseable {
     * <tr><th colspan="7">Preview stabilization guaranteed stream configurations</th></tr>
     * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th rowspan="2">Sample use case(s)</th> </tr>
     * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code RECORD}</td><td colspan="4" id="rb"></td> <td>Stabilized preview, GPU video processing, or no-preview stabilized video recording.</td> </tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code PREVIEW}</td> <td>{@code JPEG / YUV}</td><td id="rb">{@code MAXIMUM }</td><td>Standard still imaging with stabilized preview.</td> </tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code PREVIEW}</td> <td>{@code PRIV / YUV}</td><td id="rb">{@code RECORD }</td><td>High-resolution recording with stabilized preview and recording stream.</td> </tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code s1440p}</td><td colspan="4" id="rb"></td> <td>Stabilized preview, GPU video processing, or no-preview stabilized video recording.</td> </tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code s1440p}</td> <td>{@code JPEG / YUV}</td><td id="rb">{@code MAXIMUM }</td><td>Standard still imaging with stabilized preview.</td> </tr>
     * <tr> <td>{@code PRIV / YUV}</td><td id="rb">{@code PREVIEW}</td> <td>{@code PRIV / YUV}</td><td id="rb">{@code s1440p }</td><td>High-resolution recording with stabilized preview and recording stream.</td> </tr>
     * </table><br>
     * <p>
     * For the maximum size column, PREVIEW refers to the best size match to the device's screen
+11 −11
Original line number Diff line number Diff line
@@ -1265,43 +1265,43 @@ public final class MandatoryStreamCombination {
    private static StreamCombinationTemplate sPreviewStabilizedStreamCombinations[] = {
        // 1 stream combinations
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.RECORD)},
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.s1440p)},
                "Stabilized preview, GPU video processing, or no-preview stabilized recording"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.RECORD)},
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.s1440p)},
                "Stabilized preview, GPU video processing, or no-preview stabilized recording"),
        //2 stream combinations
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.JPEG, SizeThreshold.MAXIMUM),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.PREVIEW)},
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.s1440p)},
                "Standard JPEG still imaging with stabilized preview"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.MAXIMUM),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.PREVIEW)},
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.s1440p)},
                "Standard YUV still imaging with stabilized preview"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.MAXIMUM),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.PREVIEW)},
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.s1440p)},
                "Standard YUV still imaging with stabilized in-app image processing stream"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.JPEG, SizeThreshold.MAXIMUM),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.PREVIEW)},
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.s1440p)},
                "Standard JPEG still imaging with stabilized in-app image processing stream"),

        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.RECORD),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.s1440p),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.PREVIEW)},
                "High-resolution video recording with preview both streams stabilized"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.RECORD),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.s1440p),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.PREVIEW)},
                "High-resolution video recording with preview both streams stabilized"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.RECORD),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.s1440p),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.PREVIEW)},
                "High-resolution video recording with preview both streams stabilized"),
        new StreamCombinationTemplate(new StreamTemplate [] {
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.RECORD),
                new StreamTemplate(ImageFormat.YUV_420_888, SizeThreshold.s1440p),
                new StreamTemplate(ImageFormat.PRIVATE, SizeThreshold.PREVIEW)},
                "High-resolution video recording with preview both streams stabilized"),
    };
@@ -1430,7 +1430,7 @@ public final class MandatoryStreamCombination {
            StreamCombinationTemplate []chosenStreamCombinations =
                    sPreviewStabilizedStreamCombinations;

            if (mIsPreviewStabilizationSupported) {
            if (!mIsPreviewStabilizationSupported) {
                Log.v(TAG, "Device does not support preview stabilization");
                 return null;
             }
Loading