diff options
53 files changed, 618 insertions, 126 deletions
diff --git a/api/current.txt b/api/current.txt index 90d63b02f22c..2cd1708727be 100644 --- a/api/current.txt +++ b/api/current.txt @@ -27278,7 +27278,7 @@ package android.speech.tts { method public boolean isSpeaking(); method public int playEarcon(java.lang.String, int, android.os.Bundle, java.lang.String); method public deprecated int playEarcon(java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>); - method public int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>, java.lang.String); + method public int playSilence(long, int, java.lang.String); method public deprecated int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>); method public int setAudioAttributes(android.media.AudioAttributes); method public deprecated int setEngineByPackageName(java.lang.String); @@ -27366,7 +27366,7 @@ package android.speech.tts { public abstract class TextToSpeechService extends android.app.Service { ctor public TextToSpeechService(); method public android.os.IBinder onBind(android.content.Intent); - method protected java.lang.String onGetDefaultVoiceNameFor(java.lang.String, java.lang.String, java.lang.String); + method public java.lang.String onGetDefaultVoiceNameFor(java.lang.String, java.lang.String, java.lang.String); method protected java.util.Set<java.lang.String> onGetFeaturesForLanguage(java.lang.String, java.lang.String, java.lang.String); method protected abstract java.lang.String[] onGetLanguage(); method public java.util.List<android.speech.tts.Voice> onGetVoices(); @@ -27396,6 +27396,7 @@ package android.speech.tts { method public int getQuality(); method public boolean isNetworkConnectionRequired(); method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; field public static final int LATENCY_HIGH = 400; // 0x190 field public static final int LATENCY_LOW = 200; // 0xc8 field public static final int LATENCY_NORMAL = 300; // 0x12c diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 7d0d27fdef2e..dd49009281f3 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -5132,6 +5132,8 @@ public final class ActivityThread { // process. if (!ActivityManager.isHighEndGfx()) { HardwareRenderer.disable(true); + } else { + HardwareRenderer.enableForegroundTrimming(); } ActivityThread thread = new ActivityThread(); thread.attach(true); diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java index 9cbedabd98df..882a3c83d7ac 100644 --- a/core/java/android/service/notification/ZenModeConfig.java +++ b/core/java/android/service/notification/ZenModeConfig.java @@ -61,6 +61,8 @@ public class ZenModeConfig implements Parcelable { private static final int MINUTES_MS = 60 * SECONDS_MS; private static final int ZERO_VALUE_MS = 20 * SECONDS_MS; + private static final boolean DEFAULT_ALLOW_EVENTS = true; + private static final int XML_VERSION = 1; private static final String ZEN_TAG = "zen"; private static final String ZEN_ATT_VERSION = "version"; @@ -68,6 +70,7 @@ public class ZenModeConfig implements Parcelable { private static final String ALLOW_ATT_CALLS = "calls"; private static final String ALLOW_ATT_MESSAGES = "messages"; private static final String ALLOW_ATT_FROM = "from"; + private static final String ALLOW_ATT_EVENTS = "events"; private static final String SLEEP_TAG = "sleep"; private static final String SLEEP_ATT_MODE = "mode"; @@ -91,6 +94,7 @@ public class ZenModeConfig implements Parcelable { public boolean allowCalls; public boolean allowMessages; + public boolean allowEvents = DEFAULT_ALLOW_EVENTS; public int allowFrom = SOURCE_ANYONE; public String sleepMode; @@ -108,6 +112,7 @@ public class ZenModeConfig implements Parcelable { public ZenModeConfig(Parcel source) { allowCalls = source.readInt() == 1; allowMessages = source.readInt() == 1; + allowEvents = source.readInt() == 1; if (source.readInt() == 1) { sleepMode = source.readString(); } @@ -134,6 +139,7 @@ public class ZenModeConfig implements Parcelable { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(allowCalls ? 1 : 0); dest.writeInt(allowMessages ? 1 : 0); + dest.writeInt(allowEvents ? 1 : 0); if (sleepMode != null) { dest.writeInt(1); dest.writeString(sleepMode); @@ -167,6 +173,7 @@ public class ZenModeConfig implements Parcelable { .append("allowCalls=").append(allowCalls) .append(",allowMessages=").append(allowMessages) .append(",allowFrom=").append(sourceToString(allowFrom)) + .append(",allowEvents=").append(allowEvents) .append(",sleepMode=").append(sleepMode) .append(",sleepStart=").append(sleepStartHour).append('.').append(sleepStartMinute) .append(",sleepEnd=").append(sleepEndHour).append('.').append(sleepEndMinute) @@ -200,6 +207,7 @@ public class ZenModeConfig implements Parcelable { return other.allowCalls == allowCalls && other.allowMessages == allowMessages && other.allowFrom == allowFrom + && other.allowEvents == allowEvents && Objects.equals(other.sleepMode, sleepMode) && other.sleepStartHour == sleepStartHour && other.sleepStartMinute == sleepStartMinute @@ -213,7 +221,7 @@ public class ZenModeConfig implements Parcelable { @Override public int hashCode() { - return Objects.hash(allowCalls, allowMessages, allowFrom, sleepMode, + return Objects.hash(allowCalls, allowMessages, allowFrom, allowEvents, sleepMode, sleepStartHour, sleepStartMinute, sleepEndHour, sleepEndMinute, Arrays.hashCode(conditionComponents), Arrays.hashCode(conditionIds), exitCondition, exitConditionComponent); @@ -281,6 +289,7 @@ public class ZenModeConfig implements Parcelable { if (ALLOW_TAG.equals(tag)) { rt.allowCalls = safeBoolean(parser, ALLOW_ATT_CALLS, false); rt.allowMessages = safeBoolean(parser, ALLOW_ATT_MESSAGES, false); + rt.allowEvents = safeBoolean(parser, ALLOW_ATT_EVENTS, DEFAULT_ALLOW_EVENTS); rt.allowFrom = safeInt(parser, ALLOW_ATT_FROM, SOURCE_ANYONE); if (rt.allowFrom < SOURCE_ANYONE || rt.allowFrom > MAX_SOURCE) { throw new IndexOutOfBoundsException("bad source in config:" + rt.allowFrom); @@ -323,6 +332,7 @@ public class ZenModeConfig implements Parcelable { out.startTag(null, ALLOW_TAG); out.attribute(null, ALLOW_ATT_CALLS, Boolean.toString(allowCalls)); out.attribute(null, ALLOW_ATT_MESSAGES, Boolean.toString(allowMessages)); + out.attribute(null, ALLOW_ATT_EVENTS, Boolean.toString(allowEvents)); out.attribute(null, ALLOW_ATT_FROM, Integer.toString(allowFrom)); out.endTag(null, ALLOW_TAG); diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 9be220e89618..120c9e37b792 100644 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java @@ -1216,17 +1216,12 @@ public class TextToSpeech { * * @param durationInMs The duration of the silence. * @param queueMode {@link #QUEUE_ADD} or {@link #QUEUE_FLUSH}. - * @param params Parameters for the request. Can be null. - * Engine specific parameters may be passed in but the parameter keys - * must be prefixed by the name of the engine they are intended for. For example - * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the - * engine named "com.svox.pico" if it is being used. * @param utteranceId An unique identifier for this request. * * @return {@link #ERROR} or {@link #SUCCESS} of <b>queuing</b> the playSilence operation. */ public int playSilence(final long durationInMs, final int queueMode, - final HashMap<String, String> params, final String utteranceId) { + final String utteranceId) { return runAction(new Action<Integer>() { @Override public Integer run(ITextToSpeechService service) throws RemoteException { @@ -1258,12 +1253,12 @@ public class TextToSpeech { * * @return {@link #ERROR} or {@link #SUCCESS} of <b>queuing</b> the playSilence operation. * @deprecated As of API level 20, replaced by - * {@link #playSilence(long, int, HashMap, String)}. + * {@link #playSilence(long, int, String)}. */ @Deprecated public int playSilence(final long durationInMs, final int queueMode, final HashMap<String, String> params) { - return playSilence(durationInMs, queueMode, params, + return playSilence(durationInMs, queueMode, params == null ? null : params.get(Engine.KEY_PARAM_UTTERANCE_ID)); } diff --git a/core/java/android/speech/tts/TextToSpeechService.java b/core/java/android/speech/tts/TextToSpeechService.java index d00a433ac65f..079467a9e529 100644 --- a/core/java/android/speech/tts/TextToSpeechService.java +++ b/core/java/android/speech/tts/TextToSpeechService.java @@ -317,7 +317,7 @@ public abstract class TextToSpeechService extends Service { * @return A name of the default voice for a given locale. */ - protected String onGetDefaultVoiceNameFor(String lang, String country, String variant) { + public String onGetDefaultVoiceNameFor(String lang, String country, String variant) { int localeStatus = onIsLanguageAvailable(lang, country, variant); Locale iso3Locale = null; switch (localeStatus) { diff --git a/core/java/android/speech/tts/Voice.java b/core/java/android/speech/tts/Voice.java index a1fa51d1901e..dcf598014fdb 100644 --- a/core/java/android/speech/tts/Voice.java +++ b/core/java/android/speech/tts/Voice.java @@ -91,9 +91,6 @@ public class Voice implements Parcelable { Collections.addAll(this.mFeatures, in.readStringArray()); } - /** - * @hide - */ @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(mName); @@ -104,17 +101,11 @@ public class Voice implements Parcelable { dest.writeStringList(new ArrayList<String>(mFeatures)); } - /** - * @hide - */ @Override public int describeContents() { return 0; } - /** - * @hide - */ public static final Parcelable.Creator<Voice> CREATOR = new Parcelable.Creator<Voice>() { @Override public Voice createFromParcel(Parcel in) { diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java index edb379884441..904e33f0aca1 100644 --- a/core/java/android/view/HardwareRenderer.java +++ b/core/java/android/view/HardwareRenderer.java @@ -186,6 +186,18 @@ public abstract class HardwareRenderer { } } + public static boolean sTrimForeground = false; + + /** + * Controls whether or not the hardware renderer should aggressively + * trim memory. Note that this must not be set for any process that + * uses WebView! This should be only used by system_process or similar + * that do not go into the background. + */ + public static void enableForegroundTrimming() { + sTrimForeground = true; + } + /** * Indicates whether hardware acceleration is available under any form for * the view hierarchy. diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 43ab4ef33b85..b1d3d450a7f8 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -804,6 +804,9 @@ public final class ViewRootImpl implements ViewParent, if (mAppVisible != visible) { mAppVisible = visible; scheduleTraversals(); + if (!mAppVisible) { + WindowManagerGlobal.trimForeground(); + } } } diff --git a/core/java/android/view/WindowManagerGlobal.java b/core/java/android/view/WindowManagerGlobal.java index c39ec9704415..08160c8976a1 100644 --- a/core/java/android/view/WindowManagerGlobal.java +++ b/core/java/android/view/WindowManagerGlobal.java @@ -375,6 +375,9 @@ public final class WindowManagerGlobal { mDyingViews.remove(view); } } + if (HardwareRenderer.sTrimForeground && HardwareRenderer.isAvailable()) { + doTrimForeground(); + } } private int findViewLocked(View view, boolean required) { @@ -413,6 +416,35 @@ public final class WindowManagerGlobal { } HardwareRenderer.trimMemory(level); + + if (HardwareRenderer.sTrimForeground) { + doTrimForeground(); + } + } + } + + public static void trimForeground() { + if (HardwareRenderer.sTrimForeground && HardwareRenderer.isAvailable()) { + WindowManagerGlobal wm = WindowManagerGlobal.getInstance(); + wm.doTrimForeground(); + } + } + + private void doTrimForeground() { + boolean hasVisibleWindows = false; + synchronized (mLock) { + for (int i = mRoots.size() - 1; i >= 0; --i) { + if (mRoots.get(i).getHostVisibility() == View.VISIBLE + && mRoots.get(i).mAttachInfo.mHardwareRenderer != null) { + hasVisibleWindows = true; + } else { + mRoots.get(i).destroyHardwareResources(); + } + } + } + if (!hasVisibleWindows) { + HardwareRenderer.trimMemory( + ComponentCallbacks2.TRIM_MEMORY_COMPLETE); } } @@ -428,7 +460,7 @@ public final class WindowManagerGlobal { for (int i = 0; i < count; i++) { ViewRootImpl root = mRoots.get(i); String name = getWindowName(root); - pw.printf("\n\t%s", name); + pw.printf("\n\t%s (visibility=%d)", name, root.getHostVisibility()); HardwareRenderer renderer = root.getView().mAttachInfo.mHardwareRenderer; diff --git a/core/java/com/android/internal/inputmethod/InputMethodUtils.java b/core/java/com/android/internal/inputmethod/InputMethodUtils.java index 8f8ce95f4efc..ac915d190d24 100644 --- a/core/java/com/android/internal/inputmethod/InputMethodUtils.java +++ b/core/java/com/android/internal/inputmethod/InputMethodUtils.java @@ -16,6 +16,7 @@ package com.android.internal.inputmethod; +import android.app.AppOpsManager; import android.content.ContentResolver; import android.content.Context; import android.content.pm.ApplicationInfo; @@ -637,6 +638,25 @@ public class InputMethodUtils { } /** + * Returns true if a package name belongs to a UID. + * + * <p>This is a simple wrapper of {@link AppOpsManager#checkPackage(int, String)}.</p> + * @param appOpsManager the {@link AppOpsManager} object to be used for the validation. + * @param uid the UID to be validated. + * @param packageName the package name. + * @return {@code true} if the package name belongs to the UID. + */ + public static boolean checkIfPackageBelongsToUid(final AppOpsManager appOpsManager, + final int uid, final String packageName) { + try { + appOpsManager.checkPackage(uid, packageName); + return true; + } catch (SecurityException e) { + return false; + } + } + + /** * Utility class for putting and getting settings for InputMethod * TODO: Move all putters and getters of settings to this class. */ diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 40c9ed299498..4dde217460a2 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -458,7 +458,7 @@ public class ZygoteInit { Log.v(TAG, "Preloading resource #" + Integer.toHexString(id)); } if (id != 0) { - if (mResources.getDrawable(id) == null) { + if (mResources.getDrawable(id, null) == null) { throw new IllegalArgumentException( "Unable to find preloaded drawable resource #0x" + Integer.toHexString(id) diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index fb44e5876b6c..91e53307d997 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -1316,6 +1316,11 @@ public class ActionBarView extends AbsActionBarView implements DecorToolbar { mHomeLayout.setUpIndicator(indicator); } + @Override + public void setDefaultNavigationIcon(Drawable icon) { + mHomeLayout.setDefaultUpIndicator(icon); + } + public void setNavigationIcon(int resId) { mHomeLayout.setUpIndicator(resId); } @@ -1380,6 +1385,7 @@ public class ActionBarView extends AbsActionBarView implements DecorToolbar { private int mStartOffset; private int mUpIndicatorRes; private Drawable mDefaultUpIndicator; + private Drawable mUpIndicator; private static final long DEFAULT_TRANSITION_DURATION = 150; @@ -1409,13 +1415,30 @@ public class ActionBarView extends AbsActionBarView implements DecorToolbar { } public void setUpIndicator(Drawable d) { - mUpView.setImageDrawable(d != null ? d : mDefaultUpIndicator); + mUpIndicator = d; mUpIndicatorRes = 0; + updateUpIndicator(); + } + + public void setDefaultUpIndicator(Drawable d) { + mDefaultUpIndicator = d; + updateUpIndicator(); } public void setUpIndicator(int resId) { mUpIndicatorRes = resId; - mUpView.setImageDrawable(resId != 0 ? getContext().getDrawable(resId) : null); + mUpIndicator = null; + updateUpIndicator(); + } + + private void updateUpIndicator() { + if (mUpIndicator != null) { + mUpView.setImageDrawable(mUpIndicator); + } else if (mUpIndicatorRes != 0) { + mUpView.setImageDrawable(getContext().getDrawable(mUpIndicatorRes)); + } else { + mUpView.setImageDrawable(mDefaultUpIndicator); + } } @Override @@ -1423,7 +1446,7 @@ public class ActionBarView extends AbsActionBarView implements DecorToolbar { super.onConfigurationChanged(newConfig); if (mUpIndicatorRes != 0) { // Reload for config change - setUpIndicator(mUpIndicatorRes); + updateUpIndicator(); } } diff --git a/core/java/com/android/internal/widget/DecorToolbar.java b/core/java/com/android/internal/widget/DecorToolbar.java index fee30153d95e..f89f0b7d6ef7 100644 --- a/core/java/com/android/internal/widget/DecorToolbar.java +++ b/core/java/com/android/internal/widget/DecorToolbar.java @@ -90,6 +90,7 @@ public interface DecorToolbar { void setNavigationContentDescription(CharSequence description); void setNavigationContentDescription(int resId); void setDefaultNavigationContentDescription(int defaultNavigationContentDescription); + void setDefaultNavigationIcon(Drawable icon); void saveHierarchyState(SparseArray<Parcelable> toolbarStates); void restoreHierarchyState(SparseArray<Parcelable> toolbarStates); } diff --git a/core/java/com/android/internal/widget/ToolbarWidgetWrapper.java b/core/java/com/android/internal/widget/ToolbarWidgetWrapper.java index 478c8f27fecd..324a6c998683 100644 --- a/core/java/com/android/internal/widget/ToolbarWidgetWrapper.java +++ b/core/java/com/android/internal/widget/ToolbarWidgetWrapper.java @@ -84,6 +84,7 @@ public class ToolbarWidgetWrapper implements DecorToolbar { private int mNavigationMode = ActionBar.NAVIGATION_MODE_STANDARD; private int mDefaultNavigationContentDescription = 0; + private Drawable mDefaultNavigationIcon; public ToolbarWidgetWrapper(Toolbar toolbar, boolean style) { this(toolbar, style, R.string.action_bar_up_description); @@ -96,11 +97,10 @@ public class ToolbarWidgetWrapper implements DecorToolbar { mTitle = toolbar.getTitle(); mSubtitle = toolbar.getSubtitle(); mTitleSet = mTitle != null; - + final TypedArray a = toolbar.getContext().obtainStyledAttributes(null, + R.styleable.ActionBar, R.attr.actionBarStyle, 0); + mDefaultNavigationIcon = a.getDrawable(R.styleable.ActionBar_homeAsUpIndicator); if (style) { - final TypedArray a = toolbar.getContext().obtainStyledAttributes(null, - R.styleable.ActionBar, R.attr.actionBarStyle, 0); - final CharSequence title = a.getText(R.styleable.ActionBar_title); if (!TextUtils.isEmpty(title)) { setTitle(title); @@ -120,12 +120,9 @@ public class ToolbarWidgetWrapper implements DecorToolbar { if (icon != null) { setIcon(icon); } - - final Drawable navIcon = a.getDrawable(R.styleable.ActionBar_homeAsUpIndicator); - if (navIcon != null) { - setNavigationIcon(navIcon); + if (mDefaultNavigationIcon != null) { + setNavigationIcon(mDefaultNavigationIcon); } - setDisplayOptions(a.getInt(R.styleable.ActionBar_displayOptions, 0)); final int customNavId = a.getResourceId( @@ -167,11 +164,10 @@ public class ToolbarWidgetWrapper implements DecorToolbar { if (popupTheme != 0) { mToolbar.setPopupTheme(popupTheme); } - - a.recycle(); } else { mDisplayOpts = detectDisplayOptions(); } + a.recycle(); setDefaultNavigationContentDescription(defaultNavigationContentDescription); mHomeDescription = mToolbar.getNavigationContentDescription(); @@ -204,6 +200,7 @@ public class ToolbarWidgetWrapper implements DecorToolbar { ActionBar.DISPLAY_USE_LOGO; if (mToolbar.getNavigationIcon() != null) { opts |= ActionBar.DISPLAY_HOME_AS_UP; + mDefaultNavigationIcon = mToolbar.getNavigationIcon(); } return opts; } @@ -410,11 +407,9 @@ public class ToolbarWidgetWrapper implements DecorToolbar { if (changed != 0) { if ((changed & ActionBar.DISPLAY_HOME_AS_UP) != 0) { if ((newOpts & ActionBar.DISPLAY_HOME_AS_UP) != 0) { - mToolbar.setNavigationIcon(mNavIcon); updateHomeAccessibility(); - } else { - mToolbar.setNavigationIcon(null); } + updateNavigationIcon(); } if ((changed & AFFECTS_LOGO_MASK) != 0) { @@ -607,9 +602,7 @@ public class ToolbarWidgetWrapper implements DecorToolbar { @Override public void setNavigationIcon(Drawable icon) { mNavIcon = icon; - if ((mDisplayOpts & ActionBar.DISPLAY_HOME_AS_UP) != 0) { - mToolbar.setNavigationIcon(icon); - } + updateNavigationIcon(); } @Override @@ -618,6 +611,22 @@ public class ToolbarWidgetWrapper implements DecorToolbar { } @Override + public void setDefaultNavigationIcon(Drawable defaultNavigationIcon) { + if (mDefaultNavigationIcon != defaultNavigationIcon) { + mDefaultNavigationIcon = defaultNavigationIcon; + updateNavigationIcon(); + } + } + + private void updateNavigationIcon() { + if ((mDisplayOpts & ActionBar.DISPLAY_HOME_AS_UP) != 0) { + mToolbar.setNavigationIcon(mNavIcon != null ? mNavIcon : mDefaultNavigationIcon); + } else { + mToolbar.setNavigationIcon(null); + } + } + + @Override public void setNavigationContentDescription(CharSequence description) { mHomeDescription = description; updateHomeAccessibility(); diff --git a/core/res/res/drawable/ic_ab_back_material.xml b/core/res/res/drawable/ic_ab_back_material.xml index 72d798167154..e4bc6ccfbf07 100644 --- a/core/res/res/drawable/ic_ab_back_material.xml +++ b/core/res/res/drawable/ic_ab_back_material.xml @@ -21,6 +21,6 @@ Copyright (C) 2014 The Android Open Source Project android:autoMirrored="true" android:tint="?attr/colorControlNormal"> <path - android:pathData="M20.000000,11.000000L7.800000,11.000000l5.600000,-5.600000L12.000000,4.000000l-8.000000,8.000000l8.000000,8.000000l1.400000,-1.400000L7.800000,13.000000L20.000000,13.000000L20.000000,11.000000z" + android:pathData="M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_dialog_alert_material.xml b/core/res/res/drawable/ic_dialog_alert_material.xml index 3bb4d2c70d05..26daea742c0f 100644 --- a/core/res/res/drawable/ic_dialog_alert_material.xml +++ b/core/res/res/drawable/ic_dialog_alert_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M1.000000,21.000000l22.000000,0.000000L12.000000,2.000000L1.000000,21.000000zM13.000000,18.000000l-2.000000,0.000000l0.000000,-2.000000l2.000000,0.000000L13.000000,18.000000zM13.000000,14.000000l-2.000000,0.000000l0.000000,-4.000000l2.000000,0.000000L13.000000,14.000000z" + android:pathData="M1,21l22,0L12,2L1,21zM13,18l-2,0l0,-2l2,0L13,18zM13,14l-2,0l0,-4l2,0L13,14z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_go_search_api_material.xml b/core/res/res/drawable/ic_go_search_api_material.xml index 21c7249fa119..67ef281b1bb7 100644 --- a/core/res/res/drawable/ic_go_search_api_material.xml +++ b/core/res/res/drawable/ic_go_search_api_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M10.000000,6.000000l-1.400000,1.400000 4.599999,4.600000 -4.599999,4.600000 1.400000,1.400000 6.000000,-6.000000z" + android:pathData="M10,6l-1.4,1.4 4.599999,4.6 -4.599999,4.6 1.4,1.4 6,-6z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_copy_material.xml b/core/res/res/drawable/ic_menu_copy_material.xml index da3912bf5e5a..c03723b1fb33 100644 --- a/core/res/res/drawable/ic_menu_copy_material.xml +++ b/core/res/res/drawable/ic_menu_copy_material.xml @@ -21,6 +21,6 @@ Copyright (C) 2014 The Android Open Source Project android:autoMirrored="true" android:tint="?attr/colorControlNormal"> <path - android:pathData="M16.000000,1.000000L4.000000,1.000000C2.900000,1.000000 2.000000,1.900000 2.000000,3.000000l0.000000,14.000000l2.000000,0.000000L4.000000,3.000000l12.000000,0.000000L16.000000,1.000000zM19.000000,5.000000L8.000000,5.000000C6.900000,5.000000 6.000000,5.900000 6.000000,7.000000l0.000000,14.000000c0.000000,1.100000 0.900000,2.000000 2.000000,2.000000l11.000000,0.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000L21.000000,7.000000C21.000000,5.900000 20.100000,5.000000 19.000000,5.000000zM19.000000,21.000000L8.000000,21.000000L8.000000,7.000000l11.000000,0.000000L19.000000,21.000000z" + android:pathData="M16,1L4,1C2.9,1 2,1.9 2,3l0,14l2,0L4,3l12,0L16,1zM19,5L8,5C6.9,5 6,5.9 6,7l0,14c0,1.1 0.9,2 2,2l11,0c1.1,0 2,-0.9 2,-2L21,7C21,5.9 20.1,5 19,5zM19,21L8,21L8,7l11,0L19,21z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_cut_material.xml b/core/res/res/drawable/ic_menu_cut_material.xml index 54db72adcb0e..aec66856e85d 100644 --- a/core/res/res/drawable/ic_menu_cut_material.xml +++ b/core/res/res/drawable/ic_menu_cut_material.xml @@ -21,6 +21,6 @@ Copyright (C) 2014 The Android Open Source Project android:autoMirrored="true" android:tint="?attr/colorControlNormal"> <path - android:pathData="M10.000000,6.000000c0.000000,-2.200000 -1.800000,-4.000000 -4.000000,-4.000000S2.000000,3.800000 2.000000,6.000000c0.000000,2.200000 1.800000,4.000000 4.000000,4.000000c0.600000,0.000000 1.100000,-0.100000 1.600000,-0.400000L10.000000,12.000000l-2.400000,2.400000C7.100000,14.100000 6.600000,14.000000 6.000000,14.000000c-2.200000,0.000000 -4.000000,1.800000 -4.000000,4.000000c0.000000,2.200000 1.800000,4.000000 4.000000,4.000000s4.000000,-1.800000 4.000000,-4.000000c0.000000,-0.600000 -0.100000,-1.100000 -0.400000,-1.600000L12.000000,14.000000l7.000000,7.000000l4.000000,0.000000L9.600000,7.600000C9.900000,7.100000 10.000000,6.600000 10.000000,6.000000zM6.000000,8.000000C4.900000,8.000000 4.000000,7.100000 4.000000,6.000000s0.900000,-2.000000 2.000000,-2.000000c1.100000,0.000000 2.000000,0.900000 2.000000,2.000000S7.100000,8.000000 6.000000,8.000000zM6.000000,20.000000c-1.100000,0.000000 -2.000000,-0.900000 -2.000000,-2.000000s0.900000,-2.000000 2.000000,-2.000000c1.100000,0.000000 2.000000,0.900000 2.000000,2.000000S7.100000,20.000000 6.000000,20.000000zM12.000000,11.500000c0.300000,0.000000 0.500000,0.200000 0.500000,0.500000c0.000000,0.300000 -0.200000,0.500000 -0.500000,0.500000c-0.300000,0.000000 -0.500000,-0.200000 -0.500000,-0.500000C11.500000,11.700000 11.700000,11.500000 12.000000,11.500000zM23.000000,3.000000l-4.000000,0.000000l-6.000000,6.000000l2.000000,2.000000L23.000000,3.000000z" + android:pathData="M10,6c0,-2.2 -1.8,-4 -4,-4S2,3.8 2,6c0,2.2 1.8,4 4,4c0.6,0 1.1,-0.1 1.6,-0.4L10,12l-2.4,2.4C7.1,14.1 6.6,14 6,14c-2.2,0 -4,1.8 -4,4c0,2.2 1.8,4 4,4s4,-1.8 4,-4c0,-0.6 -0.1,-1.1 -0.4,-1.6L12,14l7,7l4,0L9.6,7.6C9.9,7.1 10,6.6 10,6zM6,8C4.9,8 4,7.1 4,6s0.9,-2 2,-2c1.1,0 2,0.9 2,2S7.1,8 6,8zM6,20c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2c1.1,0 2,0.9 2,2S7.1,20 6,20zM12,11.5c0.3,0 0.5,0.2 0.5,0.5c0,0.3 -0.2,0.5 -0.5,0.5c-0.3,0 -0.5,-0.2 -0.5,-0.5C11.5,11.7 11.7,11.5 12,11.5zM23,3l-4,0l-6,6l2,2L23,3z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_moreoverflow_material.xml b/core/res/res/drawable/ic_menu_moreoverflow_material.xml index c1285700394c..502ad6910a32 100644 --- a/core/res/res/drawable/ic_menu_moreoverflow_material.xml +++ b/core/res/res/drawable/ic_menu_moreoverflow_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M12.000000,8.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000s-0.900000,-2.000000 -2.000000,-2.000000c-1.100000,0.000000 -2.000000,0.900000 -2.000000,2.000000S10.900000,8.000000 12.000000,8.000000zM12.000000,10.000000c-1.100000,0.000000 -2.000000,0.900000 -2.000000,2.000000s0.900000,2.000000 2.000000,2.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000S13.100000,10.000000 12.000000,10.000000zM12.000000,16.000000c-1.100000,0.000000 -2.000000,0.900000 -2.000000,2.000000s0.900000,2.000000 2.000000,2.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000S13.100000,16.000000 12.000000,16.000000z" + android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2c-1.1,0 -2,0.9 -2,2S10.9,8 12,8zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2c1.1,0 2,-0.9 2,-2S13.1,10 12,10zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2c1.1,0 2,-0.9 2,-2S13.1,16 12,16z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_paste_material.xml b/core/res/res/drawable/ic_menu_paste_material.xml index 5f847cb2f908..ee2426741e62 100644 --- a/core/res/res/drawable/ic_menu_paste_material.xml +++ b/core/res/res/drawable/ic_menu_paste_material.xml @@ -21,6 +21,6 @@ Copyright (C) 2014 The Android Open Source Project android:autoMirrored="true" android:tint="?attr/colorControlNormal"> <path - android:pathData="M19.000000,2.000000l-4.200000,0.000000c-0.400000,-1.200000 -1.500000,-2.000000 -2.800000,-2.000000c-1.300000,0.000000 -2.400000,0.800000 -2.800000,2.000000L5.000000,2.000000C3.900000,2.000000 3.000000,2.900000 3.000000,4.000000l0.000000,16.000000c0.000000,1.100000 0.900000,2.000000 2.000000,2.000000l14.000000,0.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000L21.000000,4.000000C21.000000,2.900000 20.100000,2.000000 19.000000,2.000000zM12.000000,2.000000c0.600000,0.000000 1.000000,0.400000 1.000000,1.000000s-0.400000,1.000000 -1.000000,1.000000c-0.600000,0.000000 -1.000000,-0.400000 -1.000000,-1.000000S11.400000,2.000000 12.000000,2.000000zM19.000000,20.000000L5.000000,20.000000L5.000000,4.000000l2.000000,0.000000l0.000000,3.000000l10.000000,0.000000L17.000000,4.000000l2.000000,0.000000L19.000000,20.000000z" + android:pathData="M19,2l-4.2,0c-0.4,-1.2 -1.5,-2 -2.8,-2c-1.3,0 -2.4,0.8 -2.8,2L5,2C3.9,2 3,2.9 3,4l0,16c0,1.1 0.9,2 2,2l14,0c1.1,0 2,-0.9 2,-2L21,4C21,2.9 20.1,2 19,2zM12,2c0.6,0 1,0.4 1,1s-0.4,1 -1,1c-0.6,0 -1,-0.4 -1,-1S11.4,2 12,2zM19,20L5,20L5,4l2,0l0,3l10,0L17,4l2,0L19,20z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_selectall_material.xml b/core/res/res/drawable/ic_menu_selectall_material.xml index 11e63fde6247..fd05c72542db 100644 --- a/core/res/res/drawable/ic_menu_selectall_material.xml +++ b/core/res/res/drawable/ic_menu_selectall_material.xml @@ -21,6 +21,6 @@ Copyright (C) 2014 The Android Open Source Project android:autoMirrored="true" android:tint="?attr/colorControlNormal"> <path - android:pathData="M3.000000,5.000000l2.000000,0.000000L5.000000,3.000000C3.900000,3.000000 3.000000,3.900000 3.000000,5.000000zM3.000000,13.000000l2.000000,0.000000l0.000000,-2.000000L3.000000,11.000000L3.000000,13.000000zM7.000000,21.000000l2.000000,0.000000l0.000000,-2.000000L7.000000,19.000000L7.000000,21.000000zM3.000000,9.000000l2.000000,0.000000L5.000000,7.000000L3.000000,7.000000L3.000000,9.000000zM13.000000,3.000000l-2.000000,0.000000l0.000000,2.000000l2.000000,0.000000L13.000000,3.000000zM19.000000,3.000000l0.000000,2.000000l2.000000,0.000000C21.000000,3.900000 20.100000,3.000000 19.000000,3.000000zM5.000000,21.000000l0.000000,-2.000000L3.000000,19.000000C3.000000,20.100000 3.900000,21.000000 5.000000,21.000000zM3.000000,17.000000l2.000000,0.000000l0.000000,-2.000000L3.000000,15.000000L3.000000,17.000000zM9.000000,3.000000L7.000000,3.000000l0.000000,2.000000l2.000000,0.000000L9.000000,3.000000zM11.000000,21.000000l2.000000,0.000000l0.000000,-2.000000l-2.000000,0.000000L11.000000,21.000000zM19.000000,13.000000l2.000000,0.000000l0.000000,-2.000000l-2.000000,0.000000L19.000000,13.000000zM19.000000,21.000000c1.100000,0.000000 2.000000,-0.900000 2.000000,-2.000000l-2.000000,0.000000L19.000000,21.000000zM19.000000,9.000000l2.000000,0.000000L21.000000,7.000000l-2.000000,0.000000L19.000000,9.000000zM19.000000,17.000000l2.000000,0.000000l0.000000,-2.000000l-2.000000,0.000000L19.000000,17.000000zM15.000000,21.000000l2.000000,0.000000l0.000000,-2.000000l-2.000000,0.000000L15.000000,21.000000zM15.000000,5.000000l2.000000,0.000000L17.000000,3.000000l-2.000000,0.000000L15.000000,5.000000zM7.000000,17.000000l10.000000,0.000000L17.000000,7.000000L7.000000,7.000000L7.000000,17.000000zM9.000000,9.000000l6.000000,0.000000l0.000000,6.000000L9.000000,15.000000L9.000000,9.000000z" + android:pathData="M3,5l2,0L5,3C3.9,3 3,3.9 3,5zM3,13l2,0l0,-2L3,11L3,13zM7,21l2,0l0,-2L7,19L7,21zM3,9l2,0L5,7L3,7L3,9zM13,3l-2,0l0,2l2,0L13,3zM19,3l0,2l2,0C21,3.9 20.1,3 19,3zM5,21l0,-2L3,19C3,20.1 3.9,21 5,21zM3,17l2,0l0,-2L3,15L3,17zM9,3L7,3l0,2l2,0L9,3zM11,21l2,0l0,-2l-2,0L11,21zM19,13l2,0l0,-2l-2,0L19,13zM19,21c1.1,0 2,-0.9 2,-2l-2,0L19,21zM19,9l2,0L21,7l-2,0L19,9zM19,17l2,0l0,-2l-2,0L19,17zM15,21l2,0l0,-2l-2,0L15,21zM15,5l2,0L17,3l-2,0L15,5zM7,17l10,0L17,7L7,7L7,17zM9,9l6,0l0,6L9,15L9,9z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_menu_share_material.xml b/core/res/res/drawable/ic_menu_share_material.xml index b7c238f4bc98..6c351c9d502e 100644 --- a/core/res/res/drawable/ic_menu_share_material.xml +++ b/core/res/res/drawable/ic_menu_share_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M18.000000,16.100000c-0.800000,0.000000 -1.500000,0.300000 -2.000000,0.800000l-7.100000,-4.200000C9.000000,12.500000 9.000000,12.200000 9.000000,12.000000s0.000000,-0.500000 -0.100000,-0.700000L16.000000,7.200000C16.500000,7.700000 17.200001,8.000000 18.000000,8.000000c1.700000,0.000000 3.000000,-1.300000 3.000000,-3.000000s-1.300000,-3.000000 -3.000000,-3.000000s-3.000000,1.300000 -3.000000,3.000000c0.000000,0.200000 0.000000,0.500000 0.100000,0.700000L8.000000,9.800000C7.500000,9.300000 6.800000,9.000000 6.000000,9.000000c-1.700000,0.000000 -2.900000,1.200000 -2.900000,2.900000s1.300000,3.000000 3.000000,3.000000c0.800000,0.000000 1.500000,-0.300000 2.000000,-0.800000l7.100000,4.200000c-0.100000,0.300000 -0.100000,0.500000 -0.100000,0.700000c0.000000,1.600000 1.300000,2.900000 2.900000,2.900000s2.900000,-1.300000 2.900000,-2.900000S19.600000,16.100000 18.000000,16.100000z" + android:pathData="M18,16.1c-0.8,0 -1.5,0.3 -2,0.8l-7.1,-4.2C9,12.5 9,12.2 9,12s0,-0.5 -0.1,-0.7L16,7.2C16.5,7.7 17.200001,8 18,8c1.7,0 3,-1.3 3,-3s-1.3,-3 -3,-3s-3,1.3 -3,3c0,0.2 0,0.5 0.1,0.7L8,9.8C7.5,9.3 6.8,9 6,9c-1.7,0 -2.9,1.2 -2.9,2.9s1.3,3 3,3c0.8,0 1.5,-0.3 2,-0.8l7.1,4.2c-0.1,0.3 -0.1,0.5 -0.1,0.7c0,1.6 1.3,2.9 2.9,2.9s2.9,-1.3 2.9,-2.9S19.6,16.1 18,16.1z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_search_api_material.xml b/core/res/res/drawable/ic_search_api_material.xml index ac1aae3461b0..70367bd66795 100644 --- a/core/res/res/drawable/ic_search_api_material.xml +++ b/core/res/res/drawable/ic_search_api_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M15.500000,14.000000l-0.800000,0.000000l-0.300000,-0.300000c1.000000,-1.100000 1.600000,-2.600000 1.600000,-4.200000C16.000000,5.900000 13.100000,3.000000 9.500000,3.000000C5.900000,3.000000 3.000000,5.900000 3.000000,9.500000S5.900000,16.000000 9.500000,16.000000c1.600000,0.000000 3.100000,-0.600000 4.200000,-1.600000l0.300000,0.300000l0.000000,0.800000l5.000000,5.000000l1.500000,-1.500000L15.500000,14.000000zM9.500000,14.000000C7.000000,14.000000 5.000000,12.000000 5.000000,9.500000S7.000000,5.000000 9.500000,5.000000C12.000000,5.000000 14.000000,7.000000 14.000000,9.500000S12.000000,14.000000 9.500000,14.000000z" + android:pathData="M15.5,14l-0.8,0l-0.3,-0.3c1,-1.1 1.6,-2.6 1.6,-4.2C16,5.9 13.1,3 9.5,3C5.9,3 3,5.9 3,9.5S5.9,16 9.5,16c1.6,0 3.1,-0.6 4.2,-1.6l0.3,0.3l0,0.8l5,5l1.5,-1.5L15.5,14zM9.5,14C7,14 5,12 5,9.5S7,5 9.5,5C12,5 14,7 14,9.5S12,14 9.5,14z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/ic_voice_search_api_material.xml b/core/res/res/drawable/ic_voice_search_api_material.xml index 8c1e803988d7..a02621820b62 100644 --- a/core/res/res/drawable/ic_voice_search_api_material.xml +++ b/core/res/res/drawable/ic_voice_search_api_material.xml @@ -20,6 +20,6 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> <path - android:pathData="M12.000000,14.000000c1.700000,0.000000 3.000000,-1.300000 3.000000,-3.000000l0.000000,-6.000000c0.000000,-1.700000 -1.300000,-3.000000 -3.000000,-3.000000c-1.700000,0.000000 -3.000000,1.300000 -3.000000,3.000000l0.000000,6.000000C9.000000,12.700000 10.300000,14.000000 12.000000,14.000000zM17.299999,11.000000c0.000000,3.000000 -2.500000,5.100000 -5.300000,5.100000c-2.800000,0.000000 -5.300000,-2.100000 -5.300000,-5.100000L5.000000,11.000000c0.000000,3.400000 2.700000,6.200000 6.000000,6.700000L11.000000,21.000000l2.000000,0.000000l0.000000,-3.300000c3.300000,-0.500000 6.000000,-3.300000 6.000000,-6.700000L17.299999,11.000001z" + android:pathData="M12,14c1.7,0 3,-1.3 3,-3l0,-6c0,-1.7 -1.3,-3 -3,-3c-1.7,0 -3,1.3 -3,3l0,6C9,12.7 10.3,14 12,14zM17.299999,11c0,3 -2.5,5.1 -5.3,5.1c-2.8,0 -5.3,-2.1 -5.3,-5.1L5,11c0,3.4 2.7,6.2 6,6.7L11,21l2,0l0,-3.3c3.3,-0.5 6,-3.3 6,-6.7L17.299999,11.000001z" android:fillColor="@color/white"/> </vector> diff --git a/core/res/res/drawable/stat_notify_disabled_data.xml b/core/res/res/drawable/stat_notify_disabled_data.xml index 9089d0879e2e..4f6ea7f57d36 100644 --- a/core/res/res/drawable/stat_notify_disabled_data.xml +++ b/core/res/res/drawable/stat_notify_disabled_data.xml @@ -20,5 +20,5 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="48.0"> <path android:fillColor="#FFFFFFFF" - android:pathData="M26.000000,4.100000l0.000000,6.100000c6.800000,1.000000 12.000000,6.800000 12.000000,13.800000c0.000000,1.800000 -0.400000,3.500000 -1.000000,5.100000l5.200000,3.100000c1.100000,-2.500000 1.800000,-5.200000 1.800000,-8.100000C44.000000,13.600000 36.099998,5.100000 26.000000,4.100000zM24.000000,38.000000c-7.700000,0.000000 -14.000000,-6.300000 -14.000000,-14.000000c0.000000,-7.100000 5.200000,-12.900000 12.000000,-13.800000L22.000000,4.100000C11.900000,5.100000 4.000000,13.600000 4.000000,24.000000c0.000000,11.000000 8.900000,20.000000 20.000000,20.000000c6.600000,0.000000 12.500000,-3.200000 16.100000,-8.200000l-5.200000,-3.100000C32.299999,36.000000 28.400000,38.000000 24.000000,38.000000z"/> + android:pathData="M26,4.1l0,6.1c6.8,1 12,6.8 12,13.8c0,1.8 -0.4,3.5 -1,5.1l5.2,3.1c1.1,-2.5 1.8,-5.2 1.8,-8.1C44,13.6 36.099998,5.1 26,4.1zM24,38c-7.7,0 -14,-6.3 -14,-14c0,-7.1 5.2,-12.9 12,-13.8L22,4.1C11.9,5.1 4,13.6 4,24c0,11 8.9,20 20,20c6.6,0 12.5,-3.2 16.1,-8.2l-5.2,-3.1C32.299999,36 28.4,38 24,38z"/> </vector> diff --git a/core/res/res/drawable/stat_notify_wifi_in_range.xml b/core/res/res/drawable/stat_notify_wifi_in_range.xml index 9a5407d785c5..a271ca5224c7 100644 --- a/core/res/res/drawable/stat_notify_wifi_in_range.xml +++ b/core/res/res/drawable/stat_notify_wifi_in_range.xml @@ -20,8 +20,8 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="24.0"> <path android:fillColor="#4DFFFFFF" - android:pathData="M19.100000,14.000000l-3.400000,0.000000l0.000000,-1.500000c0.000000,-1.800000 0.800000,-2.800000 1.500000,-3.400000C18.100000,8.300000 19.200001,8.000000 20.600000,8.000000c1.200000,0.000000 2.300000,0.300000 3.100000,0.800000l1.900000,-2.300000C25.100000,6.100000 20.299999,2.100000 13.000000,2.100000S0.900000,6.100000 0.400000,6.500000L13.000000,22.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l6.500000,-8.100000L19.100000,14.000000z"/> + android:pathData="M19.1,14l-3.4,0l0,-1.5c0,-1.8 0.8,-2.8 1.5,-3.4C18.1,8.3 19.200001,8 20.6,8c1.2,0 2.3,0.3 3.1,0.8l1.9,-2.3C25.1,6.1 20.299999,2.1 13,2.1S0.9,6.1 0.4,6.5L13,22l0,0l0,0l0,0l0,0l6.5,-8.1L19.1,14z"/> <path android:fillColor="#FFFFFFFF" - android:pathData="M19.500000,17.799999c0.000000,-0.800000 0.100000,-1.300000 0.200000,-1.600000c0.200000,-0.300000 0.500000,-0.700000 1.100000,-1.200000c0.400000,-0.400000 0.700000,-0.800000 1.000000,-1.100000s0.400000,-0.800000 0.400000,-1.200000c0.000000,-0.500000 -0.100000,-0.900000 -0.400000,-1.200000c-0.300000,-0.300000 -0.700000,-0.400000 -1.200000,-0.400000c-0.400000,0.000000 -0.800000,0.100000 -1.100000,0.300000c-0.300000,0.200000 -0.400000,0.600000 -0.400000,1.100000l-1.900000,0.000000c0.000000,-1.000000 0.300000,-1.700000 1.000000,-2.200000c0.600000,-0.500000 1.500000,-0.800000 2.500000,-0.800000c1.100000,0.000000 2.000000,0.300000 2.600000,0.800000c0.600000,0.500000 0.900000,1.300000 0.900000,2.300000c0.000000,0.700000 -0.200000,1.300000 -0.600000,1.800000c-0.400000,0.600000 -0.900000,1.100000 -1.500000,1.600000c-0.300000,0.300000 -0.500000,0.500000 -0.600000,0.700000c-0.100000,0.200000 -0.100000,0.600000 -0.100000,1.000000L19.500000,17.700001zM21.400000,21.000000l-1.900000,0.000000l0.000000,-1.800000l1.900000,0.000000L21.400000,21.000000z"/> + android:pathData="M19.5,17.799999c0,-0.8 0.1,-1.3 0.2,-1.6c0.2,-0.3 0.5,-0.7 1.1,-1.2c0.4,-0.4 0.7,-0.8 1,-1.1s0.4,-0.8 0.4,-1.2c0,-0.5 -0.1,-0.9 -0.4,-1.2c-0.3,-0.3 -0.7,-0.4 -1.2,-0.4c-0.4,0 -0.8,0.1 -1.1,0.3c-0.3,0.2 -0.4,0.6 -0.4,1.1l-1.9,0c0,-1 0.3,-1.7 1,-2.2c0.6,-0.5 1.5,-0.8 2.5,-0.8c1.1,0 2,0.3 2.6,0.8c0.6,0.5 0.9,1.3 0.9,2.3c0,0.7 -0.2,1.3 -0.6,1.8c-0.4,0.6 -0.9,1.1 -1.5,1.6c-0.3,0.3 -0.5,0.5 -0.6,0.7c-0.1,0.2 -0.1,0.6 -0.1,1L19.5,17.700001zM21.4,21l-1.9,0l0,-1.8l1.9,0L21.4,21z"/> </vector> diff --git a/core/res/res/drawable/stat_sys_tether_wifi.xml b/core/res/res/drawable/stat_sys_tether_wifi.xml index 4396962a2996..23dc849f2163 100644 --- a/core/res/res/drawable/stat_sys_tether_wifi.xml +++ b/core/res/res/drawable/stat_sys_tether_wifi.xml @@ -21,5 +21,5 @@ Copyright (C) 2014 The Android Open Source Project <path android:fillColor="#FFFFFFFF" - android:pathData="M24.000000,22.000000c-2.200000,0.000000 -4.000000,1.800000 -4.000000,4.000000c0.000000,2.200000 1.800000,4.000000 4.000000,4.000000c2.200000,0.000000 4.000000,-1.800000 4.000000,-4.000000C28.000000,23.799999 26.200001,22.000000 24.000000,22.000000zM36.000000,26.000000c0.000000,-6.600000 -5.400000,-12.000000 -12.000000,-12.000000c-6.600000,0.000000 -12.000000,5.400000 -12.000000,12.000000c0.000000,4.400000 2.400000,8.300000 6.000000,10.400000l2.000000,-3.500000c-2.400000,-1.400000 -4.000000,-3.900000 -4.000000,-6.900000c0.000000,-4.400000 3.600000,-8.000000 8.000000,-8.000000s8.000000,3.600000 8.000000,8.000000c0.000000,3.000000 -1.600000,5.500000 -4.000000,6.900000l2.000000,3.500000C33.599998,34.299999 36.000000,30.400000 36.000000,26.000000zM24.000000,6.000000C13.000000,6.000000 4.000000,15.000000 4.000000,26.000000c0.000000,7.400000 4.000000,13.800000 10.000000,17.299999l2.000000,-3.500000c-4.800000,-2.800000 -8.000000,-7.900000 -8.000000,-13.800000c0.000000,-8.800000 7.200000,-16.000000 16.000000,-16.000000s16.000000,7.200000 16.000000,16.000000c0.000000,5.900000 -3.200000,11.100000 -8.000000,13.800000l2.000000,3.500000c6.000000,-3.500000 10.000000,-9.900000 10.000000,-17.299999C44.000000,15.000000 35.000000,6.000000 24.000000,6.000000z"/> + android:pathData="M24,22c-2.2,0 -4,1.8 -4,4c0,2.2 1.8,4 4,4c2.2,0 4,-1.8 4,-4C28,23.799999 26.200001,22 24,22zM36,26c0,-6.6 -5.4,-12 -12,-12c-6.6,0 -12,5.4 -12,12c0,4.4 2.4,8.3 6,10.4l2,-3.5c-2.4,-1.4 -4,-3.9 -4,-6.9c0,-4.4 3.6,-8 8,-8s8,3.6 8,8c0,3 -1.6,5.5 -4,6.9l2,3.5C33.599998,34.299999 36,30.4 36,26zM24,6C13,6 4,15 4,26c0,7.4 4,13.8 10,17.299999l2,-3.5c-4.8,-2.8 -8,-7.9 -8,-13.8c0,-8.8 7.2,-16 16,-16s16,7.2 16,16c0,5.9 -3.2,11.1 -8,13.8l2,3.5c6,-3.5 10,-9.9 10,-17.299999C44,15 35,6 24,6z"/> </vector> diff --git a/core/res/res/values-mcc310-mnc150/config.xml b/core/res/res/values-mcc310-mnc150/config.xml index f1936f43bd02..3f9330d9a760 100644 --- a/core/res/res/values-mcc310-mnc150/config.xml +++ b/core/res/res/values-mcc310-mnc150/config.xml @@ -33,4 +33,8 @@ <item>315</item> <item>316</item> </string-array> + <string-array translatable="false" name="config_twoDigitNumberPattern"> + <item>"0"</item> + <item>"00"</item> + </string-array> </resources> diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java b/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java index 1f48638d8d3e..0df5e3cf18d7 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java +++ b/packages/PrintSpooler/src/com/android/printspooler/model/MutexFileProvider.java @@ -93,7 +93,7 @@ public final class MutexFileProvider { public void releaseFile() { synchronized (mLock) { if (mOwnerThread != Thread.currentThread()) { - throw new IllegalStateException("Not acquired"); + return; } if (DEBUG) { diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml index bfeac9d3ea94..d0fba20d53e4 100644 --- a/packages/SystemUI/res/layout/zen_mode_panel.xml +++ b/packages/SystemUI/res/layout/zen_mode_panel.xml @@ -76,7 +76,7 @@ android:layout_alignParentEnd="true" android:background="@drawable/btn_borderless_rect" android:clickable="true" - android:contentDescription="@null" + android:contentDescription="@string/accessibility_desc_settings" android:scaleType="center" android:src="@drawable/ic_settings" /> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index c04ca83300cd..80e966386e2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1738,6 +1738,10 @@ public class NotificationPanelView extends PanelView implements updateKeyguardStatusBarVisibility(); } + public boolean isDozing() { + return mDozing; + } + private static void setBackgroundColorAlpha(final View target, int rgb, int targetAlpha, boolean animate) { int currentAlpha = getBackgroundAlpha(target); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 9d77331296d0..90f9cdd772bc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3641,7 +3641,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } private void updateDozingState() { - if (mState != StatusBarState.KEYGUARD) { + if (mState != StatusBarState.KEYGUARD && !mNotificationPanel.isDozing()) { return; } mNotificationPanel.setDozing(mDozing); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 90be92db232a..5353f25b4cdb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -148,7 +148,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { if (!mDozing || mPulseCallback != null) { // Pulse suppressed. - mPulseCallback.onPulseFinished(); + callback.onPulseFinished(); return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java index cb9abfd9e5fe..072fb29430ef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java @@ -748,7 +748,9 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL transition(mQsDetailHeader, showingDetail); mShowingDetail = showingDetail; if (showingDetail) { - mQsDetailHeaderTitle.setText(detail.getTitle()); + String title = mContext.getString(detail.getTitle()); + mQsDetailHeaderTitle.setText(title); + announceForAccessibility(title); final Boolean toggleState = detail.getToggleState(); if (toggleState == null) { mQsDetailHeaderSwitch.setVisibility(INVISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java index eb0be054e8b9..e34495492c02 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java @@ -55,6 +55,7 @@ public class CastControllerImpl implements CastController { private final Object mProjectionLock = new Object(); private boolean mDiscovering; + private boolean mCallbackRegistered; private MediaProjectionInfo mProjection; public CastControllerImpl(Context context) { @@ -70,6 +71,7 @@ public class CastControllerImpl implements CastController { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("CastController state:"); pw.print(" mDiscovering="); pw.println(mDiscovering); + pw.print(" mCallbackRegistered="); pw.println(mCallbackRegistered); pw.print(" mCallbacks.size="); pw.println(mCallbacks.size()); pw.print(" mRoutes.size="); pw.println(mRoutes.size()); for (int i = 0; i < mRoutes.size(); i++) { @@ -83,11 +85,17 @@ public class CastControllerImpl implements CastController { public void addCallback(Callback callback) { mCallbacks.add(callback); fireOnCastDevicesChanged(callback); + synchronized (mDiscoveringLock) { + handleDiscoveryChangeLocked(); + } } @Override public void removeCallback(Callback callback) { mCallbacks.remove(callback); + synchronized (mDiscoveringLock) { + handleDiscoveryChangeLocked(); + } } @Override @@ -96,12 +104,23 @@ public class CastControllerImpl implements CastController { if (mDiscovering == request) return; mDiscovering = request; if (DEBUG) Log.d(TAG, "setDiscovering: " + request); - if (request) { - mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback, - MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY); - } else { - mMediaRouter.removeCallback(mMediaCallback); - } + handleDiscoveryChangeLocked(); + } + } + + private void handleDiscoveryChangeLocked() { + if (mCallbackRegistered) { + mMediaRouter.removeCallback(mMediaCallback); + mCallbackRegistered = false; + } + if (mDiscovering) { + mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback, + MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY); + mCallbackRegistered = true; + } else if (mCallbacks.size() != 0) { + mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback, + MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY); + mCallbackRegistered = true; } } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java index aac02add704e..e9ca5c97ad6c 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java @@ -295,6 +295,7 @@ public class KeyguardServiceDelegate { stretch, stretch, type, flags, PixelFormat.TRANSLUCENT); lp.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; + lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED; lp.setTitle("KeyguardScrim"); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); wm.addView(view, lp); diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java index d05de697d40f..86cfdb98b715 100644 --- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java @@ -434,6 +434,8 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku } } + clearProvidersAndHostsTagsLocked(); + loadGroupWidgetProvidersLocked(newProfileIds); loadGroupStateLocked(newProfileIds); } @@ -2372,6 +2374,20 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku } } + private void clearProvidersAndHostsTagsLocked() { + final int providerCount = mProviders.size(); + for (int i = 0; i < providerCount; i++) { + Provider provider = mProviders.get(i); + provider.tag = TAG_UNDEFINED; + } + + final int hostCount = mHosts.size(); + for (int i = 0; i < hostCount; i++) { + Host host = mHosts.get(i); + host.tag = TAG_UNDEFINED; + } + } + private boolean writeProfileStateToFileLocked(FileOutputStream stream, int userId) { int N; diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 060c8e30212f..1623eac6ac9e 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlSerializer; import android.app.ActivityManagerNative; import android.app.AppGlobals; import android.app.AlertDialog; +import android.app.AppOpsManager; import android.app.IUserSwitchObserver; import android.app.KeyguardManager; import android.app.Notification; @@ -175,6 +176,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private InputMethodFileManager mFileManager; private final HardKeyboardListener mHardKeyboardListener; private final WindowManagerService mWindowManagerService; + private final AppOpsManager mAppOpsManager; final InputBindResult mNoBinding = new InputBindResult(null, null, null, -1, -1); @@ -643,6 +645,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } }, true /*asyncHandler*/); mWindowManagerService = windowManager; + mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); mHardKeyboardListener = new HardKeyboardListener(); mHasFeature = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_INPUT_METHODS); @@ -1746,6 +1749,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub throw new IllegalArgumentException("Unknown id: " + id); } + if (mCurClient != null && mCurAttribute != null) { + final int uid = mCurClient.uid; + final String packageName = mCurAttribute.packageName; + if (SystemConfig.getInstance().getFixedImeApps().contains(packageName)) { + if (InputMethodUtils.checkIfPackageBelongsToUid(mAppOpsManager, uid, packageName)) { + return; + } + // TODO: Do we need to lock the input method when the application reported an + // incorrect package name? + Slog.e(TAG, "Ignoring FixedImeApps due to the validation failure. uid=" + uid + + " package=" + packageName); + } + } + // See if we need to notify a subtype change within the same IME. if (id.equals(mCurMethodId)) { final int subtypeCount = info.getSubtypeCount(); diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 1f537befe810..34d7cb37cb61 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2351,7 +2351,7 @@ public final class ActiveServices { void serviceTimeout(ProcessRecord proc) { String anrMessage = null; - synchronized(this) { + synchronized(mAm) { if (proc.executingServices.size() == 0 || proc.thread == null) { return; } @@ -2647,7 +2647,7 @@ public final class ActiveServices { int opti, boolean dumpAll) { ArrayList<ServiceRecord> services = new ArrayList<ServiceRecord>(); - synchronized (this) { + synchronized (mAm) { int[] users = mAm.getUsersLocked(); if ("all".equals(name)) { for (int user : users) { @@ -2721,7 +2721,7 @@ public final class ActiveServices { private void dumpService(String prefix, FileDescriptor fd, PrintWriter pw, final ServiceRecord r, String[] args, boolean dumpAll) { String innerPrefix = prefix + " "; - synchronized (this) { + synchronized (mAm) { pw.print(prefix); pw.print("SERVICE "); pw.print(r.shortName); pw.print(" "); pw.print(Integer.toHexString(System.identityHashCode(r))); diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 9228fc6586a5..04e18171eb3f 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -937,13 +937,6 @@ public final class ActivityManagerService extends ActivityManagerNative private boolean mRunningVoice = false; /** - * Set while the keyguard is waiting for an activity to draw. - * In this state, if we are sleeping, we allow Activities to launch - * so that they can draw before Keyguard dismisses itself. - */ - private boolean mKeyguardWaitingForDraw = false; - - /** * State of external calls telling us if the device is asleep. */ private boolean mWentToSleep = false; @@ -2623,6 +2616,11 @@ public final class ActivityManagerService extends ActivityManagerNative final void removeLruProcessLocked(ProcessRecord app) { int lrui = mLruProcesses.lastIndexOf(app); if (lrui >= 0) { + if (!app.killed) { + Slog.wtf(TAG, "Removing process that hasn't been killed: " + app); + Process.killProcessQuiet(app.pid); + Process.killProcessGroup(app.info.uid, app.pid); + } if (lrui <= mLruProcessActivityStart) { mLruProcessActivityStart--; } @@ -3206,6 +3204,7 @@ public final class ActivityManagerService extends ActivityManagerNative app.setPid(startResult.pid); app.usingWrapper = startResult.usingWrapper; app.removed = false; + app.killed = false; app.killedByAm = false; checkTime(startTime, "startProcess: starting to update pids map"); synchronized (mPidsSelfLocked) { @@ -4804,15 +4803,16 @@ public final class ActivityManagerService extends ActivityManagerNative appDiedLocked(app, app.pid, app.thread); } - final void appDiedLocked(ProcessRecord app, int pid, - IApplicationThread thread) { + final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread) { BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics(); synchronized (stats) { stats.noteProcessDiedLocked(app.info.uid, pid); } + Process.killProcessQuiet(pid); Process.killProcessGroup(app.info.uid, pid); + app.killed = true; // Clean up already done if the process has been re-started. if (app.pid == pid && app.thread != null && @@ -6249,7 +6249,10 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized (this) { if (DEBUG_LOCKSCREEN) logLockScreen(""); mWindowManager.keyguardWaitingForActivityDrawn(); - mKeyguardWaitingForDraw = true; + if (mLockScreenShown) { + mLockScreenShown = false; + comeOutOfSleepIfNeededLocked(); + } } } finally { Binder.restoreCallingIdentity(token); @@ -9952,7 +9955,7 @@ public final class ActivityManagerService extends ActivityManagerNative } public boolean isSleeping() { - return mSleeping && !mKeyguardWaitingForDraw; + return mSleeping; } void goingToSleep() { @@ -9973,7 +9976,6 @@ public final class ActivityManagerService extends ActivityManagerNative if (mWentToSleep && !mRunningVoice) { if (!mSleeping) { mSleeping = true; - mKeyguardWaitingForDraw = false; mStackSupervisor.goingToSleepLocked(); // Initialize the wake times of all processes. @@ -10082,7 +10084,6 @@ public final class ActivityManagerService extends ActivityManagerNative try { if (DEBUG_LOCKSCREEN) logLockScreen(" shown=" + shown); mLockScreenShown = shown; - mKeyguardWaitingForDraw = false; comeOutOfSleepIfNeededLocked(); } finally { Binder.restoreCallingIdentity(ident); diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java index 0817dd84b375..7c48f3e00fac 100644 --- a/services/core/java/com/android/server/am/ProcessRecord.java +++ b/services/core/java/com/android/server/am/ProcessRecord.java @@ -100,6 +100,7 @@ final class ProcessRecord { boolean treatLikeActivity; // Bound using BIND_TREAT_LIKE_ACTIVITY boolean bad; // True if disabled in the bad process list boolean killedByAm; // True when proc has been killed by activity manager, not for RAM + boolean killed; // True once we know the process has been killed boolean procStateChanged; // Keep track of whether we changed 'setAdj'. String waitingToKill; // Process is waiting to be killed when in the bg, and reason IBinder forcingToForeground;// Token that is forcing this process to be foreground @@ -303,8 +304,9 @@ final class ProcessRecord { pw.print(" lastLowMemory="); TimeUtils.formatDuration(lastLowMemory, now, pw); pw.print(" reportLowMemory="); pw.println(reportLowMemory); - if (killedByAm || waitingToKill != null) { - pw.print(prefix); pw.print("killedByAm="); pw.print(killedByAm); + if (killed || killedByAm || waitingToKill != null) { + pw.print(prefix); pw.print("killed="); pw.print(killed); + pw.print(" killedByAm="); pw.print(killedByAm); pw.print(" waitingToKill="); pw.println(waitingToKill); } if (debugging || crashing || crashDialog != null || notResponding @@ -514,6 +516,7 @@ final class ProcessRecord { Process.killProcessQuiet(pid); Process.killProcessGroup(info.uid, pid); if (!persistent) { + killed = true; killedByAm = true; } } diff --git a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java index 8a1f3ad5479c..cdfb656f439e 100644 --- a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java +++ b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java @@ -23,6 +23,7 @@ import android.app.AppOpsManager; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.display.DisplayManager; +import android.media.MediaRouter; import android.media.projection.IMediaProjectionManager; import android.media.projection.IMediaProjection; import android.media.projection.IMediaProjectionCallback; @@ -68,6 +69,10 @@ public final class MediaProjectionManagerService extends SystemService private final Context mContext; private final AppOpsManager mAppOps; + private final MediaRouter mMediaRouter; + private final MediaRouterCallback mMediaRouterCallback; + private MediaRouter.RouteInfo mMediaRouteInfo; + private IBinder mProjectionToken; private MediaProjection mProjectionGrant; @@ -77,6 +82,8 @@ public final class MediaProjectionManagerService extends SystemService mDeathEaters = new ArrayMap<IBinder, IBinder.DeathRecipient>(); mCallbackDelegate = new CallbackDelegate(); mAppOps = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); + mMediaRouter = (MediaRouter) mContext.getSystemService(Context.MEDIA_ROUTER_SERVICE); + mMediaRouterCallback = new MediaRouterCallback(); Watchdog.getInstance().addMonitor(this); } @@ -84,6 +91,12 @@ public final class MediaProjectionManagerService extends SystemService public void onStart() { publishBinderService(Context.MEDIA_PROJECTION_SERVICE, new BinderService(), false /*allowIsolated*/); + mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY, mMediaRouterCallback); + } + + @Override + public void onSwitchUser(int userId) { + mMediaRouter.rebindAsUser(userId); } @Override @@ -95,6 +108,9 @@ public final class MediaProjectionManagerService extends SystemService if (mProjectionGrant != null) { mProjectionGrant.stop(); } + if (mMediaRouteInfo != null) { + mMediaRouter.getDefaultRoute().select(); + } mProjectionToken = projection.asBinder(); mProjectionGrant = projection; dispatchStart(projection); @@ -448,6 +464,27 @@ public final class MediaProjectionManagerService extends SystemService } } + private class MediaRouterCallback extends MediaRouter.SimpleCallback { + @Override + public void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo info) { + synchronized (mLock) { + if ((type & MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY) != 0) { + mMediaRouteInfo = info; + if (mProjectionGrant != null) { + mProjectionGrant.stop(); + } + } + } + } + + @Override + public void onRouteUnselected(MediaRouter route, int type, MediaRouter.RouteInfo info) { + if (mMediaRouteInfo == info) { + mMediaRouteInfo = null; + } + } + } + private static class CallbackDelegate { private Map<IBinder, IMediaProjectionCallback> mClientCallbacks; diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java index 479af894fc89..5038d03a48af 100644 --- a/services/core/java/com/android/server/notification/ZenModeHelper.java +++ b/services/core/java/com/android/server/notification/ZenModeHelper.java @@ -182,6 +182,12 @@ public class ZenModeHelper { } return shouldInterceptAudience(record); } + if (isEvent(record)) { + if (!mConfig.allowEvents) { + ZenLog.traceIntercepted(record, "!allowEvents"); + return true; + } + } ZenLog.traceIntercepted(record, "!allowed"); return true; } @@ -328,17 +334,20 @@ public class ZenModeHelper { } } - private boolean isSystem(NotificationRecord record) { + private static boolean isSystem(NotificationRecord record) { return record.isCategory(Notification.CATEGORY_SYSTEM); } - private boolean isAlarm(NotificationRecord record) { + private static boolean isAlarm(NotificationRecord record) { return record.isCategory(Notification.CATEGORY_ALARM) - || record.isCategory(Notification.CATEGORY_EVENT) || record.isAudioStream(AudioManager.STREAM_ALARM) || record.isAudioAttributesUsage(AudioAttributes.USAGE_ALARM); } + private static boolean isEvent(NotificationRecord record) { + return record.isCategory(Notification.CATEGORY_EVENT); + } + private boolean isCall(NotificationRecord record) { return isDefaultPhoneApp(record.sbn.getPackageName()) || record.isCategory(Notification.CATEGORY_CALL); diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h index 3fc9f815c1a9..d809c5b3003c 100644 --- a/tools/aapt/AaptAssets.h +++ b/tools/aapt/AaptAssets.h @@ -104,6 +104,9 @@ private: struct AaptGroupEntry { public: + AaptGroupEntry() {} + AaptGroupEntry(const ConfigDescription& config) : mParams(config) {} + bool initFromDirName(const char* dir, String8* resType); inline const ConfigDescription& toParams() const { return mParams; } diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp index 137c85ce6ef2..56d1650c3652 100644 --- a/tools/aapt/Images.cpp +++ b/tools/aapt/Images.cpp @@ -1483,7 +1483,7 @@ status_t preProcessImageToCache(const Bundle* bundle, const String8& source, con return NO_ERROR; } -status_t postProcessImage(const sp<AaptAssets>& assets, +status_t postProcessImage(const Bundle* bundle, const sp<AaptAssets>& assets, ResourceTable* table, const sp<AaptFile>& file) { String8 ext(file->getPath().getPathExtension()); @@ -1491,7 +1491,8 @@ status_t postProcessImage(const sp<AaptAssets>& assets, // At this point, now that we have all the resource data, all we need to // do is compile XML files. if (strcmp(ext.string(), ".xml") == 0) { - return compileXmlFile(assets, file, table); + String16 resourceName(parseResourceName(file->getPath().getPathLeaf())); + return compileXmlFile(bundle, assets, resourceName, file, table); } return NO_ERROR; diff --git a/tools/aapt/Images.h b/tools/aapt/Images.h index 91b6554c02c9..a0a94f8b9d16 100644 --- a/tools/aapt/Images.h +++ b/tools/aapt/Images.h @@ -20,7 +20,7 @@ status_t preProcessImage(const Bundle* bundle, const sp<AaptAssets>& assets, status_t preProcessImageToCache(const Bundle* bundle, const String8& source, const String8& dest); -status_t postProcessImage(const sp<AaptAssets>& assets, +status_t postProcessImage(const Bundle* bundle, const sp<AaptAssets>& assets, ResourceTable* table, const sp<AaptFile>& file); #endif diff --git a/tools/aapt/Main.h b/tools/aapt/Main.h index f24a023b70a1..089dde5fcb8c 100644 --- a/tools/aapt/Main.h +++ b/tools/aapt/Main.h @@ -62,4 +62,7 @@ int dumpResources(Bundle* bundle); status_t writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets, FILE* fp, bool includeRaw); + +android::String8 parseResourceName(const String8& pathLeaf); + #endif // __MAIN_H diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index d60520284fa2..a4c9dabb6be9 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -50,7 +50,7 @@ public: // ========================================================================== // ========================================================================== -static String8 parseResourceName(const String8& leaf) +String8 parseResourceName(const String8& leaf) { const char* firstDot = strchr(leaf.string(), '.'); const char* str = leaf.string(); @@ -1088,7 +1088,7 @@ status_t generateAndroidManifestForSplit(Bundle* bundle, const sp<AaptAssets>& a manifest->addChild(app); root->addChild(manifest); - int err = compileXmlFile(assets, root, outFile, table); + int err = compileXmlFile(bundle, assets, String16(), root, outFile, table); if (err < NO_ERROR) { return err; } @@ -1336,7 +1336,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil ResourceDirIterator it(layouts, String8("layout")); while ((err=it.next()) == NO_ERROR) { String8 src = it.getFile()->getPrintableSource(); - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err == NO_ERROR) { ResXMLTree block; block.setTo(it.getFile()->getData(), it.getFile()->getSize(), true); @@ -1355,7 +1356,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (anims != NULL) { ResourceDirIterator it(anims, String8("anim")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1370,7 +1372,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (animators != NULL) { ResourceDirIterator it(animators, String8("animator")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1385,7 +1388,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (interpolators != NULL) { ResourceDirIterator it(interpolators, String8("interpolator")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1400,7 +1404,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (transitions != NULL) { ResourceDirIterator it(transitions, String8("transition")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1415,7 +1420,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (xmls != NULL) { ResourceDirIterator it(xmls, String8("xml")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1430,7 +1436,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (drawables != NULL) { ResourceDirIterator it(drawables, String8("drawable")); while ((err=it.next()) == NO_ERROR) { - err = postProcessImage(assets, &table, it.getFile()); + err = postProcessImage(bundle, assets, &table, it.getFile()); if (err != NO_ERROR) { hasErrors = true; } @@ -1445,7 +1451,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (colors != NULL) { ResourceDirIterator it(colors, String8("color")); while ((err=it.next()) == NO_ERROR) { - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err != NO_ERROR) { hasErrors = true; } @@ -1461,7 +1468,8 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil ResourceDirIterator it(menus, String8("menu")); while ((err=it.next()) == NO_ERROR) { String8 src = it.getFile()->getPrintableSource(); - err = compileXmlFile(assets, it.getFile(), &table, xmlFlags); + err = compileXmlFile(bundle, assets, String16(it.getBaseName()), + it.getFile(), &table, xmlFlags); if (err == NO_ERROR) { ResXMLTree block; block.setTo(it.getFile()->getData(), it.getFile()->getSize(), true); @@ -1477,6 +1485,22 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil err = NO_ERROR; } + // Now compile any generated resources. + std::queue<CompileResourceWorkItem>& workQueue = table.getWorkQueue(); + while (!workQueue.empty()) { + CompileResourceWorkItem& workItem = workQueue.front(); + err = compileXmlFile(bundle, assets, workItem.resourceName, workItem.file, &table, xmlFlags); + if (err == NO_ERROR) { + assets->addResource(workItem.resPath.getPathLeaf(), + workItem.resPath, + workItem.file, + workItem.file->getResourceType()); + } else { + hasErrors = true; + } + workQueue.pop(); + } + if (table.validateLocalizations()) { hasErrors = true; } @@ -1509,7 +1533,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil if (err < NO_ERROR) { return err; } - err = compileXmlFile(assets, manifestTree, manifestFile, &table); + err = compileXmlFile(bundle, assets, String16(), manifestTree, manifestFile, &table); if (err < NO_ERROR) { return err; } @@ -1599,7 +1623,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil sp<AaptFile> outManifestFile = new AaptFile(manifestFile->getSourceFile(), manifestFile->getGroupEntry(), manifestFile->getResourceType()); - err = compileXmlFile(assets, manifestFile, + err = compileXmlFile(bundle, assets, String16(), manifestFile, outManifestFile, &table, XML_COMPILE_ASSIGN_ATTRIBUTE_IDS | XML_COMPILE_STRIP_WHITESPACE | XML_COMPILE_STRIP_RAW_VALUES); diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 8c9efc94b0dd..b8c34543c361 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -17,7 +17,9 @@ #define NOISY(x) //x -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<AaptFile>& target, ResourceTable* table, int options) @@ -27,10 +29,12 @@ status_t compileXmlFile(const sp<AaptAssets>& assets, return UNKNOWN_ERROR; } - return compileXmlFile(assets, root, target, table, options); + return compileXmlFile(bundle, assets, resourceName, root, target, table, options); } -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<AaptFile>& target, const sp<AaptFile>& outTarget, ResourceTable* table, @@ -41,10 +45,12 @@ status_t compileXmlFile(const sp<AaptAssets>& assets, return UNKNOWN_ERROR; } - return compileXmlFile(assets, root, outTarget, table, options); + return compileXmlFile(bundle, assets, resourceName, root, outTarget, table, options); } -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<XMLNode>& root, const sp<AaptFile>& target, ResourceTable* table, @@ -77,6 +83,10 @@ status_t compileXmlFile(const sp<AaptAssets>& assets, if (hasErrors) { return UNKNOWN_ERROR; } + + if (table->modifyForCompat(bundle, resourceName, target, root) != NO_ERROR) { + return UNKNOWN_ERROR; + } NOISY(printf("Input XML Resource:\n")); NOISY(root->print()); @@ -4028,6 +4038,39 @@ sp<ResourceTable::Entry> ResourceTable::getEntry(const String16& package, return t->getEntry(name, sourcePos, config, doSetIndex, overlay, mBundle->getAutoAddOverlay()); } +sp<ResourceTable::ConfigList> ResourceTable::getConfigList(const String16& package, + const String16& type, const String16& name) const +{ + const size_t packageCount = mOrderedPackages.size(); + for (size_t pi = 0; pi < packageCount; pi++) { + const sp<Package>& p = mOrderedPackages[pi]; + if (p == NULL || p->getName() != package) { + continue; + } + + const Vector<sp<Type> >& types = p->getOrderedTypes(); + const size_t typeCount = types.size(); + for (size_t ti = 0; ti < typeCount; ti++) { + const sp<Type>& t = types[ti]; + if (t == NULL || t->getName() != type) { + continue; + } + + const Vector<sp<ConfigList> >& configs = t->getOrderedConfigs(); + const size_t configCount = configs.size(); + for (size_t ci = 0; ci < configCount; ci++) { + const sp<ConfigList>& cl = configs[ci]; + if (cl == NULL || cl->getName() != name) { + continue; + } + + return cl; + } + } + } + return NULL; +} + sp<const ResourceTable::Entry> ResourceTable::getEntry(uint32_t resID, const ResTable_config* config) const { @@ -4157,6 +4200,22 @@ bool ResourceTable::isAttributeFromL(uint32_t attrId) { (attrId & 0x0000ffff) >= (baseAttrId & 0x0000ffff); } +static bool isMinSdkVersionLOrAbove(const Bundle* bundle) { + if (bundle->getMinSdkVersion() != NULL && strlen(bundle->getMinSdkVersion()) > 0) { + const char firstChar = bundle->getMinSdkVersion()[0]; + if (firstChar >= 'L' && firstChar <= 'Z') { + // L is the code-name for the v21 release. + return true; + } + + const int minSdk = atoi(bundle->getMinSdkVersion()); + if (minSdk >= SDK_L) { + return true; + } + } + return false; +} + /** * Modifies the entries in the resource table to account for compatibility * issues with older versions of Android. @@ -4200,19 +4259,10 @@ bool ResourceTable::isAttributeFromL(uint32_t attrId) { * attribute will be respected. */ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { - if (bundle->getMinSdkVersion() != NULL) { + if (isMinSdkVersionLOrAbove(bundle)) { // If this app will only ever run on L+ devices, // we don't need to do any compatibility work. - - if (String8("L") == bundle->getMinSdkVersion()) { - // Code-name for the v21 release. - return NO_ERROR; - } - - const int minSdk = atoi(bundle->getMinSdkVersion()); - if (minSdk >= SDK_L) { - return NO_ERROR; - } + return NO_ERROR; } const String16 attr16("attr"); @@ -4309,3 +4359,104 @@ status_t ResourceTable::modifyForCompat(const Bundle* bundle) { } return NO_ERROR; } + +status_t ResourceTable::modifyForCompat(const Bundle* bundle, + const String16& resourceName, + const sp<AaptFile>& target, + const sp<XMLNode>& root) { + if (isMinSdkVersionLOrAbove(bundle)) { + return NO_ERROR; + } + + if (target->getResourceType() == "" || target->getGroupEntry().toParams().sdkVersion >= SDK_L) { + // Skip resources that have no type (AndroidManifest.xml) or are already version qualified with v21 + // or higher. + return NO_ERROR; + } + + Vector<key_value_pair_t<sp<XMLNode>, size_t> > attrsToRemove; + + Vector<sp<XMLNode> > nodesToVisit; + nodesToVisit.push(root); + while (!nodesToVisit.isEmpty()) { + sp<XMLNode> node = nodesToVisit.top(); + nodesToVisit.pop(); + + const Vector<XMLNode::attribute_entry>& attrs = node->getAttributes(); + const size_t attrCount = attrs.size(); + for (size_t i = 0; i < attrCount; i++) { + const XMLNode::attribute_entry& attr = attrs[i]; + if (isAttributeFromL(attr.nameResId)) { + attrsToRemove.add(key_value_pair_t<sp<XMLNode>, size_t>(node, i)); + } + } + + // Schedule a visit to the children. + const Vector<sp<XMLNode> >& children = node->getChildren(); + const size_t childCount = children.size(); + for (size_t i = 0; i < childCount; i++) { + nodesToVisit.push(children[i]); + } + } + + if (attrsToRemove.isEmpty()) { + return NO_ERROR; + } + + ConfigDescription newConfig(target->getGroupEntry().toParams()); + newConfig.sdkVersion = SDK_L; + + // Look to see if we already have an overriding v21 configuration. + sp<ConfigList> cl = getConfigList(String16(mAssets->getPackage()), + String16(target->getResourceType()), resourceName); + if (cl->getEntries().indexOfKey(newConfig) < 0) { + // We don't have an overriding entry for v21, so we must duplicate this one. + sp<XMLNode> newRoot = root->clone(); + sp<AaptFile> newFile = new AaptFile(target->getSourceFile(), + AaptGroupEntry(newConfig), target->getResourceType()); + String8 resPath = String8::format("res/%s/%s", + newFile->getGroupEntry().toDirName(target->getResourceType()).string(), + target->getPath().getPathLeaf().string()); + resPath.convertToResPath(); + + // Add a resource table entry. + SourcePos(target->getSourceFile(), -1).printf( + "using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", + SDK_L, + mAssets->getPackage().string(), + newFile->getResourceType().string(), + String8(resourceName).string(), + newConfig.toString().string()); + + addEntry(SourcePos(), + String16(mAssets->getPackage()), + String16(target->getResourceType()), + resourceName, + String16(resPath), + NULL, + &newConfig); + + // Schedule this to be compiled. + CompileResourceWorkItem item; + item.resourceName = resourceName; + item.resPath = resPath; + item.file = newFile; + mWorkQueue.push(item); + } + + const size_t removeCount = attrsToRemove.size(); + for (size_t i = 0; i < removeCount; i++) { + sp<XMLNode> node = attrsToRemove[i].key; + size_t attrIndex = attrsToRemove[i].value; + const XMLNode::attribute_entry& ae = node->getAttributes()[attrIndex]; + SourcePos(node->getFilename(), node->getStartLineNumber()).printf( + "removing attribute %s%s%s from <%s>", + String8(ae.ns).string(), + (ae.ns.size() == 0 ? "" : ":"), + String8(ae.name).string(), + String8(node->getElementName()).string()); + node->removeAttribute(attrIndex); + } + + return NO_ERROR; +} diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h index 025a868254ee..c548a851fb2e 100644 --- a/tools/aapt/ResourceTable.h +++ b/tools/aapt/ResourceTable.h @@ -12,8 +12,9 @@ #include "SourcePos.h" #include "ResourceFilter.h" -#include <set> #include <map> +#include <queue> +#include <set> using namespace std; @@ -33,18 +34,24 @@ enum { | XML_COMPILE_STRIP_WHITESPACE | XML_COMPILE_STRIP_RAW_VALUES }; -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<AaptFile>& target, ResourceTable* table, int options = XML_COMPILE_STANDARD_RESOURCE); -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<AaptFile>& target, const sp<AaptFile>& outTarget, ResourceTable* table, int options = XML_COMPILE_STANDARD_RESOURCE); -status_t compileXmlFile(const sp<AaptAssets>& assets, +status_t compileXmlFile(const Bundle* bundle, + const sp<AaptAssets>& assets, + const String16& resourceName, const sp<XMLNode>& xmlTree, const sp<AaptFile>& target, ResourceTable* table, @@ -71,6 +78,14 @@ struct AccessorCookie } }; +// Holds the necessary information to compile the +// resource. +struct CompileResourceWorkItem { + String16 resourceName; + String8 resPath; + sp<AaptFile> file; +}; + class ResourceTable : public ResTable::Accessor { public: @@ -92,6 +107,18 @@ public: return mAssetsPackage; } + /** + * Returns the queue of resources that need to be compiled. + * This is only used for resources that have been generated + * during the compilation phase. If they were just added + * to the AaptAssets, then they may be skipped over + * and would mess up iteration order for the existing + * resources. + */ + queue<CompileResourceWorkItem>& getWorkQueue() { + return mWorkQueue; + } + status_t addIncludedResources(Bundle* bundle, const sp<AaptAssets>& assets); status_t addPublic(const SourcePos& pos, @@ -166,6 +193,10 @@ public: bool hasResources() const; status_t modifyForCompat(const Bundle* bundle); + status_t modifyForCompat(const Bundle* bundle, + const String16& resourceName, + const sp<AaptFile>& file, + const sp<XMLNode>& root); sp<AaptFile> flatten(Bundle* bundle, const sp<const ResourceFilter>& filter, const bool isBase); @@ -527,6 +558,9 @@ private: bool doSetIndex = false); sp<const Entry> getEntry(uint32_t resID, const ResTable_config* config = NULL) const; + sp<ConfigList> getConfigList(const String16& package, + const String16& type, + const String16& name) const; const Item* getItem(uint32_t resID, uint32_t attrID) const; bool getItemValue(uint32_t resID, uint32_t attrID, Res_value* outValue); @@ -545,6 +579,7 @@ private: // key = string resource name, value = set of locales in which that name is defined map<String16, map<String8, SourcePos> > mLocalizations; + queue<CompileResourceWorkItem> mWorkQueue; }; #endif diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp index 607d419b2971..51a4154d5335 100644 --- a/tools/aapt/XMLNode.cpp +++ b/tools/aapt/XMLNode.cpp @@ -621,6 +621,12 @@ sp<XMLNode> XMLNode::parse(const sp<AaptFile>& file) return state.root; } +XMLNode::XMLNode() + : mNextAttributeIndex(0x80000000) + , mStartLineNumber(0) + , mEndLineNumber(0) + , mUTF8(false) {} + XMLNode::XMLNode(const String8& filename, const String16& s1, const String16& s2, bool isNamespace) : mNextAttributeIndex(0x80000000) , mFilename(filename) @@ -810,6 +816,32 @@ status_t XMLNode::addAttribute(const String16& ns, const String16& name, return NO_ERROR; } +status_t XMLNode::removeAttribute(size_t index) +{ + if (getType() == TYPE_CDATA) { + return UNKNOWN_ERROR; + } + + if (index >= mAttributes.size()) { + return UNKNOWN_ERROR; + } + + const attribute_entry& e = mAttributes[index]; + const uint32_t key = e.nameResId ? e.nameResId : e.index; + mAttributeOrder.removeItem(key); + mAttributes.removeAt(index); + + // Shift all the indices. + const size_t attrCount = mAttributeOrder.size(); + for (size_t i = 0; i < attrCount; i++) { + size_t attrIdx = mAttributeOrder[i]; + if (attrIdx > index) { + mAttributeOrder.replaceValueAt(i, attrIdx - 1); + } + } + return NO_ERROR; +} + void XMLNode::setAttributeResID(size_t attrIdx, uint32_t resId) { attribute_entry& e = mAttributes.editItemAt(attrIdx); @@ -999,6 +1031,30 @@ status_t XMLNode::assignResourceIds(const sp<AaptAssets>& assets, return hasErrors ? UNKNOWN_ERROR : NO_ERROR; } +sp<XMLNode> XMLNode::clone() const { + sp<XMLNode> copy = new XMLNode(); + copy->mNamespacePrefix = mNamespacePrefix; + copy->mNamespaceUri = mNamespaceUri; + copy->mElementName = mElementName; + + const size_t childCount = mChildren.size(); + for (size_t i = 0; i < childCount; i++) { + copy->mChildren.add(mChildren[i]->clone()); + } + + copy->mAttributes = mAttributes; + copy->mAttributeOrder = mAttributeOrder; + copy->mNextAttributeIndex = mNextAttributeIndex; + copy->mChars = mChars; + memcpy(©->mCharsValue, &mCharsValue, sizeof(mCharsValue)); + copy->mComment = mComment; + copy->mFilename = mFilename; + copy->mStartLineNumber = mStartLineNumber; + copy->mEndLineNumber = mEndLineNumber; + copy->mUTF8 = mUTF8; + return copy; +} + status_t XMLNode::flatten(const sp<AaptFile>& dest, bool stripComments, bool stripRawValues) const { diff --git a/tools/aapt/XMLNode.h b/tools/aapt/XMLNode.h index ccbf9f403116..3161f6500291 100644 --- a/tools/aapt/XMLNode.h +++ b/tools/aapt/XMLNode.h @@ -116,6 +116,8 @@ public: status_t addAttribute(const String16& ns, const String16& name, const String16& value); + status_t removeAttribute(size_t index); + void setAttributeResID(size_t attrIdx, uint32_t resId); status_t appendChars(const String16& chars); @@ -137,6 +139,8 @@ public: status_t flatten(const sp<AaptFile>& dest, bool stripComments, bool stripRawValues) const; + sp<XMLNode> clone() const; + void print(int indent=0); private: @@ -163,6 +167,9 @@ private: static void XMLCALL commentData(void *userData, const char *comment); + // For cloning + XMLNode(); + // Creating an element node. XMLNode(const String8& filename, const String16& s1, const String16& s2, bool isNamespace); |