Skip to content

Commit

Permalink
Snap for 5339334 from cd8eace to pi-qpr3-release
Browse files Browse the repository at this point in the history
Change-Id: Ied7bc8e2a9c318dd17cf4bc32aa213187c96ace2
  • Loading branch information
android-build-team Robot committed Feb 27, 2019
2 parents 5812c57 + cd8eace commit a84433b
Show file tree
Hide file tree
Showing 190 changed files with 5,453 additions and 3,452 deletions.
4 changes: 2 additions & 2 deletions core/java/android/service/notification/ScheduleCalendar.java
Expand Up @@ -70,10 +70,10 @@ public void maybeSetNextAlarm(long now, long nextAlarm) {
}
// 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) {
Expand Down
14 changes: 3 additions & 11 deletions core/java/android/view/accessibility/AccessibilityCache.java
Expand Up @@ -418,28 +418,20 @@ private void clearSubTreeLocked(int windowId, long rootNodeId) {
*
* @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;
}

/**
Expand Down
16 changes: 9 additions & 7 deletions core/java/android/webkit/WebResourceResponse.java
Expand Up @@ -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
Expand All @@ -64,9 +64,10 @@ public WebResourceResponse(String mimeType, String encoding,
}

/**
* 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}.
Expand Down Expand Up @@ -198,7 +199,8 @@ public Map<String, String> getResponseHeaders() {

/**
* 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.
Expand Down
45 changes: 34 additions & 11 deletions core/java/com/android/internal/colorextraction/ColorExtractor.java
Expand Up @@ -21,8 +21,7 @@
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;

Expand All @@ -32,7 +31,6 @@

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.
Expand All @@ -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;

Expand All @@ -73,23 +71,48 @@ public ColorExtractor(Context context, ExtractionType extractionType) {
}

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],
Expand Down
4 changes: 2 additions & 2 deletions core/res/res/values-as/strings.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion core/res/res/values-ca/strings.xml
Expand Up @@ -1437,7 +1437,7 @@
<string name="content_description_sliding_handle" msgid="415975056159262248">"Llisca el dit. Mantén premut."</string>
<string name="description_target_unlock_tablet" msgid="3833195335629795055">"Llisca per desbloquejar."</string>
<string name="action_bar_home_description" msgid="5293600496601490216">"Torna a la pàgina d\'inici"</string>
<string name="action_bar_up_description" msgid="2237496562952152589">"Mou cap a dalt"</string>
<string name="action_bar_up_description" msgid="2237496562952152589">"Navega cap amunt"</string>
<string name="action_menu_overflow_description" msgid="2295659037509008453">"Més opcions"</string>
<string name="action_bar_home_description_format" msgid="7965984360903693903">"%1$s, %2$s"</string>
<string name="action_bar_home_subtitle_description_format" msgid="6985546530471780727">"%1$s, %2$s, %3$s"</string>
Expand Down
6 changes: 3 additions & 3 deletions core/res/res/values-da/strings.xml
Expand Up @@ -87,7 +87,7 @@
<string name="NetworkPreferenceSwitchSummary" msgid="509327194863482733">"Prøv at skifte dit foretrukne netværk. Tryk for skifte."</string>
<string name="EmergencyCallWarningTitle" msgid="813380189532491336">"Det er ikke muligt at foretage nødopkald"</string>
<string name="EmergencyCallWarningSummary" msgid="1899692069750260619">"Det er ikke muligt at foretage nødopkald via Wi‑Fi"</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Notifikationer"</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Underretninger"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Viderestilling af opkald"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Nødtilbagekaldstilstand"</string>
<string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status for mobildata"</string>
Expand Down Expand Up @@ -257,7 +257,7 @@
<string name="notification_channel_network_available" msgid="4531717914138179517">"Tilgængeligt netværk"</string>
<string name="notification_channel_vpn" msgid="8330103431055860618">"VPN-status"</string>
<string name="notification_channel_device_admin" msgid="1568154104368069249">"Enhedsadministration"</string>
<string name="notification_channel_alerts" msgid="4496839309318519037">"Notifikationer"</string>
<string name="notification_channel_alerts" msgid="4496839309318519037">"Underretninger"</string>
<string name="notification_channel_retail_mode" msgid="6088920674914038779">"Demo til udstilling i butik"</string>
<string name="notification_channel_usb" msgid="9006850475328924681">"USB-forbindelse"</string>
<string name="notification_channel_heavy_weight_app" msgid="6218742927792852607">"Appen kører"</string>
Expand Down Expand Up @@ -331,7 +331,7 @@
<string name="permlab_receiveMms" msgid="1821317344668257098">"modtage tekstbeskeder (mms)"</string>
<string name="permdesc_receiveMms" msgid="533019437263212260">"Tillader, at appen kan modtage og behandle mms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig."</string>
<string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"læse Cell Broadcast-meddelelser"</string>
<string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Tillader, at appen læser Cell Broadcast-meddelelser, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-meddelelser for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-meddelelse om en nødsituation."</string>
<string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Tillader, at appen læser Cell Broadcast-underretninger, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-underretninger for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-meddelelse om en nødsituation."</string>
<string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"læse feeds, jeg abonnerer på"</string>
<string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"Tillader, at appen kan hente oplysninger om de feeds, der synkroniseres."</string>
<string name="permlab_sendSms" msgid="7544599214260982981">"Send og se sms-beskeder"</string>
Expand Down
2 changes: 1 addition & 1 deletion core/res/res/values-en-rAU/strings.xml
Expand Up @@ -588,7 +588,7 @@
<string name="policydesc_resetPassword" msgid="1278323891710619128">"Change the screen lock."</string>
<string name="policylab_forceLock" msgid="2274085384704248431">"Lock the screen"</string>
<string name="policydesc_forceLock" msgid="1141797588403827138">"Control how and when the screen locks."</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Erase all data"</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Delete all data"</string>
<string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Erase the tablet\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="tv" msgid="5816221315214527028">"Erase the TV\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Erase the phone\'s data without warning by performing a factory data reset."</string>
Expand Down
2 changes: 1 addition & 1 deletion core/res/res/values-en-rCA/strings.xml
Expand Up @@ -588,7 +588,7 @@
<string name="policydesc_resetPassword" msgid="1278323891710619128">"Change the screen lock."</string>
<string name="policylab_forceLock" msgid="2274085384704248431">"Lock the screen"</string>
<string name="policydesc_forceLock" msgid="1141797588403827138">"Control how and when the screen locks."</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Erase all data"</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Delete all data"</string>
<string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Erase the tablet\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="tv" msgid="5816221315214527028">"Erase the TV\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Erase the phone\'s data without warning by performing a factory data reset."</string>
Expand Down
2 changes: 1 addition & 1 deletion core/res/res/values-en-rGB/strings.xml
Expand Up @@ -588,7 +588,7 @@
<string name="policydesc_resetPassword" msgid="1278323891710619128">"Change the screen lock."</string>
<string name="policylab_forceLock" msgid="2274085384704248431">"Lock the screen"</string>
<string name="policydesc_forceLock" msgid="1141797588403827138">"Control how and when the screen locks."</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Erase all data"</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Delete all data"</string>
<string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Erase the tablet\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="tv" msgid="5816221315214527028">"Erase the TV\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Erase the phone\'s data without warning by performing a factory data reset."</string>
Expand Down
2 changes: 1 addition & 1 deletion core/res/res/values-en-rIN/strings.xml
Expand Up @@ -588,7 +588,7 @@
<string name="policydesc_resetPassword" msgid="1278323891710619128">"Change the screen lock."</string>
<string name="policylab_forceLock" msgid="2274085384704248431">"Lock the screen"</string>
<string name="policydesc_forceLock" msgid="1141797588403827138">"Control how and when the screen locks."</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Erase all data"</string>
<string name="policylab_wipeData" msgid="3910545446758639713">"Delete all data"</string>
<string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Erase the tablet\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="tv" msgid="5816221315214527028">"Erase the TV\'s data without warning by performing a factory data reset."</string>
<string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Erase the phone\'s data without warning by performing a factory data reset."</string>
Expand Down

0 comments on commit a84433b

Please sign in to comment.