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

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

Merge cherrypicks of [16634161, 16660805, 16663773, 16636785, 16630306] into sc-v2-release.

Change-Id: Id2dbb9735d18687cea76640d5e1fa97509751b97
parents 11ad7ec6 ac8151be
Loading
Loading
Loading
Loading
+11 −29
Original line number Diff line number Diff line
@@ -1488,27 +1488,18 @@ public class WallpaperManager {
                    mContext.getUserId());
            if (fd != null) {
                FileOutputStream fos = null;
                final Bitmap tmp = BitmapFactory.decodeStream(resources.openRawResource(resid));
                boolean ok = false;
                try {
                    // If the stream can't be decoded, treat it as an invalid input.
                    if (tmp != null) {
                    fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
                        tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
                    copyStreamToWallpaperFile(resources.openRawResource(resid), 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) {
@@ -1750,22 +1741,13 @@ 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);
                        tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
                    copyStreamToWallpaperFile(bitmapData, fos);
                    fos.close();
                    completion.waitForCompletion();
                    } else {
                        throw new IllegalArgumentException("InputStream is invalid");
                    }
                } finally {
                    IoUtils.closeQuietly(fos);
                    if (tmp != null) {
                        tmp.recycle();
                    }
                }
            }
        } catch (RemoteException e) {
+8 −0
Original line number Diff line number Diff line
@@ -158,6 +158,14 @@ public class LocalePickerWithRegion extends ListFragment implements SearchView.O
        setListAdapter(mAdapter);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        // In order to make the list view work with CollapsingToolbarLayout,
        // we have to enable the nested scrolling feature of the list view.
        getListView().setNestedScrollingEnabled(true);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        int id = menuItem.getItemId();
+12 −6
Original line number Diff line number Diff line
@@ -378,7 +378,8 @@
                        android:clickable="true"/>
                </LinearLayout>
            </LinearLayout>
            <FrameLayout

            <LinearLayout
                android:id="@+id/button_layout"
                android:orientation="horizontal"
                android:layout_width="match_parent"
@@ -390,9 +391,10 @@
                android:clickable="false"
                android:focusable="false">

                <FrameLayout
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:layout_gravity="start|center_vertical"
                    android:orientation="vertical">
                    <Button
@@ -401,12 +403,13 @@
                        android:layout_height="wrap_content"
                        android:text="@string/turn_off_airplane_mode"
                        android:ellipsize="end"
                        android:maxLines="1"
                        style="@style/Widget.Dialog.Button.BorderButton"
                        android:clickable="true"
                        android:focusable="true"/>
                </FrameLayout>
                </LinearLayout>

                <FrameLayout
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
@@ -417,10 +420,13 @@
                        android:layout_height="wrap_content"
                        android:text="@string/inline_done_button"
                        style="@style/Widget.Dialog.Button"
                        android:maxLines="1"
                        android:ellipsize="end"
                        android:clickable="true"
                        android:focusable="true"/>
                </FrameLayout>
            </FrameLayout>
                </LinearLayout>
            </LinearLayout>

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</LinearLayout>
+2 −1
Original line number Diff line number Diff line
@@ -942,8 +942,9 @@
    </style>

    <style name="InternetDialog.NetworkSummary">
        <item name="android:layout_marginEnd">34dp</item>
        <item name="android:layout_marginEnd">7dp</item>
        <item name="android:ellipsize">end</item>
        <item name="android:maxLines">2</item>
        <item name="android:textAppearance">@style/TextAppearance.InternetDialog.Secondary</item>
    </style>

+3 −1
Original line number Diff line number Diff line
@@ -159,7 +159,9 @@ public class MediaProjectionPermissionActivity extends Activity
        mDialog.getButton(DialogInterface.BUTTON_POSITIVE).setFilterTouchesWhenObscured(true);

        final Window w = mDialog.getWindow();
        w.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        // QS is not closed when pressing CastTile. Match the type of the dialog shown from the
        // tile.
        w.setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
        w.addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        mDialog.show();
Loading