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

Commit a84433b7 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5339334 from cd8eace9 to pi-qpr3-release

Change-Id: Ied7bc8e2a9c318dd17cf4bc32aa213187c96ace2
parents 5812c578 cd8eace9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ public class ScheduleCalendar {
            }
            // only allow alarms in the future
            if (nextAlarm > now) {
                // store earliest alarm
                if (mSchedule.nextAlarm == 0) {
                if (mSchedule.nextAlarm == 0 || mSchedule.nextAlarm < now) {
                    mSchedule.nextAlarm = nextAlarm;
                } else {
                    // store earliest alarm
                    mSchedule.nextAlarm = Math.min(mSchedule.nextAlarm, nextAlarm);
                }
            } else if (mSchedule.nextAlarm < now) {
+3 −11
Original line number Diff line number Diff line
@@ -418,28 +418,20 @@ public class AccessibilityCache {
     *
     * @param nodes The nodes in the hosting window.
     * @param rootNodeId The id of the root to evict.
     *
     * @return {@code true} if the cache was cleared
     */
    private boolean clearSubTreeRecursiveLocked(LongSparseArray<AccessibilityNodeInfo> nodes,
    private void clearSubTreeRecursiveLocked(LongSparseArray<AccessibilityNodeInfo> nodes,
            long rootNodeId) {
        AccessibilityNodeInfo current = nodes.get(rootNodeId);
        if (current == null) {
            // The node isn't in the cache, but its descendents might be.
            clear();
            return true;
            return;
        }
        nodes.remove(rootNodeId);
        final int childCount = current.getChildCount();
        for (int i = 0; i < childCount; i++) {
            final long childNodeId = current.getChildId(i);
            if (clearSubTreeRecursiveLocked(nodes, childNodeId)) {
                current.recycle();
                return true;
            }
            clearSubTreeRecursiveLocked(nodes, childNodeId);
        }
        current.recycle();
        return false;
    }

    /**
+9 −7
Original line number Diff line number Diff line
@@ -39,9 +39,9 @@ public class WebResourceResponse {

    /**
     * Constructs a resource response with the given MIME type, character encoding,
     * and input stream. Callers must implement
     * {@link InputStream#read(byte[]) InputStream.read(byte[])} for the input
     * stream.
     * and input stream. Callers must implement {@link InputStream#read(byte[])} for
     * the input stream. {@link InputStream#close()} will be called after the WebView
     * has finished with the response.
     *
     * <p class="note"><b>Note:</b> The MIME type and character encoding must
     * be specified as separate parameters (for example {@code "text/html"} and
@@ -64,9 +64,10 @@ public class WebResourceResponse {
    }

    /**
     * Constructs a resource response with the given parameters. Callers must
     * implement {@link InputStream#read(byte[]) InputStream.read(byte[])} for
     * the input stream.
     * Constructs a resource response with the given parameters. Callers must implement
     * {@link InputStream#read(byte[])} for the input stream. {@link InputStream#close()} will be
     * called after the WebView has finished with the response.
     *
     *
     * <p class="note"><b>Note:</b> See {@link #WebResourceResponse(String,String,InputStream)}
     * for details on what should be specified for {@code mimeType} and {@code encoding}.
@@ -198,7 +199,8 @@ public class WebResourceResponse {

    /**
     * Sets the input stream that provides the resource response's data. Callers
     * must implement {@link InputStream#read(byte[]) InputStream.read(byte[])}.
     * must implement {@link InputStream#read(byte[])}. {@link InputStream#close()}
     * will be called after the WebView has finished with the response.
     *
     * @param data the input stream that provides the resource response's data. Must not be a
     *             StringBufferInputStream.
+34 −11
Original line number Diff line number Diff line
@@ -21,8 +21,7 @@ import android.annotation.Nullable;
import android.app.WallpaperColors;
import android.app.WallpaperManager;
import android.content.Context;
import android.os.Trace;
import android.os.UserHandle;
import android.os.AsyncTask;
import android.util.Log;
import android.util.SparseArray;

@@ -32,7 +31,6 @@ import com.android.internal.colorextraction.types.Tonal;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * Class to process wallpaper colors and generate a tonal palette based on them.
@@ -55,11 +53,11 @@ public class ColorExtractor implements WallpaperManager.OnColorsChangedListener
    protected WallpaperColors mLockColors;

    public ColorExtractor(Context context) {
        this(context, new Tonal(context));
        this(context, new Tonal(context), true /* immediately */);
    }

    @VisibleForTesting
    public ColorExtractor(Context context, ExtractionType extractionType) {
    public ColorExtractor(Context context, ExtractionType extractionType, boolean immediately) {
        mContext = context;
        mExtractionType = extractionType;

@@ -73,23 +71,48 @@ public class ColorExtractor implements WallpaperManager.OnColorsChangedListener
        }

        mOnColorsChangedListeners = new ArrayList<>();
        GradientColors[] systemColors = mGradientColors.get(WallpaperManager.FLAG_SYSTEM);
        GradientColors[] lockColors = mGradientColors.get(WallpaperManager.FLAG_LOCK);

        WallpaperManager wallpaperManager = mContext.getSystemService(WallpaperManager.class);
        if (wallpaperManager == null) {
            Log.w(TAG, "Can't listen to color changes!");
        } else {
            wallpaperManager.addOnColorsChangedListener(this, null /* handler */);
            initExtractColors(wallpaperManager, immediately);
        }
    }

            // Initialize all gradients with the current colors
            Trace.beginSection("ColorExtractor#getWallpaperColors");
    private void initExtractColors(WallpaperManager wallpaperManager, boolean immediately) {
        if (immediately) {
            mSystemColors = wallpaperManager.getWallpaperColors(WallpaperManager.FLAG_SYSTEM);
            mLockColors = wallpaperManager.getWallpaperColors(WallpaperManager.FLAG_LOCK);
            Trace.endSection();
            extractWallpaperColors();
        } else {
            new LoadWallpaperColors().executeOnExecutor(
                    AsyncTask.THREAD_POOL_EXECUTOR, wallpaperManager);
        }
    }

    private class LoadWallpaperColors extends AsyncTask<WallpaperManager, Void, Void> {
        private WallpaperColors mSystemColors;
        private WallpaperColors mLockColors;
        @Override
        protected Void doInBackground(WallpaperManager... params) {
            mSystemColors = params[0].getWallpaperColors(WallpaperManager.FLAG_SYSTEM);
            mLockColors = params[0].getWallpaperColors(WallpaperManager.FLAG_LOCK);
            return null;
        }
        @Override
        protected void onPostExecute(Void b) {
            ColorExtractor.this.mSystemColors = mSystemColors;
            ColorExtractor.this.mLockColors = mLockColors;
            extractWallpaperColors();
            triggerColorsChanged(WallpaperManager.FLAG_SYSTEM | WallpaperManager.FLAG_LOCK);
        }
    }

        // Initialize all gradients with the current colors
    private void extractWallpaperColors() {
        GradientColors[] systemColors = mGradientColors.get(WallpaperManager.FLAG_SYSTEM);
        GradientColors[] lockColors = mGradientColors.get(WallpaperManager.FLAG_LOCK);
        extractInto(mSystemColors,
                systemColors[TYPE_NORMAL],
                systemColors[TYPE_DARK],
+2 −2
Original line number Diff line number Diff line
@@ -1195,7 +1195,7 @@
    <string name="wifi_connect_alert_message" msgid="6451273376815958922">"%1$s এপ্লিকেশ্বনটোৱে ৱাই-ফাই নেটৱৰ্ক %2$sৰ সৈতে সংযুক্ত হ\'ব বিচাৰিছে"</string>
    <string name="wifi_connect_default_application" msgid="7143109390475484319">"এপ্লিকেশ্বন"</string>
    <string name="wifi_p2p_dialog_title" msgid="97611782659324517">"ৱাই-ফাই ডাইৰেক্ট"</string>
    <string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"ৱাই-ফাই ডাইৰেক্ট আৰম্ভ কৰক। এই কার্যই ৱাই-ফাই ক্লাইণ্ট/হ\'টস্প\'ট অফ কৰিব।"</string>
    <string name="wifi_p2p_turnon_message" msgid="2909250942299627244">"ৱাই-ফাই ডাইৰেক্ট আৰম্ভ কৰক। এই কার্যই ৱাই-ফাই ক্লাইণ্ট/হটস্পট অফ কৰিব।"</string>
    <string name="wifi_p2p_failed_message" msgid="3763669677935623084">"ৱাই-ফাই ডাইৰেক্ট আৰম্ভ কৰিব পৰা নগ\'ল।"</string>
    <string name="wifi_p2p_enabled_notification_title" msgid="2068321881673734886">"ৱাই-ফাই ডাইৰেক্ট অন হৈ আছে"</string>
    <string name="wifi_p2p_enabled_notification_message" msgid="8064677407830620023">"ছেটিংসমূহৰ বাবে টিপক"</string>
@@ -1776,7 +1776,7 @@
    <string name="importance_from_user" msgid="7318955817386549931">"এই জাননীবোৰৰ গুৰুত্ব আপুনি ছেট কৰব লাগিব।"</string>
    <string name="importance_from_person" msgid="9160133597262938296">"এই কার্যৰ সৈতে জড়িত থকা লোকসকলক ভিত্তি কৰি এইয়া গুৰুত্বপূর্ণ বুলি বিবেচনা কৰা হৈছ।"</string>
    <string name="user_creation_account_exists" msgid="1942606193570143289">"<xliff:g id="APP">%1$s</xliff:g><xliff:g id="ACCOUNT">%2$s</xliff:g>ৰ জৰিয়তে নতুন ব্য়ৱহাৰকাৰী সৃষ্টি কৰিবলৈ অনুমতি দিবনে?"</string>
    <string name="user_creation_adding" msgid="4482658054622099197">"<xliff:g id="APP">%1$s</xliff:g><xliff:g id="ACCOUNT">%2$s</xliff:g>ৰ (এই একাউন্টৰ এজন ব্য়ৱহাৰকাৰী ইতিমধ্যে আছে) জৰিয়তে নতুন ব্য়ৱহাৰকাৰী সৃষ্টি কৰিবলৈ অনুমতি দিবনে?"</string>
    <string name="user_creation_adding" msgid="4482658054622099197">"<xliff:g id="APP">%1$s</xliff:g><xliff:g id="ACCOUNT">%2$s</xliff:g>ৰ (এই একাউন্টৰ এজন ব্য়ৱহাৰকাৰী ইতিমধ্যে আছে) জৰিয়তে নতুন ব্য়ৱহাৰকাৰী সৃষ্টি কৰিবলৈ অনুমতি দিবনে?"</string>
    <string name="language_selection_title" msgid="2680677278159281088">"ভাষা যোগ কৰক"</string>
    <string name="country_selection_title" msgid="2954859441620215513">"অঞ্চলৰ অগ্ৰাধিকাৰ"</string>
    <string name="search_language_hint" msgid="7042102592055108574">"ভাষাৰ নাম লিখক"</string>
Loading