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

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

Snap for 7728996 from c8e92727 to sc-qpr1-release

Change-Id: I152e9e54eaf893aac621d73820deb5c91ba6e91a
parents 641776ce c8e92727
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
@@ -559,6 +559,53 @@ public class WallpaperManager {
            return null;
        }

        public Rect peekWallpaperDimensions(Context context, boolean returnDefault, int userId) {
            if (mService != null) {
                try {
                    if (!mService.isWallpaperSupported(context.getOpPackageName())) {
                        return new Rect();
                    }
                } catch (RemoteException e) {
                    throw e.rethrowFromSystemServer();
                }
            }

            Rect dimensions = null;
            synchronized (this) {
                try {
                    Bundle params = new Bundle();
                    // Let's peek user wallpaper first.
                    ParcelFileDescriptor pfd = mService.getWallpaperWithFeature(
                            context.getOpPackageName(), context.getAttributionTag(), this,
                            FLAG_SYSTEM, params, userId);
                    if (pfd != null) {
                        BitmapFactory.Options options = new BitmapFactory.Options();
                        options.inJustDecodeBounds = true;
                        BitmapFactory.decodeFileDescriptor(pfd.getFileDescriptor(), null, options);
                        dimensions = new Rect(0, 0, options.outWidth, options.outHeight);
                    }
                } catch (RemoteException ex) {
                    Log.w(TAG, "peek wallpaper dimensions failed", ex);
                }
            }
            // If user wallpaper is unavailable, may be the default one instead.
            if ((dimensions == null || dimensions.width() == 0 || dimensions.height() == 0)
                    && returnDefault) {
                InputStream is = openDefaultWallpaper(context, FLAG_SYSTEM);
                if (is != null) {
                    try {
                        BitmapFactory.Options options = new BitmapFactory.Options();
                        options.inJustDecodeBounds = true;
                        BitmapFactory.decodeStream(is, null, options);
                        dimensions = new Rect(0, 0, options.outWidth, options.outHeight);
                    } finally {
                        IoUtils.closeQuietly(is);
                    }
                }
            }
            return dimensions;
        }

        void forgetLoadedWallpaper() {
            synchronized (this) {
                mCachedWallpaper = null;
@@ -1038,6 +1085,17 @@ public class WallpaperManager {
        return sGlobals.peekWallpaperBitmap(mContext, true, FLAG_SYSTEM, userId, hardware, cmProxy);
    }

    /**
     * Peek the dimensions of system wallpaper of the user without decoding it.
     *
     * @return the dimensions of system wallpaper
     * @hide
     */
    public Rect peekBitmapDimensions() {
        return sGlobals.peekWallpaperDimensions(
                mContext, true /* returnDefault */, mContext.getUserId());
    }

    /**
     * Get an open, readable file descriptor to the given wallpaper image file.
     * The caller is responsible for closing the file descriptor when done ingesting the file.
+36 −3
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;

@@ -152,6 +153,7 @@ public abstract class WallpaperService extends Service {
    private static final int MSG_REQUEST_WALLPAPER_COLORS = 10050;
    private static final int MSG_ZOOM = 10100;
    private static final int MSG_SCALE_PREVIEW = 10110;
    private static final int MSG_REPORT_SHOWN = 10150;
    private static final List<Float> PROHIBITED_STEPS = Arrays.asList(0f, Float.POSITIVE_INFINITY,
            Float.NEGATIVE_INFINITY);

@@ -526,6 +528,35 @@ public abstract class WallpaperService extends Service {
            return false;
        }

        /**
         * This will be called in the end of {@link #updateSurface(boolean, boolean, boolean)}.
         * If true is returned, the engine will not report shown until rendering finished is
         * reported. Otherwise, the engine will report shown immediately right after redraw phase
         * in {@link #updateSurface(boolean, boolean, boolean)}.
         *
         * @hide
         */
        public boolean shouldWaitForEngineShown() {
            return false;
        }

        /**
         * Reports the rendering is finished, stops waiting, then invokes
         * {@link IWallpaperEngineWrapper#reportShown()}.
         *
         * @hide
         */
        public void reportEngineShown(boolean waitForEngineShown) {
            if (mIWallpaperEngine.mShownReported) return;
            Message message = mCaller.obtainMessage(MSG_REPORT_SHOWN);
            if (!waitForEngineShown) {
                mCaller.removeMessages(MSG_REPORT_SHOWN);
                mCaller.sendMessage(message);
            } else {
                mCaller.sendMessageDelayed(message, TimeUnit.SECONDS.toMillis(1));
            }
        }

        /**
         * Control whether this wallpaper will receive raw touch events
         * from the window manager as the user interacts with the window
@@ -930,7 +961,7 @@ public abstract class WallpaperService extends Service {

        void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNeeded) {
            if (mDestroyed) {
                Log.w(TAG, "Ignoring updateSurface: destroyed");
                Log.w(TAG, "Ignoring updateSurface due to destroyed");
            }

            boolean fixedSize = false;
@@ -1197,7 +1228,6 @@ public abstract class WallpaperService extends Service {
                                        + this);
                            onVisibilityChanged(false);
                        }

                    } finally {
                        mIsCreating = false;
                        mSurfaceCreated = true;
@@ -1207,7 +1237,7 @@ public abstract class WallpaperService extends Service {
                            processLocalColors(mPendingXOffset, mPendingXOffsetStep);
                        }
                        reposition();
                        mIWallpaperEngine.reportShown();
                        reportEngineShown(shouldWaitForEngineShown());
                    }
                } catch (RemoteException ex) {
                }
@@ -2201,6 +2231,9 @@ public abstract class WallpaperService extends Service {
                        // Connection went away, nothing to do in here.
                    }
                } break;
                case MSG_REPORT_SHOWN: {
                    reportShown();
                } break;
                default :
                    Log.w(TAG, "Unknown message type " + message.what);
            }
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.widget;

import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_MANAGED;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX;
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
@@ -1271,6 +1272,14 @@ public class LockPatternUtils {
        }
    }

    /**
     * Whether the user is not allowed to set any credentials via PASSWORD_QUALITY_MANAGED.
     */
    public boolean isCredentialsDisabledForUser(int userId) {
        return getDevicePolicyManager().getPasswordQuality(/* admin= */ null, userId)
                == PASSWORD_QUALITY_MANAGED;
    }

    /**
     * @see StrongAuthTracker#isTrustAllowedForUser
     */
+6 −6
Original line number Diff line number Diff line
@@ -245,9 +245,9 @@
    <string name="oem_unlock_enable_summary" msgid="5857388174390953829">"Tillad, at startindlæseren låses op"</string>
    <string name="confirm_enable_oem_unlock_title" msgid="8249318129774367535">"Vil du tillade OEM-oplåsning?"</string>
    <string name="confirm_enable_oem_unlock_text" msgid="854131050791011970">"ADVARSEL! Funktioner, der beskytter enheden, fungerer ikke på denne enhed, når denne indstilling er aktiveret."</string>
    <string name="mock_location_app" msgid="6269380172542248304">"Vælg app til falsk placering"</string>
    <string name="mock_location_app_not_set" msgid="6972032787262831155">"Der er ikke angivet nogen app til falsk placering"</string>
    <string name="mock_location_app_set" msgid="4706722469342913843">"App til falsk placering: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
    <string name="mock_location_app" msgid="6269380172542248304">"Vælg app til falsk lokation"</string>
    <string name="mock_location_app_not_set" msgid="6972032787262831155">"Der er ikke angivet nogen app til falsk lokation"</string>
    <string name="mock_location_app_set" msgid="4706722469342913843">"App til falsk lokation: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
    <string name="debug_networking_category" msgid="6829757985772659599">"Netværk"</string>
    <string name="wifi_display_certification" msgid="1805579519992520381">"Certificering af trådløs skærm"</string>
    <string name="wifi_verbose_logging" msgid="1785910450009679371">"Aktivér detaljeret Wi-Fi-logføring"</string>
@@ -295,8 +295,8 @@
    <string name="select_logpersist_dialog_title" msgid="7745193591195485594">"Vælg logbuffere, der skal gemmes permanent på enheden"</string>
    <string name="select_usb_configuration_title" msgid="6339801314922294586">"Vælg USB-konfiguration"</string>
    <string name="select_usb_configuration_dialog_title" msgid="3579567144722589237">"Vælg USB-konfiguration"</string>
    <string name="allow_mock_location" msgid="2102650981552527884">"Imiterede placeringer"</string>
    <string name="allow_mock_location_summary" msgid="179780881081354579">"Tillad imiterede placeringer"</string>
    <string name="allow_mock_location" msgid="2102650981552527884">"Imiterede lokationer"</string>
    <string name="allow_mock_location_summary" msgid="179780881081354579">"Tillad imiterede lokationer"</string>
    <string name="debug_view_attributes" msgid="3539609843984208216">"Aktivér visning af attributinspektion"</string>
    <string name="mobile_data_always_on_summary" msgid="1112156365594371019">"Hold altid mobildata aktiveret, selv når Wi-Fi er aktiveret (for at skifte hurtigt mellem netværk)."</string>
    <string name="tethering_hardware_offload_summary" msgid="7801345335142803029">"Brug hardwareacceleration ved netdeling, hvis det er muligt"</string>
@@ -332,7 +332,7 @@
    <string name="debug_monitoring_category" msgid="1597387133765424994">"Overvågning"</string>
    <string name="strict_mode" msgid="889864762140862437">"Striks tilstand aktiveret"</string>
    <string name="strict_mode_summary" msgid="1838248687233554654">"Blink med skærmen, når apps foretager handlinger på hovedtråd"</string>
    <string name="pointer_location" msgid="7516929526199520173">"Markørens placering"</string>
    <string name="pointer_location" msgid="7516929526199520173">"Markørens lokation"</string>
    <string name="pointer_location_summary" msgid="957120116989798464">"Skærmoverlejringen viser de aktuelle berøringsdata"</string>
    <string name="show_touches" msgid="8437666942161289025">"Vis tryk"</string>
    <string name="show_touches_summary" msgid="3692861665994502193">"Vis visuel feedback ved tryk"</string>
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@
    <string name="private_dns_broken" msgid="1984159464346556931">"Жеке DNS серверіне кіру мүмкін емес."</string>
    <string name="wifi_limited_connection" msgid="1184778285475204682">"Шектеулі байланыс"</string>
    <string name="wifi_status_no_internet" msgid="3799933875988829048">"Интернетпен байланыс жоқ"</string>
    <string name="wifi_status_sign_in_required" msgid="2236267500459526855">"Есептік жазбаға кіру керек"</string>
    <string name="wifi_status_sign_in_required" msgid="2236267500459526855">"Аккаунтқа кіру керек"</string>
    <string name="wifi_ap_unable_to_handle_new_sta" msgid="5885145407184194503">"Кіру нүктесі уақытша бос емес"</string>
    <string name="connected_via_carrier" msgid="1968057009076191514">"%1$s арқылы қосылды"</string>
    <string name="available_via_carrier" msgid="465598683092718294">"%1$s арқылы қолжетімді"</string>
Loading