diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/provider/Settings.java | 45 | ||||
| -rw-r--r-- | core/java/android/view/InputDevice.java | 8 | ||||
| -rw-r--r-- | core/java/android/view/KeyEvent.java | 20 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 61 | ||||
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 21 | ||||
| -rw-r--r-- | core/java/android/widget/AbsSeekBar.java | 20 | ||||
| -rw-r--r-- | core/java/android/widget/CompoundButton.java | 2 | ||||
| -rw-r--r-- | core/java/android/widget/Switch.java | 2 | ||||
| -rw-r--r-- | core/java/android/widget/TextView.java | 2 |
9 files changed, 89 insertions, 92 deletions
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()); } |
