Merge "Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger" into nyc-mr1-dev-plus-aosp

This commit is contained in:
Baligh Uddin
2016-11-23 17:56:24 +00:00
committed by Android (Google) Code Review
129 changed files with 4568 additions and 2349 deletions

View File

@@ -334,7 +334,8 @@ public abstract class AccessibilityService extends Service {
public static final int GLOBAL_ACTION_HOME = 2;
/**
* Action to toggle showing the overview of recent apps
* Action to toggle showing the overview of recent apps. Will fail on platforms that don't
* show recent apps.
*/
public static final int GLOBAL_ACTION_RECENTS = 3;

View File

@@ -21,6 +21,7 @@ import android.annotation.RequiresPermission;
import android.app.trust.ITrustManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.os.Binder;
import android.os.RemoteException;
@@ -44,6 +45,7 @@ public class KeyguardManager {
private IWindowManager mWM;
private ITrustManager mTrustManager;
private IUserManager mUserManager;
private Context mContext;
/**
* Intent used to prompt user for device credentials.
@@ -86,8 +88,12 @@ public class KeyguardManager {
Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL);
intent.putExtra(EXTRA_TITLE, title);
intent.putExtra(EXTRA_DESCRIPTION, description);
// For security reasons, only allow this to come from system settings.
intent.setPackage("com.android.settings");
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
intent.setPackage("com.google.android.apps.wearable.settings");
} else {
// For security reasons, only allow this to come from system settings.
intent.setPackage("com.android.settings");
}
return intent;
}
@@ -108,8 +114,12 @@ public class KeyguardManager {
intent.putExtra(EXTRA_TITLE, title);
intent.putExtra(EXTRA_DESCRIPTION, description);
intent.putExtra(Intent.EXTRA_USER_ID, userId);
// For security reasons, only allow this to come from system settings.
intent.setPackage("com.android.settings");
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
intent.setPackage("com.google.android.apps.wearable.settings");
} else {
// For security reasons, only allow this to come from system settings.
intent.setPackage("com.android.settings");
}
return intent;
}
@@ -191,7 +201,8 @@ public class KeyguardManager {
}
KeyguardManager() {
KeyguardManager(Context context) {
mContext = context;
mWM = WindowManagerGlobal.getWindowManagerService();
mTrustManager = ITrustManager.Stub.asInterface(
ServiceManager.getService(Context.TRUST_SERVICE));

View File

@@ -320,10 +320,10 @@ final class SystemServiceRegistry {
}});
registerService(Context.KEYGUARD_SERVICE, KeyguardManager.class,
new StaticServiceFetcher<KeyguardManager>() {
new CachedServiceFetcher<KeyguardManager>() {
@Override
public KeyguardManager createService() {
return new KeyguardManager();
public KeyguardManager createService(ContextImpl ctx) {
return new KeyguardManager(ctx);
}});
registerService(Context.LAYOUT_INFLATER_SERVICE, LayoutInflater.class,

View File

@@ -193,7 +193,11 @@ import java.util.List;
* The following list includes descriptions for the different attributes within a static shortcut:
* <dl>
* <dt>{@code android:shortcutId}</dt>
* <dd>Mandatory shortcut ID</dd>
* <dd>Mandatory shortcut ID.
* <p>
* This must be a string literal.
* A resource string, such as <code>@string/foo</code>, cannot be used.
* </dd>
*
* <dt>{@code android:enabled}</dt>
* <dd>Default is {@code true}. Can be set to {@code false} in order
@@ -206,15 +210,24 @@ import java.util.List;
*
* <dt>{@code android:shortcutShortLabel}</dt>
* <dd>Mandatory shortcut short label.
* See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}.</dd>
* See {@link ShortcutInfo.Builder#setShortLabel(CharSequence)}.
* <p>
* This must be a resource string, such as <code>@string/shortcut_label</code>.
* </dd>
*
* <dt>{@code android:shortcutLongLabel}</dt>
* <dd>Shortcut long label.
* See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}.</dd>
* See {@link ShortcutInfo.Builder#setLongLabel(CharSequence)}.
* <p>
* This must be a resource string, such as <code>@string/shortcut_long_label</code>.
* </dd>
*
* <dt>{@code android:shortcutDisabledMessage}</dt>
* <dd>When {@code android:enabled} is set to
* {@code false}, this attribute is used to display a custom disabled message.</dd>
* {@code false}, this attribute is used to display a custom disabled message.
* <p>
* This must be a resource string, such as <code>@string/shortcut_disabled_message</code>.
* </dd>
*
* <dt>{@code intent}</dt>
* <dd>Intent to launch when the user selects the shortcut.

View File

@@ -5163,6 +5163,16 @@ public final class Settings {
public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
"accessibility_soft_keyboard_mode";
/**
* Should we disable all animations when accessibility is turned on. On low-power devices
* like Android Wear, the performance makes the device unusable. Turning off animations
* is a partial fix.
*
* @hide
*/
public static final String ACCESSIBILITY_DISABLE_ANIMATIONS =
"accessibility_disable_animations";
/**
* Default soft keyboard behavior.
*
@@ -6441,6 +6451,7 @@ public final class Settings {
ACCESSIBILITY_CAPTIONING_TYPEFACE,
ACCESSIBILITY_CAPTIONING_FONT_SCALE,
ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
ACCESSIBILITY_DISABLE_ANIMATIONS,
TTS_USE_DEFAULTS,
TTS_DEFAULT_RATE,
TTS_DEFAULT_PITCH,

View File

@@ -31,8 +31,8 @@ class RoundScrollbarRenderer {
private static final int MAX_SCROLLBAR_ANGLE_SWIPE = 16;
private static final int MIN_SCROLLBAR_ANGLE_SWIPE = 6;
private static final float WIDTH_PERCENTAGE = 0.02f;
private static final int DEFAULT_THUMB_COLOR = 0xFF757575;
private static final int DEFAULT_TRACK_COLOR = 0x21FFFFFF;
private static final int DEFAULT_THUMB_COLOR = 0x4CFFFFFF;
private static final int DEFAULT_TRACK_COLOR = 0x26FFFFFF;
private final Paint mThumbPaint = new Paint();
private final Paint mTrackPaint = new Paint();

View File

@@ -860,32 +860,35 @@ public interface InputConnection {
android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; // 0x00000001
/**
* Called by the input method to commit a content such as PNG image to the editor.
* Called by the input method to commit content such as a PNG image to the editor.
*
* <p>In order to avoid variety of compatibility issues, this focuses on a simple use case,
* where we expect editors and IMEs work cooperatively as follows:</p>
* <p>In order to avoid a variety of compatibility issues, this focuses on a simple use case,
* where editors and IMEs are expected to work cooperatively as follows:</p>
* <ul>
* <li>Editor must keep {@link EditorInfo#contentMimeTypes} to be {@code null} if it does
* <li>Editor must keep {@link EditorInfo#contentMimeTypes} equal to {@code null} if it does
* not support this method at all.</li>
* <li>Editor can ignore this request when the MIME type specified in
* {@code inputContentInfo} does not match to any of {@link EditorInfo#contentMimeTypes}.
* {@code inputContentInfo} does not match any of {@link EditorInfo#contentMimeTypes}.
* </li>
* <li>Editor can ignore the cursor position when inserting the provided context.</li>
* <li>Editor can ignore the cursor position when inserting the provided content.</li>
* <li>Editor can return {@code true} asynchronously, even before it starts loading the
* content.</li>
* <li>Editor should provide a way to delete the content inserted by this method, or revert
* the effect caused by this method.</li>
* <li>Editor should provide a way to delete the content inserted by this method or to
* revert the effect caused by this method.</li>
* <li>IME should not call this method when there is any composing text, in case calling
* this method causes focus change.</li>
* this method causes a focus change.</li>
* <li>IME should grant a permission for the editor to read the content. See
* {@link EditorInfo#packageName} about how to obtain the package name of the editor.</li>
* </ul>
*
* @param inputContentInfo Content to be inserted.
* @param flags {@code 0} or {@link #INPUT_CONTENT_GRANT_READ_URI_PERMISSION}.
* @param flags {@link #INPUT_CONTENT_GRANT_READ_URI_PERMISSION} if the content provider
* allows {@link android.R.styleable#AndroidManifestProvider_grantUriPermissions
* grantUriPermissions} or {@code 0} if the application does not need to call
* {@link InputContentInfo#requestPermission()}.
* @param opts optional bundle data. This can be {@code null}.
* @return {@code true} if this request is accepted by the application, no matter if the request
* is already handled or still being handled in background.
* @return {@code true} if this request is accepted by the application, whether the request
* is already handled or still being handled in background, {@code false} otherwise.
*/
public boolean commitContent(@NonNull InputContentInfo inputContentInfo, int flags,
@Nullable Bundle opts);

View File

@@ -312,10 +312,10 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable, ThemedSp
}
/**
* Control whether methods that change the list ({@link #add},
* {@link #insert}, {@link #remove}, {@link #clear}) automatically call
* {@link #notifyDataSetChanged}. If set to false, caller must
* manually call notifyDataSetChanged() to have the changes
* Control whether methods that change the list ({@link #add}, {@link #addAll(Collection)},
* {@link #addAll(Object[])}, {@link #insert}, {@link #remove}, {@link #clear},
* {@link #sort(Comparator)}) automatically call {@link #notifyDataSetChanged}. If set to
* false, caller must manually call notifyDataSetChanged() to have the changes
* reflected in the attached view.
*
* The default is true, and calling notifyDataSetChanged()