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

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

Snap for 7977275 from f12551c3 to sc-v2-release

Change-Id: I2c50db74666c21ac13c571bcf7302f12d7e3bb4d
parents 2f5ea415 f12551c3
Loading
Loading
Loading
Loading
+29 −11
Original line number Diff line number Diff line
@@ -1488,18 +1488,27 @@ public class WallpaperManager {
                    mContext.getUserId());
            if (fd != null) {
                FileOutputStream fos = null;
                boolean ok = false;
                final Bitmap tmp = BitmapFactory.decodeStream(resources.openRawResource(resid));
                try {
                    // If the stream can't be decoded, treat it as an invalid input.
                    if (tmp != null) {
                        fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
                    copyStreamToWallpaperFile(resources.openRawResource(resid), fos);
                        tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
                        // The 'close()' is the trigger for any server-side image manipulation,
                        // so we must do that before waiting for completion.
                        fos.close();
                        completion.waitForCompletion();
                    } else {
                        throw new IllegalArgumentException(
                                "Resource 0x" + Integer.toHexString(resid) + " is invalid");
                    }
                } finally {
                    // Might be redundant but completion shouldn't wait unless the write
                    // succeeded; this is a fallback if it threw past the close+wait.
                    IoUtils.closeQuietly(fos);
                    if (tmp != null) {
                        tmp.recycle();
                    }
                }
            }
        } catch (RemoteException e) {
@@ -1741,13 +1750,22 @@ public class WallpaperManager {
                    result, which, completion, mContext.getUserId());
            if (fd != null) {
                FileOutputStream fos = null;
                final Bitmap tmp = BitmapFactory.decodeStream(bitmapData);
                try {
                    // If the stream can't be decoded, treat it as an invalid input.
                    if (tmp != null) {
                        fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
                    copyStreamToWallpaperFile(bitmapData, fos);
                        tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
                        fos.close();
                        completion.waitForCompletion();
                    } else {
                        throw new IllegalArgumentException("InputStream is invalid");
                    }
                } finally {
                    IoUtils.closeQuietly(fos);
                    if (tmp != null) {
                        tmp.recycle();
                    }
                }
            }
        } catch (RemoteException e) {
+16 −0
Original line number Diff line number Diff line
@@ -952,6 +952,22 @@ public final class Settings {
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS";
    /**
     * Activity Action: Show settings to allow pairing bluetooth devices.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you
     * safeguard against this.
     * <p>
     * Input: Nothing.
     * <p>
     * Output: Nothing.
     *
     * @hide
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_BLUETOOTH_PAIRING_SETTINGS =
            "android.settings.BLUETOOTH_PAIRING_SETTINGS";
    /**
     * Activity Action: Show settings to configure input methods, in particular
     * allowing the user to enable input methods.
+7 −15
Original line number Diff line number Diff line
@@ -270,8 +270,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
    private Drawable mCaptionBackgroundDrawable;
    private Drawable mUserCaptionBackgroundDrawable;

    private float mAvailableWidth;

    String mLogTag = TAG;
    private final Rect mFloatingInsets = new Rect();
    private boolean mApplyFloatingVerticalInsets = false;
@@ -315,8 +313,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
        mSemiTransparentBarColor = context.getResources().getColor(
                R.color.system_bar_background_semi_transparent, null /* theme */);

        updateAvailableWidth();

        setWindow(window);

        updateLogTag(params);
@@ -697,7 +693,8 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
        final Resources res = getContext().getResources();
        final DisplayMetrics metrics = res.getDisplayMetrics();
        final boolean isPortrait =
                getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT;

@@ -767,17 +764,19 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind

        if (!fixedWidth && widthMode == AT_MOST) {
            final TypedValue tv = isPortrait ? mWindow.mMinWidthMinor : mWindow.mMinWidthMajor;
            final float availableWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                    res.getConfiguration().screenWidthDp, metrics);
            if (tv.type != TypedValue.TYPE_NULL) {
                final int min;
                if (tv.type == TypedValue.TYPE_DIMENSION) {
                    min = (int) tv.getDimension(metrics);
                } else if (tv.type == TypedValue.TYPE_FRACTION) {
                    min = (int)tv.getFraction(mAvailableWidth, mAvailableWidth);
                    min = (int) tv.getFraction(availableWidth, availableWidth);
                } else {
                    min = 0;
                }
                if (DEBUG_MEASURE) Log.d(mLogTag, "Adjust for min width: " + min + ", value::"
                        + tv.coerceToString() + ", mAvailableWidth=" + mAvailableWidth);
                        + tv.coerceToString() + ", mAvailableWidth=" + availableWidth);

                if (width < min) {
                    widthMeasureSpec = MeasureSpec.makeMeasureSpec(min, EXACTLY);
@@ -2144,7 +2143,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind

        updateDecorCaptionStatus(newConfig);

        updateAvailableWidth();
        initializeElevation();
    }

@@ -2616,12 +2614,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
        mLogTag = TAG + "[" + getTitleSuffix(params) + "]";
    }

    private void updateAvailableWidth() {
        Resources res = getResources();
        mAvailableWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                res.getConfiguration().screenWidthDp, res.getDisplayMetrics());
    }

    /**
     * @hide
     */
+5 −0
Original line number Diff line number Diff line
@@ -120,6 +120,11 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
        mEnableDismissDragToEdge = res.getBoolean(R.bool.config_pipEnableDismissDragToEdge);
        mDismissAreaHeight = res.getDimensionPixelSize(R.dimen.floating_dismiss_gradient_height);

        if (mTargetViewContainer != null) {
            // init can be called multiple times, remove the old one from view hierarchy first.
            mWindowManager.removeViewImmediate(mTargetViewContainer);
        }

        mTargetView = new DismissCircleView(mContext);
        mTargetViewContainer = new FrameLayout(mContext);
        mTargetViewContainer.setBackgroundDrawable(
+2 −2
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@
    <dimen name="settingslib_switchbar_margin">16dp</dimen>

    <!-- Size of layout margin left -->
    <dimen name="settingslib_switchbar_padding_left">24dp</dimen>
    <dimen name="settingslib_switchbar_padding_left">20dp</dimen>

    <!-- Size of layout margin right -->
    <dimen name="settingslib_switchbar_padding_right">16dp</dimen>
    <dimen name="settingslib_switchbar_padding_right">20dp</dimen>

    <!-- Minimum width of switch -->
    <dimen name="settingslib_min_switch_width">52dp</dimen>
Loading