diff options
45 files changed, 346 insertions, 663 deletions
diff --git a/api/current.txt b/api/current.txt index eda087d..8cf132d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10908,7 +10908,6 @@ package android.graphics.drawable { method public void applyTheme(android.content.res.Resources.Theme); method public boolean canApplyTheme(); method public void clearColorFilter(); - method public void clearHotspots(); method public final void copyBounds(android.graphics.Rect); method public final android.graphics.Rect copyBounds(); method public static android.graphics.drawable.Drawable createFromPath(java.lang.String); @@ -10951,7 +10950,6 @@ package android.graphics.drawable { method protected void onBoundsChange(android.graphics.Rect); method protected boolean onLevelChange(int); method protected boolean onStateChange(int[]); - method public void removeHotspot(int); method public static int resolveOpacity(int, int); method public void scheduleSelf(java.lang.Runnable, long); method public abstract void setAlpha(int); @@ -10964,11 +10962,11 @@ package android.graphics.drawable { method public void setColorFilter(int, android.graphics.PorterDuff.Mode); method public void setDither(boolean); method public void setFilterBitmap(boolean); - method public void setHotspot(int, float, float); + method public void setHotspot(float, float); + method public void setHotspotBounds(int, int, int, int); method public final boolean setLevel(int); method public boolean setState(int[]); method public boolean setVisible(boolean, boolean); - method public boolean supportsHotspots(); method public void unscheduleSelf(java.lang.Runnable); } @@ -11027,30 +11025,6 @@ package android.graphics.drawable { method public final void setVariablePadding(boolean); } - public class DrawableWrapper extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback { - ctor public DrawableWrapper(); - method public void draw(android.graphics.Canvas); - method public android.graphics.Rect getDirtyBounds(); - method protected final android.graphics.drawable.Drawable getDrawable(); - method public int getOpacity(); - method public final int[] getState(); - method public void invalidateDrawable(android.graphics.drawable.Drawable); - method public void scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long); - method public void setAlpha(int); - method public final void setBounds(int, int, int, int); - method public final void setBounds(android.graphics.Rect); - method public void setColorFilter(android.graphics.ColorFilter); - method protected void setConstantState(android.graphics.drawable.DrawableWrapper.WrapperState, android.content.res.Resources); - method protected final void setDrawable(android.graphics.drawable.Drawable, android.content.res.Resources); - method public final boolean setState(int[]); - method public void setXfermode(android.graphics.Xfermode); - method public void unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable); - } - - public static abstract class DrawableWrapper.WrapperState extends android.graphics.drawable.Drawable.ConstantState { - method public int getChangingConfigurations(); - } - public class GradientDrawable extends android.graphics.drawable.Drawable { ctor public GradientDrawable(); ctor public GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation, int[]); @@ -11174,6 +11148,13 @@ package android.graphics.drawable { method public void setPicture(android.graphics.Picture); } + public class RippleDrawable extends android.graphics.drawable.LayerDrawable { + method public android.graphics.Rect getDirtyBounds(); + method public android.content.res.ColorStateList getTint(); + method public void setTint(android.content.res.ColorStateList); + method public void setTintMode(android.graphics.PorterDuff.Mode); + } + public class RotateDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback { ctor public RotateDrawable(); method public void draw(android.graphics.Canvas); @@ -11243,13 +11224,6 @@ package android.graphics.drawable { method public void addState(int[], android.graphics.drawable.Drawable); } - public class TouchFeedbackDrawable extends android.graphics.drawable.LayerDrawable { - method public android.graphics.Rect getDirtyBounds(); - method public android.content.res.ColorStateList getTint(); - method public void setTint(android.content.res.ColorStateList); - method public void setTintMode(android.graphics.PorterDuff.Mode); - } - public class TransitionDrawable extends android.graphics.drawable.LayerDrawable implements android.graphics.drawable.Drawable.Callback { ctor public TransitionDrawable(android.graphics.drawable.Drawable[]); method public boolean isCrossFadeEnabled(); @@ -14065,6 +14039,34 @@ package android.media { field public static final int H263ProfileISWV3 = 16; // 0x10 field public static final int H263ProfileInterlace = 128; // 0x80 field public static final int H263ProfileInternet = 64; // 0x40 + field public static final int HEVCHighTierLevel1 = 2; // 0x2 + field public static final int HEVCHighTierLevel2 = 8; // 0x8 + field public static final int HEVCHighTierLevel21 = 32; // 0x20 + field public static final int HEVCHighTierLevel3 = 128; // 0x80 + field public static final int HEVCHighTierLevel31 = 512; // 0x200 + field public static final int HEVCHighTierLevel4 = 2048; // 0x800 + field public static final int HEVCHighTierLevel41 = 8192; // 0x2000 + field public static final int HEVCHighTierLevel5 = 32768; // 0x8000 + field public static final int HEVCHighTierLevel51 = 131072; // 0x20000 + field public static final int HEVCHighTierLevel52 = 524288; // 0x80000 + field public static final int HEVCHighTierLevel6 = 2097152; // 0x200000 + field public static final int HEVCHighTierLevel61 = 8388608; // 0x800000 + field public static final int HEVCHighTierLevel62 = 33554432; // 0x2000000 + field public static final int HEVCMainTierLevel1 = 1; // 0x1 + field public static final int HEVCMainTierLevel2 = 4; // 0x4 + field public static final int HEVCMainTierLevel21 = 16; // 0x10 + field public static final int HEVCMainTierLevel3 = 64; // 0x40 + field public static final int HEVCMainTierLevel31 = 256; // 0x100 + field public static final int HEVCMainTierLevel4 = 1024; // 0x400 + field public static final int HEVCMainTierLevel41 = 4096; // 0x1000 + field public static final int HEVCMainTierLevel5 = 16384; // 0x4000 + field public static final int HEVCMainTierLevel51 = 65536; // 0x10000 + field public static final int HEVCMainTierLevel52 = 262144; // 0x40000 + field public static final int HEVCMainTierLevel6 = 1048576; // 0x100000 + field public static final int HEVCMainTierLevel61 = 4194304; // 0x400000 + field public static final int HEVCMainTierLevel62 = 16777216; // 0x1000000 + field public static final int HEVCProfileMain = 1; // 0x1 + field public static final int HEVCProfileMain10 = 2; // 0x2 field public static final int MPEG4Level0 = 1; // 0x1 field public static final int MPEG4Level0b = 2; // 0x2 field public static final int MPEG4Level1 = 4; // 0x4 @@ -23625,7 +23627,7 @@ package android.provider { field public static final java.lang.String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; field public static final java.lang.String DEVICE_PROVISIONED = "device_provisioned"; field public static final java.lang.String HTTP_PROXY = "http_proxy"; - field public static final java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; + field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final java.lang.String MODE_RINGER = "mode_ringer"; field public static final java.lang.String NETWORK_PREFERENCE = "network_preference"; field public static final java.lang.String RADIO_BLUETOOTH = "bluetooth"; @@ -23695,7 +23697,7 @@ package android.provider { field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods"; field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy"; field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility"; - field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; + field public static final java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final java.lang.String LOCATION_MODE = "location_mode"; field public static final int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2 field public static final int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3 @@ -30662,6 +30664,7 @@ package android.view { field public static final int SOURCE_CLASS_TRACKBALL = 4; // 0x4 field public static final int SOURCE_DPAD = 513; // 0x201 field public static final int SOURCE_GAMEPAD = 1025; // 0x401 + field public static final int SOURCE_HDMI = 33554433; // 0x2000001 field public static final int SOURCE_JOYSTICK = 16777232; // 0x1000010 field public static final int SOURCE_KEYBOARD = 257; // 0x101 field public static final int SOURCE_MOUSE = 8194; // 0x2002 @@ -30830,6 +30833,8 @@ package android.view { field public static final deprecated int FLAG_WOKE_HERE = 1; // 0x1 field public static final int KEYCODE_0 = 7; // 0x7 field public static final int KEYCODE_1 = 8; // 0x8 + field public static final int KEYCODE_11 = 227; // 0xe3 + field public static final int KEYCODE_12 = 228; // 0xe4 field public static final int KEYCODE_2 = 9; // 0x9 field public static final int KEYCODE_3 = 10; // 0xa field public static final int KEYCODE_3D_MODE = 206; // 0xce @@ -30949,6 +30954,7 @@ package android.view { field public static final int KEYCODE_KATAKANA_HIRAGANA = 215; // 0xd7 field public static final int KEYCODE_L = 40; // 0x28 field public static final int KEYCODE_LANGUAGE_SWITCH = 204; // 0xcc + field public static final int KEYCODE_LAST_CHANNEL = 229; // 0xe5 field public static final int KEYCODE_LEFT_BRACKET = 71; // 0x47 field public static final int KEYCODE_M = 41; // 0x29 field public static final int KEYCODE_MANNER_MODE = 205; // 0xcd @@ -30964,6 +30970,7 @@ package android.view { field public static final int KEYCODE_MEDIA_RECORD = 130; // 0x82 field public static final int KEYCODE_MEDIA_REWIND = 89; // 0x59 field public static final int KEYCODE_MEDIA_STOP = 86; // 0x56 + field public static final int KEYCODE_MEDIA_TOP_MENU = 226; // 0xe2 field public static final int KEYCODE_MENU = 82; // 0x52 field public static final int KEYCODE_META_LEFT = 117; // 0x75 field public static final int KEYCODE_META_RIGHT = 118; // 0x76 @@ -31036,6 +31043,7 @@ package android.view { field public static final int KEYCODE_T = 48; // 0x30 field public static final int KEYCODE_TAB = 61; // 0x3d field public static final int KEYCODE_TV = 170; // 0xaa + field public static final int KEYCODE_TV_DATA_SERVICE = 230; // 0xe6 field public static final int KEYCODE_TV_INPUT = 178; // 0xb2 field public static final int KEYCODE_TV_POWER = 177; // 0xb1 field public static final int KEYCODE_U = 49; // 0x31 diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e896063..2d03e1d 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -1088,6 +1088,9 @@ public final class Settings { MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); + + // At one time in System, then Global, but now back in Secure + MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); } private static final HashSet<String> MOVED_TO_GLOBAL; @@ -1102,7 +1105,6 @@ public final class Settings { MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); - MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS); MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); @@ -2573,10 +2575,10 @@ public final class Settings { public static final String HTTP_PROXY = Global.HTTP_PROXY; /** - * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead + * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead */ @Deprecated - public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS; + public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; /** * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} @@ -2814,7 +2816,6 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); - MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS); MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); @@ -3404,10 +3405,13 @@ public final class Settings { public static final String HTTP_PROXY = Global.HTTP_PROXY; /** - * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead + * Whether applications can be installed for this user via the system's + * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. + * + * <p>1 = permit app installation via the system package installer intent + * <p>0 = do not allow use of the package installer */ - @Deprecated - public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS; + public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; /** * Comma-separated list of location providers that activities may access. Do not rely on @@ -5066,13 +5070,10 @@ public final class Settings { "download_manager_recommended_max_bytes_over_mobile"; /** - * Whether the package installer should allow installation of apps downloaded from - * sources other than Google Play. - * - * 1 = allow installing from other sources - * 0 = only allow installing from Google Play + * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead */ - public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; + @Deprecated + public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; /** * Whether mobile data connections are allowed by the user. See @@ -6238,6 +6239,13 @@ public final class Settings { CALL_METHOD_GET_GLOBAL, CALL_METHOD_PUT_GLOBAL); + // Certain settings have been moved from global to the per-user secure namespace + private static final HashSet<String> MOVED_TO_SECURE; + static { + MOVED_TO_SECURE = new HashSet<String>(1); + MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); + } + /** * Look up a name in the database. * @param resolver to access the database with @@ -6251,6 +6259,11 @@ public final class Settings { /** @hide */ public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { + if (MOVED_TO_SECURE.contains(name)) { + Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" + + " to android.provider.Settings.Secure, returning read-only value."); + return Secure.getStringForUser(resolver, name, userHandle); + } return sNameValueCache.getStringForUser(resolver, name, userHandle); } @@ -6273,6 +6286,12 @@ public final class Settings { Log.v(TAG, "Global.putString(name=" + name + ", value=" + value + " for " + userHandle); } + // Global and Secure have the same access policy so we can forward writes + if (MOVED_TO_SECURE.contains(name)) { + Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" + + " to android.provider.Settings.Secure, value is unchanged."); + return Secure.putStringForUser(resolver, name, value, userHandle); + } return sNameValueCache.putStringForUser(resolver, name, value, userHandle); } diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index ae5f37e..358ae8a 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -234,6 +234,14 @@ public final class InputDevice implements Parcelable { public static final int SOURCE_JOYSTICK = 0x01000000 | SOURCE_CLASS_JOYSTICK; /** + * The input source is a device connected through HDMI-based bus. + * + * The key comes in through HDMI-CEC or MHL signal line, and is treated as if it were + * generated by a locally connected DPAD or keyboard. + */ + public static final int SOURCE_HDMI = 0x02000000 | SOURCE_CLASS_BUTTON; + + /** * A special input source constant that is used when filtering input devices * to match devices that provide any type of input source. */ diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index b8e1b89..8a996d2 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -644,14 +644,26 @@ public class KeyEvent extends InputEvent implements Parcelable { * devices or game controllers, especially if no other input mode is * available. */ public static final int KEYCODE_PAIRING = 225; - - private static final int LAST_KEYCODE = KEYCODE_PAIRING; + /** Key code constant: Media Top Menu key. + * Goes to the top of media menu. */ + public static final int KEYCODE_MEDIA_TOP_MENU = 226; + /** Key code constant: '11' key. */ + public static final int KEYCODE_11 = 227; + /** Key code constant: '12' key. */ + public static final int KEYCODE_12 = 228; + /** Key code constant: Last Channel key. + * Goes to the last viewed channel. */ + public static final int KEYCODE_LAST_CHANNEL = 229; + /** Key code constant: TV data service key. + * Displays data services like weather, sports. */ + public static final int KEYCODE_TV_DATA_SERVICE = 230; + + private static final int LAST_KEYCODE = KEYCODE_TV_DATA_SERVICE; // NOTE: If you add a new keycode here you must also add it to: // isSystem() // frameworks/native/include/android/keycodes.h - // frameworks/base/include/androidfw/InputEventAttributes.h - // external/webkit/WebKit/android/plugins/ANPKeyCodes.h + // frameworks/native/include/input/InputEventLabels.h // frameworks/base/core/res/res/values/attrs.xml // emulator? // LAST_KEYCODE diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index fb7d57d..6dc7286 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4789,25 +4789,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param v previous or the next focus holder, or null if none */ private void manageFocusHotspot(boolean focused, View v) { - if (mBackground != null && mBackground.supportsHotspots()) { - final Rect r = new Rect(); - if (!focused && v != null) { - v.getBoundsOnScreen(r); - final int[] location = new int[2]; - getLocationOnScreen(location); - r.offset(-location[0], -location[1]); - } else { - r.set(0, 0, mRight - mLeft, mBottom - mTop); - } - - final float x = r.exactCenterX(); - final float y = r.exactCenterY(); - mBackground.setHotspot(R.attr.state_focused, x, y); + if (mBackground == null) { + return; + } - if (!focused) { - mBackground.removeHotspot(R.attr.state_focused); - } + final Rect r = new Rect(); + if (!focused && v != null) { + v.getBoundsOnScreen(r); + final int[] location = new int[2]; + getLocationOnScreen(location); + r.offset(-location[0], -location[1]); + } else { + r.set(0, 0, mRight - mLeft, mBottom - mTop); } + + final float x = r.exactCenterX(); + final float y = r.exactCenterY(); + mBackground.setHotspot(x, y); } /** @@ -6763,7 +6761,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private void setPressed(boolean pressed, float x, float y) { if (pressed) { - setHotspot(R.attr.state_pressed, x, y); + setHotspot(x, y); } setPressed(pressed); @@ -6787,10 +6785,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags &= ~PFLAG_PRESSED; } - if (!pressed) { - clearHotspot(R.attr.state_pressed); - } - if (needsRefresh) { refreshDrawableState(); } @@ -9106,21 +9100,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { // Not inside a scrolling container, so show the feedback right away - setHotspot(R.attr.state_pressed, x, y); + setHotspot(x, y); setPressed(true); checkForLongClick(0); } break; case MotionEvent.ACTION_CANCEL: - clearHotspot(R.attr.state_pressed); setPressed(false); removeTapCallback(); removeLongPressCallback(); break; case MotionEvent.ACTION_MOVE: - setHotspot(R.attr.state_pressed, x, y); + setHotspot(x, y); // Be lenient about moving outside of buttons if (!pointInView(x, y, mTouchSlop)) { @@ -9142,17 +9135,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return false; } - private void setHotspot(int id, float x, float y) { - final Drawable bg = mBackground; - if (bg != null && bg.supportsHotspots()) { - bg.setHotspot(id, x, y); - } - } - - private void clearHotspot(int id) { - final Drawable bg = mBackground; - if (bg != null && bg.supportsHotspots()) { - bg.removeHotspot(id); + private void setHotspot(float x, float y) { + if (mBackground != null) { + mBackground.setHotspot(x, y); } } @@ -12903,10 +12888,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags &= ~PFLAG_CANCEL_NEXT_UP_EVENT; mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT; - if (mBackground != null) { - mBackground.clearHotspots(); - } - removeUnsetPressCallback(); removeLongPressCallback(); removePerformClickCallback(); diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index f91ef1a..c9eb130 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2502,22 +2502,16 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te positionSelector(position, sel); final Drawable selector = mSelector; - if (selector != null && selector.supportsHotspots() && position != INVALID_POSITION) { + if (selector != null && position != INVALID_POSITION) { final Rect bounds = mSelectorRect; final float x = bounds.exactCenterX(); final float y = bounds.exactCenterY(); - selector.setHotspot(R.attr.state_focused, x, y); + selector.setHotspot(x, y); } } void positionSelector(int position, View sel) { if (position != INVALID_POSITION) { - if (mSelectorPosition != position) { - final Drawable selector = mSelector; - if (selector != null && selector.supportsHotspots()) { - selector.clearHotspots(); - } - } mSelectorPosition = position; } @@ -3245,9 +3239,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te ((TransitionDrawable) d).resetTransition(); } } - if (d.supportsHotspots()) { - d.setHotspot(R.attr.state_pressed, x, y); - } + d.setHotspot(x, y); } if (longClickable) { @@ -3783,9 +3775,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (d != null && d instanceof TransitionDrawable) { ((TransitionDrawable) d).resetTransition(); } - if (mSelector.supportsHotspots()) { - mSelector.setHotspot(R.attr.state_pressed, x, ev.getY()); - } + mSelector.setHotspot(x, ev.getY()); } if (mTouchModeReset != null) { removeCallbacks(mTouchModeReset); @@ -3797,9 +3787,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchMode = TOUCH_MODE_REST; child.setPressed(false); setPressed(false); - if (mSelector != null && mSelector.supportsHotspots()) { - mSelector.removeHotspot(R.attr.state_pressed); - } if (!mDataChanged && !mIsDetaching && isAttachedToWindow()) { performClick.run(); } diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index 4f2d9c6..1152e17 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -31,8 +31,6 @@ import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; -import com.android.internal.R; - public abstract class AbsSeekBar extends ProgressBar { private final Rect mTempRect = new Rect(); @@ -348,7 +346,7 @@ public abstract class AbsSeekBar extends ProgressBar { final int right = left + thumbWidth; final Drawable background = getBackground(); - if (background != null && background.supportsHotspots()) { + if (background != null) { final Rect bounds = mThumb.getBounds(); final int offsetX = mPaddingLeft - mThumbOffset; final int offsetY = mPaddingTop; @@ -499,17 +497,10 @@ public abstract class AbsSeekBar extends ProgressBar { return true; } - private void setHotspot(int id, float x, float y) { - final Drawable bg = getBackground(); - if (bg != null && bg.supportsHotspots()) { - bg.setHotspot(id, x, y); - } - } - - private void clearHotspot(int id) { + private void setHotspot(float x, float y) { final Drawable bg = getBackground(); - if (bg != null && bg.supportsHotspots()) { - bg.removeHotspot(id); + if (bg != null) { + bg.setHotspot(x, y); } } @@ -541,7 +532,7 @@ public abstract class AbsSeekBar extends ProgressBar { final int max = getMax(); progress += scale * max; - setHotspot(R.attr.state_pressed, x, (int) event.getY()); + setHotspot(x, (int) event.getY()); setProgress((int) progress, true); } @@ -567,7 +558,6 @@ public abstract class AbsSeekBar extends ProgressBar { * canceled. */ void onStopTrackingTouch() { - clearHotspot(R.attr.state_pressed); mIsDragging = false; } diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java index 9e17cca..6aff4f4 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -285,7 +285,7 @@ public abstract class CompoundButton extends Button implements Checkable { buttonDrawable.setBounds(left, top, right, bottom); final Drawable background = getBackground(); - if (background != null && background.supportsHotspots()) { + if (background != null) { background.setHotspotBounds(left, top, right, bottom); } } diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java index 74a3eec..ad1a023 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -828,7 +828,7 @@ public class Switch extends CompoundButton { thumbDrawable.setBounds(thumbLeft, switchTop, thumbRight, switchBottom); final Drawable background = getBackground(); - if (background != null && background.supportsHotspots()) { + if (background != null) { background.setHotspotBounds(thumbLeft, switchTop, thumbRight, switchBottom); } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 8f073de..a4a9680 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8194,7 +8194,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final boolean isPassword = hasPasswordTransformationMethod(); info.setPassword(isPassword); - if (!isPassword) { + if (!isPassword || shouldSpeakPasswordsForAccessibility()) { info.setText(getTextForAccessibility()); } diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp index 43e80dc..8418162 100644 --- a/core/jni/android/graphics/Paint.cpp +++ b/core/jni/android/graphics/Paint.cpp @@ -853,7 +853,7 @@ public: } else { SkScalar sigma = android::uirenderer::Blur::convertRadiusToSigma(radius); - paint->setLooper(new SkBlurDrawLooper((SkColor)color, sigma, dx, dy))->unref(); + paint->setLooper(SkBlurDrawLooper::Create((SkColor)color, sigma, dx, dy))->unref(); } } diff --git a/core/res/res/drawable/btn_borderless_quantum.xml b/core/res/res/drawable/btn_borderless_quantum.xml index 2e3c515..eaf2550 100644 --- a/core/res/res/drawable/btn_borderless_quantum.xml +++ b/core/res/res/drawable/btn_borderless_quantum.xml @@ -14,8 +14,8 @@ limitations under the License. --> -<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorButtonPressed"> <item android:id="@id/mask" android:drawable="@drawable/btn_qntm_alpha" /> -</touch-feedback> +</ripple> diff --git a/core/res/res/drawable/btn_default_quantum.xml b/core/res/res/drawable/btn_default_quantum.xml index c6a3a33..d8ab667 100644 --- a/core/res/res/drawable/btn_default_quantum.xml +++ b/core/res/res/drawable/btn_default_quantum.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorButtonPressed"> <item> <selector> @@ -31,4 +31,4 @@ </item> </selector> </item> -</touch-feedback> +</ripple> diff --git a/core/res/res/drawable/edit_text_quantum.xml b/core/res/res/drawable/edit_text_quantum.xml index c42c7b7..67339e8 100644 --- a/core/res/res/drawable/edit_text_quantum.xml +++ b/core/res/res/drawable/edit_text_quantum.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorControlActivated"> <item> <selector> @@ -36,4 +36,4 @@ </item> </selector> </item> -</touch-feedback> +</ripple> diff --git a/core/res/res/drawable/item_background_quantum.xml b/core/res/res/drawable/item_background_quantum.xml index 11e1f67..631d3e4 100644 --- a/core/res/res/drawable/item_background_quantum.xml +++ b/core/res/res/drawable/item_background_quantum.xml @@ -14,6 +14,6 @@ limitations under the License. --> -<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorButtonPressed" android:pinned="true" /> diff --git a/core/res/res/drawable/list_selector_quantum.xml b/core/res/res/drawable/list_selector_quantum.xml index c007117..0e185aa 100644 --- a/core/res/res/drawable/list_selector_quantum.xml +++ b/core/res/res/drawable/list_selector_quantum.xml @@ -14,9 +14,9 @@ limitations under the License. --> -<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorButtonPressed"> <item android:id="@id/mask"> <color android:color="@color/white" /> </item> -</touch-feedback> +</ripple> diff --git a/core/res/res/drawable/notification_bg_dim.xml b/core/res/res/drawable/notification_bg_dim.xml index ec20368..ae03d82 100644 --- a/core/res/res/drawable/notification_bg_dim.xml +++ b/core/res/res/drawable/notification_bg_dim.xml @@ -15,9 +15,9 @@ ~ limitations under the License --> -<touch-feedback +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="#ff444444" > <item android:drawable="@drawable/notification_bg_normal" /> -</touch-feedback>
\ No newline at end of file +</ripple>
\ No newline at end of file diff --git a/core/res/res/drawable/notification_quantum_bg_dim.xml b/core/res/res/drawable/notification_quantum_bg_dim.xml index ab0e049..eb9a4ab 100644 --- a/core/res/res/drawable/notification_quantum_bg_dim.xml +++ b/core/res/res/drawable/notification_quantum_bg_dim.xml @@ -15,7 +15,7 @@ ~ limitations under the License --> -<touch-feedback +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:tint="#ffffffff" android:tintMode="src_over" @@ -26,4 +26,4 @@ <corners android:radius="@dimen/notification_quantum_rounded_rect_radius" /> </shape> </item> -</touch-feedback>
\ No newline at end of file +</ripple>
\ No newline at end of file diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 9fba1bf..55e2983 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1669,6 +1669,11 @@ <enum name="KEYCODE_MEDIA_SLEEP" value="223" /> <enum name="KEYCODE_MEDIA_WAKEUP" value="224" /> <enum name="KEYCODE_PAIRING" value="225" /> + <enum name="KEYCODE_MEDIA_TOP_MENU" value="226" /> + <enum name="KEYCODE_11" value="227" /> + <enum name="KEYCODE_12" value="228" /> + <enum name="KEYCODE_LAST_CHANNEL" value="229" /> + <enum name="KEYCODE_TV_DATA_SERVICE" value="230" /> </attr> <!-- ***************************************************************** --> @@ -4647,7 +4652,7 @@ </declare-styleable> <!-- Drawable used to show animated touch feedback. --> - <declare-styleable name="TouchFeedbackDrawable"> + <declare-styleable name="RippleDrawable"> <!-- The tint to use for feedback ripples. This attribute is required. --> <attr name="tint" /> <!-- Specifies the Porter-Duff blending mode used to apply the tint. The default vlaue is src_atop, which draws over the opaque parts of the drawable. --> @@ -4753,11 +4758,6 @@ <!-- ========================== --> <eat-comment /> - <!-- Drawable used to draw Vector Drawables. --> - <declare-styleable name="VectorDrawable"> - <attr name="versionCode" /> - </declare-styleable> - <!-- Define the virtual size of the drawing surface paths will draw to. --> <declare-styleable name="VectorDrawableViewport"> <!-- The width of the canvas the drawing is on. --> diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index b939636..c78096a 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -484,55 +484,28 @@ public abstract class Drawable { } /** - * Indicates whether the drawable supports hotspots. Hotspots are uniquely - * identifiable coordinates the may be added, updated and removed within a - * drawable. + * Specifies the hotspot's location within the drawable. * - * @return true if hotspots are supported - * @see #setHotspot(int, float, float) - * @see #removeHotspot(int) - * @see #clearHotspots() - */ - public boolean supportsHotspots() { - return false; - } - - /** - * Specifies a hotspot's location within the drawable. - * <p> - * The specified key should be an id declared in the resources of the - * application to ensure it is unique (see the <a - * href={@docRoot}guide/topics/resources/more-resources.html#Id">ID resource type</a>). - * - * @param key The key identifying the hotspot * @param x The X coordinate of the center of the hotspot * @param y The Y coordinate of the center of the hotspot */ - public void setHotspot(int key, float x, float y) {} + public void setHotspot(float x, float y) {} /** - * Removes the hotspot with the specified key from the drawable. - * - * @param key The key identifying the hotspot - */ - public void removeHotspot(int key) {} - - /** - * Immediately removes all hotspots from the drawable. - */ - public void clearHotspots() {} - - /** - * Sets the bounds to which hotspots are constrained. - * - * @hide until we finalize these APIs + * Sets the bounds to which the hotspot is constrained, if they should be + * different from the drawable bounds. + * + * @param left + * @param top + * @param right + * @param bottom */ public void setHotspotBounds(int left, int top, int right, int bottom) {} /** * Whether this drawable requests projection. * - * @hide until we finalize these APIs + * @hide magic! */ public boolean isProjected() { return false; @@ -1047,8 +1020,8 @@ public abstract class Drawable { drawable = new LayerDrawable(); } else if (name.equals("transition")) { drawable = new TransitionDrawable(); - } else if (name.equals("touch-feedback")) { - drawable = new TouchFeedbackDrawable(); + } else if (name.equals("ripple")) { + drawable = new RippleDrawable(); } else if (name.equals("color")) { drawable = new ColorDrawable(); } else if (name.equals("shape")) { diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java index 08fc99d..ec5c6c6 100644 --- a/graphics/java/android/graphics/drawable/DrawableContainer.java +++ b/graphics/java/android/graphics/drawable/DrawableContainer.java @@ -238,35 +238,13 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { } @Override - public void setHotspot(int key, float x, float y) { + public void setHotspot(float x, float y) { if (mCurrDrawable != null) { - mCurrDrawable.setHotspot(key, x, y); + mCurrDrawable.setHotspot(x, y); } } @Override - public void removeHotspot(int key) { - if (mCurrDrawable != null) { - mCurrDrawable.removeHotspot(key); - } - } - - @Override - public void clearHotspots() { - if (mCurrDrawable != null) { - mCurrDrawable.clearHotspots(); - } - } - - @Override - public boolean supportsHotspots() { - if (mCurrDrawable != null) { - return mCurrDrawable.supportsHotspots(); - } - return false; - } - - @Override protected boolean onStateChange(int[] state) { if (mLastDrawable != null) { return mLastDrawable.setState(state); diff --git a/graphics/java/android/graphics/drawable/DrawableWrapper.java b/graphics/java/android/graphics/drawable/DrawableWrapper.java deleted file mode 100644 index 6ab33f8..0000000 --- a/graphics/java/android/graphics/drawable/DrawableWrapper.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.graphics.drawable; - -import android.content.res.Resources; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Rect; -import android.graphics.Xfermode; - -/** - * A Drawable that wraps another Drawable. - */ -public class DrawableWrapper extends Drawable implements Drawable.Callback { - private WrapperState mWrapperState; - - /** Local drawable backed by its own constant state. */ - private Drawable mWrappedDrawable; - - private boolean mMutated; - - /** @hide */ - @Override - public boolean isProjected() { - return mWrappedDrawable.isProjected(); - } - - @Override - public void setAutoMirrored(boolean mirrored) { - mWrappedDrawable.setAutoMirrored(mirrored); - } - - @Override - public boolean isAutoMirrored() { - return mWrappedDrawable.isAutoMirrored(); - } - - @Override - public int getMinimumWidth() { - return mWrappedDrawable.getMinimumWidth(); - } - - @Override - public int getMinimumHeight() { - return mWrappedDrawable.getMinimumHeight(); - } - - @Override - public int getIntrinsicWidth() { - return mWrappedDrawable.getIntrinsicWidth(); - } - - @Override - public int getIntrinsicHeight() { - return mWrappedDrawable.getIntrinsicHeight(); - } - - @Override - public Drawable getCurrent() { - return mWrappedDrawable.getCurrent(); - } - - @Override - public void invalidateDrawable(Drawable who) { - final Callback callback = getCallback(); - if (callback != null) { - callback.invalidateDrawable(this); - } - } - - @Override - public void scheduleDrawable(Drawable who, Runnable what, long when) { - final Callback callback = getCallback(); - if (callback != null) { - callback.scheduleDrawable(this, what, when); - } - } - - @Override - public void unscheduleDrawable(Drawable who, Runnable what) { - final Callback callback = getCallback(); - if (callback != null) { - callback.unscheduleDrawable(this, what); - } - } - - @Override - public void draw(Canvas canvas) { - mWrappedDrawable.draw(canvas); - } - - @Override - public int getChangingConfigurations() { - return mWrappedDrawable.getChangingConfigurations(); - } - - @Override - public boolean getPadding(Rect padding) { - return mWrappedDrawable.getPadding(padding); - } - - @Override - public Rect getDirtyBounds() { - return mWrappedDrawable.getDirtyBounds(); - } - - @Override - public boolean supportsHotspots() { - return mWrappedDrawable.supportsHotspots(); - } - - @Override - public void setHotspot(int id, float x, float y) { - mWrappedDrawable.setHotspot(id, x, y); - } - - @Override - public void removeHotspot(int id) { - mWrappedDrawable.removeHotspot(id); - } - - @Override - public void clearHotspots() { - mWrappedDrawable.clearHotspots(); - } - - @Override - public boolean setVisible(boolean visible, boolean restart) { - // Must call through to super(). - super.setVisible(visible, restart); - return mWrappedDrawable.setVisible(visible, restart); - } - - @Override - public void setAlpha(int alpha) { - mWrappedDrawable.setAlpha(alpha); - } - - @Override - public int getAlpha() { - return mWrappedDrawable.getAlpha(); - } - - /** {@hide} */ - @Override - public void setLayoutDirection(int layoutDirection) { - mWrappedDrawable.setLayoutDirection(layoutDirection); - } - - /** {@hide} */ - @Override - public int getLayoutDirection() { - return mWrappedDrawable.getLayoutDirection(); - } - - @Override - public void setColorFilter(ColorFilter cf) { - mWrappedDrawable.setColorFilter(cf); - } - - @Override - public ColorFilter getColorFilter() { - return mWrappedDrawable.getColorFilter(); - } - - @Override - public void setFilterBitmap(boolean filter) { - mWrappedDrawable.setFilterBitmap(filter); - } - - @Override - public void setXfermode(Xfermode mode) { - mWrappedDrawable.setXfermode(mode); - } - - @Override - public int getOpacity() { - return mWrappedDrawable.getOpacity(); - } - - @Override - public boolean isStateful() { - return mWrappedDrawable.isStateful(); - } - - @Override - public final boolean setState(int[] stateSet) { - return super.setState(stateSet); - } - - @Override - public final int[] getState() { - return super.getState(); - } - - @Override - protected boolean onStateChange(int[] state) { - // Don't override setState(), getState(). - return mWrappedDrawable.setState(state); - } - - @Override - protected boolean onLevelChange(int level) { - // Don't override setLevel(), getLevel(). - return mWrappedDrawable.setLevel(level); - } - - @Override - public final void setBounds(int left, int top, int right, int bottom) { - super.setBounds(left, top, right, bottom); - } - - @Override - public final void setBounds(Rect bounds) { - super.setBounds(bounds); - } - - @Override - protected void onBoundsChange(Rect bounds) { - // Don't override setBounds(), getBounds(). - mWrappedDrawable.setBounds(bounds); - } - - protected void setConstantState(WrapperState wrapperState, Resources res) { - mWrapperState = wrapperState; - - // Load a new drawable from the constant state. - if (wrapperState == null || wrapperState.mWrappedConstantState == null) { - mWrappedDrawable = null; - } else if (res != null) { - mWrappedDrawable = wrapperState.mWrappedConstantState.newDrawable(res); - } else { - mWrappedDrawable = wrapperState.mWrappedConstantState.newDrawable(); - } - } - - @Override - public ConstantState getConstantState() { - return mWrapperState; - } - - @Override - public Drawable mutate() { - if (!mMutated) { - mWrappedDrawable = mWrappedDrawable.mutate(); - mMutated = true; - } - return this; - } - - /** - * Sets the wrapped drawable and update the constant state. - * - * @param drawable - * @param res - */ - protected final void setDrawable(Drawable drawable, Resources res) { - if (mWrappedDrawable != null) { - mWrappedDrawable.setCallback(null); - } - - mWrappedDrawable = drawable; - - if (drawable != null) { - drawable.setCallback(this); - - mWrapperState.mWrappedConstantState = drawable.getConstantState(); - } else { - mWrapperState.mWrappedConstantState = null; - } - } - - protected final Drawable getDrawable() { - return mWrappedDrawable; - } - - public static abstract class WrapperState extends ConstantState { - ConstantState mWrappedConstantState; - - WrapperState(WrapperState orig) { - if (orig != null) { - mWrappedConstantState = orig.mWrappedConstantState; - } - } - - @Override - public int getChangingConfigurations() { - return mWrappedConstantState.getChangingConfigurations(); - } - } -} diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index 9384caf..3749339 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -131,6 +131,7 @@ public class InsetDrawable extends Drawable implements Drawable.Callback // overrides from Drawable.Callback + @Override public void invalidateDrawable(Drawable who) { final Callback callback = getCallback(); if (callback != null) { @@ -138,6 +139,7 @@ public class InsetDrawable extends Drawable implements Drawable.Callback } } + @Override public void scheduleDrawable(Drawable who, Runnable what, long when) { final Callback callback = getCallback(); if (callback != null) { @@ -145,6 +147,7 @@ public class InsetDrawable extends Drawable implements Drawable.Callback } } + @Override public void unscheduleDrawable(Drawable who, Runnable what) { final Callback callback = getCallback(); if (callback != null) { @@ -184,23 +187,8 @@ public class InsetDrawable extends Drawable implements Drawable.Callback } @Override - public boolean supportsHotspots() { - return mInsetState.mDrawable.supportsHotspots(); - } - - @Override - public void setHotspot(int id, float x, float y) { - mInsetState.mDrawable.setHotspot(id, x, y); - } - - @Override - public void removeHotspot(int id) { - mInsetState.mDrawable.removeHotspot(id); - } - - @Override - public void clearHotspots() { - mInsetState.mDrawable.clearHotspots(); + public void setHotspot(float x, float y) { + mInsetState.mDrawable.setHotspot(x, y); } @Override diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index 7847aad..373d894 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -569,42 +569,11 @@ public class LayerDrawable extends Drawable implements Drawable.Callback { } @Override - public boolean supportsHotspots() { + public void setHotspot(float x, float y) { final ChildDrawable[] array = mLayerState.mChildren; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { - if (array[i].mDrawable.supportsHotspots()) { - return true; - } - } - - return false; - } - - @Override - public void setHotspot(int id, float x, float y) { - final ChildDrawable[] array = mLayerState.mChildren; - final int N = mLayerState.mNum; - for (int i = 0; i < N; i++) { - array[i].mDrawable.setHotspot(id, x, y); - } - } - - @Override - public void removeHotspot(int id) { - final ChildDrawable[] array = mLayerState.mChildren; - final int N = mLayerState.mNum; - for (int i = 0; i < N; i++) { - array[i].mDrawable.removeHotspot(id); - } - } - - @Override - public void clearHotspots() { - final ChildDrawable[] array = mLayerState.mChildren; - final int N = mLayerState.mNum; - for (int i = 0; i < N; i++) { - array[i].mDrawable.clearHotspots(); + array[i].mDrawable.setHotspot(x, y); } } diff --git a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java index a55a4b2..6776e66 100644 --- a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java @@ -22,6 +22,7 @@ import android.content.res.Resources.Theme; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.PixelFormat; import android.graphics.PointF; @@ -44,7 +45,7 @@ import java.io.IOException; /** * Drawable that shows a ripple effect in response to state changes. The * anchoring position of the ripple for a given state may be specified by - * calling {@link #setHotspot(int, float, float)} with the corresponding state + * calling {@link #setHotspot(float, float)} with the corresponding state * attribute identifier. * <p> * A touch feedback drawable may contain multiple child layers, including a @@ -56,19 +57,19 @@ import java.io.IOException; * <p> * If no mask layer is set, the ripple effect is simply blended onto the * composite of the child layers using the specified - * {@link android.R.styleable#TouchFeedbackDrawable_tintMode}. + * {@link android.R.styleable#RippleDrawable_tintMode}. * <p> * If no child layers or mask is specified and the ripple is set as a View * background, the ripple will be blended onto the first available parent * background within the View's hierarchy using the specified - * {@link android.R.styleable#TouchFeedbackDrawable_tintMode}. In this case, the + * {@link android.R.styleable#RippleDrawable_tintMode}. In this case, the * drawing region may extend outside of the Drawable bounds. * * @attr ref android.R.styleable#DrawableStates_state_focused * @attr ref android.R.styleable#DrawableStates_state_pressed */ -public class TouchFeedbackDrawable extends LayerDrawable { - private static final String LOG_TAG = TouchFeedbackDrawable.class.getSimpleName(); +public class RippleDrawable extends LayerDrawable { + private static final String LOG_TAG = RippleDrawable.class.getSimpleName(); private static final PorterDuffXfermode DST_IN = new PorterDuffXfermode(Mode.DST_IN); private static final PorterDuffXfermode DST_ATOP = new PorterDuffXfermode(Mode.DST_ATOP); private static final PorterDuffXfermode SRC_ATOP = new PorterDuffXfermode(Mode.SRC_ATOP); @@ -88,17 +89,17 @@ public class TouchFeedbackDrawable extends LayerDrawable { /** Current dirty bounds, union of current and previous drawing bounds. */ private final Rect mDirtyBounds = new Rect(); - private final TouchFeedbackState mState; + private final RippleState mState; /** * Lazily-created map of pending hotspot locations. These may be modified by - * calls to {@link #setHotspot(int, float, float)}. + * calls to {@link #setHotspot(float, float)}. */ private SparseArray<PointF> mPendingHotspots; /** * Lazily-created map of active hotspot locations. These may be modified by - * calls to {@link #setHotspot(int, float, float)}. + * calls to {@link #setHotspot(float, float)}. */ private SparseArray<Ripple> mActiveHotspots; @@ -121,8 +122,18 @@ public class TouchFeedbackDrawable extends LayerDrawable { /** Whether bounds are being overridden. */ private boolean mOverrideBounds; - TouchFeedbackDrawable() { - this(new TouchFeedbackState(null, null, null), null, null); + RippleDrawable() { + this(new RippleState(null, null, null), null, null); + } + + @Override + public void setAlpha(int alpha) { + + } + + @Override + public void setColorFilter(ColorFilter cf) { + } @Override @@ -233,7 +244,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { final TypedArray a = obtainAttributes( - r, theme, attrs, R.styleable.TouchFeedbackDrawable); + r, theme, attrs, R.styleable.RippleDrawable); updateStateFromTypedArray(a); a.recycle(); @@ -267,22 +278,22 @@ public class TouchFeedbackDrawable extends LayerDrawable { * Initializes the constant state from the values in the typed array. */ private void updateStateFromTypedArray(TypedArray a) { - final TouchFeedbackState state = mState; + final RippleState state = mState; // Extract the theme attributes, if any. state.mTouchThemeAttrs = a.extractThemeAttrs(); - final ColorStateList tint = a.getColorStateList(R.styleable.TouchFeedbackDrawable_tint); + final ColorStateList tint = a.getColorStateList(R.styleable.RippleDrawable_tint); if (tint != null) { mState.mTint = tint; } - final int tintMode = a.getInt(R.styleable.TouchFeedbackDrawable_tintMode, -1); + final int tintMode = a.getInt(R.styleable.RippleDrawable_tintMode, -1); if (tintMode != -1) { mState.setTintMode(Drawable.parseTintMode(tintMode, Mode.SRC_ATOP)); } - mState.mPinned = a.getBoolean(R.styleable.TouchFeedbackDrawable_pinned, mState.mPinned); + mState.mPinned = a.getBoolean(R.styleable.RippleDrawable_pinned, mState.mPinned); } /** @@ -301,13 +312,13 @@ public class TouchFeedbackDrawable extends LayerDrawable { public void applyTheme(Theme t) { super.applyTheme(t); - final TouchFeedbackState state = mState; + final RippleState state = mState; if (state == null || state.mTouchThemeAttrs == null) { return; } final TypedArray a = t.resolveAttributes(state.mTouchThemeAttrs, - R.styleable.TouchFeedbackDrawable); + R.styleable.RippleDrawable); updateStateFromTypedArray(a); a.recycle(); } @@ -318,17 +329,14 @@ public class TouchFeedbackDrawable extends LayerDrawable { } @Override - public boolean supportsHotspots() { - return true; - } - - @Override - public void setHotspot(int id, float x, float y) { + public void setHotspot(float x, float y) { if (mState.mPinned && !circleContains(mHotspotBounds, x, y)) { x = mHotspotBounds.exactCenterX(); y = mHotspotBounds.exactCenterY(); } + // TODO: We should only have a single pending/active hotspot. + final int id = R.attr.state_pressed; final int[] stateSet = getState(); if (!Arrays.contains(stateSet, id)) { // The hotspot is not active, so just modify the pending location. @@ -423,8 +431,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { mActiveHotspots.put(id, newRipple); } - @Override - public void removeHotspot(int id) { + private void removeHotspot(int id) { if (mActiveHotspots == null) { return; } @@ -437,8 +444,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { } } - @Override - public void clearHotspots() { + private void clearHotspots() { if (mActiveHotspots != null) { mActiveHotspots.clear(); } @@ -632,7 +638,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { return mState; } - static class TouchFeedbackState extends LayerState { + static class RippleState extends LayerState { int[] mTouchThemeAttrs; ColorStateList mTint = null; PorterDuffXfermode mTintXfermode = SRC_ATOP; @@ -640,8 +646,8 @@ public class TouchFeedbackDrawable extends LayerDrawable { Drawable mMask; boolean mPinned = false; - public TouchFeedbackState( - TouchFeedbackState orig, TouchFeedbackDrawable owner, Resources res) { + public RippleState( + RippleState orig, RippleDrawable owner, Resources res) { super(orig, owner, res); if (orig != null) { @@ -655,7 +661,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { } public void setTintMode(Mode mode) { - final Mode invertedMode = TouchFeedbackState.invertPorterDuffMode(mode); + final Mode invertedMode = RippleState.invertPorterDuffMode(mode); mTintXfermodeInverse = new PorterDuffXfermode(invertedMode); mTintXfermode = new PorterDuffXfermode(mode); } @@ -675,17 +681,17 @@ public class TouchFeedbackDrawable extends LayerDrawable { @Override public Drawable newDrawable() { - return new TouchFeedbackDrawable(this, null, null); + return new RippleDrawable(this, null, null); } @Override public Drawable newDrawable(Resources res) { - return new TouchFeedbackDrawable(this, res, null); + return new RippleDrawable(this, res, null); } @Override public Drawable newDrawable(Resources res, Theme theme) { - return new TouchFeedbackDrawable(this, res, theme); + return new RippleDrawable(this, res, theme); } /** @@ -716,20 +722,20 @@ public class TouchFeedbackDrawable extends LayerDrawable { } } - private TouchFeedbackDrawable(TouchFeedbackState state, Resources res, Theme theme) { + private RippleDrawable(RippleState state, Resources res, Theme theme) { boolean needsTheme = false; - final TouchFeedbackState ns; + final RippleState ns; if (theme != null && state != null && state.canApplyTheme()) { - ns = new TouchFeedbackState(state, this, res); + ns = new RippleState(state, this, res); needsTheme = true; } else if (state == null) { - ns = new TouchFeedbackState(null, this, res); + ns = new RippleState(null, this, res); } else { // We always need a new state since child drawables contain local // state but live within the parent's constant state. // TODO: Move child drawables into local state. - ns = new TouchFeedbackState(state, this, res); + ns = new RippleState(state, this, res); } if (res != null) { diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index 05658f5..e3ed75e 100644 --- a/graphics/java/android/graphics/drawable/VectorDrawable.java +++ b/graphics/java/android/graphics/drawable/VectorDrawable.java @@ -50,8 +50,7 @@ import java.util.HashMap; * <p/> * <dl> * <dt><code><vector></code></dt> - * <dd>The attribute <code>android:versionCode</code> defines the version of - * VectorDrawable</dd> + * <dd>Used to defined a vector drawable</dd> * <dt><code><size></code></dt> * <dd>Used to defined the intrinsic Width Height size of the drawable using * <code>android:width</code> and <code>android:height</code></dd> @@ -284,20 +283,6 @@ public class VectorDrawable extends Drawable { } else if (SHAPE_VIEWPORT.equals(tagName)) { pathRenderer.parseViewport(res, attrs); noViewportTag = false; - } else if (SHAPE_VECTOR.equals(tagName)) { - final TypedArray a = res.obtainAttributes(attrs, R.styleable.VectorDrawable); - - // Parsing the version information. - // Right now, we only support version "1". - // If the xml didn't specify the version number, the default - // version is "1". - final int versionCode = a.getInt(R.styleable.VectorDrawable_versionCode, 1); - if (versionCode != 1) { - throw new IllegalArgumentException( - "So far, VectorDrawable only support version 1"); - } - - a.recycle(); } } diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7993c0f..826d988 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -662,7 +662,9 @@ void OpenGLRenderer::calculateLayerBoundsAndClip(Rect& bounds, Rect& clip, bool // When the layer is not an FBO, we may use glCopyTexImage so we // need to make sure the layer does not extend outside the bounds // of the framebuffer - if (!bounds.intersect(Rect(0, 0, getViewportWidth(), getViewportHeight()))) { + const Snapshot& previous = *(currentSnapshot()->previous); + Rect previousViewport(0, 0, previous.getViewportWidth(), previous.getViewportHeight()); + if (!bounds.intersect(previousViewport)) { bounds.setEmpty(); } else if (fboLayer) { clip.set(bounds); diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h index 485dbf6..5426e89 100644 --- a/libs/hwui/Snapshot.h +++ b/libs/hwui/Snapshot.h @@ -271,7 +271,7 @@ public: private: struct ViewportData { - ViewportData() : mWidth(0), mHeight() {} + ViewportData() : mWidth(0), mHeight(0) {} void initialize(int width, int height) { mWidth = width; mHeight = height; diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 34c5520..c7b3fc9 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -212,6 +212,7 @@ final public class MediaCodec { * <li>"video/x-vnd.on2.vp8" - VP8 video (i.e. video in .webm) * <li>"video/x-vnd.on2.vp9" - VP9 video (i.e. video in .webm) * <li>"video/avc" - H.264/AVC video + * <li>"video/hevc" - H.265/HEVC video * <li>"video/mp4v-es" - MPEG4 video * <li>"video/3gpp" - H.263 video * <li>"audio/3gpp" - AMR narrowband audio diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java index 90c12c6..b5d0a57 100644 --- a/media/java/android/media/MediaCodecInfo.java +++ b/media/java/android/media/MediaCodecInfo.java @@ -264,6 +264,37 @@ public final class MediaCodecInfo { // from OMX_VIDEO_VP8PROFILETYPE public static final int VP8ProfileMain = 0x01; + // from OMX_VIDEO_HEVCPROFILETYPE + public static final int HEVCProfileMain = 0x01; + public static final int HEVCProfileMain10 = 0x02; + + // from OMX_VIDEO_HEVCLEVELTYPE + public static final int HEVCMainTierLevel1 = 0x1; + public static final int HEVCHighTierLevel1 = 0x2; + public static final int HEVCMainTierLevel2 = 0x4; + public static final int HEVCHighTierLevel2 = 0x8; + public static final int HEVCMainTierLevel21 = 0x10; + public static final int HEVCHighTierLevel21 = 0x20; + public static final int HEVCMainTierLevel3 = 0x40; + public static final int HEVCHighTierLevel3 = 0x80; + public static final int HEVCMainTierLevel31 = 0x100; + public static final int HEVCHighTierLevel31 = 0x200; + public static final int HEVCMainTierLevel4 = 0x400; + public static final int HEVCHighTierLevel4 = 0x800; + public static final int HEVCMainTierLevel41 = 0x1000; + public static final int HEVCHighTierLevel41 = 0x2000; + public static final int HEVCMainTierLevel5 = 0x4000; + public static final int HEVCHighTierLevel5 = 0x8000; + public static final int HEVCMainTierLevel51 = 0x10000; + public static final int HEVCHighTierLevel51 = 0x20000; + public static final int HEVCMainTierLevel52 = 0x40000; + public static final int HEVCHighTierLevel52 = 0x80000; + public static final int HEVCMainTierLevel6 = 0x100000; + public static final int HEVCHighTierLevel6 = 0x200000; + public static final int HEVCMainTierLevel61 = 0x400000; + public static final int HEVCHighTierLevel61 = 0x800000; + public static final int HEVCMainTierLevel62 = 0x1000000; + public static final int HEVCHighTierLevel62 = 0x2000000; /** * Defined in the OpenMAX IL specs, depending on the type of media diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 909c32e..286921e 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -70,7 +70,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 102; + private static final int DATABASE_VERSION = 103; private Context mContext; private int mUserHandle; @@ -1632,6 +1632,34 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 102; } + if (upgradeVersion == 102) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + // The INSTALL_NON_MARKET_APPS setting is becoming per-user rather + // than device-global. + if (mUserHandle == UserHandle.USER_OWNER) { + // In the owner user, the global table exists so we can migrate the + // entry from there to the secure table, preserving its value. + String[] globalToSecure = { + Settings.Secure.INSTALL_NON_MARKET_APPS + }; + moveSettingsToNewTable(db, TABLE_GLOBAL, TABLE_SECURE, globalToSecure, true); + } else { + // Secondary users' dbs don't have the global table, so institute the + // default. + stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + + " VALUES(?,?);"); + loadBooleanSetting(stmt, Settings.Secure.INSTALL_NON_MARKET_APPS, + R.bool.def_install_non_market_apps); + } + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + upgradeVersion = 103; + } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -2191,6 +2219,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadStringSetting(stmt, Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS, R.string.def_immersive_mode_confirmations); + loadBooleanSetting(stmt, Settings.Secure.INSTALL_NON_MARKET_APPS, + R.bool.def_install_non_market_apps); + } finally { if (stmt != null) stmt.close(); } @@ -2289,9 +2320,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.Global.NETSTATS_ENABLED, R.bool.def_netstats_enabled); - loadBooleanSetting(stmt, Settings.Global.INSTALL_NON_MARKET_APPS, - R.bool.def_install_non_market_apps); - loadBooleanSetting(stmt, Settings.Global.USB_MASS_STORAGE_ENABLED, R.bool.def_usb_mass_storage_enabled); diff --git a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml index 744795e..9c1165d 100644 --- a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml +++ b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml @@ -13,8 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:versionCode="1" > +<vector xmlns:android="http://schemas.android.com/apk/res/android"> <size android:height="16dp" diff --git a/packages/SystemUI/res/drawable/recents_dismiss_light.xml b/packages/SystemUI/res/drawable/recents_dismiss_light.xml index 96bfbe1..a8afeb3 100644 --- a/packages/SystemUI/res/drawable/recents_dismiss_light.xml +++ b/packages/SystemUI/res/drawable/recents_dismiss_light.xml @@ -13,8 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:versionCode="1" > +<vector xmlns:android="http://schemas.android.com/apk/res/android"> <size android:height="16dp" diff --git a/packages/SystemUI/res/layout/qs_panel.xml b/packages/SystemUI/res/layout/qs_panel.xml index b24d4ad..85de645 100644 --- a/packages/SystemUI/res/layout/qs_panel.xml +++ b/packages/SystemUI/res/layout/qs_panel.xml @@ -23,6 +23,7 @@ android:background="@drawable/qs_panel_background" > <com.android.systemui.qs.QSPanel android:id="@+id/quick_settings_panel" + android:background="#0000" android:layout_width="match_parent" android:layout_height="wrap_content" /> </FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 591b175..bae8a99 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -249,6 +249,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.setLayoutParams(new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); + mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); // Create the empty view LayoutInflater inflater = LayoutInflater.from(this); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 2821052..c63e688 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -30,6 +30,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; +import android.view.WindowInsets; import android.widget.FrameLayout; import com.android.systemui.recents.Console; import com.android.systemui.recents.Constants; @@ -288,16 +289,16 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } @Override - protected boolean fitSystemWindows(Rect insets) { + public WindowInsets onApplyWindowInsets(WindowInsets insets) { Console.log(Constants.Log.UI.MeasureAndLayout, "[RecentsView|fitSystemWindows]", "insets: " + insets, Console.AnsiGreen); // Update the configuration with the latest system insets and trigger a relayout RecentsConfiguration config = RecentsConfiguration.getInstance(); - config.updateSystemInsets(insets); + config.updateSystemInsets(insets.getSystemWindowInsets()); requestLayout(); - return true; + return insets.consumeSystemWindowInsets(false, false, false, true); } /** Closes any open info panes */ diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskInfoView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskInfoView.java index f1c362a..7b6572b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskInfoView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskInfoView.java @@ -25,7 +25,7 @@ import android.graphics.Canvas; import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.drawable.TouchFeedbackDrawable; +import android.graphics.drawable.RippleDrawable; import android.util.AttributeSet; import android.widget.Button; import android.widget.FrameLayout; @@ -156,8 +156,8 @@ class TaskInfoView extends FrameLayout { // Workaround: The button currently doesn't support setting a custom background tint // not defined in the theme. Just lower the alpha on the button to make it blend more // into the background. - if (mAppInfoButton.getBackground() instanceof TouchFeedbackDrawable) { - TouchFeedbackDrawable d = (TouchFeedbackDrawable) mAppInfoButton.getBackground(); + if (mAppInfoButton.getBackground() instanceof RippleDrawable) { + RippleDrawable d = (RippleDrawable) mAppInfoButton.getBackground(); if (d != null) { d.setAlpha(96); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 2bc6f9c..f5d4889 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -19,6 +19,7 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; +import android.os.Build; import android.util.AttributeSet; import android.util.Log; import android.view.View; @@ -167,7 +168,7 @@ public class SignalClusterView } private void applyInetProblem(ImageView iv) { - iv.setColorFilter(mInetProblem ? PROBLEM_FILTER : null); + iv.setColorFilter(Build.IS_DEBUGGABLE && mInetProblem ? PROBLEM_FILTER : null); } // Run after each indicator change. diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java index be20616..bfa0402 100644 --- a/services/core/java/com/android/server/AppOpsService.java +++ b/services/core/java/com/android/server/AppOpsService.java @@ -1253,7 +1253,10 @@ public class AppOpsService extends IAppOpsService.Stub { public void removeUser(int userHandle) throws RemoteException { checkSystemUid("removeUser"); mOpRestrictions.remove(userHandle); - mProfileOwnerUids.removeAt(mProfileOwnerUids.indexOfKey(userHandle)); + final int index = mProfileOwnerUids.indexOfKey(userHandle); + if (index >= 0) { + mProfileOwnerUids.removeAt(index); + } } private void checkSystemUid(String function) { diff --git a/services/core/java/com/android/server/notification/ConditionProviders.java b/services/core/java/com/android/server/notification/ConditionProviders.java index 007032e..dbfb1cf 100644 --- a/services/core/java/com/android/server/notification/ConditionProviders.java +++ b/services/core/java/com/android/server/notification/ConditionProviders.java @@ -88,6 +88,8 @@ public class ConditionProviders extends ManagedServices { for (int i = 0; i < mRecords.size(); i++) { pw.print(" "); pw.println(mRecords.get(i)); } + pw.print(" mCountdownHelper: "); + pw.println(mCountdownHelper.getCurrentConditionDescription()); } } @@ -474,6 +476,16 @@ public class ConditionProviders extends ManagedServices { } } + public String getCurrentConditionDescription() { + if (mCurrent == 0) return null; + final long time = mCurrent; + final long now = System.currentTimeMillis(); + final CharSequence span = + DateUtils.getRelativeTimeSpanString(time, now, DateUtils.MINUTE_IN_MILLIS); + return String.format("Scheduled for %s, %s in the future (%s), now=%s", + ts(time), time - now, span, ts(now)); + } + private String ts(long time) { return new Date(time) + " (" + time + ")"; } diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 131d05b..fd180bf 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -511,8 +511,16 @@ public class UserManagerService extends IUserManager.Stub { * Check if we've hit the limit of how many users can be created. */ private boolean isUserLimitReachedLocked() { - int nUsers = mUsers.size(); - return nUsers >= UserManager.getMaxSupportedUsers(); + int aliveUserCount = 0; + final int totalUserCount = mUsers.size(); + // Skip over users being removed + for (int i = 0; i < totalUserCount; i++) { + UserInfo user = mUsers.valueAt(i); + if (!mRemovingUserIds.get(user.id)) { + aliveUserCount++; + } + } + return aliveUserCount >= UserManager.getMaxSupportedUsers(); } /** diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java index c1b9a33..efaa91b 100644 --- a/services/core/java/com/android/server/trust/TrustManagerService.java +++ b/services/core/java/com/android/server/trust/TrustManagerService.java @@ -324,8 +324,6 @@ public class TrustManagerService extends SystemService { mTrustListeners.get(i).onTrustChanged(enabled, userId); } catch (RemoteException e) { Slog.e(TAG, "Exception while notifying TrustListener. Removing listener.", e); - mTrustListeners.get(i); - i--; } } } diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java index c90b626..08d7667 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java @@ -16,9 +16,6 @@ package com.android.test.hwuicompare; -import com.android.test.hwuicompare.R; -import com.android.test.hwuicompare.ScriptC_errorCalculator; - import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; @@ -52,7 +49,6 @@ public class ErrorCalculator { int height = resources.getDimensionPixelSize(R.dimen.layer_height); mOutputRowRegions = new int[height / REGION_SIZE]; -/* mRS = RenderScript.create(c); int[] rowIndices = new int[height / REGION_SIZE]; for (int i = 0; i < rowIndices.length; i++) @@ -68,15 +64,12 @@ public class ErrorCalculator { mInputRowsAllocation.copyFrom(rowIndices); mOutputRegionsAllocation = Allocation.createSized(mRS, Element.I32(mRS), mOutputRowRegions.length, Allocation.USAGE_SCRIPT); -*/ } private static long startMillis, middleMillis; public float calcErrorRS(Bitmap ideal, Bitmap given) { - if (true) - return calcError(ideal, given); if (LOG_TIMING) { startMillis = System.currentTimeMillis(); } @@ -86,8 +79,8 @@ public class ErrorCalculator { mGivenPixelsAllocation = Allocation.createFromBitmap(mRS, given, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); - mScript.bind_ideal(mIdealPixelsAllocation); - mScript.bind_given(mGivenPixelsAllocation); + mScript.set_ideal(mIdealPixelsAllocation); + mScript.set_given(mGivenPixelsAllocation); mScript.forEach_countInterestingRegions(mInputRowsAllocation, mOutputRegionsAllocation); mOutputRegionsAllocation.copyTo(mOutputRowRegions); @@ -127,8 +120,8 @@ public class ErrorCalculator { mGivenPixelsAllocation = Allocation.createFromBitmap(mRS, given, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); - mScript.bind_ideal(mIdealPixelsAllocation); - mScript.bind_given(mGivenPixelsAllocation); + mScript.set_ideal(mIdealPixelsAllocation); + mScript.set_given(mGivenPixelsAllocation); mOutputPixelsAllocation = Allocation.createFromBitmap(mRS, output, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs b/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs index 3681784..caa947d 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs @@ -5,8 +5,8 @@ int REGION_SIZE; int WIDTH; int HEIGHT; -const uchar4 *ideal; -const uchar4 *given; +rs_allocation ideal; +rs_allocation given; void countInterestingRegions(const int32_t *v_in, int32_t *v_out) { int y = v_in[0]; @@ -14,10 +14,10 @@ void countInterestingRegions(const int32_t *v_in, int32_t *v_out) { for (int x = 0; x < HEIGHT; x += REGION_SIZE) { bool interestingRegion = false; - int regionColor = (int)ideal[y * WIDTH + x]; + int regionColor = (int) rsGetElementAt_uchar4(ideal, x, y); for (int i = 0; i < REGION_SIZE && !interestingRegion; i++) { for (int j = 0; j < REGION_SIZE && !interestingRegion; j++) { - interestingRegion |= (int)(ideal[(y + i) * WIDTH + (x + j)]) != regionColor; + interestingRegion |= ((int) rsGetElementAt_uchar4(ideal, x + j, y + i)) != regionColor; } } if (interestingRegion) { @@ -31,8 +31,9 @@ void accumulateError(const int32_t *v_in, int32_t *v_out) { int error = 0; for (int y = startY; y < startY + REGION_SIZE; y++) { for (int x = 0; x < HEIGHT; x++) { - uchar4 idealPixel = ideal[y * WIDTH + x]; - uchar4 givenPixel = given[y * WIDTH + x]; + uchar4 idealPixel = rsGetElementAt_uchar4(ideal, x, y); + uchar4 givenPixel = rsGetElementAt_uchar4(given, x, y); + error += abs(idealPixel.x - givenPixel.x); error += abs(idealPixel.y - givenPixel.y); error += abs(idealPixel.z - givenPixel.z); @@ -43,8 +44,8 @@ void accumulateError(const int32_t *v_in, int32_t *v_out) { } void displayDifference(const uchar4 *v_in, uchar4 *v_out, uint32_t x, uint32_t y) { - float4 idealPixel = rsUnpackColor8888(ideal[y * WIDTH + x]); - float4 givenPixel = rsUnpackColor8888(given[y * WIDTH + x]); + float4 idealPixel = rsGetElementAt_float4(ideal, x, y); + float4 givenPixel = rsGetElementAt_float4(given, x, y); float4 diff = idealPixel - givenPixel; float totalDiff = diff.x + diff.y + diff.z + diff.w; diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java index b766268..9ea7027 100644 --- a/wifi/java/android/net/wifi/WifiScanner.java +++ b/wifi/java/android/net/wifi/WifiScanner.java @@ -783,6 +783,9 @@ public class WifiScanner { FullScanResult result = (FullScanResult) msg.obj; ((ScanListener) listener).onFullResult(result); return; + case CMD_PERIOD_CHANGED: + ((ScanListener) listener).onPeriodChanged(msg.arg1); + return; case CMD_AP_FOUND: ((HotlistListener) listener).onFound( ((ParcelableScanResults) msg.obj).getResults()); |
