Merge "Load SPEAK_PASSWORD from currently active user rather than self" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8a45126a29
@@ -31,6 +31,7 @@ import android.inputmethodservice.Keyboard.Key;
|
|||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
@@ -980,8 +981,9 @@ public class KeyboardView extends View implements View.OnClickListener {
|
|||||||
onInitializeAccessibilityEvent(event);
|
onInitializeAccessibilityEvent(event);
|
||||||
String text = null;
|
String text = null;
|
||||||
// This is very efficient since the properties are cached.
|
// This is very efficient since the properties are cached.
|
||||||
final boolean speakPassword = Settings.Secure.getInt(mContext.getContentResolver(),
|
final boolean speakPassword = Settings.Secure.getIntForUser(
|
||||||
Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
|
mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0,
|
||||||
|
UserHandle.USER_CURRENT) != 0;
|
||||||
// Add text only if password announcement is enabled or if headset is
|
// Add text only if password announcement is enabled or if headset is
|
||||||
// used to avoid leaking passwords.
|
// used to avoid leaking passwords.
|
||||||
if (speakPassword || mAudioManager.isBluetoothA2dpOn()
|
if (speakPassword || mAudioManager.isBluetoothA2dpOn()
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ public final class UserHandle implements Parcelable {
|
|||||||
|
|
||||||
/** @hide A user id to indicate that we would like to send to the current
|
/** @hide A user id to indicate that we would like to send to the current
|
||||||
* user, but if this is calling from a user process then we will send it
|
* user, but if this is calling from a user process then we will send it
|
||||||
* to the caller's user instead of failing wiht a security exception */
|
* to the caller's user instead of failing with a security exception */
|
||||||
public static final int USER_CURRENT_OR_SELF = -3;
|
public static final int USER_CURRENT_OR_SELF = -3;
|
||||||
|
|
||||||
/** @hide A user handle to indicate that we would like to send to the current
|
/** @hide A user handle to indicate that we would like to send to the current
|
||||||
* user, but if this is calling from a user process then we will send it
|
* user, but if this is calling from a user process then we will send it
|
||||||
* to the caller's user instead of failing wiht a security exception */
|
* to the caller's user instead of failing with a security exception */
|
||||||
public static final UserHandle CURRENT_OR_SELF = new UserHandle(USER_CURRENT_OR_SELF);
|
public static final UserHandle CURRENT_OR_SELF = new UserHandle(USER_CURRENT_OR_SELF);
|
||||||
|
|
||||||
/** @hide An undefined user id */
|
/** @hide An undefined user id */
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.BoringLayout;
|
import android.text.BoringLayout;
|
||||||
import android.text.DynamicLayout;
|
import android.text.DynamicLayout;
|
||||||
@@ -8390,8 +8391,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
* to speak passwords.
|
* to speak passwords.
|
||||||
*/
|
*/
|
||||||
private boolean shouldSpeakPasswordsForAccessibility() {
|
private boolean shouldSpeakPasswordsForAccessibility() {
|
||||||
return (Settings.Secure.getInt(mContext.getContentResolver(),
|
return (Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0) == 1);
|
Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0, UserHandle.USER_CURRENT) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.keyguard;
|
|||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.AccessibilityDelegate;
|
import android.view.View.AccessibilityDelegate;
|
||||||
@@ -85,8 +86,8 @@ class ObscureSpeechDelegate extends AccessibilityDelegate {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private boolean shouldObscureSpeech() {
|
private boolean shouldObscureSpeech() {
|
||||||
// The user can optionally force speaking passwords.
|
// The user can optionally force speaking passwords.
|
||||||
if (Settings.Secure.getInt(mContentResolver,
|
if (Settings.Secure.getIntForUser(mContentResolver,
|
||||||
Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0) {
|
Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0, UserHandle.USER_CURRENT) != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user