summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt152
-rw-r--r--api/system-current.txt154
-rw-r--r--core/java/android/app/ActivityThread.java241
-rw-r--r--core/java/android/app/ApplicationThreadNative.java7
-rw-r--r--core/java/android/app/AssistStructure.java16
-rw-r--r--core/java/android/app/ContextImpl.java24
-rw-r--r--core/java/android/app/IApplicationThread.java2
-rw-r--r--core/java/android/app/INotificationManager.aidl13
-rw-r--r--core/java/android/app/INotificationManagerCallback.aidl2
-rw-r--r--core/java/android/app/NotificationManager.aidl1
-rw-r--r--core/java/android/app/NotificationManager.java290
-rw-r--r--core/java/android/app/admin/DeviceInitializerStatus.java40
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java14
-rw-r--r--core/java/android/content/pm/PackageManager.java7
-rw-r--r--core/java/android/content/res/Resources.java7
-rw-r--r--core/java/android/os/Build.java21
-rw-r--r--core/java/android/os/Debug.java236
-rw-r--r--core/java/android/provider/Settings.java12
-rw-r--r--core/java/android/security/IKeystoreService.aidl4
-rw-r--r--core/java/android/service/notification/NotificationListenerService.java33
-rw-r--r--core/java/android/service/notification/ZenModeConfig.java13
-rw-r--r--core/java/android/view/ContextThemeWrapper.java9
-rw-r--r--core/java/android/view/GhostView.java3
-rw-r--r--core/java/android/view/View.java52
-rw-r--r--core/java/android/view/ViewAssistStructure.java67
-rw-r--r--core/java/android/view/ViewGroup.java10
-rw-r--r--core/java/android/view/ViewRootImpl.java4
-rw-r--r--core/java/android/view/ViewStructure.java86
-rw-r--r--core/java/android/webkit/WebView.java4
-rw-r--r--core/java/android/webkit/WebViewProvider.java4
-rw-r--r--core/java/android/widget/Editor.java24
-rw-r--r--core/java/android/widget/Switch.java8
-rw-r--r--core/java/android/widget/TextView.java6
-rw-r--r--core/res/res/values/attrs.xml5
-rw-r--r--core/res/res/values/public.xml4
-rw-r--r--core/res/res/values/strings.xml7
-rwxr-xr-xcore/res/res/values/symbols.xml1
-rw-r--r--docs/html/design/building-blocks/buttons.jd99
-rw-r--r--docs/html/design/building-blocks/dialogs.jd186
-rw-r--r--docs/html/design/building-blocks/grid-lists.jd96
-rw-r--r--docs/html/design/building-blocks/index.jd30
-rw-r--r--docs/html/design/building-blocks/lists.jd56
-rw-r--r--docs/html/design/building-blocks/pickers.jd40
-rw-r--r--docs/html/design/building-blocks/progress.jd105
-rw-r--r--docs/html/design/building-blocks/scrolling.jd39
-rw-r--r--docs/html/design/building-blocks/seek-bars.jd45
-rw-r--r--docs/html/design/building-blocks/spinners.jd54
-rw-r--r--docs/html/design/building-blocks/switches.jd64
-rw-r--r--docs/html/design/building-blocks/tabs.jd65
-rw-r--r--docs/html/design/building-blocks/text-fields.jd88
-rw-r--r--docs/html/design/design_toc.cs59
-rw-r--r--docs/html/design/downloads/index.jd187
-rw-r--r--docs/html/design/get-started/creative-vision.jd7
-rw-r--r--docs/html/design/index.jd15
-rw-r--r--docs/html/design/patterns/gestures.jd135
-rw-r--r--docs/html/design/patterns/index.jd30
-rw-r--r--docs/html/design/patterns/multi-pane-layouts.jd130
-rw-r--r--docs/html/design/patterns/navigation-drawer.jd346
-rw-r--r--docs/html/design/patterns/selection.jd123
-rw-r--r--docs/html/design/patterns/settings.jd708
-rw-r--r--docs/html/design/style/branding.jd128
-rw-r--r--docs/html/design/style/color.jd141
-rw-r--r--docs/html/design/style/iconography.jd601
-rw-r--r--docs/html/design/style/metrics-grids.jd90
-rw-r--r--docs/html/design/style/themes.jd53
-rw-r--r--docs/html/design/style/touch-feedback.jd95
-rw-r--r--docs/html/design/style/typography.jd78
-rw-r--r--docs/html/design/style/writing.jd322
-rw-r--r--docs/html/design/videos/index.jd130
-rw-r--r--docs/html/guide/topics/renderscript/reference.jd21
-rw-r--r--docs/html/training/articles/keystore.jd2
-rw-r--r--graphics/java/android/graphics/Bitmap.java8
-rw-r--r--keystore/java/android/security/KeyGeneratorSpec.java66
-rw-r--r--keystore/java/android/security/KeyPairGeneratorSpec.java101
-rw-r--r--keystore/java/android/security/KeyStore.java54
-rw-r--r--keystore/java/android/security/KeyStoreKeyProperties.java2
-rw-r--r--keystore/java/android/security/KeyStoreKeySpec.java68
-rw-r--r--keystore/java/android/security/KeyStoreParameter.java103
-rw-r--r--keystore/java/android/security/KeyStoreSecretKeyFactorySpi.java12
-rw-r--r--keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java4
-rw-r--r--keystore/tests/src/android/security/AndroidKeyStoreTest.java4
-rw-r--r--keystore/tests/src/android/security/KeyStoreTest.java110
-rw-r--r--libs/hwui/Properties.cpp5
-rw-r--r--libs/hwui/Properties.h19
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp47
-rw-r--r--libs/hwui/renderthread/CanvasContext.h3
-rw-r--r--libs/hwui/renderthread/EglManager.cpp38
-rw-r--r--libs/hwui/renderthread/EglManager.h3
-rw-r--r--media/java/android/media/AudioManager.java62
-rw-r--r--media/java/android/media/AudioPortEventHandler.java2
-rw-r--r--media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java34
-rw-r--r--native/graphics/jni/Android.mk2
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java1
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java39
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java13
-rw-r--r--services/core/java/com/android/server/display/VirtualDisplayAdapter.java16
-rw-r--r--services/core/java/com/android/server/notification/CalendarTracker.java4
-rw-r--r--services/core/java/com/android/server/notification/ManagedServices.java4
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java133
-rw-r--r--services/core/java/com/android/server/notification/ZenModeHelper.java55
-rw-r--r--services/core/java/com/android/server/pm/UserManagerService.java12
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java2
-rw-r--r--telecomm/java/android/telecom/Conference.java4
-rw-r--r--telecomm/java/android/telecom/Connection.java11
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java2
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java1
-rw-r--r--tests/VoiceInteraction/res/layout/main.xml6
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/AsyncStructure.java6
108 files changed, 1731 insertions, 5276 deletions
diff --git a/api/current.txt b/api/current.txt
index cdc2404f5223..07137f15052e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -217,6 +217,7 @@ package android {
public static final class R.attr {
ctor public R.attr();
+ field public static final int __reserved0 = 16844020; // 0x10104f4
field public static final int absListViewStyle = 16842858; // 0x101006a
field public static final int accessibilityEventTypes = 16843648; // 0x1010380
field public static final int accessibilityFeedbackType = 16843650; // 0x1010382
@@ -300,7 +301,6 @@ package android {
field public static final int anyDensity = 16843372; // 0x101026c
field public static final int apduServiceBanner = 16843757; // 0x10103ed
field public static final int apiKey = 16843281; // 0x1010211
- field public static final int assistBlocked = 16844020; // 0x10104f4
field public static final int author = 16843444; // 0x10102b4
field public static final int authorities = 16842776; // 0x1010018
field public static final int autoAdvanceViewId = 16843535; // 0x101030f
@@ -5145,17 +5145,31 @@ package android.app {
method public void cancel(java.lang.String, int);
method public void cancelAll();
method public android.service.notification.StatusBarNotification[] getActiveNotifications();
- method public android.app.NotificationManager.Policy getNotificationPolicy(android.app.NotificationManager.Policy.Token);
- method public boolean isNotificationPolicyTokenValid(android.app.NotificationManager.Policy.Token);
+ method public final int getCurrentInterruptionFilter();
+ method public android.app.NotificationManager.Policy getNotificationPolicy();
+ method public boolean isNotificationPolicyAccessGranted();
method public void notify(int, android.app.Notification);
method public void notify(java.lang.String, int, android.app.Notification);
- method public void requestNotificationPolicyToken(android.app.NotificationManager.Policy.Token.RequestCallback, android.os.Handler);
- method public void setNotificationPolicy(android.app.NotificationManager.Policy.Token, android.app.NotificationManager.Policy);
+ method public void requestPolicyAccess(android.app.NotificationManager.NotificationPolicyAccessRequestCallback, android.os.Handler);
+ method public final void setInterruptionFilter(int);
+ method public void setNotificationPolicy(android.app.NotificationManager.Policy);
+ field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
field public static final java.lang.String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED";
+ field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
+ field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
+ field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3
+ field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
+ field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
+ }
+
+ public static abstract class NotificationManager.NotificationPolicyAccessRequestCallback {
+ ctor public NotificationManager.NotificationPolicyAccessRequestCallback();
+ method public abstract void onAccessDenied();
+ method public abstract void onAccessGranted();
}
public static class NotificationManager.Policy implements android.os.Parcelable {
- ctor public NotificationManager.Policy(int, int);
+ ctor public NotificationManager.Policy(int, int, int);
method public int describeContents();
method public static java.lang.String priorityCategoriesToString(int);
method public static java.lang.String prioritySendersToString(int);
@@ -5169,20 +5183,9 @@ package android.app {
field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
+ field public final int priorityCallSenders;
field public final int priorityCategories;
- field public final int prioritySenders;
- }
-
- public static class NotificationManager.Policy.Token implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.app.NotificationManager.Policy.Token> CREATOR;
- }
-
- public static abstract class NotificationManager.Policy.Token.RequestCallback {
- ctor public NotificationManager.Policy.Token.RequestCallback();
- method public abstract void onTokenDenied();
- method public abstract void onTokenGranted(android.app.NotificationManager.Policy.Token);
+ field public final int priorityMessageSenders;
}
public final class PendingIntent implements android.os.Parcelable {
@@ -5695,9 +5698,6 @@ package android.app.admin {
}
public class DeviceInitializerStatus {
- method public static boolean isCustomStatus(int);
- method public static boolean isErrorStatus(int);
- method public static boolean isHighPriority(int);
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
@@ -5709,9 +5709,9 @@ package android.app.admin {
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
- field public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = 134217736; // 0x8000008
+ field public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = 134217736; // 0x8000008
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
- field public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = 134217737; // 0x8000009
+ field public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = 134217737; // 0x8000009
}
public class DevicePolicyManager {
@@ -5835,7 +5835,6 @@ package android.app.admin {
field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD";
field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
- field public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
@@ -5900,6 +5899,7 @@ package android.app.admin {
field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
+ field public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
@@ -9341,6 +9341,7 @@ package android.content.pm {
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";
+ field public static final java.lang.String FEATURE_AUDIO_PRO = "android.hardware.audio.pro";
field public static final java.lang.String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
field public static final java.lang.String FEATURE_BACKUP = "android.software.backup";
field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
@@ -22667,6 +22668,7 @@ package android.os {
ctor public Build.VERSION();
field public static final java.lang.String CODENAME;
field public static final java.lang.String INCREMENTAL;
+ field public static final int PREVIEW_SDK_INT;
field public static final java.lang.String RELEASE;
field public static final deprecated java.lang.String SDK;
field public static final int SDK_INT;
@@ -26544,6 +26546,7 @@ package android.provider {
field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
+ field public static final java.lang.String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS";
field public static final java.lang.String AUTHORITY = "settings";
field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types";
field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
@@ -28593,9 +28596,9 @@ package android.security {
method public int getPurposes();
method public java.lang.String[] getSignaturePaddings();
method public int getUserAuthenticationValidityDurationSeconds();
- method public boolean isTeeBacked();
+ method public boolean isInsideSecureHardware();
method public boolean isUserAuthenticationRequired();
- method public boolean isUserAuthenticationRequirementTeeEnforced();
+ method public boolean isUserAuthenticationRequirementEnforcedBySecureHardware();
}
public final class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
@@ -28843,7 +28846,6 @@ package android.service.notification {
method public final int getCurrentInterruptionFilter();
method public final int getCurrentListenerHints();
method public android.service.notification.NotificationListenerService.RankingMap getCurrentRanking();
- method public final android.app.NotificationManager.Policy.Token getNotificationPolicyToken();
method public android.os.IBinder onBind(android.content.Intent);
method public void onInterruptionFilterChanged(int);
method public void onListenerConnected();
@@ -30163,6 +30165,8 @@ package android.telecom {
method public android.telecom.Connection getPrimaryConnection();
method public final int getState();
method public final android.telecom.StatusHints getStatusHints();
+ method public android.telecom.Connection.VideoProvider getVideoProvider();
+ method public int getVideoState();
method public void onAudioStateChanged(android.telecom.AudioState);
method public void onConnectionAdded(android.telecom.Connection);
method public void onDisconnect();
@@ -30182,6 +30186,8 @@ package android.telecom {
method public final void setDisconnected(android.telecom.DisconnectCause);
method public final void setOnHold();
method public final void setStatusHints(android.telecom.StatusHints);
+ method public final void setVideoProvider(android.telecom.Connection, android.telecom.Connection.VideoProvider);
+ method public final void setVideoState(android.telecom.Connection, int);
field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L
}
@@ -30209,6 +30215,7 @@ package android.telecom {
method public final android.telecom.Connection.VideoProvider getVideoProvider();
method public final boolean isRingbackRequested();
method public void onAbort();
+ method public void onAnswer(int);
method public void onAnswer();
method public void onAudioStateChanged(android.telecom.AudioState);
method public void onDisconnect();
@@ -30238,7 +30245,11 @@ package android.telecom {
method public final void setRingbackRequested(boolean);
method public final void setRinging();
method public final void setStatusHints(android.telecom.StatusHints);
+ method public final void setVideoProvider(android.telecom.Connection.VideoProvider);
+ method public final void setVideoState(int);
method public static java.lang.String stateToString(int);
+ field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
+ field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
field public static final int CAPABILITY_HOLD = 1; // 0x1
field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80
@@ -30246,6 +30257,12 @@ package android.telecom {
field public static final int CAPABILITY_MUTE = 64; // 0x40
field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20
field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
field public static final int STATE_ACTIVE = 4; // 0x4
@@ -30291,10 +30308,12 @@ package android.telecom {
public final class ConnectionRequest implements android.os.Parcelable {
ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
+ ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle, int);
method public int describeContents();
method public android.telecom.PhoneAccountHandle getAccountHandle();
method public android.net.Uri getAddress();
method public android.os.Bundle getExtras();
+ method public int getVideoState();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telecom.ConnectionRequest> CREATOR;
}
@@ -35883,7 +35902,7 @@ package android.view {
method public boolean dispatchNestedPreScroll(int, int, int[], int[]);
method public boolean dispatchNestedScroll(int, int, int, int, int[]);
method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
- method public void dispatchProvideAssistStructure(android.view.ViewAssistStructure);
+ method public void dispatchProvideStructure(android.view.ViewStructure);
method protected void dispatchRestoreInstanceState(android.util.SparseArray<android.os.Parcelable>);
method protected void dispatchSaveInstanceState(android.util.SparseArray<android.os.Parcelable>);
method protected void dispatchSetActivated(boolean);
@@ -36063,7 +36082,6 @@ package android.view {
method public void invalidateOutline();
method public boolean isAccessibilityFocused();
method public boolean isActivated();
- method public boolean isAssistBlocked();
method public boolean isAttachedToWindow();
method public boolean isClickable();
method public boolean isDirty();
@@ -36145,8 +36163,8 @@ package android.view {
method protected void onMeasure(int, int);
method protected void onOverScrolled(int, int, boolean, boolean);
method public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
- method public void onProvideAssistStructure(android.view.ViewAssistStructure);
- method public void onProvideVirtualAssistStructure(android.view.ViewAssistStructure);
+ method public void onProvideStructure(android.view.ViewStructure);
+ method public void onProvideVirtualStructure(android.view.ViewStructure);
method protected void onRestoreInstanceState(android.os.Parcelable);
method public void onRtlPropertiesChanged(int);
method protected android.os.Parcelable onSaveInstanceState();
@@ -36209,7 +36227,6 @@ package android.view {
method public void setActivated(boolean);
method public void setAlpha(float);
method public void setAnimation(android.view.animation.Animation);
- method public void setAssistBlocked(boolean);
method public void setBackground(android.graphics.drawable.Drawable);
method public void setBackgroundColor(int);
method public deprecated void setBackgroundDrawable(android.graphics.drawable.Drawable);
@@ -36572,40 +36589,8 @@ package android.view {
method public static android.animation.Animator createCircularReveal(android.view.View, int, int, float, float);
}
- public abstract class ViewAssistStructure {
+ public abstract deprecated class ViewAssistStructure extends android.view.ViewStructure {
ctor public ViewAssistStructure();
- method public abstract void asyncCommit();
- method public abstract android.view.ViewAssistStructure asyncNewChild(int);
- method public abstract void clearExtras();
- method public abstract android.os.Bundle editExtras();
- method public abstract int getChildCount();
- method public abstract java.lang.CharSequence getHint();
- method public abstract java.lang.CharSequence getText();
- method public abstract int getTextSelectionEnd();
- method public abstract int getTextSelectionStart();
- method public abstract android.view.ViewAssistStructure newChild(int);
- method public abstract void setAccessibilityFocused(boolean);
- method public abstract void setActivated(boolean);
- method public abstract void setAssistBlocked(boolean);
- method public abstract void setCheckable(boolean);
- method public abstract void setChecked(boolean);
- method public abstract void setChildCount(int);
- method public abstract void setClassName(java.lang.String);
- method public abstract void setClickable(boolean);
- method public abstract void setContentDescription(java.lang.CharSequence);
- method public abstract void setDimens(int, int, int, int, int, int);
- method public abstract void setEnabled(boolean);
- method public abstract void setFocusable(boolean);
- method public abstract void setFocused(boolean);
- method public abstract void setHint(java.lang.CharSequence);
- method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
- method public abstract void setLongClickable(boolean);
- method public abstract void setSelected(boolean);
- method public abstract void setStylusButtonPressable(boolean);
- method public abstract void setText(java.lang.CharSequence);
- method public abstract void setText(java.lang.CharSequence, int, int);
- method public abstract void setTextPaint(android.text.TextPaint);
- method public abstract void setVisibility(int);
}
public class ViewConfiguration {
@@ -36982,6 +36967,41 @@ package android.view {
method public android.view.ViewPropertyAnimator zBy(float);
}
+ public abstract class ViewStructure {
+ ctor public ViewStructure();
+ method public abstract void asyncCommit();
+ method public abstract android.view.ViewAssistStructure asyncNewChild(int);
+ method public abstract int getChildCount();
+ method public abstract android.os.Bundle getExtras();
+ method public abstract java.lang.CharSequence getHint();
+ method public abstract java.lang.CharSequence getText();
+ method public abstract int getTextSelectionEnd();
+ method public abstract int getTextSelectionStart();
+ method public abstract boolean hasExtras();
+ method public abstract android.view.ViewAssistStructure newChild(int);
+ method public abstract void setAccessibilityFocused(boolean);
+ method public abstract void setActivated(boolean);
+ method public abstract void setCheckable(boolean);
+ method public abstract void setChecked(boolean);
+ method public abstract void setChildCount(int);
+ method public abstract void setClassName(java.lang.String);
+ method public abstract void setClickable(boolean);
+ method public abstract void setContentDescription(java.lang.CharSequence);
+ method public abstract void setDimens(int, int, int, int, int, int);
+ method public abstract void setEnabled(boolean);
+ method public abstract void setFocusable(boolean);
+ method public abstract void setFocused(boolean);
+ method public abstract void setHint(java.lang.CharSequence);
+ method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
+ method public abstract void setLongClickable(boolean);
+ method public abstract void setSelected(boolean);
+ method public abstract void setStylusButtonPressable(boolean);
+ method public abstract void setText(java.lang.CharSequence);
+ method public abstract void setText(java.lang.CharSequence, int, int);
+ method public abstract void setTextPaint(android.text.TextPaint);
+ method public abstract void setVisibility(int);
+ }
+
public final class ViewStub extends android.view.View {
ctor public ViewStub(android.content.Context);
ctor public ViewStub(android.content.Context, int);
diff --git a/api/system-current.txt b/api/system-current.txt
index 701277349024..00da3d334c67 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -289,6 +289,7 @@ package android {
public static final class R.attr {
ctor public R.attr();
+ field public static final int __reserved0 = 16844020; // 0x10104f4
field public static final int absListViewStyle = 16842858; // 0x101006a
field public static final int accessibilityEventTypes = 16843648; // 0x1010380
field public static final int accessibilityFeedbackType = 16843650; // 0x1010382
@@ -372,7 +373,6 @@ package android {
field public static final int anyDensity = 16843372; // 0x101026c
field public static final int apduServiceBanner = 16843757; // 0x10103ed
field public static final int apiKey = 16843281; // 0x1010211
- field public static final int assistBlocked = 16844020; // 0x10104f4
field public static final int author = 16843444; // 0x10102b4
field public static final int authorities = 16842776; // 0x1010018
field public static final int autoAdvanceViewId = 16843535; // 0x101030f
@@ -5237,17 +5237,31 @@ package android.app {
method public void cancel(java.lang.String, int);
method public void cancelAll();
method public android.service.notification.StatusBarNotification[] getActiveNotifications();
- method public android.app.NotificationManager.Policy getNotificationPolicy(android.app.NotificationManager.Policy.Token);
- method public boolean isNotificationPolicyTokenValid(android.app.NotificationManager.Policy.Token);
+ method public final int getCurrentInterruptionFilter();
+ method public android.app.NotificationManager.Policy getNotificationPolicy();
+ method public boolean isNotificationPolicyAccessGranted();
method public void notify(int, android.app.Notification);
method public void notify(java.lang.String, int, android.app.Notification);
- method public void requestNotificationPolicyToken(android.app.NotificationManager.Policy.Token.RequestCallback, android.os.Handler);
- method public void setNotificationPolicy(android.app.NotificationManager.Policy.Token, android.app.NotificationManager.Policy);
+ method public void requestPolicyAccess(android.app.NotificationManager.NotificationPolicyAccessRequestCallback, android.os.Handler);
+ method public final void setInterruptionFilter(int);
+ method public void setNotificationPolicy(android.app.NotificationManager.Policy);
+ field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED";
field public static final java.lang.String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED";
+ field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4
+ field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1
+ field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3
+ field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
+ field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
+ }
+
+ public static abstract class NotificationManager.NotificationPolicyAccessRequestCallback {
+ ctor public NotificationManager.NotificationPolicyAccessRequestCallback();
+ method public abstract void onAccessDenied();
+ method public abstract void onAccessGranted();
}
public static class NotificationManager.Policy implements android.os.Parcelable {
- ctor public NotificationManager.Policy(int, int);
+ ctor public NotificationManager.Policy(int, int, int);
method public int describeContents();
method public static java.lang.String priorityCategoriesToString(int);
method public static java.lang.String prioritySendersToString(int);
@@ -5261,20 +5275,9 @@ package android.app {
field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
+ field public final int priorityCallSenders;
field public final int priorityCategories;
- field public final int prioritySenders;
- }
-
- public static class NotificationManager.Policy.Token implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.app.NotificationManager.Policy.Token> CREATOR;
- }
-
- public static abstract class NotificationManager.Policy.Token.RequestCallback {
- ctor public NotificationManager.Policy.Token.RequestCallback();
- method public abstract void onTokenDenied();
- method public abstract void onTokenGranted(android.app.NotificationManager.Policy.Token);
+ field public final int priorityMessageSenders;
}
public final class PendingIntent implements android.os.Parcelable {
@@ -5791,9 +5794,6 @@ package android.app.admin {
}
public class DeviceInitializerStatus {
- method public static boolean isCustomStatus(int);
- method public static boolean isErrorStatus(int);
- method public static boolean isHighPriority(int);
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
@@ -5805,9 +5805,9 @@ package android.app.admin {
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
- field public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = 134217736; // 0x8000008
+ field public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = 134217736; // 0x8000008
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
- field public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = 134217737; // 0x8000009
+ field public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = 134217737; // 0x8000009
}
public class DevicePolicyManager {
@@ -5943,7 +5943,6 @@ package android.app.admin {
field public static final java.lang.String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION";
field public static final java.lang.String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED";
- field public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
field public static final int ENCRYPTION_STATUS_ACTIVATING = 2; // 0x2
field public static final int ENCRYPTION_STATUS_ACTIVE = 3; // 0x3
field public static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY = 4; // 0x4
@@ -6011,6 +6010,7 @@ package android.app.admin {
field public static final int PERMISSION_POLICY_AUTO_DENY = 2; // 0x2
field public static final int PERMISSION_POLICY_AUTO_GRANT = 1; // 0x1
field public static final int PERMISSION_POLICY_PROMPT = 0; // 0x0
+ field public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 2; // 0x2
field public static final int RESET_PASSWORD_REQUIRE_ENTRY = 1; // 0x1
field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
@@ -9600,6 +9600,7 @@ package android.content.pm {
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";
+ field public static final java.lang.String FEATURE_AUDIO_PRO = "android.hardware.audio.pro";
field public static final java.lang.String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
field public static final java.lang.String FEATURE_BACKUP = "android.software.backup";
field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
@@ -24566,6 +24567,7 @@ package android.os {
ctor public Build.VERSION();
field public static final java.lang.String CODENAME;
field public static final java.lang.String INCREMENTAL;
+ field public static final int PREVIEW_SDK_INT;
field public static final java.lang.String RELEASE;
field public static final deprecated java.lang.String SDK;
field public static final int SDK_INT;
@@ -28557,6 +28559,7 @@ package android.provider {
field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
+ field public static final java.lang.String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS";
field public static final java.lang.String AUTHORITY = "settings";
field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types";
field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
@@ -30607,9 +30610,9 @@ package android.security {
method public int getPurposes();
method public java.lang.String[] getSignaturePaddings();
method public int getUserAuthenticationValidityDurationSeconds();
- method public boolean isTeeBacked();
+ method public boolean isInsideSecureHardware();
method public boolean isUserAuthenticationRequired();
- method public boolean isUserAuthenticationRequirementTeeEnforced();
+ method public boolean isUserAuthenticationRequirementEnforcedBySecureHardware();
}
public final class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
@@ -30897,7 +30900,6 @@ package android.service.notification {
method public final int getCurrentInterruptionFilter();
method public final int getCurrentListenerHints();
method public android.service.notification.NotificationListenerService.RankingMap getCurrentRanking();
- method public final android.app.NotificationManager.Policy.Token getNotificationPolicyToken();
method public android.os.IBinder onBind(android.content.Intent);
method public void onInterruptionFilterChanged(int);
method public void onListenerConnected();
@@ -32284,6 +32286,8 @@ package android.telecom {
method public android.telecom.Connection getPrimaryConnection();
method public final int getState();
method public final android.telecom.StatusHints getStatusHints();
+ method public android.telecom.Connection.VideoProvider getVideoProvider();
+ method public int getVideoState();
method public void onAudioStateChanged(android.telecom.AudioState);
method public void onConnectionAdded(android.telecom.Connection);
method public void onDisconnect();
@@ -32303,6 +32307,8 @@ package android.telecom {
method public final void setDisconnected(android.telecom.DisconnectCause);
method public final void setOnHold();
method public final void setStatusHints(android.telecom.StatusHints);
+ method public final void setVideoProvider(android.telecom.Connection, android.telecom.Connection.VideoProvider);
+ method public final void setVideoState(android.telecom.Connection, int);
field public static final long CONNECT_TIME_NOT_SPECIFIED = 0L; // 0x0L
}
@@ -32330,6 +32336,7 @@ package android.telecom {
method public final android.telecom.Connection.VideoProvider getVideoProvider();
method public final boolean isRingbackRequested();
method public void onAbort();
+ method public void onAnswer(int);
method public void onAnswer();
method public void onAudioStateChanged(android.telecom.AudioState);
method public void onDisconnect();
@@ -32359,7 +32366,11 @@ package android.telecom {
method public final void setRingbackRequested(boolean);
method public final void setRinging();
method public final void setStatusHints(android.telecom.StatusHints);
+ method public final void setVideoProvider(android.telecom.Connection.VideoProvider);
+ method public final void setVideoState(int);
method public static java.lang.String stateToString(int);
+ field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
+ field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
field public static final int CAPABILITY_HOLD = 1; // 0x1
field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80
@@ -32367,6 +32378,12 @@ package android.telecom {
field public static final int CAPABILITY_MUTE = 64; // 0x40
field public static final int CAPABILITY_RESPOND_VIA_TEXT = 32; // 0x20
field public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 4096; // 0x1000
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL = 768; // 0x300
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 256; // 0x100
+ field public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 512; // 0x200
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
+ field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
field public static final int STATE_ACTIVE = 4; // 0x4
@@ -32412,10 +32429,12 @@ package android.telecom {
public final class ConnectionRequest implements android.os.Parcelable {
ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle);
+ ctor public ConnectionRequest(android.telecom.PhoneAccountHandle, android.net.Uri, android.os.Bundle, int);
method public int describeContents();
method public android.telecom.PhoneAccountHandle getAccountHandle();
method public android.net.Uri getAddress();
method public android.os.Bundle getExtras();
+ method public int getVideoState();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telecom.ConnectionRequest> CREATOR;
}
@@ -38094,7 +38113,7 @@ package android.view {
method public boolean dispatchNestedPreScroll(int, int, int[], int[]);
method public boolean dispatchNestedScroll(int, int, int, int, int[]);
method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
- method public void dispatchProvideAssistStructure(android.view.ViewAssistStructure);
+ method public void dispatchProvideStructure(android.view.ViewStructure);
method protected void dispatchRestoreInstanceState(android.util.SparseArray<android.os.Parcelable>);
method protected void dispatchSaveInstanceState(android.util.SparseArray<android.os.Parcelable>);
method protected void dispatchSetActivated(boolean);
@@ -38274,7 +38293,6 @@ package android.view {
method public void invalidateOutline();
method public boolean isAccessibilityFocused();
method public boolean isActivated();
- method public boolean isAssistBlocked();
method public boolean isAttachedToWindow();
method public boolean isClickable();
method public boolean isDirty();
@@ -38356,8 +38374,8 @@ package android.view {
method protected void onMeasure(int, int);
method protected void onOverScrolled(int, int, boolean, boolean);
method public void onPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
- method public void onProvideAssistStructure(android.view.ViewAssistStructure);
- method public void onProvideVirtualAssistStructure(android.view.ViewAssistStructure);
+ method public void onProvideStructure(android.view.ViewStructure);
+ method public void onProvideVirtualStructure(android.view.ViewStructure);
method protected void onRestoreInstanceState(android.os.Parcelable);
method public void onRtlPropertiesChanged(int);
method protected android.os.Parcelable onSaveInstanceState();
@@ -38420,7 +38438,6 @@ package android.view {
method public void setActivated(boolean);
method public void setAlpha(float);
method public void setAnimation(android.view.animation.Animation);
- method public void setAssistBlocked(boolean);
method public void setBackground(android.graphics.drawable.Drawable);
method public void setBackgroundColor(int);
method public deprecated void setBackgroundDrawable(android.graphics.drawable.Drawable);
@@ -38783,40 +38800,8 @@ package android.view {
method public static android.animation.Animator createCircularReveal(android.view.View, int, int, float, float);
}
- public abstract class ViewAssistStructure {
+ public abstract deprecated class ViewAssistStructure extends android.view.ViewStructure {
ctor public ViewAssistStructure();
- method public abstract void asyncCommit();
- method public abstract android.view.ViewAssistStructure asyncNewChild(int);
- method public abstract void clearExtras();
- method public abstract android.os.Bundle editExtras();
- method public abstract int getChildCount();
- method public abstract java.lang.CharSequence getHint();
- method public abstract java.lang.CharSequence getText();
- method public abstract int getTextSelectionEnd();
- method public abstract int getTextSelectionStart();
- method public abstract android.view.ViewAssistStructure newChild(int);
- method public abstract void setAccessibilityFocused(boolean);
- method public abstract void setActivated(boolean);
- method public abstract void setAssistBlocked(boolean);
- method public abstract void setCheckable(boolean);
- method public abstract void setChecked(boolean);
- method public abstract void setChildCount(int);
- method public abstract void setClassName(java.lang.String);
- method public abstract void setClickable(boolean);
- method public abstract void setContentDescription(java.lang.CharSequence);
- method public abstract void setDimens(int, int, int, int, int, int);
- method public abstract void setEnabled(boolean);
- method public abstract void setFocusable(boolean);
- method public abstract void setFocused(boolean);
- method public abstract void setHint(java.lang.CharSequence);
- method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
- method public abstract void setLongClickable(boolean);
- method public abstract void setSelected(boolean);
- method public abstract void setStylusButtonPressable(boolean);
- method public abstract void setText(java.lang.CharSequence);
- method public abstract void setText(java.lang.CharSequence, int, int);
- method public abstract void setTextPaint(android.text.TextPaint);
- method public abstract void setVisibility(int);
}
public class ViewConfiguration {
@@ -39193,6 +39178,41 @@ package android.view {
method public android.view.ViewPropertyAnimator zBy(float);
}
+ public abstract class ViewStructure {
+ ctor public ViewStructure();
+ method public abstract void asyncCommit();
+ method public abstract android.view.ViewAssistStructure asyncNewChild(int);
+ method public abstract int getChildCount();
+ method public abstract android.os.Bundle getExtras();
+ method public abstract java.lang.CharSequence getHint();
+ method public abstract java.lang.CharSequence getText();
+ method public abstract int getTextSelectionEnd();
+ method public abstract int getTextSelectionStart();
+ method public abstract boolean hasExtras();
+ method public abstract android.view.ViewAssistStructure newChild(int);
+ method public abstract void setAccessibilityFocused(boolean);
+ method public abstract void setActivated(boolean);
+ method public abstract void setCheckable(boolean);
+ method public abstract void setChecked(boolean);
+ method public abstract void setChildCount(int);
+ method public abstract void setClassName(java.lang.String);
+ method public abstract void setClickable(boolean);
+ method public abstract void setContentDescription(java.lang.CharSequence);
+ method public abstract void setDimens(int, int, int, int, int, int);
+ method public abstract void setEnabled(boolean);
+ method public abstract void setFocusable(boolean);
+ method public abstract void setFocused(boolean);
+ method public abstract void setHint(java.lang.CharSequence);
+ method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
+ method public abstract void setLongClickable(boolean);
+ method public abstract void setSelected(boolean);
+ method public abstract void setStylusButtonPressable(boolean);
+ method public abstract void setText(java.lang.CharSequence);
+ method public abstract void setText(java.lang.CharSequence, int, int);
+ method public abstract void setTextPaint(android.text.TextPaint);
+ method public abstract void setVisibility(int);
+ }
+
public final class ViewStub extends android.view.View {
ctor public ViewStub(android.content.Context);
ctor public ViewStub(android.content.Context, int);
@@ -41783,7 +41803,7 @@ package android.webkit {
method public abstract boolean onKeyUp(int, android.view.KeyEvent);
method public abstract void onMeasure(int, int);
method public abstract void onOverScrolled(int, int, boolean, boolean);
- method public abstract void onProvideVirtualAssistStructure(android.view.ViewAssistStructure);
+ method public abstract void onProvideVirtualAssistStructure(android.view.ViewStructure);
method public abstract void onScrollChanged(int, int, int, int);
method public abstract void onSizeChanged(int, int, int, int);
method public abstract void onStartTemporaryDetach();
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index f16406acc68f..f506d59448bf 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -571,8 +571,6 @@ public final class ActivityThread {
private native void dumpGraphicsInfo(FileDescriptor fd);
private class ApplicationThread extends ApplicationThreadNative {
- private static final String ONE_COUNT_COLUMN = "%21s %8d";
- private static final String TWO_COUNT_COLUMNS = "%21s %8d %21s %8d";
private static final String DB_INFO_FORMAT = " %8s %8s %14s %14s %s";
private int mLastProcessState = -1;
@@ -972,18 +970,18 @@ public final class ActivityThread {
@Override
public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
- boolean dumpFullInfo, boolean dumpDalvik, String[] args) {
+ boolean dumpFullInfo, boolean dumpDalvik, boolean dumpSummaryOnly, String[] args) {
FileOutputStream fout = new FileOutputStream(fd);
PrintWriter pw = new FastPrintWriter(fout);
try {
- dumpMemInfo(pw, mem, checkin, dumpFullInfo, dumpDalvik);
+ dumpMemInfo(pw, mem, checkin, dumpFullInfo, dumpDalvik, dumpSummaryOnly);
} finally {
pw.flush();
}
}
private void dumpMemInfo(PrintWriter pw, Debug.MemoryInfo memInfo, boolean checkin,
- boolean dumpFullInfo, boolean dumpDalvik) {
+ boolean dumpFullInfo, boolean dumpDalvik, boolean dumpSummaryOnly) {
long nativeMax = Debug.getNativeHeapSize() / 1024;
long nativeAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
long nativeFree = Debug.getNativeHeapFreeSize() / 1024;
@@ -1007,7 +1005,8 @@ public final class ActivityThread {
long openSslSocketCount = Debug.countInstancesOfClass(OpenSSLSocketImpl.class);
SQLiteDebug.PagerStats stats = SQLiteDebug.getDatabaseInfo();
- dumpMemInfoTable(pw, memInfo, checkin, dumpFullInfo, dumpDalvik, Process.myPid(),
+ dumpMemInfoTable(pw, memInfo, checkin, dumpFullInfo, dumpDalvik, dumpSummaryOnly,
+ Process.myPid(),
(mBoundApplication != null) ? mBoundApplication.processName : "unknown",
nativeMax, nativeAllocated, nativeFree,
dalvikMax, dalvikAllocated, dalvikFree);
@@ -1935,6 +1934,9 @@ public final class ActivityThread {
= "%13s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s";
private static final String HEAP_COLUMN
= "%13s %8s %8s %8s %8s %8s %8s %8s";
+ private static final String ONE_COUNT_COLUMN = "%21s %8d";
+ private static final String TWO_COUNT_COLUMNS = "%21s %8d %21s %8d";
+ private static final String ONE_COUNT_COLUMN_HEADER = "%21s %8s";
// Formatting for checkin service - update version if row format changes
private static final int ACTIVITY_THREAD_CHECKIN_VERSION = 3;
@@ -1944,7 +1946,8 @@ public final class ActivityThread {
}
public static void dumpMemInfoTable(PrintWriter pw, Debug.MemoryInfo memInfo, boolean checkin,
- boolean dumpFullInfo, boolean dumpDalvik, int pid, String processName,
+ boolean dumpFullInfo, boolean dumpDalvik, boolean dumpSummaryOnly,
+ int pid, String processName,
long nativeMax, long nativeAllocated, long nativeFree,
long dalvikMax, long dalvikAllocated, long dalvikFree) {
@@ -2025,106 +2028,50 @@ public final class ActivityThread {
return;
}
- // otherwise, show human-readable format
- if (dumpFullInfo) {
- printRow(pw, HEAP_FULL_COLUMN, "", "Pss", "Pss", "Shared", "Private",
- "Shared", "Private", "Swapped", "Heap", "Heap", "Heap");
- printRow(pw, HEAP_FULL_COLUMN, "", "Total", "Clean", "Dirty", "Dirty",
- "Clean", "Clean", "Dirty", "Size", "Alloc", "Free");
- printRow(pw, HEAP_FULL_COLUMN, "", "------", "------", "------", "------",
- "------", "------", "------", "------", "------", "------");
- printRow(pw, HEAP_FULL_COLUMN, "Native Heap", memInfo.nativePss,
- memInfo.nativeSwappablePss, memInfo.nativeSharedDirty,
- memInfo.nativePrivateDirty, memInfo.nativeSharedClean,
- memInfo.nativePrivateClean, memInfo.nativeSwappedOut,
- nativeMax, nativeAllocated, nativeFree);
- printRow(pw, HEAP_FULL_COLUMN, "Dalvik Heap", memInfo.dalvikPss,
- memInfo.dalvikSwappablePss, memInfo.dalvikSharedDirty,
- memInfo.dalvikPrivateDirty, memInfo.dalvikSharedClean,
- memInfo.dalvikPrivateClean, memInfo.dalvikSwappedOut,
- dalvikMax, dalvikAllocated, dalvikFree);
- } else {
- printRow(pw, HEAP_COLUMN, "", "Pss", "Private",
- "Private", "Swapped", "Heap", "Heap", "Heap");
- printRow(pw, HEAP_COLUMN, "", "Total", "Dirty",
- "Clean", "Dirty", "Size", "Alloc", "Free");
- printRow(pw, HEAP_COLUMN, "", "------", "------", "------",
- "------", "------", "------", "------", "------");
- printRow(pw, HEAP_COLUMN, "Native Heap", memInfo.nativePss,
- memInfo.nativePrivateDirty,
- memInfo.nativePrivateClean, memInfo.nativeSwappedOut,
- nativeMax, nativeAllocated, nativeFree);
- printRow(pw, HEAP_COLUMN, "Dalvik Heap", memInfo.dalvikPss,
- memInfo.dalvikPrivateDirty,
- memInfo.dalvikPrivateClean, memInfo.dalvikSwappedOut,
- dalvikMax, dalvikAllocated, dalvikFree);
- }
-
- int otherPss = memInfo.otherPss;
- int otherSwappablePss = memInfo.otherSwappablePss;
- int otherSharedDirty = memInfo.otherSharedDirty;
- int otherPrivateDirty = memInfo.otherPrivateDirty;
- int otherSharedClean = memInfo.otherSharedClean;
- int otherPrivateClean = memInfo.otherPrivateClean;
- int otherSwappedOut = memInfo.otherSwappedOut;
-
- for (int i=0; i<Debug.MemoryInfo.NUM_OTHER_STATS; i++) {
- final int myPss = memInfo.getOtherPss(i);
- final int mySwappablePss = memInfo.getOtherSwappablePss(i);
- final int mySharedDirty = memInfo.getOtherSharedDirty(i);
- final int myPrivateDirty = memInfo.getOtherPrivateDirty(i);
- final int mySharedClean = memInfo.getOtherSharedClean(i);
- final int myPrivateClean = memInfo.getOtherPrivateClean(i);
- final int mySwappedOut = memInfo.getOtherSwappedOut(i);
- if (myPss != 0 || mySharedDirty != 0 || myPrivateDirty != 0
- || mySharedClean != 0 || myPrivateClean != 0 || mySwappedOut != 0) {
- if (dumpFullInfo) {
- printRow(pw, HEAP_FULL_COLUMN, Debug.MemoryInfo.getOtherLabel(i),
- myPss, mySwappablePss, mySharedDirty, myPrivateDirty,
- mySharedClean, myPrivateClean, mySwappedOut, "", "", "");
- } else {
- printRow(pw, HEAP_COLUMN, Debug.MemoryInfo.getOtherLabel(i),
- myPss, myPrivateDirty,
- myPrivateClean, mySwappedOut, "", "", "");
- }
- otherPss -= myPss;
- otherSwappablePss -= mySwappablePss;
- otherSharedDirty -= mySharedDirty;
- otherPrivateDirty -= myPrivateDirty;
- otherSharedClean -= mySharedClean;
- otherPrivateClean -= myPrivateClean;
- otherSwappedOut -= mySwappedOut;
- }
- }
-
- if (dumpFullInfo) {
- printRow(pw, HEAP_FULL_COLUMN, "Unknown", otherPss, otherSwappablePss,
- otherSharedDirty, otherPrivateDirty, otherSharedClean, otherPrivateClean,
- otherSwappedOut, "", "", "");
- printRow(pw, HEAP_FULL_COLUMN, "TOTAL", memInfo.getTotalPss(),
- memInfo.getTotalSwappablePss(),
- memInfo.getTotalSharedDirty(), memInfo.getTotalPrivateDirty(),
- memInfo.getTotalSharedClean(), memInfo.getTotalPrivateClean(),
- memInfo.getTotalSwappedOut(), nativeMax+dalvikMax,
- nativeAllocated+dalvikAllocated, nativeFree+dalvikFree);
- } else {
- printRow(pw, HEAP_COLUMN, "Unknown", otherPss,
- otherPrivateDirty, otherPrivateClean, otherSwappedOut,
- "", "", "");
- printRow(pw, HEAP_COLUMN, "TOTAL", memInfo.getTotalPss(),
- memInfo.getTotalPrivateDirty(),
- memInfo.getTotalPrivateClean(),
- memInfo.getTotalSwappedOut(),
- nativeMax+dalvikMax,
- nativeAllocated+dalvikAllocated, nativeFree+dalvikFree);
- }
-
- if (dumpDalvik) {
- pw.println(" ");
- pw.println(" Dalvik Details");
+ if (!dumpSummaryOnly) {
+ if (dumpFullInfo) {
+ printRow(pw, HEAP_FULL_COLUMN, "", "Pss", "Pss", "Shared", "Private",
+ "Shared", "Private", "Swapped", "Heap", "Heap", "Heap");
+ printRow(pw, HEAP_FULL_COLUMN, "", "Total", "Clean", "Dirty", "Dirty",
+ "Clean", "Clean", "Dirty", "Size", "Alloc", "Free");
+ printRow(pw, HEAP_FULL_COLUMN, "", "------", "------", "------", "------",
+ "------", "------", "------", "------", "------", "------");
+ printRow(pw, HEAP_FULL_COLUMN, "Native Heap", memInfo.nativePss,
+ memInfo.nativeSwappablePss, memInfo.nativeSharedDirty,
+ memInfo.nativePrivateDirty, memInfo.nativeSharedClean,
+ memInfo.nativePrivateClean, memInfo.nativeSwappedOut,
+ nativeMax, nativeAllocated, nativeFree);
+ printRow(pw, HEAP_FULL_COLUMN, "Dalvik Heap", memInfo.dalvikPss,
+ memInfo.dalvikSwappablePss, memInfo.dalvikSharedDirty,
+ memInfo.dalvikPrivateDirty, memInfo.dalvikSharedClean,
+ memInfo.dalvikPrivateClean, memInfo.dalvikSwappedOut,
+ dalvikMax, dalvikAllocated, dalvikFree);
+ } else {
+ printRow(pw, HEAP_COLUMN, "", "Pss", "Private",
+ "Private", "Swapped", "Heap", "Heap", "Heap");
+ printRow(pw, HEAP_COLUMN, "", "Total", "Dirty",
+ "Clean", "Dirty", "Size", "Alloc", "Free");
+ printRow(pw, HEAP_COLUMN, "", "------", "------", "------",
+ "------", "------", "------", "------", "------");
+ printRow(pw, HEAP_COLUMN, "Native Heap", memInfo.nativePss,
+ memInfo.nativePrivateDirty,
+ memInfo.nativePrivateClean, memInfo.nativeSwappedOut,
+ nativeMax, nativeAllocated, nativeFree);
+ printRow(pw, HEAP_COLUMN, "Dalvik Heap", memInfo.dalvikPss,
+ memInfo.dalvikPrivateDirty,
+ memInfo.dalvikPrivateClean, memInfo.dalvikSwappedOut,
+ dalvikMax, dalvikAllocated, dalvikFree);
+ }
+
+ int otherPss = memInfo.otherPss;
+ int otherSwappablePss = memInfo.otherSwappablePss;
+ int otherSharedDirty = memInfo.otherSharedDirty;
+ int otherPrivateDirty = memInfo.otherPrivateDirty;
+ int otherSharedClean = memInfo.otherSharedClean;
+ int otherPrivateClean = memInfo.otherPrivateClean;
+ int otherSwappedOut = memInfo.otherSwappedOut;
- for (int i=Debug.MemoryInfo.NUM_OTHER_STATS;
- i<Debug.MemoryInfo.NUM_OTHER_STATS + Debug.MemoryInfo.NUM_DVK_STATS; i++) {
+ for (int i=0; i<Debug.MemoryInfo.NUM_OTHER_STATS; i++) {
final int myPss = memInfo.getOtherPss(i);
final int mySwappablePss = memInfo.getOtherSwappablePss(i);
final int mySharedDirty = memInfo.getOtherSharedDirty(i);
@@ -2133,7 +2080,7 @@ public final class ActivityThread {
final int myPrivateClean = memInfo.getOtherPrivateClean(i);
final int mySwappedOut = memInfo.getOtherSwappedOut(i);
if (myPss != 0 || mySharedDirty != 0 || myPrivateDirty != 0
- || mySharedClean != 0 || myPrivateClean != 0) {
+ || mySharedClean != 0 || myPrivateClean != 0 || mySwappedOut != 0) {
if (dumpFullInfo) {
printRow(pw, HEAP_FULL_COLUMN, Debug.MemoryInfo.getOtherLabel(i),
myPss, mySwappablePss, mySharedDirty, myPrivateDirty,
@@ -2143,9 +2090,89 @@ public final class ActivityThread {
myPss, myPrivateDirty,
myPrivateClean, mySwappedOut, "", "", "");
}
+ otherPss -= myPss;
+ otherSwappablePss -= mySwappablePss;
+ otherSharedDirty -= mySharedDirty;
+ otherPrivateDirty -= myPrivateDirty;
+ otherSharedClean -= mySharedClean;
+ otherPrivateClean -= myPrivateClean;
+ otherSwappedOut -= mySwappedOut;
+ }
+ }
+
+ if (dumpFullInfo) {
+ printRow(pw, HEAP_FULL_COLUMN, "Unknown", otherPss, otherSwappablePss,
+ otherSharedDirty, otherPrivateDirty, otherSharedClean, otherPrivateClean,
+ otherSwappedOut, "", "", "");
+ printRow(pw, HEAP_FULL_COLUMN, "TOTAL", memInfo.getTotalPss(),
+ memInfo.getTotalSwappablePss(),
+ memInfo.getTotalSharedDirty(), memInfo.getTotalPrivateDirty(),
+ memInfo.getTotalSharedClean(), memInfo.getTotalPrivateClean(),
+ memInfo.getTotalSwappedOut(), nativeMax+dalvikMax,
+ nativeAllocated+dalvikAllocated, nativeFree+dalvikFree);
+ } else {
+ printRow(pw, HEAP_COLUMN, "Unknown", otherPss,
+ otherPrivateDirty, otherPrivateClean, otherSwappedOut,
+ "", "", "");
+ printRow(pw, HEAP_COLUMN, "TOTAL", memInfo.getTotalPss(),
+ memInfo.getTotalPrivateDirty(),
+ memInfo.getTotalPrivateClean(),
+ memInfo.getTotalSwappedOut(),
+ nativeMax+dalvikMax,
+ nativeAllocated+dalvikAllocated, nativeFree+dalvikFree);
+ }
+
+ if (dumpDalvik) {
+ pw.println(" ");
+ pw.println(" Dalvik Details");
+
+ for (int i=Debug.MemoryInfo.NUM_OTHER_STATS;
+ i<Debug.MemoryInfo.NUM_OTHER_STATS + Debug.MemoryInfo.NUM_DVK_STATS; i++) {
+ final int myPss = memInfo.getOtherPss(i);
+ final int mySwappablePss = memInfo.getOtherSwappablePss(i);
+ final int mySharedDirty = memInfo.getOtherSharedDirty(i);
+ final int myPrivateDirty = memInfo.getOtherPrivateDirty(i);
+ final int mySharedClean = memInfo.getOtherSharedClean(i);
+ final int myPrivateClean = memInfo.getOtherPrivateClean(i);
+ final int mySwappedOut = memInfo.getOtherSwappedOut(i);
+ if (myPss != 0 || mySharedDirty != 0 || myPrivateDirty != 0
+ || mySharedClean != 0 || myPrivateClean != 0) {
+ if (dumpFullInfo) {
+ printRow(pw, HEAP_FULL_COLUMN, Debug.MemoryInfo.getOtherLabel(i),
+ myPss, mySwappablePss, mySharedDirty, myPrivateDirty,
+ mySharedClean, myPrivateClean, mySwappedOut, "", "", "");
+ } else {
+ printRow(pw, HEAP_COLUMN, Debug.MemoryInfo.getOtherLabel(i),
+ myPss, myPrivateDirty,
+ myPrivateClean, mySwappedOut, "", "", "");
+ }
+ }
}
}
}
+
+ pw.println(" ");
+ pw.println(" App Summary");
+ printRow(pw, ONE_COUNT_COLUMN_HEADER, "", "Pss(KB)");
+ printRow(pw, ONE_COUNT_COLUMN_HEADER, "", "------");
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Java Heap:", memInfo.getSummaryJavaHeap());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Native Heap:", memInfo.getSummaryNativeHeap());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Code:", memInfo.getSummaryCode());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Stack:", memInfo.getSummaryStack());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Graphics:", memInfo.getSummaryGraphics());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "Private Other:", memInfo.getSummaryPrivateOther());
+ printRow(pw, ONE_COUNT_COLUMN,
+ "System:", memInfo.getSummarySystem());
+ pw.println(" ");
+ printRow(pw, TWO_COUNT_COLUMNS,
+ "TOTAL:", memInfo.getSummaryTotalPss(),
+ "TOTAL SWAP (KB):", memInfo.getSummaryTotalSwap());
}
public void registerOnActivityPausedListener(Activity activity,
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index b6989abfc578..146138007138 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -529,10 +529,12 @@ public abstract class ApplicationThreadNative extends Binder
boolean checkin = data.readInt() != 0;
boolean dumpInfo = data.readInt() != 0;
boolean dumpDalvik = data.readInt() != 0;
+ boolean dumpSummaryOnly = data.readInt() != 0;
String[] args = data.readStringArray();
if (fd != null) {
try {
- dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args);
+ dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo,
+ dumpDalvik, dumpSummaryOnly, args);
} finally {
try {
fd.close();
@@ -1248,7 +1250,7 @@ class ApplicationThreadProxy implements IApplicationThread {
}
public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
- boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException {
+ boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, String[] args) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
@@ -1257,6 +1259,7 @@ class ApplicationThreadProxy implements IApplicationThread {
data.writeInt(checkin ? 1 : 0);
data.writeInt(dumpInfo ? 1 : 0);
data.writeInt(dumpDalvik ? 1 : 0);
+ data.writeInt(dumpSummaryOnly ? 1 : 0);
data.writeStringArray(args);
mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0);
reply.readException();
diff --git a/core/java/android/app/AssistStructure.java b/core/java/android/app/AssistStructure.java
index 3abbb5ba72e6..a06bc319e3f7 100644
--- a/core/java/android/app/AssistStructure.java
+++ b/core/java/android/app/AssistStructure.java
@@ -35,6 +35,7 @@ import android.util.Log;
import android.view.View;
import android.view.ViewAssistStructure;
import android.view.ViewRootImpl;
+import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import java.util.ArrayList;
@@ -140,7 +141,14 @@ final public class AssistStructure implements Parcelable {
mTitle = root.getTitle();
mRoot = new ViewNode();
ViewNodeBuilder builder = new ViewNodeBuilder(assist, mRoot, false);
- view.dispatchProvideAssistStructure(builder);
+ if ((root.getWindowFlags()&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
+ // This is a secure window, so it doesn't want a screenshot, and that
+ // means we should also not copy out its view hierarchy.
+ view.onProvideStructure(builder);
+ builder.setAssistBlocked(true);
+ return;
+ }
+ view.dispatchProvideStructure(builder);
}
WindowNode(Parcel in, PooledStringReader preader) {
@@ -652,7 +660,7 @@ final public class AssistStructure implements Parcelable {
}
@Override
- public Bundle editExtras() {
+ public Bundle getExtras() {
if (mNode.mExtras != null) {
return mNode.mExtras;
}
@@ -661,8 +669,8 @@ final public class AssistStructure implements Parcelable {
}
@Override
- public void clearExtras() {
- mNode.mExtras = null;
+ public boolean hasExtras() {
+ return mNode.mExtras != null;
}
@Override
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 81a78f6cb256..cb20cb8681d6 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -237,8 +237,11 @@ class ContextImpl extends Context {
}
@Override
- public void setTheme(int resid) {
- mThemeResource = resid;
+ public void setTheme(int resId) {
+ if (mThemeResource != resId) {
+ mThemeResource = resId;
+ initializeTheme();
+ }
}
@Override
@@ -248,13 +251,22 @@ class ContextImpl extends Context {
@Override
public Resources.Theme getTheme() {
+ if (mTheme != null) {
+ return mTheme;
+ }
+
+ mThemeResource = Resources.selectDefaultTheme(mThemeResource,
+ getOuterContext().getApplicationInfo().targetSdkVersion);
+ initializeTheme();
+
+ return mTheme;
+ }
+
+ private void initializeTheme() {
if (mTheme == null) {
- mThemeResource = Resources.selectDefaultTheme(mThemeResource,
- getOuterContext().getApplicationInfo().targetSdkVersion);
mTheme = mResources.newTheme();
- mTheme.applyStyle(mThemeResource, true);
}
- return mTheme;
+ mTheme.applyStyle(mThemeResource, true);
}
@Override
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index 3fb82f603e28..185578fa707c 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -131,7 +131,7 @@ public interface IApplicationThread extends IInterface {
void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException;
void scheduleTrimMemory(int level) throws RemoteException;
void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo,
- boolean dumpDalvik, String[] args) throws RemoteException;
+ boolean dumpDalvik, boolean dumpSummaryOnly, String[] args) throws RemoteException;
void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException;
void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException;
void unstableProviderDied(IBinder provider) throws RemoteException;
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index ac8d5d89de61..63ff005c1869 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -75,7 +75,7 @@ interface INotificationManager
void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
int getInterruptionFilterFromListener(in INotificationListener token);
void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
- NotificationManager.Policy.Token getPolicyTokenFromListener(in INotificationListener listener);
+ void setInterruptionFilter(String pkg, int interruptionFilter);
ComponentName getEffectsSuppressor();
boolean matchesCallFilter(in Bundle extras);
@@ -87,10 +87,13 @@ interface INotificationManager
oneway void setZenMode(int mode, in Uri conditionId, String reason);
oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
oneway void requestZenModeConditions(in IConditionListener callback, int relevance);
- oneway void requestNotificationPolicyToken(String pkg, in INotificationManagerCallback callback);
- boolean isNotificationPolicyTokenValid(String pkg, in NotificationManager.Policy.Token token);
- NotificationManager.Policy getNotificationPolicy(in NotificationManager.Policy.Token token);
- void setNotificationPolicy(in NotificationManager.Policy.Token token, in NotificationManager.Policy policy);
+ oneway void requestNotificationPolicyAccess(String pkg, in INotificationManagerCallback callback);
+ boolean isNotificationPolicyAccessGranted(String pkg);
+ NotificationManager.Policy getNotificationPolicy(String pkg);
+ void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
+ String[] getPackagesRequestingNotificationPolicyAccess();
+ boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
+ void setNotificationPolicyAccessGranted(String pkg, boolean granted);
byte[] getBackupPayload(int user);
void applyRestore(in byte[] payload, int user);
diff --git a/core/java/android/app/INotificationManagerCallback.aidl b/core/java/android/app/INotificationManagerCallback.aidl
index b9414caa4b6b..99297456ad7a 100644
--- a/core/java/android/app/INotificationManagerCallback.aidl
+++ b/core/java/android/app/INotificationManagerCallback.aidl
@@ -20,5 +20,5 @@ import android.app.NotificationManager;
/** @hide */
oneway interface INotificationManagerCallback {
- void onPolicyToken(in NotificationManager.Policy.Token token);
+ void onPolicyRequestResult(boolean granted);
}
diff --git a/core/java/android/app/NotificationManager.aidl b/core/java/android/app/NotificationManager.aidl
index 8380b8df5e29..a5d5671c1bc8 100644
--- a/core/java/android/app/NotificationManager.aidl
+++ b/core/java/android/app/NotificationManager.aidl
@@ -17,4 +17,3 @@
package android.app;
parcelable NotificationManager.Policy;
-parcelable NotificationManager.Policy.Token; \ No newline at end of file
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 0a5902658aa0..e4bbe2755570 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -20,7 +20,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.app.Notification.Builder;
-import android.app.NotificationManager.Policy.Token;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ParceledListSlice;
@@ -38,6 +37,7 @@ import android.provider.Settings.Global;
import android.service.notification.IConditionListener;
import android.service.notification.StatusBarNotification;
import android.service.notification.ZenModeConfig;
+import android.util.ArraySet;
import android.util.Log;
import java.util.Objects;
@@ -107,6 +107,43 @@ public class NotificationManager
public static final String ACTION_NOTIFICATION_POLICY_CHANGED
= "android.app.action.NOTIFICATION_POLICY_CHANGED";
+ /**
+ * Intent that is broadcast when the state of getCurrentInterruptionFilter() changes.
+ * This broadcast is only sent to registered receivers.
+ */
+ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_INTERRUPTION_FILTER_CHANGED
+ = "android.app.action.INTERRUPTION_FILTER_CHANGED";
+
+ /**
+ * {@link #getCurrentInterruptionFilter() Interruption filter} constant -
+ * Normal interruption filter.
+ */
+ public static final int INTERRUPTION_FILTER_ALL = 1;
+
+ /**
+ * {@link #getCurrentInterruptionFilter() Interruption filter} constant -
+ * Priority interruption filter.
+ */
+ public static final int INTERRUPTION_FILTER_PRIORITY = 2;
+
+ /**
+ * {@link #getCurrentInterruptionFilter() Interruption filter} constant -
+ * No interruptions filter.
+ */
+ public static final int INTERRUPTION_FILTER_NONE = 3;
+
+ /**
+ * {@link #getCurrentInterruptionFilter() Interruption filter} constant -
+ * Alarms only interruption filter.
+ */
+ public static final int INTERRUPTION_FILTER_ALARMS = 4;
+
+ /** {@link #getCurrentInterruptionFilter() Interruption filter} constant - returned when
+ * the value is unavailable for any reason.
+ */
+ public static final int INTERRUPTION_FILTER_UNKNOWN = 0;
+
private static INotificationManager sService;
/** @hide */
@@ -357,29 +394,29 @@ public class NotificationManager
}
/**
- * Requests a notification policy token for the calling package.
+ * Requests the ability to read/modify notification policy for the calling package.
*
- * @param callback required, used to receive the granted token or the deny signal.
+ * @param callback required, used to receive the granted or the denied signal.
* @param handler The handler used when receiving the result.
* If null, the current thread is used.
*/
- public void requestNotificationPolicyToken(@NonNull final Policy.Token.RequestCallback callback,
+ public void requestPolicyAccess(@NonNull final NotificationPolicyAccessRequestCallback callback,
@Nullable Handler handler) {
checkRequired("callback", callback);
final Handler h = handler != null ? handler : new Handler();
INotificationManager service = getService();
try {
- service.requestNotificationPolicyToken(mContext.getOpPackageName(),
+ service.requestNotificationPolicyAccess(mContext.getOpPackageName(),
new INotificationManagerCallback.Stub() {
@Override
- public void onPolicyToken(final Token token) throws RemoteException {
+ public void onPolicyRequestResult(final boolean granted) throws RemoteException {
h.post(new Runnable() {
@Override
public void run() {
- if (token != null) {
- callback.onTokenGranted(token);
+ if (granted) {
+ callback.onAccessGranted();
} else {
- callback.onTokenDenied();
+ callback.onAccessDenied();
}
}
});
@@ -389,16 +426,38 @@ public class NotificationManager
}
}
+ /** Callback for receiving the result of a policy access request. */
+ public static abstract class NotificationPolicyAccessRequestCallback {
+ /**
+ * Received if the request was granted for this package.
+ */
+ public abstract void onAccessGranted();
+
+ /**
+ * Received if the request was denied for this package.
+ */
+ public abstract void onAccessDenied();
+ }
+
/**
- * Checks a given notification policy token.
+ * Checks the ability to read/modify notification policy for the calling package.
*
- * Returns true if the token is still valid for managing policy.
+ * Returns true if the calling package can read/modify notification policy.
*/
- public boolean isNotificationPolicyTokenValid(@NonNull Policy.Token token) {
- if (token == null) return false;
+ public boolean isNotificationPolicyAccessGranted() {
INotificationManager service = getService();
try {
- return service.isNotificationPolicyTokenValid(mContext.getOpPackageName(), token);
+ return service.isNotificationPolicyAccessGranted(mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ }
+ return false;
+ }
+
+ /** @hide */
+ public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) {
+ INotificationManager service = getService();
+ try {
+ return service.isNotificationPolicyAccessGrantedForPackage(pkg);
} catch (RemoteException e) {
}
return false;
@@ -407,13 +466,13 @@ public class NotificationManager
/**
* Gets the current notification policy.
*
- * @param token A valid notification policy token is required to access the current policy.
+ * <p>
+ * Only available if policy access is granted.
*/
- public Policy getNotificationPolicy(@NonNull Policy.Token token) {
- checkRequired("token", token);
+ public Policy getNotificationPolicy() {
INotificationManager service = getService();
try {
- return service.getNotificationPolicy(token);
+ return service.getNotificationPolicy(mContext.getOpPackageName());
} catch (RemoteException e) {
}
return null;
@@ -422,19 +481,46 @@ public class NotificationManager
/**
* Sets the current notification policy.
*
- * @param token A valid notification policy token is required to modify the current policy.
+ * <p>
+ * Only available if policy access is granted.
+ *
* @param policy The new desired policy.
*/
- public void setNotificationPolicy(@NonNull Policy.Token token, @NonNull Policy policy) {
- checkRequired("token", token);
+ public void setNotificationPolicy(@NonNull Policy policy) {
checkRequired("policy", policy);
INotificationManager service = getService();
try {
- service.setNotificationPolicy(token, policy);
+ service.setNotificationPolicy(mContext.getOpPackageName(), policy);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** @hide */
+ public void setNotificationPolicyAccessGranted(String pkg, boolean granted) {
+ INotificationManager service = getService();
+ try {
+ service.setNotificationPolicyAccessGranted(pkg, granted);
} catch (RemoteException e) {
}
}
+ /** @hide */
+ public ArraySet<String> getPackagesRequestingNotificationPolicyAccess() {
+ INotificationManager service = getService();
+ try {
+ final String[] pkgs = service.getPackagesRequestingNotificationPolicyAccess();
+ if (pkgs != null && pkgs.length > 0) {
+ final ArraySet<String> rt = new ArraySet<>(pkgs.length);
+ for (int i = 0; i < pkgs.length; i++) {
+ rt.add(pkgs[i]);
+ }
+ return rt;
+ }
+ } catch (RemoteException e) {
+ }
+ return new ArraySet<String>();
+ }
+
private Context mContext;
private static void checkRequired(String name, Object value) {
@@ -477,24 +563,30 @@ public class NotificationManager
/** Notification categories to prioritize. Bitmask of PRIORITY_CATEGORY_* constants. */
public final int priorityCategories;
- /** Notification senders to prioritize. One of:
+ /** Notification senders to prioritize for calls. One of:
+ * PRIORITY_SENDERS_ANY, PRIORITY_SENDERS_CONTACTS, PRIORITY_SENDERS_STARRED */
+ public final int priorityCallSenders;
+
+ /** Notification senders to prioritize for messages. One of:
* PRIORITY_SENDERS_ANY, PRIORITY_SENDERS_CONTACTS, PRIORITY_SENDERS_STARRED */
- public final int prioritySenders;
+ public final int priorityMessageSenders;
- public Policy(int priorityCategories, int prioritySenders) {
+ public Policy(int priorityCategories, int priorityCallSenders, int priorityMessageSenders) {
this.priorityCategories = priorityCategories;
- this.prioritySenders = prioritySenders;
+ this.priorityCallSenders = priorityCallSenders;
+ this.priorityMessageSenders = priorityMessageSenders;
}
/** @hide */
public Policy(Parcel source) {
- this(source.readInt(), source.readInt());
+ this(source.readInt(), source.readInt(), source.readInt());
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(priorityCategories);
- dest.writeInt(prioritySenders);
+ dest.writeInt(priorityCallSenders);
+ dest.writeInt(priorityMessageSenders);
}
@Override
@@ -504,7 +596,7 @@ public class NotificationManager
@Override
public int hashCode() {
- return Objects.hash(priorityCategories, prioritySenders);
+ return Objects.hash(priorityCategories, priorityCallSenders, priorityMessageSenders);
}
@Override
@@ -513,14 +605,16 @@ public class NotificationManager
if (o == this) return true;
final Policy other = (Policy) o;
return other.priorityCategories == priorityCategories
- && other.prioritySenders == prioritySenders;
+ && other.priorityCallSenders == priorityCallSenders
+ && other.priorityMessageSenders == priorityMessageSenders;
}
@Override
public String toString() {
return "NotificationManager.Policy["
+ "priorityCategories=" + priorityCategoriesToString(priorityCategories)
- + ",prioritySenders=" + prioritySendersToString(prioritySenders)
+ + ",priorityCallSenders=" + prioritySendersToString(priorityCallSenders)
+ + ",priorityMessageSenders=" + prioritySendersToString(priorityMessageSenders)
+ "]";
}
@@ -574,75 +668,6 @@ public class NotificationManager
}
};
- /**
- * Represents a client-specific token required to manage notification policy.
- */
- public static class Token implements Parcelable {
- private final IBinder mBinder;
-
- /** @hide */
- public Token(IBinder binder) {
- if (binder == null) throw new IllegalArgumentException("Binder required for token");
- mBinder = binder;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mBinder);
- }
-
- @Override
- public boolean equals(Object o) {
- if (!(o instanceof Token)) return false;
- if (o == this) return true;
- final Token other = (Token) o;
- return Objects.equals(other.mBinder, mBinder);
- }
-
- @Override
- public String toString() {
- return String.format("NotificationManager.Token[0x%08x]",
- System.identityHashCode(mBinder));
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeStrongBinder(mBinder);
- }
-
- public static final Parcelable.Creator<Token> CREATOR
- = new Parcelable.Creator<Token>() {
- @Override
- public Token createFromParcel(Parcel in) {
- return new Token(in.readStrongBinder());
- }
-
- @Override
- public Token[] newArray(int size) {
- return new Token[size];
- }
- };
-
- /** Callback for receiving the result of a token request. */
- public static abstract class RequestCallback {
- /**
- * Received if the request was granted for this package.
- *
- * @param token can be used to manage notification policy.
- */
- public abstract void onTokenGranted(Policy.Token token);
-
- /**
- * Received if the request was denied for this package.
- */
- public abstract void onTokenDenied();
- }
- }
}
/**
@@ -671,4 +696,69 @@ public class NotificationManager
}
return new StatusBarNotification[0];
}
+
+ /**
+ * Gets the current notification interruption filter.
+ *
+ * <p>
+ * The interruption filter defines which notifications are allowed to interrupt the user
+ * (e.g. via sound &amp; vibration) and is applied globally.
+ * @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when
+ * unavailable.
+ *
+ * <p>
+ * Only available if policy access is granted.
+ */
+ public final int getCurrentInterruptionFilter() {
+ final INotificationManager service = getService();
+ try {
+ return zenModeToInterruptionFilter(service.getZenMode());
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to talk to notification manager. Woe!", e);
+ }
+ return INTERRUPTION_FILTER_UNKNOWN;
+ }
+
+ /**
+ * Sets the current notification interruption filter.
+ *
+ * <p>
+ * The interruption filter defines which notifications are allowed to interrupt the user
+ * (e.g. via sound &amp; vibration) and is applied globally.
+ * @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when
+ * unavailable.
+ *
+ * <p>
+ * Only available if policy access is granted.
+ */
+ public final void setInterruptionFilter(int interruptionFilter) {
+ final INotificationManager service = getService();
+ try {
+ service.setInterruptionFilter(mContext.getOpPackageName(), interruptionFilter);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to talk to notification manager. Woe!", e);
+ }
+ }
+
+ /** @hide */
+ public static int zenModeToInterruptionFilter(int zen) {
+ switch (zen) {
+ case Global.ZEN_MODE_OFF: return INTERRUPTION_FILTER_ALL;
+ case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: return INTERRUPTION_FILTER_PRIORITY;
+ case Global.ZEN_MODE_ALARMS: return INTERRUPTION_FILTER_ALARMS;
+ case Global.ZEN_MODE_NO_INTERRUPTIONS: return INTERRUPTION_FILTER_NONE;
+ default: return INTERRUPTION_FILTER_UNKNOWN;
+ }
+ }
+
+ /** @hide */
+ public static int zenModeFromInterruptionFilter(int interruptionFilter, int defValue) {
+ switch (interruptionFilter) {
+ case INTERRUPTION_FILTER_ALL: return Global.ZEN_MODE_OFF;
+ case INTERRUPTION_FILTER_PRIORITY: return Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
+ case INTERRUPTION_FILTER_ALARMS: return Global.ZEN_MODE_ALARMS;
+ case INTERRUPTION_FILTER_NONE: return Global.ZEN_MODE_NO_INTERRUPTIONS;
+ default: return defValue;
+ }
+ }
}
diff --git a/core/java/android/app/admin/DeviceInitializerStatus.java b/core/java/android/app/admin/DeviceInitializerStatus.java
index b58711ccbed8..7de518b46f7b 100644
--- a/core/java/android/app/admin/DeviceInitializerStatus.java
+++ b/core/java/android/app/admin/DeviceInitializerStatus.java
@@ -37,8 +37,8 @@ package android.app.admin;
* <li>{@link #STATUS_ERROR_SET_DEVICE_POLICY}
* <li>{@link #STATUS_ERROR_DELETE_APPS}
* <li>{@link #STATUS_ERROR_DOUBLE_BUMP}
- * <li>{@link #STATUS_STATE_CONNECT_BLUETOOTH_PROXY}
- * <li>{@link #STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY}
+ * <li>{@link #STATUS_STATE_CONNECTING_BLUETOOTH_PROXY}
+ * <li>{@link #STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY}
* <li>{@link #STATUS_STATE_DEVICE_PROVISIONED}
* </ul>
*/
@@ -84,13 +84,13 @@ public class DeviceInitializerStatus {
* Device provisioning status code that indicates that a device is connecting to establish
* a Bluetooth network proxy.
*/
- public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 8;
+ public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 8;
/**
* Device provisioning status code that indicates that a connected Bluetooth network proxy
* is being shut down.
*/
- public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 9;
+ public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 9;
/**
* Device provisioning status code that indicates that a device has been successfully
@@ -141,37 +141,5 @@ public class DeviceInitializerStatus {
*/
public static final int STATUS_ERROR_DOUBLE_BUMP = FLAG_STATUS_ERROR | 30;
- /**
- * Determine if the specified status code represents an error status.
- * @param statusCode status code to check
- * @return {@code true} if the status code is an error status code
- */
- public static boolean isErrorStatus(int statusCode) {
- return isFlagSet(statusCode, FLAG_STATUS_ERROR);
- }
-
- /**
- * Determine if the specified status code is a custom status. Custom status codes are defined
- * and sent by device initialization agents.
- * @param statusCode status code to check
- * @return {@code true} if the status code is a custom status code
- */
- public static boolean isCustomStatus(int statusCode) {
- return isFlagSet(statusCode, FLAG_STATUS_CUSTOM);
- }
-
- /**
- * Determine if the specified status code is a high priority status code.
- * @param statusCode status code to check
- * @return {@code true} if the status code is a high priority status code
- */
- public static boolean isHighPriority(int statusCode) {
- return isFlagSet(statusCode, FLAG_STATUS_HIGH_PRIORITY);
- }
-
- private static boolean isFlagSet(int statusCode, int flag) {
- return (statusCode & flag) != 0;
- }
-
private DeviceInitializerStatus() {}
}
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 8009b6c6ce4d..ae072068b922 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -702,7 +702,7 @@ public class DevicePolicyManager {
* reported to the remote setup device over Bluetooth.
*
* <p>Broadcasts with this action must supply a
- * {@linkplain DeviceInitializerStatus#isCustomStatus(int) custom} status code in the
+ * {@linkplain DeviceInitializerStatus#FLAG_STATUS_CUSTOM custom} status code in the
* {@link EXTRA_DEVICE_INITIALIZER_STATUS_CODE} extra.
*
* <p>Broadcasts may optionally contain a description in the
@@ -718,7 +718,7 @@ public class DevicePolicyManager {
* sent as part of a broadcast with an action of {@code ACTION_SEND_DEVICE_INITIALIZER_STATUS}.
*
* <p>The status code sent with this extra must be a custom status code as defined by
- * {@link DeviceInitializerStatus#isCustomStatus(int)}.
+ * {@link DeviceInitializerStatus#FLAG_STATUS_CUSTOM}.
* @hide
*/
@SystemApi
@@ -1653,9 +1653,9 @@ public class DevicePolicyManager {
}
/**
- * Queries whether {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT} flag is set.
+ * Queries whether {@link #RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT} flag is set.
*
- * @return true if DO_NOT_ASK_CREDENTIALS_ON_BOOT flag is set.
+ * @return true if RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT flag is set.
* @hide
*/
public boolean getDoNotAskCredentialsOnBoot() {
@@ -1753,7 +1753,7 @@ public class DevicePolicyManager {
* is ignored. Once the flag is set, it cannot be reverted back without resetting the
* device to factory defaults.
*/
- public static final int DO_NOT_ASK_CREDENTIALS_ON_BOOT = 0x0002;
+ public static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT = 0x0002;
/**
* Force a new device unlock password (the password needed to access the
@@ -1779,7 +1779,7 @@ public class DevicePolicyManager {
*
* @param password The new password for the user. Null or empty clears the password.
* @param flags May be 0 or combination of {@link #RESET_PASSWORD_REQUIRE_ENTRY} and
- * {@link #DO_NOT_ASK_CREDENTIALS_ON_BOOT}.
+ * {@link #RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT}.
* @return Returns true if the password was applied, or false if it is
* not acceptable for the current constraints.
*/
@@ -4229,7 +4229,7 @@ public class DevicePolicyManager {
* Called by device initializer to send a provisioning status update to the remote setup device.
*
* @param statusCode a custom status code value as defined by
- * {@link DeviceInitializerStatus#isCustomStatus(int)}.
+ * {@link DeviceInitializerStatus#FLAG_STATUS_CUSTOM}.
* @param description custom description of the status code sent
*/
public void sendDeviceInitializerStatus(int statusCode, String description) {
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 7ff6ec38699f..51fa0750b78f 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1067,6 +1067,13 @@ public abstract class PackageManager {
public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";
/**
+ * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
+ * The device has professional audio level of functionality, performance, and acoustics.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro";
+
+ /**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device is capable of communicating with
* other devices via Bluetooth.
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index e65b4ca98d4a..a572590e702b 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -1804,8 +1804,8 @@ public class Resources {
final int N = mKey.mCount;
final String[] themes = new String[N * 2];
for (int i = 0, j = N - 1; i < themes.length; i += 2, --j) {
- final int resId = mKey.mResId[i];
- final boolean forced = mKey.mForce[i];
+ final int resId = mKey.mResId[j];
+ final boolean forced = mKey.mForce[j];
try {
themes[i] = getResourceName(resId);
} catch (NotFoundException e) {
@@ -1819,8 +1819,7 @@ public class Resources {
/** @hide */
public void encode(@NonNull ViewHierarchyEncoder encoder) {
encoder.beginObject(this);
- // TODO: revert after getTheme() is fixed
- String[] properties = new String[0]; // getTheme();
+ final String[] properties = getTheme();
for (int i = 0; i < properties.length; i += 2) {
encoder.addProperty(properties[i], properties[i+1]);
}
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 36fc4f960d80..50eed3e9df7e 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -173,6 +173,27 @@ public class Build {
"ro.build.version.sdk", 0);
/**
+ * The developer preview revision of a prerelease SDK. This value will always
+ * be <code>0</code> on production platform builds/devices.
+ *
+ * <p>When this value is nonzero, any new API added since the last
+ * officially published {@link #SDK_INT API level} is only guaranteed to be present
+ * on that specific preview revision. For example, an API <code>Activity.fooBar()</code>
+ * might be present in preview revision 1 but renamed or removed entirely in
+ * preview revision 2, which may cause an app attempting to call it to crash
+ * at runtime.</p>
+ *
+ * <p>Experimental apps targeting preview APIs should check this value for
+ * equality (<code>==</code>) with the preview SDK revision they were built for
+ * before using any prerelease platform APIs. Apps that detect a preview SDK revision
+ * other than the specific one they expect should fall back to using APIs from
+ * the previously published API level only to avoid unwanted runtime exceptions.
+ * </p>
+ */
+ public static final int PREVIEW_SDK_INT = SystemProperties.getInt(
+ "ro.build.version.preview_sdk", 0);
+
+ /**
* The current development codename, or the string "REL" if this is
* a release build.
*/
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index 4aff7a1835a7..19c8fa9da1f9 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -169,6 +169,65 @@ public final class Debug
public int otherSwappedOut;
/** @hide */
+ public static final int HEAP_UNKNOWN = 0;
+ /** @hide */
+ public static final int HEAP_DALVIK = 1;
+ /** @hide */
+ public static final int HEAP_NATIVE = 2;
+
+ /** @hide */
+ public static final int OTHER_DALVIK_OTHER = 0;
+ /** @hide */
+ public static final int OTHER_STACK = 1;
+ /** @hide */
+ public static final int OTHER_CURSOR = 2;
+ /** @hide */
+ public static final int OTHER_ASHMEM = 3;
+ /** @hide */
+ public static final int OTHER_GL_DEV = 4;
+ /** @hide */
+ public static final int OTHER_UNKNOWN_DEV = 5;
+ /** @hide */
+ public static final int OTHER_SO = 6;
+ /** @hide */
+ public static final int OTHER_JAR = 7;
+ /** @hide */
+ public static final int OTHER_APK = 8;
+ /** @hide */
+ public static final int OTHER_TTF = 9;
+ /** @hide */
+ public static final int OTHER_DEX = 10;
+ /** @hide */
+ public static final int OTHER_OAT = 11;
+ /** @hide */
+ public static final int OTHER_ART = 12;
+ /** @hide */
+ public static final int OTHER_UNKNOWN_MAP = 13;
+ /** @hide */
+ public static final int OTHER_GRAPHICS = 14;
+ /** @hide */
+ public static final int OTHER_GL = 15;
+ /** @hide */
+ public static final int OTHER_OTHER_MEMTRACK = 16;
+
+ /** @hide */
+ public static final int OTHER_DALVIK_NORMAL = 17;
+ /** @hide */
+ public static final int OTHER_DALVIK_LARGE = 18;
+ /** @hide */
+ public static final int OTHER_DALVIK_LINEARALLOC = 19;
+ /** @hide */
+ public static final int OTHER_DALVIK_ACCOUNTING = 20;
+ /** @hide */
+ public static final int OTHER_DALVIK_CODE_CACHE = 21;
+ /** @hide */
+ public static final int OTHER_DALVIK_ZYGOTE = 22;
+ /** @hide */
+ public static final int OTHER_DALVIK_NON_MOVING = 23;
+ /** @hide */
+ public static final int OTHER_DALVIK_INDIRECT_REFERENCE_TABLE = 24;
+
+ /** @hide */
public static final int NUM_OTHER_STATS = 17;
/** @hide */
@@ -284,6 +343,11 @@ public final class Debug
}
/** @hide */
+ public int getOtherPrivate(int which) {
+ return getOtherPrivateClean(which) + getOtherPrivateDirty(which);
+ }
+
+ /** @hide */
public int getOtherSharedClean(int which) {
return otherStats[which*NUM_CATEGORIES + offsetSharedClean];
}
@@ -296,35 +360,157 @@ public final class Debug
/** @hide */
public static String getOtherLabel(int which) {
switch (which) {
- case 0: return "Dalvik Other";
- case 1: return "Stack";
- case 2: return "Cursor";
- case 3: return "Ashmem";
- case 4: return "Gfx dev";
- case 5: return "Other dev";
- case 6: return ".so mmap";
- case 7: return ".jar mmap";
- case 8: return ".apk mmap";
- case 9: return ".ttf mmap";
- case 10: return ".dex mmap";
- case 11: return ".oat mmap";
- case 12: return ".art mmap";
- case 13: return "Other mmap";
- case 14: return "EGL mtrack";
- case 15: return "GL mtrack";
- case 16: return "Other mtrack";
- case 17: return ".Heap";
- case 18: return ".LOS";
- case 19: return ".LinearAlloc";
- case 20: return ".GC";
- case 21: return ".JITCache";
- case 22: return ".Zygote";
- case 23: return ".NonMoving";
- case 24: return ".IndirectRef";
+ case OTHER_DALVIK_OTHER: return "Dalvik Other";
+ case OTHER_STACK: return "Stack";
+ case OTHER_CURSOR: return "Cursor";
+ case OTHER_ASHMEM: return "Ashmem";
+ case OTHER_GL_DEV: return "Gfx dev";
+ case OTHER_UNKNOWN_DEV: return "Other dev";
+ case OTHER_SO: return ".so mmap";
+ case OTHER_JAR: return ".jar mmap";
+ case OTHER_APK: return ".apk mmap";
+ case OTHER_TTF: return ".ttf mmap";
+ case OTHER_DEX: return ".dex mmap";
+ case OTHER_OAT: return ".oat mmap";
+ case OTHER_ART: return ".art mmap";
+ case OTHER_UNKNOWN_MAP: return "Other mmap";
+ case OTHER_GRAPHICS: return "EGL mtrack";
+ case OTHER_GL: return "GL mtrack";
+ case OTHER_OTHER_MEMTRACK: return "Other mtrack";
+ case OTHER_DALVIK_NORMAL: return ".Heap";
+ case OTHER_DALVIK_LARGE: return ".LOS";
+ case OTHER_DALVIK_LINEARALLOC: return ".LinearAlloc";
+ case OTHER_DALVIK_ACCOUNTING: return ".GC";
+ case OTHER_DALVIK_CODE_CACHE: return ".JITCache";
+ case OTHER_DALVIK_ZYGOTE: return ".Zygote";
+ case OTHER_DALVIK_NON_MOVING: return ".NonMoving";
+ case OTHER_DALVIK_INDIRECT_REFERENCE_TABLE: return ".IndirectRef";
default: return "????";
}
}
+ /**
+ * Pss of Java Heap bytes in KB due to the application.
+ * Notes:
+ * * OTHER_ART is the boot image. Anything private here is blamed on
+ * the application, not the system.
+ * * dalvikPrivateDirty includes private zygote, which means the
+ * application dirtied something allocated by the zygote. We blame
+ * the application for that memory, not the system.
+ * * Does not include OTHER_DALVIK_OTHER, which is considered VM
+ * Overhead and lumped into Private Other.
+ * * We don't include dalvikPrivateClean, because there should be no
+ * such thing as private clean for the Java Heap.
+ * @hide
+ */
+ public int getSummaryJavaHeap() {
+ return dalvikPrivateDirty + getOtherPrivate(OTHER_ART);
+ }
+
+ /**
+ * Pss of Native Heap bytes in KB due to the application.
+ * Notes:
+ * * Includes private dirty malloc space.
+ * * We don't include nativePrivateClean, because there should be no
+ * such thing as private clean for the Native Heap.
+ * @hide
+ */
+ public int getSummaryNativeHeap() {
+ return nativePrivateDirty;
+ }
+
+ /**
+ * Pss of code and other static resource bytes in KB due to
+ * the application.
+ * @hide
+ */
+ public int getSummaryCode() {
+ return getOtherPrivate(OTHER_SO)
+ + getOtherPrivate(OTHER_JAR)
+ + getOtherPrivate(OTHER_APK)
+ + getOtherPrivate(OTHER_TTF)
+ + getOtherPrivate(OTHER_DEX)
+ + getOtherPrivate(OTHER_OAT);
+ }
+
+ /**
+ * Pss in KB of the stack due to the application.
+ * Notes:
+ * * Includes private dirty stack, which includes both Java and Native
+ * stack.
+ * * Does not include private clean stack, because there should be no
+ * such thing as private clean for the stack.
+ * @hide
+ */
+ public int getSummaryStack() {
+ return getOtherPrivateDirty(OTHER_STACK);
+ }
+
+ /**
+ * Pss in KB of graphics due to the application.
+ * Notes:
+ * * Includes private Gfx, EGL, and GL.
+ * * Warning: These numbers can be misreported by the graphics drivers.
+ * * We don't include shared graphics. It may make sense to, because
+ * shared graphics are likely buffers due to the application
+ * anyway, but it's simpler to implement to just group all shared
+ * memory into the System category.
+ * @hide
+ */
+ public int getSummaryGraphics() {
+ return getOtherPrivate(OTHER_GL_DEV)
+ + getOtherPrivate(OTHER_GRAPHICS)
+ + getOtherPrivate(OTHER_GL);
+ }
+
+ /**
+ * Pss in KB due to the application that haven't otherwise been
+ * accounted for.
+ * @hide
+ */
+ public int getSummaryPrivateOther() {
+ return getTotalPrivateClean()
+ + getTotalPrivateDirty()
+ - getSummaryJavaHeap()
+ - getSummaryNativeHeap()
+ - getSummaryCode()
+ - getSummaryStack()
+ - getSummaryGraphics();
+ }
+
+ /**
+ * Pss in KB due to the system.
+ * Notes:
+ * * Includes all shared memory.
+ * @hide
+ */
+ public int getSummarySystem() {
+ return getTotalPss()
+ - getTotalPrivateClean()
+ - getTotalPrivateDirty();
+ }
+
+ /**
+ * Total Pss in KB.
+ * @hide
+ */
+ public int getSummaryTotalPss() {
+ return getTotalPss();
+ }
+
+ /**
+ * Total Swap in KB.
+ * Notes:
+ * * Some of this memory belongs in other categories, but we don't
+ * know if the Swap memory is shared or private, so we don't know
+ * what to blame on the application and what on the system.
+ * For now, just lump all the Swap in one place.
+ * @hide
+ */
+ public int getSummaryTotalSwap() {
+ return getTotalSwappedOut();
+ }
+
public int describeContents() {
return 0;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 7c3c11be5b79..dc70d7bd0e34 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -809,6 +809,18 @@ public final class Settings {
= "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
/**
+ * Activity Action: Show Do Not Disturb access settings.
+ * <p>
+ * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
+ * <p>
+ * Input: Nothing.
+ * <p>
+ * Output: Nothing.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS";
+
+ /**
* @hide
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
diff --git a/core/java/android/security/IKeystoreService.aidl b/core/java/android/security/IKeystoreService.aidl
index 579cdbeb40f4..4809050f3197 100644
--- a/core/java/android/security/IKeystoreService.aidl
+++ b/core/java/android/security/IKeystoreService.aidl
@@ -37,9 +37,9 @@ interface IKeystoreService {
int exist(String name, int uid);
String[] saw(String namePrefix, int uid);
int reset();
- int password(String password);
+ int onUserPasswordChanged(int userId, String newPassword);
int lock();
- int unlock(String password);
+ int unlock(int userId, String userPassword);
int zero();
int generate(String name, int uid, int keyType, int keySize, int flags,
in KeystoreArguments args);
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 35b8819f3048..7956a3f16ce7 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -21,7 +21,7 @@ import android.annotation.SdkConstant;
import android.app.INotificationManager;
import android.app.Notification;
import android.app.Notification.Builder;
-import android.app.NotificationManager.Policy;
+import android.app.NotificationManager;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
@@ -64,25 +64,29 @@ public abstract class NotificationListenerService extends Service {
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* Normal interruption filter.
*/
- public static final int INTERRUPTION_FILTER_ALL = 1;
+ public static final int INTERRUPTION_FILTER_ALL
+ = NotificationManager.INTERRUPTION_FILTER_ALL;
/**
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* Priority interruption filter.
*/
- public static final int INTERRUPTION_FILTER_PRIORITY = 2;
+ public static final int INTERRUPTION_FILTER_PRIORITY
+ = NotificationManager.INTERRUPTION_FILTER_PRIORITY;
/**
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* No interruptions filter.
*/
- public static final int INTERRUPTION_FILTER_NONE = 3;
+ public static final int INTERRUPTION_FILTER_NONE
+ = NotificationManager.INTERRUPTION_FILTER_NONE;
/**
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* Alarms only interruption filter.
*/
- public static final int INTERRUPTION_FILTER_ALARMS = 4;
+ public static final int INTERRUPTION_FILTER_ALARMS
+ = NotificationManager.INTERRUPTION_FILTER_ALARMS;
/** {@link #getCurrentInterruptionFilter() Interruption filter} constant - returned when
* the value is unavailable for any reason. For example, before the notification listener
@@ -90,7 +94,8 @@ public abstract class NotificationListenerService extends Service {
*
* {@see #onListenerConnected()}
*/
- public static final int INTERRUPTION_FILTER_UNKNOWN = 0;
+ public static final int INTERRUPTION_FILTER_UNKNOWN
+ = NotificationManager.INTERRUPTION_FILTER_UNKNOWN;
/** {@link #getCurrentListenerHints() Listener hints} constant - the primary device UI
* should disable notification sound, vibrating and other visual or aural effects.
@@ -516,22 +521,6 @@ public abstract class NotificationListenerService extends Service {
}
/**
- * Gets the notification policy token associated with this listener.
- *
- * <p>
- * Returns null if this listener is not currently active.
- */
- public final Policy.Token getNotificationPolicyToken() {
- if (!isBound()) return null;
- try {
- return getNotificationInterface().getPolicyTokenFromListener(mWrapper);
- } catch (android.os.RemoteException ex) {
- Log.v(TAG, "Unable to contact notification manager", ex);
- return null;
- }
- }
-
- /**
* Sets the desired {@link #getCurrentListenerHints() listener hints}.
*
* <p>
diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java
index 26bd10f45f37..599ac74336b7 100644
--- a/core/java/android/service/notification/ZenModeConfig.java
+++ b/core/java/android/service/notification/ZenModeConfig.java
@@ -538,7 +538,7 @@ public class ZenModeConfig implements Parcelable {
}
priorityCallSenders = sourceToPrioritySenders(allowCallsFrom, priorityCallSenders);
priorityMessageSenders = sourceToPrioritySenders(allowMessagesFrom, priorityMessageSenders);
- return new Policy(priorityCategories, priorityCallSenders);
+ return new Policy(priorityCategories, priorityCallSenders, priorityMessageSenders);
}
private static int sourceToPrioritySenders(int source, int def) {
@@ -567,7 +567,9 @@ public class ZenModeConfig implements Parcelable {
allowReminders = (policy.priorityCategories & Policy.PRIORITY_CATEGORY_REMINDERS) != 0;
allowRepeatCallers = (policy.priorityCategories & Policy.PRIORITY_CATEGORY_REPEAT_CALLERS)
!= 0;
- allowCallsFrom = prioritySendersToSource(policy.prioritySenders, allowCallsFrom);
+ allowCallsFrom = prioritySendersToSource(policy.priorityCallSenders, allowCallsFrom);
+ allowMessagesFrom = prioritySendersToSource(policy.priorityMessageSenders,
+ allowMessagesFrom);
}
public static Condition toTimeCondition(Context context, int minutesFromNow, int userHandle) {
@@ -733,17 +735,20 @@ public class ZenModeConfig implements Parcelable {
&& conditionId.getPathSegments().get(0).equals(EVENT_PATH);
if (!isEvent) return null;
final EventInfo rt = new EventInfo();
- rt.calendar = tryParseLong(conditionId.getQueryParameter("calendar"), 0L);
+ rt.calendar = tryParseLong(conditionId.getQueryParameter("calendar"),
+ EventInfo.ANY_CALENDAR);
rt.reply = tryParseInt(conditionId.getQueryParameter("reply"), 0);
return rt;
}
public static class EventInfo {
+ public static final long ANY_CALENDAR = 0;
+
public static final int REPLY_ANY_EXCEPT_NO = 0;
public static final int REPLY_YES_OR_MAYBE = 1;
public static final int REPLY_YES = 2;
- public long calendar; // CalendarContract.Calendars._ID, or 0 for any
+ public long calendar = ANY_CALENDAR; // CalendarContract.Calendars._ID, or ANY_CALENDAR
public int reply;
@Override
diff --git a/core/java/android/view/ContextThemeWrapper.java b/core/java/android/view/ContextThemeWrapper.java
index 9047b1dd73a2..ce50091f515c 100644
--- a/core/java/android/view/ContextThemeWrapper.java
+++ b/core/java/android/view/ContextThemeWrapper.java
@@ -87,9 +87,12 @@ public class ContextThemeWrapper extends ContextWrapper {
}
}
- @Override public void setTheme(int resid) {
- mThemeResource = resid;
- initializeTheme();
+ @Override
+ public void setTheme(int resid) {
+ if (mThemeResource != resid) {
+ mThemeResource = resid;
+ initializeTheme();
+ }
}
/** @hide */
diff --git a/core/java/android/view/GhostView.java b/core/java/android/view/GhostView.java
index 9f46f45ce9df..41502b6696ab 100644
--- a/core/java/android/view/GhostView.java
+++ b/core/java/android/view/GhostView.java
@@ -82,8 +82,7 @@ public class GhostView extends View {
mView.mGhostView = null;
final ViewGroup parent = (ViewGroup) mView.getParent();
if (parent != null) {
- parent.mRecreateDisplayList = true;
- parent.updateDisplayListIfDirty();
+ parent.invalidate();
}
}
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a3d0b2aa4457..e1f1816d993b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -633,7 +633,6 @@ import java.util.concurrent.atomic.AtomicInteger;
* </p>
*
* @attr ref android.R.styleable#View_alpha
- * @attr ref android.R.styleable#View_assistBlocked
* @attr ref android.R.styleable#View_background
* @attr ref android.R.styleable#View_clickable
* @attr ref android.R.styleable#View_contentDescription
@@ -2533,7 +2532,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
PFLAG3_SCROLL_INDICATOR_END >> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT;
/**
- * <p>Indicates that we are allowing {@link android.view.ViewAssistStructure} to traverse
+ * <p>Indicates that we are allowing {@link ViewStructure} to traverse
* into this view.<p>
*/
static final int PFLAG3_ASSIST_BLOCKED = 0x100;
@@ -4050,11 +4049,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
viewFlagMasks |= SAVE_DISABLED_MASK;
}
break;
- case com.android.internal.R.styleable.View_assistBlocked:
- if (a.getBoolean(attr, false)) {
- mPrivateFlags3 |= PFLAG3_ASSIST_BLOCKED;
- }
- break;
case com.android.internal.R.styleable.View_duplicateParentState:
if (a.getBoolean(attr, false)) {
viewFlagValues |= DUPLICATE_PARENT_STATE;
@@ -6163,7 +6157,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param structure Fill in with structured view data. The default implementation
* fills in all data that can be inferred from the view itself.
*/
- public void onProvideAssistStructure(ViewAssistStructure structure) {
+ public void onProvideStructure(ViewStructure structure) {
final int id = mID;
if (id > 0 && (id&0xff000000) != 0 && (id&0x00ff0000) != 0
&& (id&0x0000ffff) != 0) {
@@ -6217,6 +6211,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
structure.setContentDescription(getContentDescription());
}
+ /** @hide */
+ public void onProvideAssistStructure(ViewStructure structure) {
+ onProvideStructure(structure);
+ }
+
/**
* Called when assist structure is being retrieved from a view as part of
* {@link android.app.Activity#onProvideAssistData Activity.onProvideAssistData} to
@@ -6225,19 +6224,24 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* view's virtual accessibility nodes, if any. You can override this for a more
* optimal implementation providing this data.
*/
- public void onProvideVirtualAssistStructure(ViewAssistStructure structure) {
+ public void onProvideVirtualStructure(ViewStructure structure) {
AccessibilityNodeProvider provider = getAccessibilityNodeProvider();
if (provider != null) {
AccessibilityNodeInfo info = createAccessibilityNodeInfo();
Log.i("View", "Provider of " + this + ": children=" + info.getChildCount());
structure.setChildCount(1);
- ViewAssistStructure root = structure.newChild(0);
- populateVirtualAssistStructure(root, provider, info);
+ ViewStructure root = structure.newChild(0);
+ populateVirtualStructure(root, provider, info);
info.recycle();
}
}
- private void populateVirtualAssistStructure(ViewAssistStructure structure,
+ /** @hide */
+ public void onProvideVirtualAssistStructure(ViewStructure structure) {
+ onProvideVirtualStructure(structure);
+ }
+
+ private void populateVirtualStructure(ViewStructure structure,
AccessibilityNodeProvider provider, AccessibilityNodeInfo info) {
structure.setId(AccessibilityNodeInfo.getVirtualDescendantId(info.getSourceNodeId()),
null, null, null);
@@ -6288,19 +6292,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
for (int i=0; i<NCHILDREN; i++) {
AccessibilityNodeInfo cinfo = provider.createAccessibilityNodeInfo(
AccessibilityNodeInfo.getVirtualDescendantId(info.getChildId(i)));
- ViewAssistStructure child = structure.newChild(i);
- populateVirtualAssistStructure(child, provider, cinfo);
+ ViewStructure child = structure.newChild(i);
+ populateVirtualStructure(child, provider, cinfo);
cinfo.recycle();
}
}
}
/**
- * Dispatch creation of {@link ViewAssistStructure} down the hierarchy. The default
- * implementation calls {@link #onProvideAssistStructure} and
- * {@link #onProvideVirtualAssistStructure}.
+ * Dispatch creation of {@link ViewStructure} down the hierarchy. The default
+ * implementation calls {@link #onProvideStructure} and
+ * {@link #onProvideVirtualStructure}.
*/
- public void dispatchProvideAssistStructure(ViewAssistStructure structure) {
+ public void dispatchProvideStructure(ViewStructure structure) {
if (!isAssistBlocked()) {
onProvideAssistStructure(structure);
onProvideVirtualAssistStructure(structure);
@@ -7904,8 +7908,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
+ * @hide
* Indicates whether this view will participate in data collection through
- * {@link android.view.ViewAssistStructure}. If true, it will not provide any data
+ * {@link ViewStructure}. If true, it will not provide any data
* for itself or its children. If false, the normal data collection will be allowed.
*
* @return Returns false if assist data collection is not blocked, else true.
@@ -7918,17 +7923,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
+ * @hide
* Controls whether assist data collection from this view and its children is enabled
- * (that is, whether {@link #onProvideAssistStructure} and
- * {@link #onProvideVirtualAssistStructure} will be called). The default value is false,
+ * (that is, whether {@link #onProvideStructure} and
+ * {@link #onProvideVirtualStructure} will be called). The default value is false,
* allowing normal assist collection. Setting this to false will disable assist collection.
*
* @param enabled Set to true to <em>disable</em> assist data collection, or false
* (the default) to allow it.
*
* @see #isAssistBlocked()
- * @see #onProvideAssistStructure
- * @see #onProvideVirtualAssistStructure
+ * @see #onProvideStructure
+ * @see #onProvideVirtualStructure
* @attr ref android.R.styleable#View_assistBlocked
*/
public void setAssistBlocked(boolean enabled) {
diff --git a/core/java/android/view/ViewAssistStructure.java b/core/java/android/view/ViewAssistStructure.java
index fccfbb8fc409..a66d93c8cc05 100644
--- a/core/java/android/view/ViewAssistStructure.java
+++ b/core/java/android/view/ViewAssistStructure.java
@@ -16,70 +16,9 @@
package android.view;
-import android.graphics.Rect;
-import android.os.Bundle;
-import android.text.TextPaint;
-
/**
- * Container for storing additional per-view data generated by {@link View#onProvideAssistStructure
- * View.onProvideAssistStructure}.
+ * @deprecated Temporary until old apps can move off this.
*/
-public abstract class ViewAssistStructure {
- public abstract void setId(int id, String packageName, String typeName, String entryName);
-
- public abstract void setDimens(int left, int top, int scrollX, int scrollY, int width,
- int height);
-
- public abstract void setVisibility(int visibility);
-
- public abstract void setAssistBlocked(boolean state);
-
- public abstract void setEnabled(boolean state);
-
- public abstract void setClickable(boolean state);
-
- public abstract void setLongClickable(boolean state);
-
- public abstract void setStylusButtonPressable(boolean state);
-
- public abstract void setFocusable(boolean state);
-
- public abstract void setFocused(boolean state);
-
- public abstract void setAccessibilityFocused(boolean state);
-
- public abstract void setCheckable(boolean state);
-
- public abstract void setChecked(boolean state);
-
- public abstract void setSelected(boolean state);
-
- public abstract void setActivated(boolean state);
-
- public abstract void setClassName(String className);
-
- public abstract void setContentDescription(CharSequence contentDescription);
-
- public abstract void setText(CharSequence text);
- public abstract void setText(CharSequence text, int selectionStart, int selectionEnd);
- public abstract void setTextPaint(TextPaint paint);
- public abstract void setHint(CharSequence hint);
-
- public abstract CharSequence getText();
- public abstract int getTextSelectionStart();
- public abstract int getTextSelectionEnd();
- public abstract CharSequence getHint();
-
- public abstract Bundle editExtras();
- public abstract void clearExtras();
-
- public abstract void setChildCount(int num);
- public abstract int getChildCount();
- public abstract ViewAssistStructure newChild(int index);
-
- public abstract ViewAssistStructure asyncNewChild(int index);
- public abstract void asyncCommit();
-
- /** @hide */
- public abstract Rect getTempRect();
+@Deprecated
+public abstract class ViewAssistStructure extends ViewStructure {
}
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index d0738b084e5e..51c4760749f2 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2878,12 +2878,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
- * Dispatch creation of {@link ViewAssistStructure} down the hierarchy. This implementation
+ * Dispatch creation of {@link ViewStructure} down the hierarchy. This implementation
* adds in all child views of the view group, in addition to calling the default View
* implementation.
*/
- public void dispatchProvideAssistStructure(ViewAssistStructure structure) {
- super.dispatchProvideAssistStructure(structure);
+ public void dispatchProvideStructure(ViewStructure structure) {
+ super.dispatchProvideStructure(structure);
if (!isAssistBlocked()) {
if (structure.getChildCount() == 0) {
final int childrenCount = getChildCount();
@@ -2898,8 +2898,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
? getChildDrawingOrder(childrenCount, i) : i;
final View child = (preorderedList == null)
? children[childIndex] : preorderedList.get(childIndex);
- ViewAssistStructure cstructure = structure.newChild(i);
- child.dispatchProvideAssistStructure(cstructure);
+ ViewStructure cstructure = structure.newChild(i);
+ child.dispatchProvideStructure(cstructure);
}
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index c9c2a8273054..ea1dadb2899b 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -654,6 +654,10 @@ public final class ViewRootImpl implements ViewParent,
return (mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE) != 0;
}
+ public int getWindowFlags() {
+ return mWindowAttributes.flags;
+ }
+
public CharSequence getTitle() {
return mWindowAttributes.getTitle();
}
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
new file mode 100644
index 000000000000..8dc49acdb6cd
--- /dev/null
+++ b/core/java/android/view/ViewStructure.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2015 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.view;
+
+import android.graphics.Rect;
+import android.os.Bundle;
+import android.text.TextPaint;
+
+/**
+ * Container for storing additional per-view data generated by {@link View#onProvideStructure
+ * View.onProvideStructure}.
+ */
+public abstract class ViewStructure {
+ public abstract void setId(int id, String packageName, String typeName, String entryName);
+
+ public abstract void setDimens(int left, int top, int scrollX, int scrollY, int width,
+ int height);
+
+ public abstract void setVisibility(int visibility);
+
+ /** @hide */
+ public abstract void setAssistBlocked(boolean state);
+
+ public abstract void setEnabled(boolean state);
+
+ public abstract void setClickable(boolean state);
+
+ public abstract void setLongClickable(boolean state);
+
+ public abstract void setStylusButtonPressable(boolean state);
+
+ public abstract void setFocusable(boolean state);
+
+ public abstract void setFocused(boolean state);
+
+ public abstract void setAccessibilityFocused(boolean state);
+
+ public abstract void setCheckable(boolean state);
+
+ public abstract void setChecked(boolean state);
+
+ public abstract void setSelected(boolean state);
+
+ public abstract void setActivated(boolean state);
+
+ public abstract void setClassName(String className);
+
+ public abstract void setContentDescription(CharSequence contentDescription);
+
+ public abstract void setText(CharSequence text);
+ public abstract void setText(CharSequence text, int selectionStart, int selectionEnd);
+ public abstract void setTextPaint(TextPaint paint);
+ public abstract void setHint(CharSequence hint);
+
+ public abstract CharSequence getText();
+ public abstract int getTextSelectionStart();
+ public abstract int getTextSelectionEnd();
+ public abstract CharSequence getHint();
+
+ public abstract Bundle getExtras();
+ public abstract boolean hasExtras();
+
+ public abstract void setChildCount(int num);
+ public abstract int getChildCount();
+ public abstract ViewAssistStructure newChild(int index);
+
+ public abstract ViewAssistStructure asyncNewChild(int index);
+ public abstract void asyncCommit();
+
+ /** @hide */
+ public abstract Rect getTempRect();
+}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index a261aafcfd29..e27e2532dae6 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -41,7 +41,7 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewAssistStructure;
+import android.view.ViewStructure;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
@@ -2428,7 +2428,7 @@ public class WebView extends AbsoluteLayout
}
@Override
- public void onProvideVirtualAssistStructure(ViewAssistStructure structure) {
+ public void onProvideVirtualStructure(ViewStructure structure) {
mProvider.getViewDelegate().onProvideVirtualAssistStructure(structure);
}
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index d5787de65ec5..e367192d9291 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -32,7 +32,7 @@ import android.print.PrintDocumentAdapter;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewAssistStructure;
+import android.view.ViewStructure;
import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -299,7 +299,7 @@ public interface WebViewProvider {
interface ViewDelegate {
public boolean shouldDelayChildPressedState();
- public void onProvideVirtualAssistStructure(ViewAssistStructure structure);
+ public void onProvideVirtualAssistStructure(ViewStructure structure);
public AccessibilityNodeProvider getAccessibilityNodeProvider();
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 86a100f87de7..78c418b13a88 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -3974,16 +3974,16 @@ public class Editor {
}
}
mTouchWordOffset = Math.max(trueOffset - offset, 0);
- mInWord = !getWordIteratorWithText().isBoundary(offset);
positionCursor = true;
- } else if (offset - mTouchWordOffset > mPreviousOffset) {
+ } else if (offset - mTouchWordOffset > mPreviousOffset || currLine > mPrevLine) {
// User is shrinking the selection.
if (currLine > mPrevLine) {
// We're on a different line, so we'll snap to word boundaries.
- offset = end;
+ offset = start;
+ mTouchWordOffset = Math.max(trueOffset - offset, 0);
+ } else {
+ offset -= mTouchWordOffset;
}
- offset -= mTouchWordOffset;
- mInWord = !getWordIteratorWithText().isBoundary(offset);
positionCursor = true;
}
@@ -3999,7 +3999,9 @@ public class Editor {
} else {
offset = alteredOffset;
}
+ mTouchWordOffset = 0;
}
+ mInWord = !getWordIteratorWithText().isBoundary(offset);
positionAtCursorOffset(offset, false);
}
}
@@ -4072,17 +4074,17 @@ public class Editor {
}
}
mTouchWordOffset = Math.max(offset - trueOffset, 0);
- mInWord = !getWordIteratorWithText().isBoundary(offset);
positionCursor = true;
- } else if (offset + mTouchWordOffset < mPreviousOffset) {
+ } else if (offset + mTouchWordOffset < mPreviousOffset || currLine < mPrevLine) {
// User is shrinking the selection.
if (currLine < mPrevLine) {
// We're on a different line, so we'll snap to word boundaries.
- offset = start;
+ offset = end;
+ mTouchWordOffset = Math.max(offset - trueOffset, 0);
+ } else {
+ offset += mTouchWordOffset;
}
- offset += mTouchWordOffset;
positionCursor = true;
- mInWord = !getWordIteratorWithText().isBoundary(offset);
}
if (positionCursor) {
@@ -4097,7 +4099,9 @@ public class Editor {
} else {
offset = Math.min(alteredOffset, length);
}
+ mTouchWordOffset = 0;
}
+ mInWord = !getWordIteratorWithText().isBoundary(offset);
positionAtCursorOffset(offset, false);
}
}
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index f94f97c759b8..ff587c2c4c2e 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -26,13 +26,11 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Insets;
-import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.Region.Op;
import android.graphics.drawable.Drawable;
-import android.os.Bundle;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
@@ -46,7 +44,7 @@ import android.view.Gravity;
import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.VelocityTracker;
-import android.view.ViewAssistStructure;
+import android.view.ViewStructure;
import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -1363,8 +1361,8 @@ public class Switch extends CompoundButton {
}
@Override
- public void onProvideAssistStructure(ViewAssistStructure structure) {
- super.onProvideAssistStructure(structure);
+ public void onProvideStructure(ViewStructure structure) {
+ super.onProvideStructure(structure);
CharSequence switchText = isChecked() ? mTextOn : mTextOff;
if (!TextUtils.isEmpty(switchText)) {
CharSequence oldText = structure.getText();
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b9a08f510276..68c49cd06302 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -114,7 +114,7 @@ import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewAssistStructure;
+import android.view.ViewStructure;
import android.view.ViewConfiguration;
import android.view.ViewDebug;
import android.view.ViewGroup.LayoutParams;
@@ -8715,8 +8715,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
@Override
- public void onProvideAssistStructure(ViewAssistStructure structure) {
- super.onProvideAssistStructure(structure);
+ public void onProvideStructure(ViewStructure structure) {
+ super.onProvideStructure(structure);
final boolean isPassword = hasPasswordTransformationMethod();
if (!isPassword) {
structure.setText(getText(), getSelectionStart(), getSelectionEnd());
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index eaa627863159..0b96d22eb495 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2347,11 +2347,6 @@
be saved. -->
<attr name="saveEnabled" format="boolean" />
- <!-- If true, no {@link android.view.ViewAssistStructure} data will be collected from
- this view or any of its children. The default is false, allowing assist structure
- to be reported by it. -->
- <attr name="assistBlocked" format="boolean" />
-
<!-- Specifies whether to filter touches when the view's window is obscured by
another visible window. When set to true, the view will not receive touches
whenever a toast, dialog or other window appears above the view's window.
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 297b30272d7e..e403a166034c 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2682,7 +2682,9 @@
<!-- NFC CardEmulation: dynamically load service resources -->
<public type="attr" name="dynamicResources" />
- <public type="attr" name="assistBlocked" />
+ <attr name="__reserved0" format="boolean" />
+ <public type="attr" name="__reserved0" />
+
<public type="attr" name="stylusButtonPressable" />
<public type="attr" name="supportsLaunchVoiceAssistFromKeyguard" />
<public type="attr" name="scrollIndicators" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 55b32e1e31ee..a3a610548588 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4068,10 +4068,13 @@
<string name="zen_mode_downtime_feature_name">Downtime</string>
<!-- Zen mode - name of default automatic schedule for weeknights. [CHAR LIMIT=40] -->
- <string name="zen_mode_default_weeknights_name">Weeknights</string>
+ <string name="zen_mode_default_weeknights_name">Weeknight</string>
<!-- Zen mode - name of default automatic schedule for weekends. [CHAR LIMIT=40] -->
- <string name="zen_mode_default_weekends_name">Weekends</string>
+ <string name="zen_mode_default_weekends_name">Weekend</string>
+
+ <!-- Zen mode - name of default automatic calendar event-based rule. [CHAR LIMIT=40] -->
+ <string name="zen_mode_default_events_name">Event</string>
<!-- Indication that the current volume and other effects (vibration) are being suppressed by a third party, such as a notification listener. [CHAR LIMIT=30] -->
<string name="muted_by">Muted by <xliff:g id="third_party">%1$s</xliff:g></string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 28ffbfa18352..801a98a679d0 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2065,6 +2065,7 @@
<java-symbol type="string" name="zen_mode_downtime_feature_name" />
<java-symbol type="string" name="zen_mode_default_weeknights_name" />
<java-symbol type="string" name="zen_mode_default_weekends_name" />
+ <java-symbol type="string" name="zen_mode_default_events_name" />
<java-symbol type="array" name="config_system_condition_providers" />
<java-symbol type="string" name="muted_by" />
diff --git a/docs/html/design/building-blocks/buttons.jd b/docs/html/design/building-blocks/buttons.jd
deleted file mode 100644
index 713574a6cb49..000000000000
--- a/docs/html/design/building-blocks/buttons.jd
+++ /dev/null
@@ -1,99 +0,0 @@
-page.title=Buttons
-page.tags=button,input
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/buttons.html">
- <div>
- <h3>Material Design</h3>
- <p>Buttons<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/button.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Buttons</p>
- </div>
-</a>
-
-<p itemprop="description">A button consists of text and/or an image that clearly communicates what action
- will occur when the user touches it. A button can have an image, text, or both.
-</p>
-
-<div class="cols" style="margin-top:22px">
- <div class="col-3">
- <img src="{@docRoot}design/media/icon_magnifying_glass.png" style="height:64px;padding:20px 0 0 40px;">
- </div>
- <div class="col-3">
- <img src="{@docRoot}design/media/buttons_text.png" style="height:94px;">
- </div>
- <div class="col-7">
- <img src="{@docRoot}design/media/buttons_image_and_text.png" style="height:94px;">
- </div>
-</div>
-
-<div class="cols" style="margin-top:0;">
- <div class="col-3">
- <p>An image alone works best when the action can be represented by a symbol that's well understood.</p>
- </div>
- <div class="col-3">
- <p>Text alone is most appropriate for actions that would be difficult to
- represent visually, or are critical to convey in words to avoid any ambiguity.</p>
- </div>
- <div class="col-7">
- <p>
- Both an icon and text is most appropriate when they complement each other:
- each carrying its own bit of information, but together making a larger whole.
- </p>
-
- <p>
- For example, in a birthday reminder card in Google Now, the button's text
- describes the action while its image indicates that the action will be done
- in Google+.
- </p>
- </div>
-</div>
-
-<h3>What about button backgrounds?</h3>
-
-<div class="cols">
- <div class="col-6">
- <p>For <strong>image-only</strong> buttons, a background isn't necessary because
- users are accustomed to interacting with objects.</p>
-
- <div class="cols" style="margin-left:72px">
- <div class="col-2">
- <div class="do-dont-label bad emulate-content-left-padding" style="width:30px">Don't</div>
- <img src="{@docRoot}design/media/buttons_image_bg_dont.png" style="padding-left:14px;">
- </div>
- <div class="col-2" style="width:29px;margin-left:10px;">
- <div class="do-dont-label good"><strong>Do</strong></div>
- <img src="{@docRoot}design/media/icon_alarm.png" style="width:31px;padding-top:7px;">
- </div>
- </div>
- </div>
-
-<div class="col-7">
-<p>
- For buttons <strong>with text</strong>, a background is also usually
- unnecessary. To invite users to touch, phrase it as a clear action (e.g.
- "Start", "Sign in") and use different color and formatting than the screen's
- usual body text.
-</p>
-
-<p>
- Use buttons with backgrounds sparingly. Because they have a heavy appearance,
- they work best when there's only one or two of them on the screen. They're
- most appropriate for:
-</p>
-
-<ul>
- <li>A call to action you really want users to pursue (e.g. "Sign up")</li>
- <li>A key decision point (e.g. "Accept" / "Decline")</li>
- <li>When the user is about to commit a significant action (e.g. "Erase
- everything", "Buy now")</li>
-</ul>
-</div>
-</div>
-
diff --git a/docs/html/design/building-blocks/dialogs.jd b/docs/html/design/building-blocks/dialogs.jd
deleted file mode 100644
index 70460bac917a..000000000000
--- a/docs/html/design/building-blocks/dialogs.jd
+++ /dev/null
@@ -1,186 +0,0 @@
-page.title=Dialogs
-page.tags=dialog,alert,popup,toast
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/dialogs.html">
- <div>
- <h3>Material Design</h3>
- <p>Dialogs<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/dialogs.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Dialogs</p>
- </div>
-</a>
-
-<p itemprop="description">Dialogs prompt the user for decisions or additional information required by the app to continue a
-task. Such requests can range from simple Cancel/OK decisions to more complex layouts asking the
-user to adjust settings or enter text.</p>
-
-<img src="{@docRoot}design/media/dialogs_main.png">
-
-<div class="with-callouts">
-
-<ol>
- <li>
- <h4>Optional title region</h4>
- <p>The title introduces the content of your dialog. It can, for example, identify the name of a
- setting that the user is about to change, or request a decision.</p>
- </li>
- <li>
- <h4>Content area</h4>
- <p>Dialog content varies widely. For settings dialogs, a dialog may contain UI elements such as
- sliders, text fields, checkboxes, or radio buttons that allow the user to change app or system
- settings. In other cases, such as alerts, the content may consist solely of text that provides
- further context for a user decision.</p>
- </li>
-
- <li>
- <h4>Action buttons</h4>
- <p>Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely action. However, if the options consist of specific actions such as Close or Wait rather than a confirmation or cancellation of the action described in the content, then all the buttons should be active verbs. Order actions following these rules:</p>
- <ul>
-
- <li>The dismissive action of a dialog is always on the left. Dismissive actions return to the user to the previous state.</li>
- <li>The affirmative actions are on the right. Affirmative actions continue progress toward the user goal that triggered the dialog.</li>
- </ul>
- </li>
-</ol>
-</div>
-
-<img src="{@docRoot}design/media/dialogs_examples.png">
-<div class="figure-caption">
- Samples of typical dialog use in Android.
-</div>
-
-<h2 id="alerts">Alerts</h2>
-
-<p>Alerts inform the user about a situation that requires their confirmation or acknowledgement before
-proceeding. They differ slightly in appearance based upon the severity and impact of the message
-conveyed.</p>
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/dialogs_w_no_title.png">
-
- </div>
- <div class="col-5">
-
-<h4>Alerts without title bars</h4>
-<p>Most alerts don't need titles. Usually the decision doesn't have a severe impact and can be summed
-up succinctly in a sentence or two. The content area should either ask a question (such as "Delete
-this conversation?") or make a clear statement whose relationship to the action buttons is obvious.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/dialogs_w_title.png">
-
- </div>
- <div class="col-5">
-
-<h4>Alerts with title bars</h4>
-<p>Use alerts with title bars sparingly. They are appropriate only when a high-risk operation involving
-potential loss of data, connectivity, extra charges, and so on requires a clear question or
-statement (the title) and some additional explanation (in the content area).</p>
-<p>Keep the question or statement short: for example, "Erase USB storage?" Avoid apologies. A user
-should be able to skip the content completely and still have a clear idea of what choices are
-available based on the title and the text of the action buttons.</p>
-
- </div>
-</div>
-<p>When crafting a confirmation dialog, make the title meaningful by echoing the requested action.</p>
-
-<div class="cols">
- <div class="col-4">
- <div class="do-dont-label bad">Don't</div>
- <table class="ui-table bad">
- <thead>
- <tr>
- <th class="label">
- Are you sure?
- </th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="col-4">
- <div class="do-dont-label bad">Don't</div>
- <table class="ui-table bad">
- <thead>
- <tr>
- <th class="label">
- Warning!
- </th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="col-5">
- <div class="do-dont-label good">Do</div>
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- Erase USB storage?
- </th>
- </tr>
- </thead>
- </table>
- </div>
-</div>
-
-
-<h2 id="popups">Popups</h2>
-
-<p>Popups are lightweight version of dialogs that require a single selection from the user. Popups
-don't have have explicit buttons that accept or cancel the operation. Instead, making a selection
-advances the workflow, and simply touching outside the popup dismisses it.</p>
-
-<img src="{@docRoot}design/media/dialogs_popups_example.png">
-
-
-<h2 id="toasts">Toasts</h2>
-
-
-<div class="cols">
- <div class="col-6">
-
- <div class="vspace size-3"></div>
-
-<p>Toasts provide lightweight feedback about an operation in a small popup. For example, navigating
-away from an email before you send it triggers a "Draft saved" toast to let you know that you can
-continue editing later. Toasts automatically disappear after a timeout.</p>
-
-<a class="notice-designers-material left"
- href="http://www.google.com/design/spec/components/snackbars-toasts.html">
- <div>
- <h3>Material Design</h3>
- <p>Toasts<p>
- </div>
-</a>
-
-
-<a class="notice-developers left" href="{@docRoot}guide/topics/ui/notifiers/toasts.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Toasts</p>
- </div>
-</a>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/dialogs_toasts.png">
-
- </div>
-</div>
-
diff --git a/docs/html/design/building-blocks/grid-lists.jd b/docs/html/design/building-blocks/grid-lists.jd
deleted file mode 100644
index 7a1c65254a8c..000000000000
--- a/docs/html/design/building-blocks/grid-lists.jd
+++ /dev/null
@@ -1,96 +0,0 @@
-page.title=Grid Lists
-page.tags=gridview,layout,listview
-@jd:body
-
-<img src="{@docRoot}design/media/gridview_overview.png">
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/grid-lists.html">
- <div>
- <h3>Material Design</h3>
- <p>Grid lists<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/layout/gridview.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Grid View</p>
- </div>
-</a>
-
-<p itemprop="description">Grid lists are an alternative to standard list views. They are best suited for showing data sets
-that represent themselves through images. In contrast to simple lists, grid lists may scroll either
-vertically or horizontally.</p>
-
-
-
-<h2 id="generic_grid">Generic Grids</h2>
-
-
-<p>The items in a grid list are arranged in two dimensions, one of which is fixed when scrolling
-content. The scrolling direction dictates the ordering of the items within the grid list. Since the
-scrolling direction is not deterministic, make it easy for the user to determine the orientation by
-cutting off grid items to communicate where the overflow is located.</p>
-<p>Avoid creating grid lists that scroll in two dimensions.</p>
-
-
-<div class="cols">
- <div class="col-7">
-
- <img src="{@docRoot}design/media/gridview_vertical.png">
-
- </div>
- <div class="col-6">
-
-<h4>Vertical scrolling</h4>
-<p>Vertically scrolling grid list items are sorted in traditional western reading direction:
-left-to-right and top-down. When displaying the list, cut off the items in the bottom row to
-communicate that the user can scroll the list down to show additional items. Be sure to retain this
-scheme when the user rotates the screen.</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-7">
-
- <img src="{@docRoot}design/media/gridview_horizontal.png">
-
- </div>
- <div class="col-6">
-
-<h4>Horizontal scrolling</h4>
-<p>Horizontally scrolling lists fix the vertical axis of the item grid. Compared to vertically
-scrolling lists, the sorting changes slightly to a top-down and left-to-right arrangement. Employ
-the same technique of cutting off the items in the rightmost column to indicate the scrolling
-direction.</p>
-<p>Don't use scrolling tabs as a means to switch views in conjunction with horizontally scrolling grid
-lists, because the horizontal gesture for view and content navigation will conflict. If you show
-scrolling tabs for view navigation together with a grid list, use vertical grid scrolling for list
-navigation.</p>
-
- </div>
-</div>
-
-
-<h2 id="with-labels">Grid List with Labels</h2>
-
-<p>Use labels to display additional contextual information for your grid list items.</p>
-
-
-<div class="cols">
- <div class="col-7">
-
- <img src="{@docRoot}design/media/gridview_style.png">
-
- </div>
- <div class="col-6">
-
-<h4>Style</h4>
-<p>Use semi-transparent panels on top of the grid list items to display your labels. This allows you to
-control the contrast and ensures legibility of the labels while letting the content "shine through".</p>
-
- </div>
-</div>
diff --git a/docs/html/design/building-blocks/index.jd b/docs/html/design/building-blocks/index.jd
deleted file mode 100644
index 7fb0e553be37..000000000000
--- a/docs/html/design/building-blocks/index.jd
+++ /dev/null
@@ -1,30 +0,0 @@
-page.title=Building Blocks
-header.justLinks=1
-footer.hide=1
-@jd:body
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 0;
- top: 520px;
- width: 450px;
-}
-</style>
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- <span itemprop="description">Your inventory of ready-to-use elements for creating
- outstanding apps.</span>
- <br><br>
- <a href="{@docRoot}design/building-blocks/tabs.html" class="landing-page-link">Tabs</a>
- </div>
-
- <a href="{@docRoot}design/building-blocks/tabs.html">
- <img src="{@docRoot}design/media/building_blocks_landing.png">
- </a>
-</div>
diff --git a/docs/html/design/building-blocks/lists.jd b/docs/html/design/building-blocks/lists.jd
deleted file mode 100644
index 85753c826abe..000000000000
--- a/docs/html/design/building-blocks/lists.jd
+++ /dev/null
@@ -1,56 +0,0 @@
-page.title=Lists
-page.tags=listview,layout
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/lists.html">
- <div>
- <h3>Material Design</h3>
- <p>Lists<p>
- </div>
-</a>
-
-<p itemprop="description">Lists present multiple line items in a vertical arrangement. They can be used for data selection as
-well as drilldown navigation.</p>
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols clearfix">
- <div class="col-9">
-
- <img src="{@docRoot}design/media/lists_main.png">
-
- </div>
- <div class="col-4 with-callouts">
-
-<ol style="margin-bottom: 60px;">
-<li>
-<h4>Section Divider</h4>
-<p>Use section dividers to organize the content of your list into groups and facilitate scanning.</p>
-</li>
-<li>
-<h4>Line Items</h4>
-<p>List items can accommodate a wide range of data types in different arrangements, including
- simple single-line items, multi-line items, and custom items with icons, checkboxes, and action
- buttons.</p>
-</li>
-</ol>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/layout/listview.html">
- <div>
- <h3>Developer Docs</h3>
- <p>List View</p>
- </div>
-</a>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/lists-controls.html">
- <div>
- <h3>Material Design</h3>
- <p>Lists: Controls<p>
- </div>
-</a>
-
-
- </div>
-</div>
diff --git a/docs/html/design/building-blocks/pickers.jd b/docs/html/design/building-blocks/pickers.jd
deleted file mode 100644
index 72da0f7fed4b..000000000000
--- a/docs/html/design/building-blocks/pickers.jd
+++ /dev/null
@@ -1,40 +0,0 @@
-page.title=Pickers
-page.tags=datepicker,timepicker
-@jd:body
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/pickers.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Pickers</p>
- </div>
-</a>
-
-<p itemprop="description">Pickers provide a simple way to select a single value from a set. In addition to touching the
-up/down arrow buttons, it's possible to set the desired value from the keyboard or via a swipe
-gesture.</p>
-
-<div class="cols">
- <div class="col-6">
-
- <img src="{@docRoot}design/media/picker_space.png">
-
- </div>
- <div class="col-6">
-
-<h4>Space considerations</h4>
-<p>Pickers can be used inline on a form, but their relatively large footprint is best suited for
-display in a dialog. For inline display, consider using more compact controls such as text fields or
-spinners.</p>
-
- </div>
-</div>
-
-<h2 id="date-time">Date and time pickers</h2>
-
-<p>Android provides these as ready-to-use dialogs. Each picker is a dialog with a set of controls for
-entering the parts of the date (month, day, year) or time (hour, minute, AM/PM). Using these in your
-app helps ensure that a user's specification of a data or time input is valid and formatted
-correctly. The format of a time and date picker adjusts automatically to the locale.</p>
-
-<img src="{@docRoot}design/media/picker_datetime.png">
-
diff --git a/docs/html/design/building-blocks/progress.jd b/docs/html/design/building-blocks/progress.jd
deleted file mode 100644
index ae81440fef1e..000000000000
--- a/docs/html/design/building-blocks/progress.jd
+++ /dev/null
@@ -1,105 +0,0 @@
-page.title=Progress &amp; Activity
-page.tags=progressbar,download,network
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/progress-activity.html">
- <div>
- <h3>Material Design</h3>
- <p>Progress and Activity<p>
- </div>
-</a>
-
-<p>Progress bars and activity indicators signal to users that something is happening that will take a moment.</p>
-<h2 id="progress">Progress bars</h2>
-
-<p>Progress bars are for situations where the percentage completed can be determined. They give users a quick sense of how much longer an operation will take.</p>
-
-<img src="{@docRoot}design/media/progress_download.png">
-
-<p>A progress bar should always fill from 0% to 100% and never move backwards to a lower value. If multiple operations are happening in sequence, use the progress bar to represent the delay as a whole, so that when the bar reaches 100%, it doesn't return back to 0%.</p>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<img src="{@docRoot}design/media/progress_themes.png">
-<div class="figure-caption">
- Progress bar in Holo Dark and Holo Light.
-</div>
-
-<h2 id="activity">Activity indicators</h2>
-
-<p>Activity indicators are for operations of an indeterminate length. They ask users to wait a moment while something finishes up, without getting into specifics about what's happening behind the scenes.</p>
-
-<p>Two styles are available: a bar and a circle. Each is offered in a variety of sizes, in both Holo Light and Holo Dark themes. Choose the appropriate style and size for the surrounding context. For example, the largest activity circle works well when displayed in a blank content area, but not in a smaller dialog box. Each operation should only be represented by one activity indicator.</p>
-
-<div class="cols">
- <div class="col-6">
-
- <img src="{@docRoot}design/media/progress_activity.png">
-
- </div>
- <div class="col-7 with-callouts">
-
- <ol>
- <li class="value-1"><h4>Activity bar</h4>
- <p>In this example, an activity bar (in Holo Dark) appears when a user first requests a download. There's an unknown period of time when the download has not yet started. As soon as the download starts, this activity bar transforms into a progress bar.</p>
- </li>
- </ol>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-6">
-
- <img src="{@docRoot}design/media/progress_activity2.png">
-
- </div>
- <div class="col-7 with-callouts">
-
- <ol>
- <li class="value-2"><h4>Activity circle</h4>
- <p>In this example, an activity circle (in Holo Light) is used in the Gmail application when a message is being loaded because it's not possible to determine how long it will take to download the email.</p>
- <p>When displaying an activity circle, do not include text to communicate what the app is doing. The moving circle alone provides sufficient feedback about the delay, and does so in an understated way that minimizes the impact.</p>
- <p>
- <div style="margin-left:0;margin-top:1em;">
- <img src="{@docRoot}design/media/progress_activity_do_dont.png">
- </div>
- </p>
- </li>
- </ol>
-
- </div>
-</div>
-
-<h2 id="custom-indicators">Custom indicators</h2>
-<p>The standard progress bar and activity indicators work well for most situations and should be used whenever possible to provide a consistent experience across Android. However, some situations may call for something more custom.</p>
-
-<p>Here's an example:<br>
-In all of the Google Play apps (Music, Books, Movies, Magazines), we wanted the current download state of each item to be visible at all times at the top-level screen. These states are:
- <ul>
- <li>Not downloaded</li>
- <li>Temporarily downloaded (automatically cached by the app)</li>
- <li>Permanently downloaded on the device at the user's request</li>
- </ul>
-</p>
-<p>We also needed to indicate progress from one download state to another, because downloading is not instantaneous.</p>
-<p>This presented a challenge, because the Google Play apps use a variety of different layouts, and some of them are highly space-constrained. We didn't want this information to clutter the top-level screens, or compete too much with the cover art.</p>
-<p>So we designed a custom indicator that could show all of the information in a tiny footprint, with the flexibility to appear on top of content if necessary.</p>
-
-<img src="{@docRoot}design/media/progress_activity_custom.png">
-
-<p>The color indicates whether it's downloaded (blue) or not (gray). The appearance of the pin indicates whether the download is permanent (white, upright) or temporary (gray, diagonal). And when state is in the process of changing, progress is indicated by a moving pie chart.</p>
-
-<div class="cols">
- <div class="col-9">
- <img src="{@docRoot}design/media/progress_activity_custom_app.png">
- </div>
- <div class="col-4">
- <div class="figure-caption">
- Across Google Play apps with different layouts, the same custom indicator appears with each item. It communicates download state as well as progress, in a compact package that can be incorporated into any screen design.
- </div>
- </div>
-</div>
-
-<p>If you find that the standard indicators aren't meeting your needs (due to space constraints, state complexities), by all means design your own. Make it feel like part of the Android family by injecting some of the visual characteristics of the standard indicators. In this example, we carried over the circular shape, the same shade of blue, and the flat and simple style.</p>
diff --git a/docs/html/design/building-blocks/scrolling.jd b/docs/html/design/building-blocks/scrolling.jd
deleted file mode 100644
index 04b1e4a1acb0..000000000000
--- a/docs/html/design/building-blocks/scrolling.jd
+++ /dev/null
@@ -1,39 +0,0 @@
-page.title=Scrolling
-page.tags=scrollview,listview
-@jd:body
-
-
-<p>Scrolling allows the user to navigate to content in the overflow using a swipe gesture. The
-scrolling speed is proportional to the speed of the gesture.</p>
-<h2 id="indicator">Scroll Indicator</h2>
-
-<p>Appears during scrolling to indicate what portion of the content is currently in view.</p>
-
-<div class="framed-nexus5-land-span-13">
- <video class="play-on-hover" autoplay>
- <source src="{@docRoot}design/media/scroll_indicator.mp4" type="video/mp4">
- <source src="{@docRoot}design/media/scroll_indicator.webm" type="video/webm">
- <source src="{@docRoot}design/media/scroll_indicator.ogv" type="video/ogg">
- </video>
-</div>
-<div class="figure-caption">
- <div class="video-instructions">&nbsp;</div>
-</div>
-
-<h2 id="index-scrolling">Index Scrolling</h2>
-
-<p>In addition to traditional scrolling, a long alphabetical list can also offer index scrolling: a way
-to quickly navigate to the items that begin with a particular letter. With index scrolling, a scroll
-indicator appears even when the user isn't scrolling. Touching or dragging it causes the current
-letter to pop up in a prominent way.</p>
-
-<div class="framed-nexus5-land-span-13">
- <video class="play-on-hover" autoplay>
- <source src="{@docRoot}design/media/scroll_index.mp4" type="video/mp4">
- <source src="{@docRoot}design/media/scroll_index.webm" type="video/webm">
- <source src="{@docRoot}design/media/scroll_index.ogv" type="video/ogg">
- </video>
-</div>
-<div class="figure-caption">
- <div class="video-instructions">&nbsp;</div>
-</div>
diff --git a/docs/html/design/building-blocks/seek-bars.jd b/docs/html/design/building-blocks/seek-bars.jd
deleted file mode 100644
index 04446d219051..000000000000
--- a/docs/html/design/building-blocks/seek-bars.jd
+++ /dev/null
@@ -1,45 +0,0 @@
-page.title=Seek Bars and Sliders
-page.tags=seekbar,progressbar
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/sliders.html">
- <div>
- <h3>Material Design</h3>
- <p>Sliders<p>
- </div>
-</a>
-
-<p>Interactive sliders make it possible to select a value from a continuous or discrete range of values
-by moving the slider thumb. The smallest value is to the left, the largest to the right. The
-interactive nature of the slider makes it a great choice for settings that reflect intensity levels,
-such as volume, brightness, or color saturation.</p>
-
-<div class="cols">
- <div class="col-9">
-
- <img src="{@docRoot}design/media/seekbar_example.png">
-
- </div>
- <div class="col-4">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<h4>Example</h4>
-<p>Interactive slider to set the ringer volume. The value can either be set through the hardware volume controls or interactively via a gesture.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-9">
-
- <img src="{@docRoot}design/media/seekbar_style.png">
- <div class="figure-caption">
- Seek bars in Holo Light &amp; Dark
- </div>
-
- </div>
- <div class="col-4">&nbsp;</div>
-</div>
diff --git a/docs/html/design/building-blocks/spinners.jd b/docs/html/design/building-blocks/spinners.jd
deleted file mode 100644
index 31c55585838c..000000000000
--- a/docs/html/design/building-blocks/spinners.jd
+++ /dev/null
@@ -1,54 +0,0 @@
-page.title=Spinners
-page.tags=spinner,dropdown
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/menus.html">
- <div>
- <h3>Material Design</h3>
- <p>Menus<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/spinner.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Spinners</p>
- </div>
-</a>
-
-<p itemprop="description">Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
-its currently selected value. Touching the spinner displays a dropdown menu with all other available
-values, from which the user can select a new one.</p>
-
-
-<div class="cols">
- <div class="col-6">
-
- <img src="{@docRoot}design/media/spinners_form.png">
-
-<h4>Spinners in forms</h4>
-<p>Spinners are useful for data picking in forms. They are compact and integrate nicely with other
-components. Use spinners in forms for both simple data input and in combination with other input
-fields. For example, a text field might let you edit an email address for a contact, while its
-associated spinner allows you to select whether it's a Home or Work address.</p>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/spinners_actionbar.png">
-
-<h4>Spinners in action bars</h4>
-<p>Use spinners in action bars to switch views. For example, Gmail uses a spinner to permit switching
-between accounts or commonly used labels. Spinners are useful when changing the view is important to
-your app, but not necessarily a frequent occurrence. In cases where view switching is frequent, use
-tabs.</p>
-
- </div>
-</div>
-
-<img src="{@docRoot}design/media/spinners_hololightanddark.png">
-<div class="figure-caption">
- Spinners in the Holo Dark and Holo Light themes, in various states.
-</div>
-
diff --git a/docs/html/design/building-blocks/switches.jd b/docs/html/design/building-blocks/switches.jd
deleted file mode 100644
index 9dd09caac84b..000000000000
--- a/docs/html/design/building-blocks/switches.jd
+++ /dev/null
@@ -1,64 +0,0 @@
-page.title=Switches
-page.tags=switch,checkbox,radiobutton,button
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/selection-controls.html">
- <div>
- <h3>Material Design</h3>
- <p>Selection Controls<p>
- </div>
-</a>
-
-<p>Switches allow the user to select options. There are three kinds of switches: checkboxes, radio
-buttons, and on/off switches.</p>
-
-
-
-<h2 id="checkboxes">Checkboxes</h2>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/checkbox.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Checkboxes</p>
- </div>
-</a>
-
-<p itemprop="description">Checkboxes allow the user to select multiple options from a set. Avoid using a single checkbox to
-turn an option off or on. Instead, use an on/off switch.</p>
-
- <img src="{@docRoot}design/media/switches_checkboxes.png">
-
-
-
-<h2 id="radio-buttons">Radio Buttons</h2>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/radiobutton.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Radio Buttons</p>
- </div>
-</a>
-
-<p>Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive
-selection if you think that the user needs to see all available options side-by-side. Otherwise,
-consider a spinner, which uses less space.</p>
-
- <img src="{@docRoot}design/media/switches_radios.png">
-
-
-
-<h2 id="switches">On/off Switches</h2>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/togglebutton.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Toggle Buttons</p>
- </div>
-</a>
-
-<p>On/off switches toggle the state of a single settings option.</p>
-
- <img src="{@docRoot}design/media/switches_switches.png">
-
-
diff --git a/docs/html/design/building-blocks/tabs.jd b/docs/html/design/building-blocks/tabs.jd
deleted file mode 100644
index 1315a2fbd85e..000000000000
--- a/docs/html/design/building-blocks/tabs.jd
+++ /dev/null
@@ -1,65 +0,0 @@
-page.title=Tabs
-page.tags=tabs,actionbar,navigation,viewpager
-@jd:body
-
-<img src="{@docRoot}design/media/tabs_overview.png">
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/tabs.html">
- <div>
- <h3>Material Design</h3>
- <p>Tabs<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}training/implementing-navigation/lateral.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Creating Swipe Views<br>with Tabs</p>
- </div>
-</a>
-
-<p itemprop="description">Tabs in the action bar make it easy to explore and switch between different views or functional
-aspects of your app, or to browse categorized data sets.</p>
-
-<p>For details on using gestures to move between tabs, see the <a href="{@docRoot}design/patterns/swipe-views.html">Swipe Views</a> pattern.</p>
-
-<h2 id="scrollable">Scrollable Tabs</h2>
-
-
-<div class="cols">
- <div class="col-6">
-
-<p>Scrolling tab controls can contain a larger number of items than a standard tab control. To navigate
-to the next/previous view, swipe left or right.</p>
-
- </div>
- <div class="col-7">
-
- <video width="400" class="with-shadow play-on-hover" autoplay>
- <source src="{@docRoot}design/media/tabs_scrolly.mp4" type="video/mp4">
- <source src="{@docRoot}design/media/tabs_scrolly.webm" type="video/webm">
- <source src="{@docRoot}design/media/tabs_scrolly.ogv" type="video/ogg">
- </video>
- <div class="figure-caption">
- Scrolling tabs in the Play Store app.
- <div class="video-instructions-image">&nbsp;</div>
- </div>
-
- </div>
-</div>
-
-
-<h2 id="fixed">Fixed Tabs</h2>
-<p>Fixed tabs display all items concurrently. To navigate to a different view, touch the tab, or swipe left or right.</p>
-<p>Fixed tabs are displayed with equal width, based on the width of the widest tab label. If there is insufficient room to display all tabs, the tab labels themselves will be scrollable. For this reason, fixed tabs are best suited for displaying 3 or fewer tabs.</p>
-
-<img src="{@docRoot}design/media/tabs_standard.png">
-<div class="figure-caption">
- Tabs in Holo Dark &amp; Light.
-</div>
-
-<img src="{@docRoot}design/media/tabs_youtube.png">
-<div class="figure-caption">
- Tabs in the Google Play Movies app.
-</div>
diff --git a/docs/html/design/building-blocks/text-fields.jd b/docs/html/design/building-blocks/text-fields.jd
deleted file mode 100644
index 9403679154c8..000000000000
--- a/docs/html/design/building-blocks/text-fields.jd
+++ /dev/null
@@ -1,88 +0,0 @@
-page.title=Text Fields
-page.tags=text,edittext,input
-@jd:body
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/components/text-fields.html">
- <div>
- <h3>Material Design</h3>
- <p>Text Fields<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/controls/text.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Text Fields</p>
- </div>
-</a>
-
-<p itemprop="description">Text fields allow the user to type text into your app. They can be either single line or multi-line.
-Touching a text field places the cursor and automatically displays the keyboard. In addition to
-typing, text fields allow for a variety of other activities, such as text selection (cut, copy,
-paste) and data lookup via auto-completion.</p>
-
-
-<div class="cols">
- <div class="col-12">
-
- <img src="{@docRoot}design/media/text_input_singlevsmultiline.png">
-
- </div>
-</div>
-
-<h4>Single line and multi line</h4>
-<p>Single-line fields automatically scroll their content to the left as the text input cursor reaches
-the right edge of the input field. Multi-line text fields automatically break to a new line for
-overflow text and scroll vertically when the cursor reaches the lower edge.</p>
-
-<img src="{@docRoot}design/media/text_input_typesandtypedown.png">
-
-<div class="cols">
- <div class="col-6">
-
-<h4>Text field types</h4>
-<p>Text fields can have different types, such as number, message, or email address. The type determines
-what kind of characters are allowed inside the field, and may prompt the virtual keyboard to
-optimize its layout for frequently used characters.</p>
-
- </div>
- <div class="col-6">
-
-<h4>Auto-complete text fields</h4>
-<p>Use auto-complete text fields to present real-time completions or search results in popups, so users
-can enter information more accurately and efficiently.</p>
-
- </div>
-</div>
-
-<h2 id="text-selection">Text Selection</h2>
-
-<p>Users can select any word in a text field with a long press. This action triggers a text selection
-mode that facilitates extending the selection or choosing an action to perform on the selected text.
-Selection mode includes:</p>
-
-<div class="cols">
- <div class="col-9">
-
- <img src="{@docRoot}design/media/text_input_textselection.png">
-
- </div>
- <div class="col-4 with-callouts">
-
-<ol>
-<li>
-<h4>Contextual action bar</h4>
-<p>A contextual action bar (CAB) displays the actions available to perform on the selection:
- typically cut, copy, and paste, but apps can insert additional commands as needed.</p>
-</li>
-<li>
-<h4>Selection handles</h4>
-<p>Selection handles can be dragged to select more or less text while remaining in selection mode.</p>
-</li>
-</ol>
-
- </div>
-</div>
-
diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs
index 63f5cadbd56c..85569ef6e252 100644
--- a/docs/html/design/design_toc.cs
+++ b/docs/html/design/design_toc.cs
@@ -1,15 +1,15 @@
<ul id="nav">
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>design/index.html">Get Started</a></div>
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/get-started/creative-vision.html">Creative Vision</a></div>
<ul>
- <li><a href="<?cs var:toroot ?>design/get-started/creative-vision.html">Creative Vision</a></li>
<li><a href="<?cs var:toroot ?>design/get-started/principles.html">Design Principles</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/new.html">New in Android</a></li>
</ul>
</li>
<li class="nav-section">
- <div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/material/index.html">Material Design</a></div>
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/material/index.html">Material for Android</a></div>
</li>
<li class="nav-section">
@@ -43,59 +43,20 @@
</li>
<li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>design/style/index.html">Style</a></div>
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>design/style/index.html">Pure Android</a></div>
<ul>
<li><a href="<?cs var:toroot ?>design/style/devices-displays.html">Devices and Displays</a></li>
- <li><a href="<?cs var:toroot ?>design/style/themes.html">Themes</a></li>
- <li><a href="<?cs var:toroot ?>design/style/touch-feedback.html">Touch Feedback</a></li>
- <li><a href="<?cs var:toroot ?>design/style/metrics-grids.html">Metrics and Grids</a></li>
- <li><a href="<?cs var:toroot ?>design/style/typography.html">Typography</a></li>
- <li><a href="<?cs var:toroot ?>design/style/color.html">Color</a></li>
- <li><a href="<?cs var:toroot ?>design/style/iconography.html">Iconography</a></li>
- <li><a href="<?cs var:toroot ?>design/style/branding.html">Your Branding</a></li>
- <li><a href="<?cs var:toroot ?>design/style/writing.html" zh-cn-lang="写作风格">Writing Style</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>design/patterns/index.html">Patterns</a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>design/patterns/new.html">New in Android</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/gestures.html">Gestures</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/app-structure.html">App Structure</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/navigation.html">Navigation</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/actionbar.html">Action Bar</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/navigation-drawer.html">Navigation Drawer</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/multi-pane-layouts.html">Multi-pane Layouts</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/notifications.html">Notifications</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/widgets.html">Widgets</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/swipe-views.html">Swipe Views</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/fullscreen.html">Full Screen</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/selection.html">Selection</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/confirming-acknowledging.html">Confirming &amp; Acknowledging</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/notifications.html">Notifications</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/widgets.html">Widgets</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/settings.html">Settings</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/help.html">Help</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/pure-android.html">Pure Android</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/compatibility.html">Compatibility</a></li>
<li><a href="<?cs var:toroot ?>design/patterns/accessibility.html">Accessibility</a></li>
- <li><a href="<?cs var:toroot ?>design/patterns/pure-android.html">Pure Android</a></li>
- </ul>
- </li>
-
- <li class="nav-section">
- <div class="nav-section-header"><a href="<?cs var:toroot ?>design/building-blocks/index.html">Building Blocks</a></div>
- <ul>
- <li><a href="<?cs var:toroot ?>design/building-blocks/tabs.html">Tabs</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/lists.html">Lists</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/grid-lists.html">Grid Lists</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/scrolling.html">Scrolling</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/spinners.html">Spinners</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/buttons.html">Buttons</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/text-fields.html">Text Fields</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/seek-bars.html">Seek Bars</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/progress.html">Progress &amp; Activity</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/switches.html">Switches</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/dialogs.html">Dialogs</a></li>
- <li><a href="<?cs var:toroot ?>design/building-blocks/pickers.html">Pickers</a></li>
+ <li><a href="<?cs var:toroot ?>design/patterns/help.html">Help</a></li>
</ul>
</li>
@@ -103,8 +64,8 @@
<div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/downloads/index.html">Downloads</a></div>
</li>
- <li class="nav-section">
+<!-- <li class="nav-section">
<div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/videos/index.html">Videos</a></div>
- </li>
+ </li> -->
</ul>
diff --git a/docs/html/design/downloads/index.jd b/docs/html/design/downloads/index.jd
index 0b9f59f8843d..089a4af6db95 100644
--- a/docs/html/design/downloads/index.jd
+++ b/docs/html/design/downloads/index.jd
@@ -3,107 +3,16 @@ page.tags=Icons,stencils,color swatches
@jd:body
-<p>You may use these materials without restriction to facilitate your app design
-and implementation.</p>
+<p>For icons, sticker sheets, and other downloadable resources, visit the
+<a href="http://www.google.com/design">Design site</a> or use the links below. </p>
-
-<h2 id="stencils">Phone &amp; Tablet Stencils</h2>
-
-<div class="cols">
- <div class="col-5">
-
-
-<p>Drag and drop your way to beautifully designed Android apps. The stencils feature the
-rich typography, colors, interactive controls, and icons found throughout Android, along with
-phone and tablet outlines to frame your creations. Source files for icons and controls are also
-available.</p>
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/downloads_stencils.png">
-
- </div>
-
- <div class="col-4">
- <a class="notice-designers-material"
- style="width:218px;"
- href="http://www.google.com/design/spec/resources/layout-templates.html">
- <div>
- <h3>Material Design</h3>
- <p>Layout Templates<p>
- </div>
- </a>
- </div>
-
- <div class="col-4">
- <a class="notice-designers-material"
- style="width:218px;"
- href="http://www.google.com/design/spec/resources/sticker-sheets-icons.html">
- <div>
- <h3>Material Design</h3>
- <p>Sticker Sheets<p>
- </div>
- </a>
- </div>
-
- <div class="col-4">
-<p>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Photoshop Sources');"
- href="{@docRoot}downloads/design/Android_Design_Stencils_Sources_20131106.zip">Adobe&reg; Photoshop&reg; Stencils and Sources</a>
-</p>
-
- </div>
-</div>
-
-
-
-
-
-
-<h2 id="action-bar-icon-pack">Action Bar Icon Pack</h2>
-
-<div class="cols">
- <div class="col-5">
-
-<p>Action bar icons are graphic buttons that represent the most important actions people can take
-within your app. <a href="{@docRoot}design/style/iconography.html">More on Action Bar Iconography</a></p>
-<p>The download package includes icons that are scaled for various screen densities and suitable for
-use with the Holo Light and Holo Dark themes. The package also includes unstyled icons that you can
-modify to match your theme, plus source files.</p>
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_actionbar_style.png">
-
- </div>
-
- <div class="col-4">
- <a class="notice-designers-material"
- style="width:218px;"
- href="http://www.google.com/design/spec/resources/sticker-sheets-icons.html">
- <div>
- <h3>Material Design</h3>
- <p>Sticker Sheets<p>
- </div>
- </a>
- </div>
-
- <div class="col-4">
-
-<p>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Action Bar Icons');"
- href="{@docRoot}downloads/design/Android_Design_Icons_20131106.zip">Action Bar Icon Pack</a>
-</p>
-
- </div>
+ <div class="resource-widget resource-flow-layout col-16"
+ data-query="collection:design/landing/resources"
+ data-cardSizes="6x2"
+ data-maxResults="6"></div>
</div>
-
-
-
<h2 id="Wear">Android Wear Materials</h2>
<div class="cols">
@@ -243,86 +152,4 @@ system indicators.
<a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Wear Watch Face Example Specifications');"
href="{@docRoot}downloads/design/Slide_IconExample.psd">Adobe&reg; Photoshop&reg; Icon</a>
</div>
-</div>
-
-
-
-
-<h2 id="style">Style</h2>
-
-<div class="cols">
- <div class="col-5">
-
-<h4 id="roboto">Roboto</h4>
-<p>Ice Cream Sandwich introduced a new type family named Roboto, created specifically for the
-requirements of UI and high-resolution screens.</p>
-<p>For Android Wear, Roboto Condensed is the system font and the Regular and Light variants should be used by all Wear apps.</p>
-<p><a href="{@docRoot}design/style/typography.html">More on Roboto</a></p>
-<p><a href="http://www.google.com/fonts/specimen/Roboto" class="external-link">Roboto on Google Fonts</a></p>
-<p><a href="http://www.google.com/fonts/specimen/Roboto+Condensed" class="external-link">Roboto Condensed on Google Fonts</a></p>
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/downloads_roboto_specimen_preview.png">
-
- </div>
-
- <div class="col-4">
- <a class="notice-designers-material"
- style="width:218px;"
- href="http://www.google.com/design/spec/resources/roboto-noto-fonts.html">
- <div>
- <h3>Material Design</h3>
- <p>Roboto Font<p>
- </div>
- </a>
- </div>
-
- <div class="col-4">
-
-<p>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Roboto ZIP');"
- href="{@docRoot}downloads/design/roboto-1.2.zip">Roboto</a>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Roboto Specemin Book');"
- href="{@docRoot}downloads/design/Roboto_Specimen_Book_20131031.pdf">Specimen Book</a>
-</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-5">
-
-<h4>Color</h4>
-<p>In Android's color palette, each color has a corresponding darker
-shade that can be used as a complement when needed.</p>
-<p><a href="{@docRoot}design/style/color.html">More on Color</a></p>
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/downloads_color_swatches.png">
-
- </div>
-
- <div class="col-4">
- <a class="notice-designers-material"
- style="width:218px;"
- href="http://www.google.com/design/spec/resources/color-palettes.html">
- <div>
- <h3>Material Design</h3>
- <p>Color Palettes<p>
- </div>
- </a>
- </div>
-
- <div class="col-4">
-
-<p>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Color Swatches');"
- href="{@docRoot}downloads/design/Android_Design_Color_Swatches_20120229.zip">Color Swatches</a>
-</p>
-
- </div>
-</div>
+</div> \ No newline at end of file
diff --git a/docs/html/design/get-started/creative-vision.jd b/docs/html/design/get-started/creative-vision.jd
index 3955494e42ac..974d5d0386ad 100644
--- a/docs/html/design/get-started/creative-vision.jd
+++ b/docs/html/design/get-started/creative-vision.jd
@@ -7,10 +7,9 @@ page.image=images/cards/design-creative-vision_2x.jpg
<div class="vspace size-1">&nbsp;</div>
<p itemprop="description">
- Starting with Ice Cream Sandwich, we focused the design of
- Android around these three overarching goals, which apply
- to our core apps as well as the system at large.
- As you work with Android, consider these goals.
+ Android design is shaped by three overarching goals for users that apply
+ to apps as well as the system at large. As you work with Android,
+ keep these goals in mind.
</p>
<div class="vspace size-1">&nbsp;</div>
diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd
index 74af6e7c3d14..638f35b27929 100644
--- a/docs/html/design/index.jd
+++ b/docs/html/design/index.jd
@@ -14,17 +14,14 @@ footer.hide=1
<img class="dac-hero-image" src="/design/media/hero-material-design.png">
</div>
<div class="col-1of2 col-pull-1of2">
- <h1 class="dac-hero-title">Up and running with Material Design</h1>
+ <h1 class="dac-hero-title">Up and running with material design</h1>
<p class="dac-hero-description">
- Android 5.0 introduces a design metaphor inspired by paper and ink that provides a reassuring sense of tactility.
+ Android uses a new design metaphor inspired by paper and ink that provides a reassuring
+ sense of tactility. Visit the <a href="http://www.google.com/design/spec/material-design/introduction">material design</a> site for more resources.
</p>
<a class="dac-hero-cta" href="https://www.google.com/design/spec/material-design/introduction.html">
<span class="dac-sprite dac-auto-chevron"></span>
- Introducing Material Design
- </a><br>
- <a class="dac-hero-cta" href="/design/material/index.html">
- <span class="dac-sprite dac-auto-chevron"></span>
- Material Design for Android
+ Introducing material design
</a><br>
<a class="dac-hero-cta" href="https://www.google.com/design/spec/resources/color-palettes.html">
<span class="dac-sprite dac-auto-chevron"></span>
@@ -56,7 +53,7 @@ footer.hide=1
<section class="dac-section dac-light"><div class="wrap">
<h1 class="dac-section-title">Pure Android</h1>
<div class="dac-section-subtitle">
- This is a place holder paragraph. Some text here would povide some context.
+ Design around Android's capabilities and conventions to give users the best experience.
</div>
<div class="resource-widget resource-flow-layout col-16"
data-query="collection:design/landing/pureandroid"
@@ -67,7 +64,7 @@ footer.hide=1
<section class="dac-section dac-gray"><div class="wrap">
<h1 class="dac-section-title">Resources</h1>
<div class="dac-section-subtitle">
- This is a place holder paragraph. Some text here would povide some context.
+ Essential downloads, stencils, and tools to help you create your design.
</div>
<div class="resource-widget resource-flow-layout col-16"
data-query="collection:design/landing/resources"
diff --git a/docs/html/design/patterns/gestures.jd b/docs/html/design/patterns/gestures.jd
deleted file mode 100644
index b471ee3e5521..000000000000
--- a/docs/html/design/patterns/gestures.jd
+++ /dev/null
@@ -1,135 +0,0 @@
-page.title=Gestures
-page.tags=gesture,input,touch
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/patterns/gestures.html">
- <div>
- <h3>Material Design</h3>
- <p>Gestures<p>
- </div>
-</a>
-
-<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
-following table shows the core gesture set that is supported in Android.</p>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_touch.png">
- <h4>Touch</h4>
- <p>Triggers the default functionality for a given item.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, lift</p></li>
- </ul>
- </div>
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_longtouch.png">
- <h4>Long press</h4>
- <p>Enters data selection mode. Allows you to select one or more items in a view and act upon
- the data using a contextual action bar. Avoid using long press for showing contextual menus.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, wait, lift</p></li>
- </ul>
- </div>
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_swipe.png">
- <h4>Swipe or drag</h4>
- <p>Scrolls overflowing content, or navigates between views in the same hierarchy. Swipes are
- quick and affect the screen even after the finger is picked up. Drags are slower and more precise,
- and the screen stops responding when the finger is picked up.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Press, move, lift</p></li>
- </ul>
- </div>
-
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_drag.png">
- <h4>Long press drag</h4>
- <p>Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Long press, move, lift</p></li>
- </ul>
- </div>
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_doubletouch.png">
- <h4>Double touch </h4>
- <p> Scales up a standard amount around the target with each repeated gesture until reaching
- maximum scale. For nested views, scales up the smallest targetable view, or returns it to
- its original scale. Also used as a secondary gesture for text selection.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>Two touches in quick succession</p>
- </li>
- </ul>
- </div>
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_doubletouchdrag.png">
- <h4>Double touch drag</h4>
- <p>Scales content by pushing away or pulling closer, centered around gesture.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>A single touch followed in quick succession by a drag up or down:</p>
- <ul style="padding-left:1.5em;list-style-type:disc;">
- <li>Dragging up decreases content scale</li>
- <li>Dragging down increases content scale</li>
- <li>Reversing drag direction reverses scaling.</li>
- </ul>
- </li>
- </ul>
- </div>
-
-</div>
-
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_pinchopen.png" style="margin-left:-4px">
- <h4>Pinch open</h4>
- <p>Zooms into content.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>2-finger press, move outwards, lift</p></li>
- </ul>
- </div>
-
- <div class="col-4">
- <img src="{@docRoot}design/media/gesture_pinchclose.png">
- <h4>Pinch close</h4>
- <p>Zooms out of content.</p>
- <ul>
- <li class="no-bullet with-icon action">
- <h4>Action</h4>
- <p>2-finger press, move inwards, lift</p>
- </li>
- </ul>
- </div>
-
-</div>
-
diff --git a/docs/html/design/patterns/index.jd b/docs/html/design/patterns/index.jd
deleted file mode 100644
index e091a29ca5e8..000000000000
--- a/docs/html/design/patterns/index.jd
+++ /dev/null
@@ -1,30 +0,0 @@
-page.title=Patterns
-header.justLinks=1
-footer.hide=1
-@jd:body
-
-<style>
-#landing-graphic-container {
- position: relative;
-}
-
-#text-overlay {
- position: absolute;
- left: 0;
- top: 492px;
- width: 200px;
-}
-</style>
-
-<div id="landing-graphic-container">
- <div id="text-overlay">
- <span itemprop="description">Design apps that behave in a consistent, predictable
- fashion.</span>
- <br><br>
- <a href="{@docRoot}design/patterns/new.html" class="landing-page-link">New in Android</a>
- </div>
-
- <a href="{@docRoot}design/patterns/new.html">
- <img src="{@docRoot}design/media/patterns_landing.png">
- </a>
-</div>
diff --git a/docs/html/design/patterns/multi-pane-layouts.jd b/docs/html/design/patterns/multi-pane-layouts.jd
deleted file mode 100644
index c9d3d841d946..000000000000
--- a/docs/html/design/patterns/multi-pane-layouts.jd
+++ /dev/null
@@ -1,130 +0,0 @@
-page.title=Multi-pane Layouts
-page.tags="tablet","navigation","layout","fragment"
-page.metaDescription=Design guide with examples of how to flatten navigation and provide improved layout across the range of Android devices.
-
-@jd:body
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/layout/structure.html#structure-ui-regions">
- <div>
- <h3>Material Design</h3>
- <p>UI Regions and Guidance<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}training/basics/fragments/index.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Building a Dynamic UI with Fragments</p>
- </div>
-</a>
-
-<p>When writing an app for Android, keep in mind that Android devices
-come in many different screen sizes and types. Make sure that your app consistently provides a
-balanced and aesthetically pleasing layout by adjusting its content to varying screen sizes and
-orientations.</p>
-
-<p><em>Panels</em> are a great way for your app to achieve this. They allow you to combine multiple views into
-one compound view when a lot of horizontal screen real estate is available and by splitting them up
-when less space is available.</p>
-<h2 id="combining-views">Combining Multiple Views Into One</h2>
-
-<p>On smaller devices your content is typically divided into a master grid or list view and a detail
-view. Touching an item in the master view opens a different screen showing that item's detail
-information.</p>
-
-<img src="{@docRoot}design/media/multipane_views.png">
-
-<p>Because tablets have more screen real estate than phones, you can use panels to combine the related
-list and detail views into a single compound view. This uses the additional space more efficiently
-and makes navigating the app easier. </p>
-
-<img src="{@docRoot}design/media/multipane_view_tablet.png">
-
-<p>In general, use the pane on the right to present more information about the item you selected in the
-left pane. Make sure to keep the item in the left pane selected in order to establish the
-relationship between the panels.</p>
-<h2 id="orientation">Compound Views and Orientation Changes</h2>
-
-<p>Screens should strive to have the same functionality regardless of orientation. If you use a compound view in
-one orientation, try not to split it up when the user rotates the screen. There are several techniques
-you can use to adjust the layout after orientation change while keeping functional parity intact.</p>
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/multipane_stretch.png">
-
- </div>
- <div class="col-5">
-
-<h4>Stretch/compress</h4>
-<p>Adjust the column width of your left pane to achieve a balanced layout in both orientations.</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/multipane_stack.png">
-
- </div>
- <div class="col-5">
-
-<h4>Stack</h4>
-<p>Rearrange the panels on your screen to match the orientation.</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/multipane_expand.png">
-
- </div>
- <div class="col-5">
-
-<h4>Expand/collapse</h4>
-<p>When the device rotates, collapse the left pane view to only show the most important information.</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/multipane_show.png">
-
- </div>
- <div class="col-5">
-
-<h4>Show/hide</h4>
-<p>If your screen cannot accommodate the compound view on rotation show the right pane in full screen view on rotation to portrait. Use the Up icon in action bar to show the parent screen.</p>
-
- </div>
-</div>
-
-
-
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Plan in advance on how your app scales to different screen sizes and screen orientations.</p>
-</li>
-<li>
-<p>Identify the most appropriate method for the panels in your compound views to reorganize
- themselves when screen orientation changes.</p>
-</li>
-<li>
-<p>Look for opportunities to consolidate your views into multi-panel compound views.</p>
-</li>
-<li>
-<p>Make sure that your screens try to provide functional parity after the screen orientation
- changes.</p>
-</li>
-</ul>
diff --git a/docs/html/design/patterns/navigation-drawer.jd b/docs/html/design/patterns/navigation-drawer.jd
deleted file mode 100644
index b359470140d3..000000000000
--- a/docs/html/design/patterns/navigation-drawer.jd
+++ /dev/null
@@ -1,346 +0,0 @@
-page.title=Navigation Drawer
-page.tags=DrawerLayout,SlidingPaneLayout
-@jd:body
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/layout/structure.html#structure-side-nav">
- <div>
- <h3>Material Design</h3>
- <p>Side Nav<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}training/implementing-navigation/nav-drawer.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Creating a Navigation Drawer</p>
- </div>
-</a>
-
-
-<p>The navigation drawer is a panel that transitions in from the left edge of the screen and
-displays the app’s main navigation options.</p>
-
-
-<h4>Displaying the navigation drawer</h4>
-
-<p>The user can bring the navigation drawer onto the screen by swiping from the left edge of the
-screen or by touching the application icon on the action bar.</p>
-
-<p>As the navigation drawer expands, it overlays the content but not the action bar. When the
-drawer is fully extended, the action bar adjusts its content by replacing the current action
-bar title with the app name and removing all actions that are contextual to the view underneath
-the navigation drawer. The overflow menu with the standard action items for Settings and Help
-remains visible.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_overview.png">
-<div class="figure-caption">
- The user can open the drawer panel by touching the navigation drawer indicator.
-</div>
-
-<p>Because they are transient, navigation drawers make views less cluttered. You can also use
-them at deeper levels in the navigation hierarchy, allowing users to switch to your app's most
-important screens from anywhere in the app.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_open_from_lower.png">
-<div class="figure-caption">
- Open the drawer from anywhere in your app by swiping from the left edge of the screen.
-</div>
-
-
-<h4>Dismissing the navigation drawer</h4>
-
-<p> When the navigation drawer is expanded, the user can dismiss it in one of four ways: </p>
-<ul>
- <li>Touching the content outside the navigation drawer</li>
- <li>Swiping to the left anywhere on the screen (including edge swipe from right)</li>
- <li>Touching the app icon/title in the action bar</li>
- <li>Pressing Back</li>
-</ul>
-
-
-<h2 id="WhenToUse"> When to Use the Navigation Drawer </h2>
-
-<p> The navigation drawer is not a general replacement for top-level navigation via spinners
-or tabs. The structure of your app should guide your choice of which pattern to use for
-top-level switching. For more information on top-level switching mechanisms, see the
-<a href="{@docRoot}design/patterns/app-structure.html">Application Structure</a> design pattern.</p>
-<p> Here are some examples of where navigation drawers work best:</p>
-
-<h4>More than 3 top-level views</h4>
-<p> Navigation drawers are great for displaying a large number of navigation targets
-concurrently. Use the navigation drawer if you have more than 3 unique top-level views.
-If not, use fixed tabs for top-level organization to ease discovery and interaction.</p>
-
-<h4>Cross-navigation from lower levels</h4>
-<p> If your app requires cross-navigating between lower-level screens, consider using the
-navigation drawer. Because it is accessible from anywhere in the app, the drawer enables
-efficient navigation from lower-level screens to other important places in your app.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_cross_nav.png">
-<div class="figure-caption">
- The navigation drawer makes cross-navigation at lower levels possible.
-</div>
-
-
-<h4>Deep navigation branches</h4>
-<p> If you have particularly deep branches, navigating to the top-level of your app can become
-repetitive and cumbersome with Up and Back alone. Since navigation drawers are accessible from
-anywhere in the app, navigation up to the top level is faster and more efficient.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_quick_to_top.png">
-<div class="figure-caption">
- The navigation drawer allows for quick jumps to the top-level of your app, removing the need
- for repetitive Back or Up sequences.
-</div>
-
-
-<h2 id="Hubs">Navigation Hubs</h2>
-
-<p>The navigation drawer is a reflection of your app’s structure and displays its major
-navigation hubs. Think of navigation hubs as those places in your app that a user will want
-to visit frequently or use as a jumping-off point to other parts of the app.
-At a minimum, the navigation hubs are the top-level views, since they correspond to your app’s
-major functional areas.</p>
-<p> If your app’s structure is deep, you can add screens from lower levels that your users will
-likely visit often and make those navigation hubs as well.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_navigation_hubs.png">
-<div class="figure-caption">
- The navigation drawer contains all of your app's navigation hubs. Include your top level
- screens as well as important lower-level screens.
-</div>
-
-<div class="cols">
- <div class="col-8">
- <p> To facilitate access to the navigation drawer on navigation hubs, all screens that
- correspond to an entry in your navigation drawer should show the navigation drawer indicator
- next to the application icon in the action bar. Touching the app icon causes the navigation
- drawer to slide in from the left. </p>
- <p> All other lower-level screens show the traditional Up indicator next to the application
- icon. The drawer is still accessible with an edge-swipe, but is not featured in the action bar.</p>
- </div>
- <div class="col-5">
- <img src="{@docRoot}design/media/navigation_drawer_indicator_big.png">
- <div class="figure-caption">
- App icon with navigation drawer indicator.
- </div>
- </div>
-</div>
-
-
-<h2 id="Content">Content of the Navigation Drawer</h2>
-
-<p> Keep the content of the navigation drawer focused on app navigation. Expose the navigation
-hubs of your app as list items inside the navigation drawer - one item per row.
-
-<div class="cols">
- <div class="col-8">
- <h4>Titles, icons, and counters</h4>
- <p> You can structure navigation targets by adding titles. The titles are not interactive,
- but just organize navigation targets into functional topics. If you have many navigation
- targets, use titles to orient the user within the drawer.</p>
- <p> Navigation targets can have optional leading icons as well as trailing counters. Use
- the counters to inform users about a changed state of data in the corresponding view.</p>
- </div>
- <div class="col-5">
- <img src="{@docRoot}design/media/navigation_drawer_titles_icons.png">
- <div class="figure-caption">
- Use titles and icons to organize your drawer.
- </div>
- </div>
-</div>
-
-<div class="cols">
- <div class="col-8">
- <img src="{@docRoot}design/media/navigation_drawer_collapse.png">
- <div class="figure-caption">
- Collapsible navigation items are split. Use the left side for navigation and the right
- to collapse and expand items.
- </div>
- </div>
- <div class="col-5">
- <h4>Collapsible navigation items</h4>
- <p>If you have many views with some subordinate to others, consider collapsing them into one
- expandable item to conserve space.
- The parent in the navigation drawer then turns into a split item. The left side allows
- navigation to the parent item’s view, and the right side collapses or expands the list of
- child items. </p>
- <p> At launch, the initial state of the collapsible items is up to you. As a rule, all
- top-level view entries of the navigation drawer should be visible. If you have many collapsible
- items, consider collapsing all items to allow the user to see the top-level views in their
- entirety.</p>
- <p> When the user opens the drawer from a lower-level screen, expand the associated branch
- of the top-level view to give a stronger sense of place and highlight navigation opportunities
- close to the user’s current
- location in the app.</p>
- </div>
-</div>
-
-
-<h2 id="ActionBar">Navigation Drawers and Action Bars</h2>
-
-<p> When the user expands the navigation drawer, the task focus switches to selecting an item
-from the drawer. Because the drawer does not overlay the action bar, users may not realize that
-the items in the action bar do not pertain to the navigation drawer. </p>
-<p> To reduce confusion, adjust the content of the action bar to the following, once the drawer
-is fully expanded:</p>
-<ul>
- <li>App icon</li>
- <li>App name</li>
- <li>Remove actions from the action bar that are contextual to the underlying view (such as
- Create new, Refresh). You may retain actions with global scope, such as “Search”.</li>
- <li>Overflow menu with expected navigation targets, such as Settings and Help.</li>
-</ul>
-
-<img src="{@docRoot}design/media/navigation_drawer_open_overflow.png">
-<div class="figure-caption">
- Clean up the action bar when the drawer is fully expanded. Remove actions that are not needed
- and display your app's name in the title area.
-</div>
-
-<h4>Actions</h4>
-<div class="cols">
- <div class="col-6">
- <img src="{@docRoot}design/media/navigation_drawer_nav_and_actions.png">
- <div class="figure-caption">
- Keep actions on the right side of the action bar and in the overflow
- </div>
- </div>
- <div class="col-6">
- <p> Don’t place actions in the navigation drawer. Actions belong in the action bar, and the
- user expects to see them there. Keep in mind that not all applications use the navigation
- drawer pattern. It may be tempting to expose all your app’s capabilities in a single place,
- but keep the bigger picture in mind. Place your actions where all apps display them.</p>
- </div>
-</div>
-<div class="cols">
- <div class="col-6">
- <p> This also applies to common navigation targets, such as access to Help or the app’s
- Settings. As per style guide convention Help and Settings are always located in the action
- overflow.</p>
- </div>
- <div class="col-6">
- <img src="{@docRoot}design/media/navigation_drawer_settings_help.png">
- <div class="figure-caption">
- Keep Help and Settings in the overflow.
- </div>
- </div>
-</div>
-
-
-<h4>Contextual action bars</h4>
-<p> Sometimes the user will be in a state where a contextual action bar (CAB) appears instead
-of the app’s action bar. This typically happens when the user selects text or selects multiple
-items after a press-and-hold gesture. While the CAB is visible, you should still allow the
-user to open the navigation drawer using an edge swipe. However, replace the CAB with the
-standard action bar while the navigation drawer is open. When the user dismisses the drawer,
-re-display the CAB.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_CAB.png">
-<div class="figure-caption">
- Hide contextual action bars while the drawer is visible.
-</div>
-
-<p>If the user navigates away from a view with selected content, deselect the content before
-before navigating to the new view.</p>
-
-
-<h2 id="Interaction">Interaction Details</h2>
-
-<h4>Introduce the user to the drawer at first use</h4>
-<p> Upon first launch of your app, introduce the user to the navigation drawer by
-automatically opening it. This ensures that users know about the navigation drawer and prompts
-them to learn about the structure of your app by exploring its content. Continue showing the
-drawer upon subsequent launches until the user actively expands the navigation drawer manually.
-Once you know that the user understands how to open the drawer, launch the app with the
-navigation drawer closed. </p>
-
-<img src="{@docRoot}design/media/navigation_drawer_first_run.png">
-<div class="figure-caption">
- At first use, show the navigation drawer automatically to help the user learn the
- functionality and structure of your app.
-</div>
-
-<h4>Give the user a quick peek</h4>
-<p> If the user touches the very left edge of the screen (within 20 dp from the left), have the
-drawer peek out as soon as the finger makes contact with the display. This promotes accidental
-discovery and provides richer feedback. </p>
-
-<img src="{@docRoot}design/media/navigation_drawer_peek.png">
-<div class="figure-caption">
- The navigation drawer peeks out when the user touches the very left edge of the screen.
-</div>
-
-<h4>Highlights</h4>
-<p> When you open the navigation drawer from a screen that is represented inside the drawer,
-highlight its entry in the drawer. Vice versa, if you open the drawer from a screen that is
-not listed in the drawer, none of the items of the drawer should be highlighted.</p>
-
-
-<h2 id="ImpactOnNav">Impact of Drawer on Overall App Navigation</h2>
-
-<p>The navigation drawer is an alternative to other top-level navigation patterns. To make apps
-with navigation drawers work consistently with apps that use a tab or spinner pattern, remember
-that all navigation requirements for system Back and Up apply.</p>
-<p>Pay special attention to the following situations:</p>
-
-<h4>System Back at the top level of the app</h4>
-<p>Touching System Back at the app’s top level never opens the navigation drawer. Instead,
-System Back behaves according to the navigation rules for the top level, such as navigating
-to the previous app within the task or navigating to the Home screen.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_top_out.png">
-<div class="figure-caption">
- System Back does not show the drawer, but behaves according to the navigation rules for
- the top level.
-</div>
-
-<h4>System Back after cross navigation to lower hierarchy levels</h4>
-<p>If the user navigates to a lower hierarchy screen from the navigation drawer and the screen
-has a direct parent, then the Back stack is reset and Back points to the target screen’s parent.
-This Back behavior is the same as when a user navigates into an app from a notification.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_reset_backstack.png">
-<div class="figure-caption">
- Reset the Back stack if your lower-level navigation target has direct parents.
-</div>
-
-
-<h2 id="Style">Style</h2>
-
-<p>The width of the navigation drawer depends on the content you want to display, but should be
-between a minimum of 240 dp and a maximum of 320 dp. The height of the individual line items
-should not fall below 48 dp. See the layout guideline below for recommendations on padding and
-spacing.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_layout.png">
-<div class="figure-caption">
- Layout guidelines for the navigation drawer.
-</div>
-
-
-<p>Pick the drawer background to best match your app’s theme. See the following examples
-for a Holo light and a Holo dark themed drawer.</p>
-
-<img src="{@docRoot}design/media/navigation_drawer_holo_dark_light.png">
-<div class="figure-caption">
- Navigation drawers in Holo light and Holo dark themed apps.
-</div>
-
-
-<h2 id="Checklist">Navigation Drawer Checklist</h2>
-
-<p>Even if you already support a similar navigation drawer, update your drawer to this
-pattern to make sure that:</p>
-<ul>
- <li>The action bar remains in place and adjusts its content.</li>
- <li>Your navigation drawer overlays the content.</li>
- <li>Any view represented in the drawer has a navigation drawer indicator in its action bar
- that allows the drawer to be opened by touching the app icon.</li>
- <li>You take advantage of the new visual drawer transition.</li>
- <li>Any view not represented in the drawer maintains the traditional Up indicator in its action bar.</li>
- <li>You stay in sync with the general navigation patterns for Up and Back.</li>
-</ul>
-
diff --git a/docs/html/design/patterns/selection.jd b/docs/html/design/patterns/selection.jd
deleted file mode 100644
index e00f726b920c..000000000000
--- a/docs/html/design/patterns/selection.jd
+++ /dev/null
@@ -1,123 +0,0 @@
-page.title=Selection
-page.tags=actionmode,navigation,contextual
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/patterns/selection.html">
- <div>
- <h3>Material Design</h3>
- <p>Selection<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/menus.html#context-menu">
- <div>
- <h3>Developer Docs</h3>
- <p>Menus: Creating Contextual Menus</p>
- </div>
-</a>
-
-
-<p>Android 3.0 changed the <em>long press</em> gesture&mdash;that is, a touch that's held in the same position for a moment&mdash;to be the global gesture to select data.. This affects the way you should
-handle multi-select and contextual actions in your apps.</p>
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6">
-
-<h4>What has changed?</h4>
-<p>In previous versions of Android, the long press gesture was universally used to display contextual
-actions for a given data item in a contextual menu.</p>
-<p>This pattern changed with Android 3.0. The long press gesture is now used to select data, combining
-contextual actions and selection management functions for selected data into a new element called
-the contextual action bar (CAB).</p>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/selection_context_menu.png">
- <div class="figure-caption">
- Traditional use of the long press gesture to show contextual menus.
- </div>
-
- </div>
-</div>
-
-<h4>Using the contextual action bar</h4>
-<p itemprop="description">The contextual action bar (CAB) is a temporary action bar that overlays your app's current action bar while data
-is selected. It appears after the user long-presses on a selectable data item.</p>
-
-<img src="{@docRoot}design/media/selection_cab_big.png">
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6">
-
-<p>From here the user can:</p>
-<ul>
-<li>Select additional data items by touching them.</li>
-<li>Trigger an action from the CAB that applies to all highlighted data items. The CAB then
- automatically dismisses itself.</li>
-<li>Dismiss the CAB via the navigation bar's Back button or the CAB's checkmark button. This removes
- the CAB along with all selection highlights.</li>
-</ul>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/selection_cab_example.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-6">
-
-<h4>Selecting CAB actions</h4>
-<p>You can decide which actions and elements appear in the CAB. Use the guidelines in the <a href="actionbar.html">Action Bar
-pattern</a> to decide which items to surface at the top level and which to move to the
-action overflow.</p>
-<h4>Dynamically adjust CAB actions</h4>
-<p>In most cases you need to adjust the actions in the CAB dynamically as the user adds more items to
-the selection. Actions that apply to a single selected data item don't necessarily apply to multiple
-selected data items of the same kind.</p>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/selection_adjusting_actions.png">
- <div class="figure-caption">
- Adjusting actions in the CAB as additional items are selected.
- </div>
-
- </div>
-</div>
-
-<div class="note develop">
-<p><strong>Developer Guide</strong></p>
- <p>For information about how to create a contextual action bar, read
- <a href="{@docRoot}guide/topics/ui/menus.html#CAB">Using the contextual action mode</a>.</p>
-</div>
-
-
-<h2 id="checklist">Checklist</h2>
-
-<ul>
-<li>
-<p>Whenever your app supports the selection of multiple data items, make use of the contextual action
- bar (CAB).</p>
-</li>
-<li>
-<p>Reserve the long press gesture for selection exclusively. Don't use it to display traditional
- contextual menus.</p>
-</li>
-<li>
-<p>If you don't support multi-selection within a list, long press should do nothing.</p>
-</li>
-<li>
-<p>Plan the actions you want to display inside of a CAB in the same way you would plan the actions
- inside your app's action bar.</p>
-</li>
-</ul>
diff --git a/docs/html/design/patterns/settings.jd b/docs/html/design/patterns/settings.jd
deleted file mode 100644
index 9ba837af0635..000000000000
--- a/docs/html/design/patterns/settings.jd
+++ /dev/null
@@ -1,708 +0,0 @@
-page.title=Settings
-page.tags=preferences,sharedpreferences
-@jd:body
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/patterns/settings.html">
- <div>
- <h3>Material Design</h3>
- <p>Settings<p>
- </div>
-</a>
-
-<a class="notice-developers" href="{@docRoot}guide/topics/ui/settings.html">
- <div>
- <h3>Developer Docs</h3>
- <p>Settings</p>
- </div>
-</a>
-
-
-<p itemprop="description">Settings is a place in your app where users indicate their preferences for how your app should
-behave. This benefits users because:</p>
-
-<ul>
-<li>You don't need to interrupt them with the same questions over and over when certain situations
-arise. The settings predetermine what will always happen in those situations (see design
-principle: <a href="{@docRoot}design/get-started/principles.html#decide-for-me">Decide for me but
-let me have the final say</a>).</li>
-<li>You help them feel at home and in control (see design principle:
-<a href="{@docRoot}design/get-started/principles.html#make-it-mine">Let me make it mine</a>).</li>
-</ul>
-
-<h2 id="flow-structure">Flow and Structure</h2>
-
-<h4 id="settings-access">Provide access to Settings in the action overflow</h4>
-
-<p>Settings is given low prominence in the UI because it's not frequently needed. Even if there's
-room in the <a href="{@docRoot}design/patterns/actionbar.html">action bar</a>, never make Settings
-an action button. Always keep it in the action overflow and label it "Settings". Place it below
-all other items except "Help".</p>
-
-<img src="{@docRoot}design/media/settings_overflow.png">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<h4 id="what-to-make-a-setting">Avoid the temptation to make everything a setting</h4>
-
-<p>Because Settings is a few navigational steps away, no matter how many items you have, they'll
-never clutter up the core part of your UI. This may seem like good news, but it also poses a
-challenge.</p>
-
-<p>Settings can be a tempting place to keep a lot of stuff&mdash;like a hall closet where things
-get stashed when you tidy up before company comes over. It's not a place where you spend lots of
-time, so it's easy to rationalize and ignore its cluttered condition. But when users visit
-Settings&mdash;however infrequently&mdash;they'll have the same expectations for the experience as
-they do everywhere else in your app. More settings means more choices to make, and too many are
-overwhelming.</p>
-
-<p>So don't punt on the difficult product decisions and debates that can bring on the urge to
-"just make it a setting". For each control you're considering adding to Settings, make sure it
-meets the bar:</p>
-
-<img src="{@docRoot}design/media/settings_flowchart.png">
-
-<div class="vspace size-3">&nbsp;</div>
-
-<div class="cols">
- <div class="col-5 with-callouts">
-
-<h4 id="group-settings">If you still have lots of settings, group related settings together</h4>
-
-<p>The number of items an average human can hold in short-term memory is 7&plusmn;2. If you
-present a list of 10 or more settings (even after applying the criteria above), users will have
-more difficulty scanning, comprehending, and processing them.</p>
-
-<p>You can remedy this by dividing some or all of the settings into groups, effectively turning
-one long list into multiple shorter lists. A group of related settings can be presented in one of
-two ways:</p>
-
-<ol>
-<li><h4>Under a section divider</h4></li>
-<li><h4>In a separate subscreen</h4></li>
-</ol>
-
-<p>You can use one or both these grouping techniques to organize your app's settings.</p>
-
-<p>For example, in the main screen of the Android Settings app, each item in the list navigates
-to a subscreen of related settings. In addition, the items themselves are grouped under section
-dividers.</p>
-
- </div>
- <div class="col-8">
-
- <img src="{@docRoot}design/media/settings_grouping.png">
-
- </div>
-</div>
-
-<p>Grouping settings is not an exact science, but here's some advice for how to approach it, based
-on the total number of settings in your app.</p>
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols">
- <div class="col-2">
-
-<h4>7 or fewer</h4>
-
- </div>
- <div class="col-11">
-
-<p>Don't group them at all. It won't benefit users and will seem like overkill.</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-2">
-
-<h4>8 to 10</h4>
-
- </div>
- <div class="col-11">
-
-<p>Try grouping related settings under 1 or 2 section dividers. If you have any "singletons"
-(settings that don't relate to any other settings and can't be grouped under your section
-dividers), treat them as follows:</p>
-
-<ul>
-<li>If they include some of your most important settings, list them at the top without a section
-divider.</li>
-<li>Otherwise, list them at the bottom with a section divider called "OTHER", in order of
-importance.</li>
-</ul>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-2">
-
-<h4>11 to 15</h4>
-
- </div>
- <div class="col-11">
-
-<p>Same advice as above, but try 2 to 4 section dividers.</p>
-
-<p>Also, try the following to reduce the list:</p>
-
-<ul>
-<li>If 2 or more of the settings are mainly for power users, move them out of your main Settings
-screen and into an "Advanced" subscreen. Place an item in the action overflow called "Advanced" to
-navigate to it.</li>
-<li>Look for "doubles": two settings that relate to one another, but not to any other settings.
-Try to combine them into one setting, using the design patterns described later in this section.
-For example, you might be able to redesign two related checkbox settings into one multiple choice
-setting.</li>
-</ul>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-2">
-
-<h4>16 or more</h4>
-
- </div>
- <div class="col-11">
-
-<p>If you have any instances of 4 or more related settings, group them under a subscreen. Then use
-the advice suggested above for the reduced list size.</p>
-
- </div>
-</div>
-
-
-<h2 id="patterns">Design Patterns</h2>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Checkbox</h4>
-<p>Use this pattern for a setting that is either selected or not selected.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_checkbox.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Multiple choice</h4>
-<p>Use this pattern for a setting that needs to present a discrete set of options, from which the
-user can choose only one.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_multiple_choice.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Slider</h4>
-<p>Use this pattern for a setting where the range of values are not discrete and fall along a
-continuum.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_slider.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Date/time</h4>
-<p>Use this pattern for a setting that needs to collect a date and/or time from the user.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_date_time.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Subscreen navigation</h4>
-<p>Use this pattern for navigating to a subscreen or sequence of subscreens that guide the user
-through a more complex setup process.</p>
-<ul>
-<li>If navigating to a single subscreen, use the same title in both the subscreen and the label
-navigating to it.</li>
-<li>If navigating to a sequence of subscreens (as in this example), use a title that describes the
-first step in the sequence.</li>
-</ul>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_subscreen_navigation.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>List subscreen</h4>
-<p>Use this pattern for a setting or category of settings that contains a list of equivalent items.
-</p>
-<p>The label provides the name of the item, and secondary text may be used for status. (In this
-example, status is reinforced with an icon to the right of the label.) Any actions associated with
-the list appear in the action bar rather than the list itself.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_list_subscreen.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Master on/off switch</h4>
-<p>Use this pattern for a category of settings that need a mechanism for turning on or off as a
-whole.</p>
-<p>An on/off switch is placed as the first item in the action bar of a subscreen. When the switch
-is turned off, the items in the list disappear, replaced by text that describes why the list is
-empty. If any actions require the switch to be on, they become disabled.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_master_on_off.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<p>You can also echo the master on/off switch in the menu item that leads to the subscreen.
-However, you should only do this in cases where users rarely need to access the subscreen once
-it's initially set up and more often just want to toggle the switch.</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_master_on_off_2.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Individual on/off switch</h4>
-<p>Use this pattern for an individual setting that requires a more elaborate description than can
-be provided in checkbox form.</p>
-<p>The on/off switch only appears in the subscreen so that users aren't able to toggle it without
-also being exposed to the descriptive text. Secondary text appears below the setting label to
-reflect the current selection.</p>
-<p>In this example, Android Beam is on by default. Since users might not know what this setting
-does, we made the status more descriptive than just "On".</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_individual_on_off.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Dependency</h4>
-<p>Use this pattern for a setting that changes availability based on the value of another setting.
-</p>
-<p>The disabled setting appears below its dependency, without any indentation. If the setting
-includes a status line, it says "Unavailable", and if the reason isn't obvious, a brief
-explanation is included in the status.</p>
-<p>If a given setting is a dependency to 3 or more settings, consider using a subscreen with a
-master on/off switch so that your main settings screen isn't cluttered by lots of disabled items.
-</p>
-
- </div>
- <div class="col-10">
-
-<img src="{@docRoot}design/media/settings_dependency.png">
-
- </div>
-</div>
-
-<h2 id="defaults">Defaults</h2>
-
-<p>Take great care in choosing default values for each of your settings. Because settings
-determine app behavior, your choices will contribute to users' first impressions of your app. Even
-though users can change settings, they'll expect the initial states to be sensible. The following
-questions (when applicable) may help inform your decisions:</p>
-
-<ul>
-<li>Which choice would most users be likely to choose on their own if there were no default?</li>
-<li>Which choice is the most neutral or middle-of-the-road?</li>
-<li>Which choice is the least risky, controversial, or over-the-top?</li>
-<li>Which choice uses the least amount of battery or mobile data?</li>
-<li>Which choice best supports the design principle
-<a href="{@docRoot}design/get-started/principles.html#never-lose-my-stuff">Never lose my stuff</a>?</li>
-<li>Which choice best supports the design principle
-<a href="{@docRoot}design/get-started/principles.html#interrupt-only-if-important">Only interrupt
-me if it's important</a>?
-</li>
-</ul>
-
-<h2 id="writing">Writing Guidelines</h2>
-
-<h4>Label clearly and concisely</h4>
-
-<p>Writing a good label for a setting can be challenging because space is very limited. You only
-get one line, and it's incredibly short on the smallest of devices. Follow these guidelines to
-make your labels brief, meaningful, and scannable:</p>
-
-<ul>
-<li>Write each label in sentence case (i.e. only the first word and proper nouns are capitalized).
-</li>
-<li>Don't start a label with an instructional verb like "Set", "Change", "Edit", "Modify",
-"Manage", "Use", "Select", or "Choose". Users already understand that they can do these things to
-settings.</li>
-<li>Likewise, don't end a label with a word like "setting" or "settings". It's already implied.
-</li>
-<li>If the setting is part of a grouping, don't repeat the word(s) used in the section divider or
-subscreen title.</li>
-<li>Avoid starting a label with a negative word like "Don't" or "Never". For example, "Don't
-allow" could be rephrased to "Block".</li>
-<li>Steer clear of technical jargon as much as possible, unless it's a term widely understood by
-your target users. Use common verbs and nouns to convey the setting's purpose rather than its
-underlying technology.</li>
-<li>Don't refer to the user. For example, for a setting allowing the user to turn notifications on
-or off, label it "Notifications" instead of "Notify me".</li>
-</ul>
-
-<p>Once you've decided on labels for your settings, be sure to preview them on an
-<a href="{@docRoot}design/style/metrics-grids.html">LDPI handset</a> in portrait to make sure
-they'll fit everywhere.</p>
-
-<h4>Secondary text below is for status, not description&hellip;</h4>
-
-<p>Before Ice Cream Sandwich, we often displayed secondary text below a label to further describe
-it or provide instructions. Starting in Ice Cream Sandwich, we're using secondary text for status.
-</p>
-
-<div class="cols">
- <div class="col-4">
-
- <div class="do-dont-label bad emulate-content-left-padding">Before</div>
-
- <table class="ui-table bad emulate-content-left-padding">
- <thead>
- <tr>
- <th class="label">
- Screen timeout
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Adjust the delay before the screen automatically turns off
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-4">
-
- <div class="do-dont-label good">After</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- Sleep
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- After 10 minutes of inactivity
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-<p>Status in secondary text has the following benefits:</p>
-<ul>
-<li>Users can see at a glance what the current value of a setting is without having to navigate
-any further.</li>
-<li>It applies the design principle
-<a href="{@docRoot}design/get-started/principles.html#keep-it-brief">Keep it brief</a>, which
-users greatly appreciate.</li>
-</ul>
-
-<h4>&hellip;unless it's a checkbox setting</h4>
-<p>There's one important exception to the using secondary text for status: checkbox settings.
-Here, use secondary text for description, not status. Status below a checkbox is unnecessary
-because the checkbox already indicates it. The reason why it's appropriate to have a description
-below a checkbox setting is because&mdash;unlike other controls&mdash;it doesn't display a dialog
-or navigate to another screen where additional information can be provided.</p>
-
-<p>That said, if a checkbox setting's label is clear enough on its own, there's no need to also
-provide a description. Only include one if necessary.</p>
-
-<p>Follow these guidelines to write checkbox setting descriptions:</p>
-<ul>
-<li>Keep it to one sentence and don't use ending punctuation.</li>
-<li>Convey what happens when the setting is checked, phrased in the form of a command. Example:
-"Allow data exchange", not "Allows data exchange".</li>
-<li>Avoid repetition by choosing words that don't already appear in the label.</li>
-<li>Don't refer to the user unless it's necessary for understanding the setting.</li>
-<li>If you must refer to the user, do so in the second person ("you") rather than the first person
-("I"). Android speaks to users, not on behalf of them.</li>
-</ul>
-
-<h4>Writing examples</h4>
-
-<p>The following are examples of changes we made to labels and secondary text in the Settings app
-in Ice Cream Sandwich.</p>
-
-<div class="cols">
- <div class="col-4">
-
- <div class="do-dont-label bad emulate-content-left-padding">Before</div>
-
- <table class="ui-table bad emulate-content-left-padding">
- <thead>
- <tr>
- <th class="label">
- Use tactile feedback
- </th>
- </tr>
- </thead>
- </table>
-
- </div>
- <div class="col-4">
-
- <div class="do-dont-label good">After</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- Vibrate on touch
- </th>
- </tr>
- </thead>
- </table>
-
- </div>
- <div class="col-5">
-
-<p>In this checkbox setting, we eliminated the throwaway word "Use" and rephrased the label to be
-more direct and understandable.</p>
-
- </div>
-
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <div class="do-dont-label bad emulate-content-left-padding">Before</div>
-
- <table class="ui-table bad emulate-content-left-padding">
- <thead>
- <tr>
- <th class="label">
- Screen timeout
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Adjust the delay before the screen automatically turns off
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-4">
-
- <div class="do-dont-label good">After</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- Sleep
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- After 10 minutes of inactivity
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-5">
-
-<p>In this multiple choice setting, we changed the label to a friendlier term and also replaced
-the description with status. We put some descriptive words around the selected value, "10
-minutes", because on its own, the meaning could be misinterpreted as "sleep for 10 minutes".</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <div class="do-dont-label bad emulate-content-left-padding">Before</div>
-
- <table class="ui-table bad emulate-content-left-padding">
- <thead>
- <tr>
- <th class="label">
- Change screen lock
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Change or disable pattern, PIN, or password security
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-4">
-
- <div class="do-dont-label good">After</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- Screen lock
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Pattern
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-5">
-
-<p>This setting navigates to a a sequence of subscreens that allow users to choose a type of
-screen lock and then set it up. We eliminated the throwaway word "Change" in the label, and
-replaced the description with the current type of screen lock set up by the user. If the user
-hasn't set up a screen lock, the secondary text says "None".</p>
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <div class="do-dont-label bad emulate-content-left-padding">Before</div>
-
- <table class="ui-table bad emulate-content-left-padding">
- <thead>
- <tr>
- <th class="label">
- NFC
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Use Near Field Communication to read and exchange tags
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-4">
-
- <div class="do-dont-label good">After</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th class="label">
- NFC
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="secondary-text">
- Allow data exchange when the phone touches another device
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-5">
-
-<p>In this checkbox setting&mdash;although it's technical jargon&mdash;we kept the "NFC" label
-because: (1) we couldn't find a clear, concise alternative, and (2) user familiarity with the
-acronym is expected to increase dramatically in the next couple of years.</p>
-<p>We did, however, rewrite the description. It's far less technical than before and does a better
-job of conveying how and why you'd use NFC. We didn't include what the acronym stands for because
-it doesn't mean anything to most users and would have taken up a lot of space.</p>
-
- </div>
-</div>
-
-
-
-<h2 id="checklist">Checklist</h2>
-<ul>
-<li><p>Make sure each item in Settings meets the criteria for belonging there.</p></li>
-<li><p>If you have more than 7 items, explore ways to group related settings.</p></li>
-<li><p>Use design patterns wherever applicable so users don't face a learning curve.</p></li>
-<li><p>Choose defaults that are safe, neutral, and fit the majority of users.</p></li>
-<li><p>Give each setting a clear, concise label and use secondary text appropriately.</p></li>
-</ul>
diff --git a/docs/html/design/style/branding.jd b/docs/html/design/style/branding.jd
deleted file mode 100644
index 5995d03d589d..000000000000
--- a/docs/html/design/style/branding.jd
+++ /dev/null
@@ -1,128 +0,0 @@
-page.title=Your Branding
-page.tags=branding,logo
-@jd:body
-
-<p>Following Android design patterns doesn't mean that your app has to look the same as
-everyone else's. In Android, your app can shine as an extension of your brand. </p>
-
-<h2 id="color">Color</h2>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/color.html#color-ui-color-application">
- <div>
- <h3>Material Design</h3>
- <p>UI Color Application<p>
- </div>
-</a>
-
-<p>Use your brand color for accent by overriding the Android framework's default blue in UI elements like checkboxes, progress bars, radio buttons, sliders, tabs, and scroll indicators.</p>
-
-<p>Look for opportunities to use high-contrast color for emphasis, for example, as the background color of the action bar or a primary button. But don't go overboard: not all actions are equal, so use it only for the one or two most important things.</p>
-<p>When customizing colors, <a href="{@docRoot}design/style/touch-feedback.html">touch feedback</a>
- should be subtle &mdash; just slightly lighter or darker than the untouched color.</p>
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6">
- <img src="{@docRoot}design/media/branding_wallet.png" style="width:94%">
- <div class="figure-caption">
- The four colors of the Google Wallet logo provide a playful accent to the four dots
- that appear as the user enters a PIN.
- </div>
- </div>
- <div class="col-6">
- <img src="{@docRoot}design/media/branding_googlemusic.png" style="width:94%">
- <div class="figure-caption">
- The Google Play Music app has an orange theme color, which is used for emphasis
- in the action bar and for accent in the selected tab, scroll indicator, and
- hyperlinks.
- </div>
- </div>
-</div>
-
-<h2 id="logo">Logo</h2>
-
-<p>Your app's <a href="{@docRoot}design/style/iconography.html#launcher">launcher icon</a> is
- a key place to incorporate your logo, because it's what
- users will look for and touch to begin using your app. You can carry the launcher
- icon through to all the screens in your app by showing it in the
- <a href="{@docRoot}design/patterns/actionbar.html">action bar</a> along
- with the name of the app.</p>
-
-<p>Another approach to consider is to have your logo take the place of the launcher icon
-and app name in the action bar.</p>
-
-
-<div class="vspace size-1">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6" style="padding-top:24px;">
- <img src="{@docRoot}design/media/branding_launcher_icon.png" style="width:60px;float:left;padding-right:1em;">
- <div class="figure-caption" style="width:290px;margin-left:20px;">
- Google+ reinforces its brand by carrying its launcher icon through to the action bar.
- </div>
- <img src="{@docRoot}design/media/branding_logo_icon_action_bar.png" style="width:320px;float:left;padding-right:1em;">
- </div>
- <div class="col-6">
- <img src="{@docRoot}design/media/yourbranding_app.png" style="width:320px;">
- <div class="figure-caption" style="width:320px;">
- Example of a the logo in the action bar. This works well in cases where the brand's logo matches the name of the app.
- </div>
- </div>
-</div>
-
-<h2 id="logo">Icons</h2>
-
-<a class="notice-designers-material" href="http://www.google.com/design/spec/style/icons.html">
- <div>
- <h3>Material Design</h3>
- <p>Icons<p>
- </div>
-</a>
-
-<p>If you have icons that you're already using for your app on other platforms
-and they have a distinctive look intended to fit your brand, use them on your
-Android app as well. <strong>If you take this approach, make sure your brand styling is
-applied to every single icon in your app.</strong></p>
-
-
-<div class="cols">
- <div class="col-6">
- <p>One exception: For any icon in your existing set where the symbol is different from
- Android's, use Android's symbol but give it your brand's styling. That way, users will
- understand what the purpose of the icon is based on what they've learned in other
- Android apps (Design principle:
- <a href="{@docRoot}design/get-started/principles.html#give-me-tricks">Give me tricks that
- work everywhere</a>). But the icon will still look like it belongs with all of
- your other icons as a part of your brand.</p>
-
- </div>
-
- <div class="col-6">
- <img src="{@docRoot}design/media/yourbranding_in-app-icons.png" style="width:300px;margin:12px 48px 0 16px;">
- </div>
- </div>
-</div>
-
-<div class="cols">
- <div class="col-6">
- <p><strong>Example</strong>:<br />
- </p>
- <p>The brand's normal icon for sharing on other platforms is a right arrow.
- </div>
-
- <div class="col-6 lasyout-with-list-item-margins">
-
- <div style="margin-bottom:1em;">
- <span class="do-dont-label bad" style="margin-left:12px">Don't</span>
- <span style="margin-left: 64px;" class="do-dont-label good"><strong>Do</strong></span>
- </div>
- <img src="{@docRoot}design/media/yourbranding_sharing.png" style="width:180px;">
- </div>
-</div>
-
-<p>What if you don't already have your own icons &mdash; for example, if you're creating a
-brand new app only for Android? In this case, use Android's standard icons and rely
-more on color and logo for branding. Get the Action Bar Icon Pack, available for free
-in <a href="{@docRoot}design/downloads/index.html">Downloads</a>.</p>
diff --git a/docs/html/design/style/color.jd b/docs/html/design/style/color.jd
deleted file mode 100644
index 4c5f5abb3b6c..000000000000
--- a/docs/html/design/style/color.jd
+++ /dev/null
@@ -1,141 +0,0 @@
-page.title=Color
-@jd:body
-
-<style>
- .color-row {
- width: 760px;
- margin:0;
-
- display: -webkit-box;
- display: -moz-box;
- display: box;
-
- -webkit-box-orient: horizontal;
- -moz-box-orient: horizontal;
- box-orient: horizontal;
-
- cursor: pointer;
-
- -webkit-user-select: none;
- user-select: none;
- /* nested user-select in FF is broken as of Jan 2012, don't use it */
- }
-
- .color-row-container {
- line-height: 0; /* to remove more top space in FF for -moz-box elements */
- }
-
- .color-row-container + .color-row-container {
- margin-top: -10px !important;
- }
-
- .color-row li {
- margin-left: 0 !important;
- position: relative;
- list-style-type: none;
- height: 80px;
- display: block;
-
- -webkit-box-flex: 1;
- -moz-box-flex: 1;
- box-flex: 1;
- }
-
- .color-row li:before {
- display: none;
- }
-
- .color-row li.thin {
- height: 40px;
- }
-
- .color-row li span {
- display: none;
- position: absolute;
- top: -30px;
- left: 50%;
- margin-left: -2.5em;
- width: 5em;
- background-color: #fff;
- padding: 10px;
- font-weight: 600;
- line-height: 20px;
- text-align: center;
- box-shadow: 0 5px 5px rgba(0,0,0,0.1);
- cursor: text;
-
- -webkit-user-select: text;
- user-select: text;
- /* nested user-select in FF is broken as of Jan 2012, don't use it */
- }
-
- .color-row li:hover span {
- display: block;
- }
-
- /* triangle callout */
- .color-row li span:after {
- content: '';
- display: block;
- position: absolute;
- left: 50%;
- bottom: -16px;
- border: 8px solid transparent;
- border-top-color: #fff;
- width: 0;
- height: 0;
- margin-left: -8px;
- }
-</style>
-
-<a class="notice-designers-material" href="http://www.google.com/design/spec/style/color.html">
- <div>
- <h3>Material Design</h3>
- <p>Color<p>
- </div>
-</a>
-
-<p>Use color primarily for emphasis. Choose colors that fit with your brand and provide good contrast
-between visual components. Note that red and green may be indistinguishable to color-blind users.</p>
-
- <div class="color-row-container">
- <ul class="color-row">
- <li><span>#33b5e5</span></li>
- <li><span>#aa66cc</span></li>
- <li><span>#99cc00</span></li>
- <li><span>#ffbb33</span></li>
- <li><span>#ff4444</span></li>
- </ul>
- </div>
-
- <div class="color-row-container">
- <ul class="color-row">
- <li class="thin"><span>#0099cc</span></li>
- <li class="thin"><span>#9933cc</span></li>
- <li class="thin"><span>#669900</span></li>
- <li class="thin"><span>#ff8800</span></li>
- <li class="thin"><span>#cc0000</span></li>
- </ul>
- </div>
-
-<h2 id="palette">Palette</h2>
-
-<p>Blue is the standard accent color in Android's color palette. Each color has a corresponding darker
-shade that can be used as a complement when needed.</p>
-<p><a onClick="ga('send', 'event', 'Design', 'Download', 'Color Swatches (@color page)');"
- href="{@docRoot}downloads/design/Android_Design_Color_Swatches_20120229.zip">Download the swatches</a></p>
-
-<img src="{@docRoot}design/media/color_spectrum.png">
-
-<script>
- $(document).ready(function() {
- $('.color-row li').each(function() {
- var color = $(this).text();
- $(this).css('background-color', color);
- $(this).find('span')
- .css('color', color)
- .text(color.toUpperCase());
- });
-
- });
-</script>
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
deleted file mode 100644
index 8b6f3abc1fd7..000000000000
--- a/docs/html/design/style/iconography.jd
+++ /dev/null
@@ -1,601 +0,0 @@
-page.title=Iconography
-page.tags="icons"
-meta.tags="icons, googleplay, listing, branding"
-page.titleFriendly=Guidelines for creating your app's icons
-@jd:body
-
-<img src="{@docRoot}design/media/iconography_overview.png">
-
-
-<p>An icon is a graphic that takes up a small portion of screen real estate and provides a quick,
-intuitive representation of an action, a status, or an app.</p>
-
-<p>When you design icons for your app, it's important to keep in mind that your
-app may be installed on a variety of devices that offer a range of
-pixel densities, as mentioned in
-<a href="{@docRoot}design/style/devices-displays.html">Devices
-and Displays</a>. But you can make your icons look great on all devices
-by providing each icon in multiple sizes. When your app runs, Android checks the characteristics of
-the device screen and loads the appropriate density-specific assets for your app. </p>
-
-<p>Because you will deliver each icon in multiple sizes to support different densities,
-the design guidelines below
-refer to the icon dimensions in <acronym title="density-independent pixels">dp</acronym>
-units, which are based on the pixel dimensions of a medium-density (MDPI) screen.</p>
-
-<img src="{@docRoot}design/media/devices_displays_density@2x.png" alt="" height="160" />
-
-<p>So, to create an icon for different densities, you should follow the <strong>2:3:4:6:8
-scaling ratio</strong> between the five primary densities (medium, high, x-high, xx-high, and
-xxx-high respectively). For example, consider that the size for a launcher icon is specified to be
-48x48 dp. This means the baseline (MDPI) asset is 48x48 px, and the
-high-density(HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high
-density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.</p>
-
-<p class="note"><strong>Note:</strong> Android also supports low-density (LDPI) screens,
-but you normally don't need to create custom assets at this size because Android
-effectively down-scales your HDPI assets by 1/2 to match the expected size.</p>
-
-
-
-
-<h2 id="launcher">Launcher</h2>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/icons.html#icons-product-icons">
- <div>
- <h3>Material Design</h3>
- <p>Product Icons<p>
- </div>
-</a>
-
-<p>The launcher icon is the visual representation of your app on the Home or All Apps screen. Since the
-user can change the Home screen's wallpaper, make sure that your launcher icon is clearly visible on
-any type of background.</p>
-
-<div class="cols">
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_launcher_size.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_launcher_focal.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_launcher_style.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <h4>Sizes &amp; scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Launcher icons on a mobile device must be <strong>48x48 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- <li class="no-bullet with-icon web">
- <p>Launcher icons for display on Google Play must be <strong>512x512 pixels</strong>.</p></li>
- </ul>
-
- </div>
- <div class="col-4">
-
- <h4>Proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>48x48 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="col-4">
-
-<h4>Style</h4>
-<p>Use a distinct silhouette. Three-dimensional, front view, with a slight perspective as if viewed
-from above, so that users perceive some depth.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-4">
- &nbsp;
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/iconography_launcher_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-<div class="cols">
- <div class="col-12">
-
- <img src="{@docRoot}design/media/iconography_launcher_example2.png">
-
- <div class="vspace size-2">&nbsp;</div>
-
- </div>
- <!-- 1 free columns -->
-</div>
-
-
-<h2 id="action-bar">Action Bar</h2>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/icons.html#icons-system-icons">
- <div>
- <h3>Material Design</h3>
- <p>System Icons<p>
- </div>
-</a>
-
-<p>
-
-Action bar icons are graphic buttons that represent the most important actions people can take
-within your app. Each one should employ a simple metaphor representing a single concept that most
-people can grasp at a glance.
-
-</p>
-<p>
-
-Pre-defined glyphs should be used for certain common actions such as "refresh" and "share." The
-download link below provides a package with icons that are scaled for various screen densities and
-are suitable for use with the Holo Light and Holo Dark themes. The package also includes unstyled
-icons that you can modify to match your theme, in addition to Adobe&reg; Illustrator&reg; source
-files for further customization.
-
-</p>
-<p>
-<a onClick="ga('send', 'event', 'Design', 'Download', 'Action Bar Icons (@iconography page)');"
- href="{@docRoot}downloads/design/Android_Design_Icons_20131106.zip">Download the Action Bar Icon Pack</a>
-</p>
-
-<div class="cols">
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_actionbar_size.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_actionbar_focal.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_actionbar_style.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <h4>Sizes &amp; scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Action bar icons for phones should be <strong>32x32 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="col-4">
-
- <h4>Focal area &amp; proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>32x32 dp</strong></p>
- <p>Optical square, <strong>24x24 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="col-4">
-
-<h4>Style</h4>
-<p>Pictographic, flat, not too detailed, with smooth curves or sharp shapes. If the graphic is thin,
-rotate it 45&deg; left or right to fill the focal space. The thickness of the strokes and negative
-spaces should be a minimum of 2 dp.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-3">
-
-<h4>Colors</h4>
-<p>Colors: <strong>#333333</strong><br />
-Enabled: <strong>60%</strong> opacity<br />
-Disabled: <strong>30%</strong> opacity</p>
-<div class="vspace size-1">&nbsp;</div>
-
-<p>Colors: <strong>#FFFFFF</strong><br />
-Enabled: <strong>80%</strong> opacity<br />
-Disabled: <strong>30%</strong> opacity</p>
-
- </div>
- <div class="col-9">
-
- <img src="{@docRoot}design/media/iconography_actionbar_colors.png">
-
- </div>
-</div>
-
-
-<h2 id="small-contextual">Small / Contextual Icons</h2>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/icons.html#icons-system-icons">
- <div>
- <h3>Material Design</h3>
- <p>System Icons<p>
- </div>
-</a>
-
-<p>Within the body of your app, use small icons to surface actions and/or provide status for specific
-items. For example, in the Gmail app, each message has a star icon that marks the message as
-important.</p>
-
-
-<div class="cols">
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_small_size.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_small_focal.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_small_style.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <h4>Sizes &amp; scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Small icons should be <strong>16x16 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="col-4">
-
- <h4>Focal area &amp; proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>16x16 dp</strong></p>
- <p>Optical square, <strong>12x12 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="col-4">
-
-<h4>Style</h4>
-<p>Neutral, flat, and simple. Filled shapes are easier to see than thin strokes. Use a single visual
-metaphor so that a user can easily recognize and understand its purpose.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_small_colors.png">
-
- <div class="vspace size-2">&nbsp;</div>
-
-<h4>Colors</h4>
-<p>Use non-neutral colors sparingly and with purpose. For example, Gmail uses yellow in the star icon
-to indicate a bookmarked message. If an icon is actionable, choose a color that contrasts well with
-the background.</p>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/iconography_small_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-
-<h2 id="notification">Notification Icons</h2>
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/icons.html#icons-system-icons">
- <div>
- <h3>Material Design</h3>
- <p>System Icons<p>
- </div>
-</a>
-
-
-<p>If your app generates notifications, provide an icon that the system can display in the status bar
-whenever a new notification is available.</p>
-
-
-<div class="cols">
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_notification_size.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_notification_focal.png">
-
- </div>
- <div class="col-4">
-
- <img src="{@docRoot}design/media/iconography_notification_style.png">
-
- </div>
-</div>
-
-<div class="cols">
- <div class="col-4">
-
- <h4>Sizes &amp; scale</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Notification icons must be <strong>24x24 <acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi screen.">dp</acronym></strong>.</p></li>
- </ul>
-
- </div>
- <div class="col-4">
-
- <h4>Focal area &amp; proportions</h4>
-
- <ul>
- <li class="no-bullet with-icon tablet">
- <p>Full asset, <strong>24x24 dp</strong></p>
- <p>Optical square, <strong>22x22 dp</strong></p>
- </li>
- </ul>
-
- </div>
- <div class="col-4">
-
-<h4>Style</h4>
-<p>Keep the style flat and simple, using the same single, visual metaphor as your launcher icon.</p>
-
- </div>
-</div>
-
-
-<div class="cols">
- <div class="col-4">
-
-<h4>Colors</h4>
-<p>Notification icons must be entirely white. Also, the system may scale down and/or darken the icons.</p>
-
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/iconography_notification_example.png">
-
- </div>
- <!-- 2 free columns -->
-</div>
-
-
-
-
-
-
-
-
-
-
-<h2 id="DesignTips">Design Tips</h2>
-
-<p>Here are some tips you might find useful as you create icons or other
-drawable assets for your application. These tips assume you are using
-Adobe&reg; Photoshop&reg; or a similar raster and vector image-editing program.</p>
-
-
-
-
-<h3>Use vector shapes where possible</h3>
-
-<p>Many image-editing programs such as Adobe&reg; Photoshop&reg; allow you to use a
-combination of vector shapes and raster layers and effects. When possible,
-use vector shapes so that if the need arises, assets can be scaled up without
-loss of detail and edge crispness.</p>
-
-<p>Using vectors also makes it easy to align edges and corners to pixel
-boundaries at smaller resolutions.</li>
-
-
-
-<h3>Start with large artboards</h3>
-
-<p>Because you will need to create assets for different screen densities,
-it is best to start your icon
-designs on large artboards with dimensions that are multiples of the target icon
-sizes. For example, launcher icons are 48, 72, 96, or 144 pixels wide,
-depending on screen density (mdpi, hdpi, xhdpi, and xxhdpi, respectively). If you
-initially draw launcher icons on an 864x864 artboard, it will be easier and
-cleaner to adjust the icons when you scale the artboard down to the target
-sizes for final asset creation.</p>
-
-
-
-<h3>When scaling, redraw bitmap layers as needed</h3>
-
-<p>If you scaled an image up from a bitmap layer, rather than from a vector
-layer, those layers will need to be redrawn manually to appear crisp at higher
-densities. For example if a 60x60 circle was painted as a bitmap for
-mdpi it will need to be repainted as a 90x90 circle for hdpi.</p>
-
-
-
-<h3>Use common naming conventions for icon assets</h3>
-
-<p>Try to name files so that related assets will group together inside a
-directory when they are sorted alphabetically. In particular, it helps to use a
-common prefix for each icon type. For example:</p>
-
-<table>
-<tr>
-<th>Asset Type</th>
-<th>Prefix</th>
-<th>Example</th>
-</tr>
-<tr>
-<td>Icons</td>
-<td><code>ic_</code></td>
-<td><code>ic_star.png</code></td>
-</tr>
-<tr>
-<td>Launcher icons</td>
-<td><code>ic_launcher</code></td>
-<td><code>ic_launcher_calendar.png</code></td>
-</tr>
-<tr>
-<td>Menu icons and Action Bar icons</td>
-<td><code>ic_menu</code></td>
-<td><code>ic_menu_archive.png</code></td>
-</tr>
-<tr>
-<td>Status bar icons</td>
-<td><code>ic_stat_notify</code></td>
-<td><code>ic_stat_notify_msg.png</code></td>
-</tr>
-<tr>
-<td>Tab icons</td>
-<td><code>ic_tab</code></td>
-<td><code>ic_tab_recent.png</code></td>
-</tr>
-<tr>
-<td>Dialog icons</td>
-<td><code>ic_dialog</code></td>
-<td><code>ic_dialog_info.png</code></td>
-</tr>
-</table>
-
-<p>Note that you are not required to use a shared prefix of any
-type&mdash;doing so is for your convenience only.</p>
-
-
-<h3>Set up a working space that organizes files by density</h3>
-
-<p>Supporting multiple screen densities means you must create multiple versions
-of the same icon. To help keep the multiple copies of files safe and easier to
-find, we recommend creating a directory structure in your working space that
-organizes asset files based on the target density. For example:</p>
-
-<pre>
-art/...
- mdpi/...
- _pre_production/...
- <em>working_file</em>.psd
- <em>finished_asset</em>.png
- hdpi/...
- _pre_production/...
- <em>working_file</em>.psd
- <em>finished_asset</em>.png
- xhdpi/...
- _pre_production/...
- <em>working_file</em>.psd
- <em>finished_asset</em>.png
- xxhdpi/...
- _pre_production/...
- <em>working_file</em>.psd
- <em>finished_asset</em>.png
-</pre>
-
-<p>Because the structure in your working space is similar to that of the application, you
-can quickly determine which assets should be copied to each
-resources directory. Separating assets by density also helps you detect any
-variances in filenames across densities, which is important because
-corresponding assets for different densities must share the same filename.</p>
-
-<p>For comparison, here's the resources directory structure of a typical
-application: </p>
-
-<pre>res/...
- drawable-ldpi/...
- <em>finished_asset</em>.png
- drawable-mdpi/...
- <em>finished_asset</em>.png
- drawable-hdpi/...
- <em>finished_asset</em>.png
- drawable-xhdpi/...
- <em>finished_asset</em>.png
- drawable-xxhdpi/...
- <em>finished_asset</em>.png
-
- mipmap-ldpi/...
- <em>finished_launcher_asset</em>.png
- mipmap-mdpi/...
- <em>finished_launcher_asset</em>.png
- mipmap-hdpi/...
- <em>finished_launcher_asset</em>.png
- mipmap-xhdpi/...
- <em>finished_launcher_asset</em>.png
- mipmap-xxhdpi/...
- <em>finished_launcher_asset</em>.png
- mipmap-xxxhdpi/...
- <em>finished_launcher_asset</em>.png
-</pre>
-
-<p>For more information about how to save resources in the application project,
-see <a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a>.
-</p>
-
-<p> For more information about using the mipmap folders, see
-<a href="{@docRoot}tools/projects/index.html#mipmap">Managing Projects Overview</a>.</p>
-
-<h3 id="xxxhdpi-launcher">Provide an xxx-high-density launcher icon</h3>
-
-<p>Some devices scale-up the launcher icon by as much as 25%. For example, if your highest density
-launcher icon image is already extra-extra-high density, the scaling process will make it appear
-less crisp. So you should provide a higher density launcher icon in the <code>mipmap-xxxhdpi
-</code> directory, which the system uses instead of scaling up a smaller version of the icon.</p>
-
-<p class="note"><strong>Note:</strong> The <code>mipmap-xxxhdpi</code> qualifier is necessary
-only to provide a launcher icon that can appear larger than usual on an xxhdpi device. It is best
-practice to place all your launcher icons in the <code>res/mipmap-[density]/</code> folders. This
-enables your app to display launcher icons that have a higher density than the device, without
-scaling up a lower density version of the icon. You do not need to provide xxxhdpi assets for all
-your app's images.</p>
-
-<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> for
-more information.</p>
-
-
-<h3>Remove unnecessary metadata from final assets</h3>
-
-<p>Although the Android SDK tools will automatically compress PNGs when packaging
-application resources into the application binary, a good practice is to remove
-unnecessary headers and metadata from your PNG assets. Tools such as <a
-href="http://optipng.sourceforge.net/">OptiPNG</a> or <a
-href="http://pmt.sourceforge.net/pngcrush/">Pngcrush</a> can ensure that this
-metadata is removed and that your image asset file sizes are optimized.</p>
-
-
diff --git a/docs/html/design/style/metrics-grids.jd b/docs/html/design/style/metrics-grids.jd
deleted file mode 100644
index 97915b85e460..000000000000
--- a/docs/html/design/style/metrics-grids.jd
+++ /dev/null
@@ -1,90 +0,0 @@
-page.title=Metrics and Grids
-page.metaDescription=Optimize your app's UI by designing layouts based on density-independent grids.
-page.tags="layout","screens"
-meta.tags="multiple screens, layout, tablets"
-page.image=/design/media/metrics_closeup.png
-@jd:body
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/layout/metrics-keylines.html">
- <div>
- <h3>Material Design</h3>
- <p>Metrics and Keylines<p>
- </div>
-</a>
-
-
-<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
-inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
-falling into a particular size bucket and density bucket:</p>
-<ul>
- <li>The size buckets are <em>handset</em> (smaller than
-600<acronym title="Density-independent pixels: One dp is one pixel on a 160 dpi (mdpi)
-screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp).</li>
- <li>The density buckets are <acronym
-title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
-dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, <acronym title
-="Extra-high density (320 dpi)">XHDPI</acronym>, <acronym title
-="Extra-extra!-high density (480 dpi)">XXHDPI</acronym>, and <acronym title
-="Extra-extra-extra!-high density (640 dpi)">XXXHDPI</acronym>.</li>
-</ul>
-
-<p>Optimize your application's UI by designing
-alternative layouts for some of the different size buckets, and provide alternative bitmap images
-for different density buckets.</p>
-
-<p>Because it's important that you design and implement your layouts for multiple densities,
-the guidelines below and throught the documentation
-refer to layout dimensions with <acronym title="Density-independent pixels: One dp is one pixel
-on a 160 dpi (mdpi) screen.">dp</acronym> measurements instead of pixels.</p>
-
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/metrics_diagram.png">
-
- </div>
- <div class="col-5">
-
-<h4>Space considerations</h4>
-<p>Devices vary in the amount of density-independent pixels (dp) they can display.</p>
-<p>To see more, visit the
-<a href="http://developer.android.com/resources/dashboard/screens.html" target="_blank">
-Screen Sizes and Densities Device Dashboard</a>.</p>
-
- </div>
-</div>
-
-
-<h2 id="48dp-rhythm">48dp Rhythm</h2>
-
-<p>Touchable UI components are generally laid out along 48dp units.</p>
-
-<img src="{@docRoot}design/media/metrics_48.png">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<h4>Why 48dp?</h4>
-<p>On average, 48dp translate to a physical size of about 9mm (with some variability). This is
-comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users
-will be able to reliably and accurately target them with their fingers.</p>
-<p>If you design your elements to be at least 48dp high and wide you can guarantee that:</p>
-<ul>
-<li>your targets will never be smaller than the minimum recommended target size of 7mm regardless of
- what screen they are displayed on.</li>
-<li>you strike a good compromise between overall information density on the one hand, and
- targetability of UI elements on the other.</li>
-</ul>
-
-<img src="{@docRoot}design/media/metrics_closeup.png">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<h4>Mind the gaps</h4>
-<p>Spacing between each UI element is 8dp.</p>
-
-<h2 id="examples">Examples</h2>
-
-<img src="{@docRoot}design/media/metrics_forms.png">
diff --git a/docs/html/design/style/themes.jd b/docs/html/design/style/themes.jd
deleted file mode 100644
index 6c8169baa642..000000000000
--- a/docs/html/design/style/themes.jd
+++ /dev/null
@@ -1,53 +0,0 @@
-page.title=Themes
-@jd:body
-
-<div class="cols">
- <div class="col-5">
-
- <img src="{@docRoot}design/media/themes_holo_light.png">
- <div class="figure-caption">
- Gmail in Holo Light.
- </div>
-
- <img src="{@docRoot}design/media/themes_holo_dark.png">
- <div class="figure-caption">
- Settings in Holo Dark.
- </div>
-
- </div>
- <div class="col-7">
-
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/style/color.html#color-themes">
- <div>
- <h3>Material Design</h3>
- <p>Color Themes<p>
- </div>
-</a>
-
-
-<p>Themes are Android's mechanism for applying a consistent style to an app or activity.
-The style specifies the visual properties of the elements that make up your user interface,
-such as color, height, padding and font size. To promote greater cohesion between all apps
-on the platform, Android provides two system themes that you can choose from when building apps:</p>
-<ul>
-<li>Holo Light</li>
-<li>Holo Dark</li>
-</ul>
-<p>Applying these themes will go a long way in helping you to build apps that fit right into the
-general visual language of Android.</p>
-<p>Pick the system theme that best matches the needs and design aesthetics for your app. If your
-desire is to have a more distinct look for your app, using one of the system themes as a starting
-point for your customizations is a good idea. The system themes provide a solid foundation on top
-of which you can selectively implement your own visual stylings.</p>
-
-<div class="note develop">
-<p><strong>Developer Guide</strong></p>
- <p>For information about how to apply themes such as Holo Light and Dark, and
- how to build your own themes, see the
- <a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> API guide.</p>
-</div>
-
- </div>
-</div>
diff --git a/docs/html/design/style/touch-feedback.jd b/docs/html/design/style/touch-feedback.jd
deleted file mode 100644
index e1fac2f1c26d..000000000000
--- a/docs/html/design/style/touch-feedback.jd
+++ /dev/null
@@ -1,95 +0,0 @@
-page.title=Touch Feedback
-page.tags=input,button
-@jd:body
-
-<div class="cols" style="margin-bottom: -100px">
-<div class="col-7">
-
-<a class="notice-designers-material"
- href="http://www.google.com/design/spec/animation/responsive-interaction.html">
- <div>
- <h3>Material Design</h3>
- <p>Responsive Interaction<p>
- </div>
-</a>
-
-
-<p>Use illumination and dimming to respond to touches, reinforce the resulting behaviors
-of gestures, and indicate what actions are enabled and disabled.</p>
-
-<p><strong>Be responsive to touches in a gentle way</strong>. Whenever a user touches an
-actionable area in your app, let them know the app is "listening" by providing a visual
-response. Make it subtle &mdash;just slightly lighter or darker than the untouched color. This
-provides two benefits:</p>
-
-<ul>
-<li><a href="{@docRoot}design/get-started/principles.html#sprinkle-encouragement">Sprinkles
-of encouragement</a> are more pleasant than jolts.</li>
-<li>Incorporating <a href="{@docRoot}design/style/branding.html">your branding</a> is much
-easier because the default touch feedback works with whatever hue you choose.</li>
-</ul>
-
-</div>
-
-<div class="col-6" style="float:right;">
- <video class="play-on-hover" width="268" height="442" autoplay style="border:1px solid #ddd;background-color:#f9f9f9;" poster="">
- <source src="{@docRoot}design/media/touch_feedback.mp4" type="video/mp4">
- <source src="{@docRoot}design/media/touch_feedback.webm" type="video/webm">
- <source src="{@docRoot}design/media/touch_feedback.ogv" type="video/ogg">
- </video>
- <div class="figure-caption">
- <div style="color:#a3a3a3;margin-left:130px;"><em>Click image to replay...</em></div>
- </div>
-</div>
-
-<h4 style="clear:both;">States</h4>
-
-
-<div class="vspace size-1">&nbsp;</div>
-
-<img src="{@docRoot}design/media/touch_feedback_states.png">
-<div class="figure-caption">
- Most of Android's UI elements have touch feedback built in, including
- states that indicate whether touching the element will have any effect.
-</div>
-
-<div class="vspace size-3">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6">
-
- <h4>Communication</h4>
-<p>When your objects react to more complex gestures, help users
-understand what the outcome will be.</p>
-
-<p>In Recents, when a user starts swiping a thumbnail left or right, it
-begins to dim. This helps the user understand that swiping will cause the
-item to be removed.</p>
- </div>
- <div class="col-7">
-
- <img src="{@docRoot}design/media/touch_feedback_manipulation.png">
-
- </div>
-</div>
-<div class="vspace size-3">&nbsp;</div>
-
-<div class="cols">
- <div class="col-6">
-
- <img src="{@docRoot}design/media/touch_feedback_communication.png">
- <p><em>If a user attempts to scroll past the last home screen panel, the screen
- content tilts to the right to indicate that further navigation in this direction
- isn’t possible.</em></p>
-
- </div>
- <div class="col-6">
-
-<h4>Boundaries</h4>
-<p>
- When users try to scroll past the beginning or end of a scrollable area,
- communicate the boundary with a visual cue. Many of Android's scrollable UI
- widgets, like lists and grid lists, have support for boundary feedback built
- in. If you’re building custom widgets, keep boundary feedback in mind and
- provide it from within your app.
-</p>
diff --git a/docs/html/design/style/typography.jd b/docs/html/design/style/typography.jd
deleted file mode 100644
index af76c409d327..000000000000
--- a/docs/html/design/style/typography.jd
+++ /dev/null
@@ -1,78 +0,0 @@
-page.title=Typography
-page.tags="textview","font"
-page.metaDescription=How to use typography in your Android apps.
-@jd:body
-
-<div class="cols">
- <div class="col-8">
-
- <img src="{@docRoot}design/media/typography_main.png">
-
- </div>
-
-<a class="notice-designers-material"
- style="width: 278px;"
- href="http://www.google.com/design/spec/style/typography.html">
- <div>
- <h3>Material Design</h3>
- <p>Typography<p>
- </div>
-</a>
-
-<div class="col-5">
-
-<p>
- <a class="download-button" onClick="ga('send', 'event', 'Design', 'Download', 'Roboto ZIP');"
- href="{@docRoot}downloads/design/roboto-1.2.zip">Download Roboto</a>
-</p>
-
-<p>The Android design language relies on traditional typographic tools such as scale, space, rhythm,
-and alignment with an underlying grid. Successful deployment of these tools is essential to help
-users quickly understand a screen of information. To support such use of typography, Ice Cream
-Sandwich introduced a new type family named
-<a href="http://www.google.com/fonts/specimen/Roboto" class="external-link">Roboto</a>, created
-specifically for the requirements of UI and high-resolution screens.</p>
-
-<p>The current {@link android.widget.TextView} framework offers Roboto in thin, light, regular and bold
-weights, along with an italic style for each weight. The framework also offers the
-<a href="http://www.google.com/fonts/specimen/Roboto+Condensed" class="external-link">Roboto Condensed</a>
-variant in regular and bold weights, along with an italic style for each weight.</p>
-
- <img src="{@docRoot}design/media/typography_variants@2x.png" width="220">
-
-<p><a onClick="ga('send', 'event', 'Design', 'Download', 'Roboto Specimen Book (@typography page)');"
- href="{@docRoot}downloads/design/Roboto_Specimen_Book_20131031.pdf">Specimen Book</a></p>
-
- </div>
-</div>
-
-<hr>
-
-<div class="cols">
- <div class="col-6">
-
-<h4>Default type colors</h4>
-<p>The Android UI uses the following default color styles: <code>textColorPrimary</code> and
-<code>textColorSecondary</code>. For light themes use <code>textColorPrimaryInverse</code> and
-<code>textColorSecondaryInverse</code>. The framework text color styles also support variants for
-touch feedback states when used inside UI elements.</p>
-
- <img src="{@docRoot}design/media/typography_defaults.png">
-
- </div>
- <div class="col-6">
-
-<h4>Typographic Scale</h4>
-<p>Contrast in type sizes can go a long way to create ordered, understandable layouts. However, too
-many different sizes in the same UI can be messy. The Android framework uses the following limited
-set of type sizes:</p>
-
-<img src="{@docRoot}design/media/typography_sizes.png">
-
-<p>Users can select a system-wide scaling factor for text in the Settings app. In order to support
-these accessibility features, type should be specified in scale-independent pixels
-(<acronym title="Scale-independent pixels. One sp is one pixel on a 160 dpi screen if the user's global text scale is set to 100%.">sp</acronym>)
-wherever possible. Layouts supporting scalable types should be tested against these settings.</p>
-
- </div>
-</div>
diff --git a/docs/html/design/style/writing.jd b/docs/html/design/style/writing.jd
deleted file mode 100644
index 0c62a5502804..000000000000
--- a/docs/html/design/style/writing.jd
+++ /dev/null
@@ -1,322 +0,0 @@
-page.title=Writing Style
-page.tags=dialog,toast,notification
-@jd:body
-
-<h2 id="voa">Android's Voice</h2>
-
-<p>When writing text that appears in your app, keep it concise, simple, and friendly.</p>
-
-<h4 id="concise">Concise</h4>
-
-<ul>
- <li>Describe only what the user needs to know.</li>
- <li>Eliminate redundancy, such as titles that restate the body of an information box.</li>
- <li>Keep text as short as possible.</li>
-</ul>
-
-<p><em>Avoid wordy, stilted text</em></p>
-
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
-
- <div class="do-dont-label bad">Don't</div>
-
- <table class="ui-table good"><tbody><tr><td>
- Consult the documentation that came with your phone for further instructions.
- </td></tr></tbody></table>
-
- </div>
- <div class="col-6">
-
- <div class="do-dont-label good">Do</div>
-
- <table class="ui-table good"><tbody><tr><td>
- Read the instructions that came with your phone.
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<p><em>Don't provide unnecessary information</em></p>
-
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
-
- <div class="do-dont-label bad">From a Setup Wizard screen</div>
-
- <table class="ui-table bad">
- <thead>
- <tr>
- <th>
- Signing in...
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Your phone needs to communicate with<br>
- Google servers to sign in to your account.<br>
- This may take up to five minutes.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-6">
-
- <div class="do-dont-label good">From a Setup Wizard screen</div>
-
- <table class="ui-table good">
- <thead>
- <tr>
- <th>
- Signing in...
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Your phone is contacting Google.<br>
- This can take up to 5 minutes.
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
-</div>
-
-<h4 id="simple">Simple</h4>
-
-<ul>
- <li>Use short words, active verbs, and common nouns.</li>
- <li>Put the most important thing first. “Front-load” the first 11 characters
- with the most salient information in the string.</li>
- <li>Don’t try to explain subtle differences. They are lost on most users.</li>
-</ul>
-
-<p><em>Focus on the user's concern, not technical details</em></p>
-
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
-
- <div class="do-dont-label bad">Don't</div>
-
- <table class="ui-table good"><tbody><tr><td>
- Manually control GPS to prevent other apps from using it
- </td></tr></tbody></table>
-
- </div>
- <div class="col-6">
-
- <div class="do-dont-label good">Do</div>
-
- <table class="ui-table good"><tbody><tr><td>
- To save power, switch Location mode to Battery saving
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<p><em>Put top news first</em></p>
-
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
-
- <div class="do-dont-label bad">Don't</div>
-
- <table class="ui-table good"><tbody><tr><td>
- 77 other people +1’d this, including Larry Page
- </td></tr></tbody></table>
-
- </div>
- <div class="col-6">
-
- <div class="do-dont-label good">Do</div>
-
- <table class="ui-table good"><tbody><tr><td>
- Larry Page and 76 others +1’d this
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-<p><em>Put the user's goal first</em></p>
-
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
-
- <div class="do-dont-label bad">Don't</div>
-
- <table class="ui-table good"><tbody><tr><td>
- Touch Next to complete setup using a Wi-Fi connection
- </td></tr></tbody></table>
-
- </div>
- <div class="col-6">
-
- <div class="do-dont-label good">Do</div>
-
- <table class="ui-table good"><tbody><tr><td>
- To finish setup using Wi-Fi, touch Next
- </td></tr></tbody></table>
-
- </div>
-</div>
-
-
-<h4 id="friendly">Friendly</h4>
-
-<ul>
- <li>Use contractions.</li>
- <li>Talk directly to the reader. Use “you” to refer to the reader.</li>
- <li>Keep your tone casual and conversational, but avoid slang.</li>
-</li>
-</ul>
-
-<p><em>Avoid being confusing or annoying</em></p>
-<div class="cols">
- <div class="col-6 layout-with-list-item-margins">
- <div class="do-dont-label bad">Don't</div>
- <table class="ui-table bad">
- <thead>
- <tr>
- <th>
- Sorry!
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Activity MyAppActivity (in application<br />
- MyApp) is not responding
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- <div class="col-6">
- <div class="do-dont-label good">Do</div>
- <table class="ui-table good">
- <thead>
- <tr>
- <th>
- MyApp isn’t responding
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- Do you want to close it?
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</div>
-
-
-<h4>Words to avoid</h4>
-
-<div style="padding:5px 2.1em;">
-<table>
- <tr>
- <td class="do-dont-label bad" style="width:40%">Don't use</td>
- <td class="do-dont-label good" style="width:40%">Use</td>
- </tr>
- <tr>
- <td>one, two, three, four, ...</td>
- <td>1, 2, 3, 4, ...</td>
- </tr>
- <tr>
- <td>application</td>
- <td>app</td>
- </tr>
- <tr>
- <td>cannot, could not, do not, did not
-will not, you will</td>
- <td><em>Contractions:</em> can’t, couldn’t, don’t, didn’t won’t, you’ll, and so on</td>
- </tr>
- <tr>
- <td>okay, ok</td>
- <td>OK</td>
- </tr>
- <tr>
- <td>please, sorry, thank you</td>
- <td><em>Attempts at politeness can annoy the user, especially in messages that say
- something has gone wrong.<br />
- Exception: In Japanese, “please” is mandatory and imperative verbs should
- be localized accordingly (turn on -> please turn on).
- </em></td>
- </tr>
- <tr>
- <td>there is, there are, it is<br />
- <em>and other “disappeared” subjects (grammatical expletives)</em></td>
- <td><em>Use a noun as the subject</em></td>
- </tr>
- <tr>
- <td>abort, kill, terminate</td>
- <td>stop, cancel, end, exit</td>
- </tr>
- <tr>
- <td>fail, failed, <em>negative language</em></td>
- <td><em>In general, use positive phrasing<br />
- (for example, “do” rather than “don’t,” except in cases such as “Don’t show
- again,” “Can’t connect,” and so on.)</em></td>
- </tr>
- <tr>
- <td>me, I, my, mine</td>
- <td>you, your, yours</td>
- </tr>
- <tr>
- <td>Are you sure? Warning!</td>
- <td><em>Tell user the consequence instead, for example, “You’ll lose all photos
- and media”</em></td>
- </tr>
-</table>
-
-</div>
-
-<h2 id="formatting_text">Formatting text</h2>
-
-<h4 id="capitalization">Capitalization</h4>
-
-<ul>
- <li>Use sentence-style capitalization for all UI strings: “Words to live by.”</li>
- <li>Capitalize all important words in:
- <ul>
- <li>App names (Calendar, Google Drive)</li>
- <li>Named features (Android Beam, Face Unlock)</li>
- <li>Proper nouns (Statue of Liberty, San Francisco Giants)</li>
- </ul>
- </li>
- <li>Be conservative. Don't capitalize words that aren't part of a formal feature name:
- <ul>
- <li>Sim card lock, Home screen, not Sim Card Lock, Home Screen.</li>
- </ul>
- </li>
-</ul>
-
-
-<h4 id="punctuation">Punctuation</h4>
-<ul>
- <li><strong>Period.</strong> Don't use a period after a single sentence or
- phrase used in isolation, such as in a toast, label, or notification. Wherever two or
- more sentences run together, use a period for each sentence. </li>
- <li><strong>Ellipsis.</strong> Use the ellipsis character (…) (Option-; on MacOS and &amp;hellip;
- in HTML) to indicate
- <ul>
- <li>Incompleteness, such as an action in progress (“Downloading...”) or truncated text.</li>
- <li>That a menu item (such as Print… or Share…) leads to further UI involving significant
- choices. Exception: Commands whose wording already implies further (but limited) UI, such
- as <strong>Find in page</strong> or <strong>Pick a date</strong>, do not require an
- ellipsis. </li>
- </ul>
- </li>
-</ul>
diff --git a/docs/html/design/videos/index.jd b/docs/html/design/videos/index.jd
deleted file mode 100644
index 3845b44991b4..000000000000
--- a/docs/html/design/videos/index.jd
+++ /dev/null
@@ -1,130 +0,0 @@
-page.title=Videos
-@jd:body
-
-<p>The Android Design Team presents design-oriented sessions at Google I/O every year. Visit these pages to view the videos and presentations from the conferences.</p>
-
-<img src="{@docRoot}images/home/io-logo-2013-alt.png">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/2013/sessions/326368573">Enchant, Simplify, Amaze: Android's Design Principles</a></h3>
- <p>Want to enchant people, simplify their lives, and make them feel amazing with your app? Learn how Android's Design Principles can help you create products that resonate with people. Find out about the meaning and research behind the principles. See real-world examples and practices from the Android Design team. Discover techniques for applying the principles in your daily work. No design experience necessary.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/s0HIP8EdlnE" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/2013/sessions/326301704">Structure in Android App Design</a></h3>
- <p>Life is simple when your app is simple. But when your apps gets more complex, how do you choose between spinners, tabs, and drawers for navigation? Members of the Android Design team look at techniques for making your app predictable and pleasing to use.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/XpqyiBR0lJ4" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/2013/sessions/326425499">Fireside Chat with the Android Team</a></h3>
- <p>Pull up a chair and join the Android platform team for a fireside chat. It's your opportunity to ask us about the platform and learn a little bit more about why things work the way they do, from the people who built it. </p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/A5OOJDIrYls" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/2013/sessions/326483138">Agile UX Research Practice in Android</a></h3>
- <p>In the Android UX team, it is critical to get user feedback frequently and consistently so that we are able to iterate and develop the best-in-class designs for our users. We will discuss how the team applied "Pulse Studies" (iterative research sessions) in order to put new ideas, designs, and concepts in front of users on a regular basis; it requires minimal advance planning, it can have an immediate product impact, and it can meet urgent needs. </p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/6MOeVNbh9cY" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/2013/sessions/326460111">Cognitive Science and Design</a></h3>
- <p>This session will provide an in-depth look at human perception and cognition, and its implications for interactive and visual design. The human brain is purely treated as an information processing machine, and we will teach the audience its attributes, its advantages, its limitations, and generally how to hack it. </p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/z2exxj4COhU" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<img src="{@docRoot}design/media/extras_googleio_12.png">
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-success"><a href="https://developers.google.com/events/io/sessions/gooio2012/112/">Android Design for Success</a></h3>
- <p>You have a great idea for an Android app. You want it to stand out among hundreds of thousands. You want your users to love it and tell everyone they know. The Android User Experience team is here to help. We talk about the Android Design guide and other tricks of the trade for creating apps that delight users and help them accomplish their goals. No design background is required.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/2NL_83EG0no" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="design-for-engineers"><a href="https://developers.google.com/events/io/sessions/gooio2012/1204/">Android Design for Engineers</a></h3>
- <p>Design isn't black magic, it's a field that people can learn. In this talk two elite designers from Google give you an advanced crash course in interactive and visual design. Topics include mental models, natural mappings, metaphors, mode errors, visual hierarchies, typography and gestalt principles. Correctly applied, this knowledge can drastically improve the quality of your work.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/iJDoxOTyMdk" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="navigation-in-android"><a href="https://developers.google.com/events/io/sessions/gooio2012/114/">Navigation in Android</a></h3>
- <p>An app is useless if people can't find their way around it. Android introduced big navigation-support changes in 3.0 and 4.0. The Action Bar offers a convenient control for Up navigation, the Back key's behavior became more consistent within tasks, and the Recent Tasks UI got an overhaul. In this talk, we discuss how and why we got where we are today, how to think about navigation when designing your app's user experience, and how to write apps that offer effortless navigation in multiple Android versions.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/XwGHJJYBs0Q" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="now-what"><a href="https://developers.google.com/events/io/sessions/gooio2012/115/">So You've Read the Design Guide&#59; Now What?</a></h3>
- <p>The Android Design Guide describes how to design beautiful Android apps, but not how to build them. In this talk we give practical tips for how to apply fit &amp; finish as you implement your design, we show you how to avoid some common pitfalls, we describe some useful patterns, and show how tools can help.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/2jCVmfCse1E" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<div class="vspace size-2">&nbsp;</div>
-
-<div class="cols">
- <div class="col-7">
- <h3 id="playing-with-patterns"><a href="https://developers.google.com/events/io/sessions/gooio2012/131/">Playing with Patterns</a></h3>
- <p>Best-in-class application designers and developers talk about their experience in developing for Android, showing screenshots from their app, exploring the challenges they faced, and offering creative solutions congruent with the Android Design guide. Guests are invited to show examples of visual and interaction patterns in their application that manage to keep it simultaneously consistent and personal.</p>
- </div>
- <div class="col-6">
- <iframe width="355" height="200" src="//www.youtube.com/embed/8iUbr8RZKtg" frameborder="0" allowfullscreen=""></iframe>
- </div>
-</div>
-
-<p>Videos for the entire Design Track can also be found on the <a href="http://www.youtube.com/playlist?list=PL54FA004D676C3EE9">Android Developers Channel</a> on YouTube.</p>
diff --git a/docs/html/guide/topics/renderscript/reference.jd b/docs/html/guide/topics/renderscript/reference.jd
deleted file mode 100644
index a9d780ad00a2..000000000000
--- a/docs/html/guide/topics/renderscript/reference.jd
+++ /dev/null
@@ -1,21 +0,0 @@
-page.title=Runtime API Reference
-parent.title=Computation
-parent.link=index.html
-
-@jd:body
-
-<script language="JavaScript">
-
-function autoResize(element){
- var newheight;
- var newwidth;
-
- newheight = element.contentWindow.document.body.scrollHeight + 20;
- newwidth = element.contentWindow.document.body.scrollWidth;
- element.height = (newheight) + "px";
- element.width = (newwidth) + "px";
-}
-</script>
-
-
-<iframe SRC="{@docRoot}reference/renderscript/index.html" width="100%" id="iframe" marginheight="0" frameborder="0" onLoad="autoResize(this);"></iframe>
diff --git a/docs/html/training/articles/keystore.jd b/docs/html/training/articles/keystore.jd
index 217db8149aee..fea3b2c8a7df 100644
--- a/docs/html/training/articles/keystore.jd
+++ b/docs/html/training/articles/keystore.jd
@@ -129,7 +129,7 @@ of the two modes:
for use as soon as the user unlocks the secure lock screen or confirms their secure lock screen
credentials using the {@link android.app.KeyguardManager#createConfirmDeviceCredentialIntent(CharSequence, CharSequence) KeyguardManager.createConfirmDeviceCredentialIntent}
flow. Each key specifies for how long the authorization remains valid for that key. Such keys
- can only be generated or imported if the secure lock screen is enabled (see {@link android.app.KeyguardManager#isKeyguardSecure Keyguard.isKeyguardSecure}).
+ can only be generated or imported if the secure lock screen is enabled (see {@link android.app.KeyguardManager#isDeviceSecure()}).
These keys become permanently invalidated once the secure lock screen is disabled or forcibly
reset (e.g. by a Device Admin).</li>
<li>User authentication is required for every use of the key. In this mode, a specific operation
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index c850b074a90e..bd52848086a6 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -330,6 +330,7 @@ public final class Bitmap implements Parcelable {
* @return The current generation ID for this bitmap.
*/
public int getGenerationId() {
+ if (mRecycled) return 0;
return nativeGenerationId(mFinalizer.mNativeBitmap);
}
@@ -1040,6 +1041,7 @@ public final class Bitmap implements Parcelable {
* @see BitmapFactory.Options#inPremultiplied
*/
public final boolean isPremultiplied() {
+ if (mRecycled) return false;
return nativeIsPremultiplied(mFinalizer.mNativeBitmap);
}
@@ -1064,6 +1066,7 @@ public final class Bitmap implements Parcelable {
* @see BitmapFactory.Options#inPremultiplied
*/
public final void setPremultiplied(boolean premultiplied) {
+ checkRecycled("setPremultiplied called on a recycled bitmap");
mRequestPremultiplied = premultiplied;
nativeSetPremultiplied(mFinalizer.mNativeBitmap, premultiplied);
}
@@ -1200,6 +1203,7 @@ public final class Bitmap implements Parcelable {
* that config, otherwise return null.
*/
public final Config getConfig() {
+ if (mRecycled) return Config.ARGB_8888;
return Config.nativeToConfig(nativeConfig(mFinalizer.mNativeBitmap));
}
@@ -1212,6 +1216,7 @@ public final class Bitmap implements Parcelable {
* it will return true by default.
*/
public final boolean hasAlpha() {
+ if (mRecycled) return false;
return nativeHasAlpha(mFinalizer.mNativeBitmap);
}
@@ -1226,6 +1231,7 @@ public final class Bitmap implements Parcelable {
* non-opaque per-pixel alpha values.
*/
public void setHasAlpha(boolean hasAlpha) {
+ checkRecycled("setHasAlpha called on a recycled bitmap");
nativeSetHasAlpha(mFinalizer.mNativeBitmap, hasAlpha, mRequestPremultiplied);
}
@@ -1247,6 +1253,7 @@ public final class Bitmap implements Parcelable {
* @see #setHasMipMap(boolean)
*/
public final boolean hasMipMap() {
+ if (mRecycled) return false;
return nativeHasMipMap(mFinalizer.mNativeBitmap);
}
@@ -1271,6 +1278,7 @@ public final class Bitmap implements Parcelable {
* @see #hasMipMap()
*/
public final void setHasMipMap(boolean hasMipMap) {
+ checkRecycled("setHasMipMap called on a recycled bitmap");
nativeSetHasMipMap(mFinalizer.mNativeBitmap, hasMipMap);
}
diff --git a/keystore/java/android/security/KeyGeneratorSpec.java b/keystore/java/android/security/KeyGeneratorSpec.java
index 729646d6dfe4..5a10a0a3f109 100644
--- a/keystore/java/android/security/KeyGeneratorSpec.java
+++ b/keystore/java/android/security/KeyGeneratorSpec.java
@@ -16,6 +16,7 @@
package android.security;
+import android.app.KeyguardManager;
import android.content.Context;
import android.text.TextUtils;
@@ -24,19 +25,53 @@ import java.util.Date;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
/**
- * {@link AlgorithmParameterSpec} for initializing a {@code KeyGenerator} that works with
- * <a href="{@docRoot}training/articles/keystore.html">Android KeyStore facility</a>.
+ * {@link AlgorithmParameterSpec} for initializing a {@link KeyGenerator} of the
+ * <a href="{@docRoot}training/articles/keystore.html">Android KeyStore facility</a>. This class
+ * specifies whether user authentication is required for using the key, what uses the key is
+ * authorized for (e.g., only in {@code CBC} mode), whether the key should be encrypted at rest, the
+ * key's and validity start and end dates.
*
- * <p>The Android KeyStore facility is accessed through a {@link KeyGenerator} API using the
- * {@code AndroidKeyStore} provider. The {@code context} passed in may be used to pop up some UI to
- * ask the user to unlock or initialize the Android KeyStore facility.
+ * <p>To generate a key, create an instance of this class using the {@link Builder}, initialize a
+ * {@code KeyGenerator} of the desired key type (e.g., {@code AES} or {@code HmacSHA256}) from the
+ * {@code AndroidKeyStore} provider with the {@code KeyGeneratorSpec} instance, and then generate a
+ * key using {@link KeyGenerator#generateKey()}.
*
- * <p>After generation, the {@code keyStoreAlias} is used with the
- * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter)}
- * interface to retrieve the {@link SecretKey}.
+ * <p>The generated key will be returned by the {@code KeyGenerator} and also stored in the Android
+ * KeyStore under the alias specified in this {@code KeyGeneratorSpec}. To obtain the key from the
+ * Android KeyStore use
+ * {@link java.security.KeyStore#getKey(String, char[]) KeyStore.getKey(String, null)} or
+ * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter) KeyStore.getEntry(String, null)}.
+ *
+ * <p>NOTE: The key material of the keys generating using the {@code KeyGeneratorSpec} is not
+ * accessible.
+ *
+ * <p><h3>Example</h3>
+ * The following example illustrates how to generate an HMAC key in the Android KeyStore under alias
+ * {@code key1} authorized to be used only for HMAC with SHA-256 digest and only if the user has
+ * been authenticated within the last five minutes.
+ * <pre> {@code
+ * KeyGenerator keyGenerator = KeyGenerator.getInstance(
+ * KeyStoreKeyProperties.Algorithm.HMAC_SHA256,
+ * "AndroidKeyStore");
+ * keyGenerator.initialize(
+ * new KeyGeneratorSpec.Builder(context)
+ * .setAlias("key1")
+ * .setPurposes(KeyStoreKeyProperties.Purpose.SIGN
+ * | KeyStoreKeyProperties.Purpose.VERIFY)
+ * // Only permit this key to be used if the user authenticated
+ * // within the last five minutes.
+ * .setUserAuthenticationRequired(true)
+ * .setUserAuthenticationValidityDurationSeconds(5 * 60)
+ * .build());
+ * SecretKey key = keyGenerator.generateKey();
+ *
+ * // The key can also be obtained from the Android KeyStore any time as follows:
+ * KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
+ * keyStore.load(null);
+ * SecretKey key = (SecretKey) keyStore.getKey("key1", null);
+ * }</pre>
*/
public class KeyGeneratorSpec implements AlgorithmParameterSpec {
@@ -207,7 +242,8 @@ public class KeyGeneratorSpec implements AlgorithmParameterSpec {
}
/**
- * Returns {@code true} if the key must be encrypted in the {@link java.security.KeyStore}.
+ * Returns {@code true} if the key must be encrypted at rest. This will protect the key with the
+ * secure lock screen credential (e.g., password, PIN, or pattern).
*/
public boolean isEncryptionRequired() {
return (mFlags & KeyStore.FLAG_ENCRYPTED) != 0;
@@ -266,9 +302,13 @@ public class KeyGeneratorSpec implements AlgorithmParameterSpec {
}
/**
- * Indicates that this key must be encrypted at rest on storage. Note that enabling this
- * will require that the user enable a strong lock screen (e.g., PIN, password) before
- * creating or using the generated key is successful.
+ * Indicates that this key must be encrypted at rest. This will protect the key with the
+ * secure lock screen credential (e.g., password, PIN, or pattern).
+ *
+ * <p>Note that this feature requires that the secure lock screen (e.g., password, PIN,
+ * pattern) is set up. Otherwise key generation will fail.
+ *
+ * @see KeyguardManager#isDeviceSecure()
*/
public Builder setEncryptionRequired(boolean required) {
if (required) {
diff --git a/keystore/java/android/security/KeyPairGeneratorSpec.java b/keystore/java/android/security/KeyPairGeneratorSpec.java
index 25c61fd1c988..1fcb355a874f 100644
--- a/keystore/java/android/security/KeyPairGeneratorSpec.java
+++ b/keystore/java/android/security/KeyPairGeneratorSpec.java
@@ -16,10 +16,12 @@
package android.security;
+import android.app.KeyguardManager;
import android.content.Context;
import android.text.TextUtils;
import java.math.BigInteger;
+import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.cert.Certificate;
@@ -29,26 +31,64 @@ import java.util.Date;
import javax.security.auth.x500.X500Principal;
/**
- * This provides the required parameters needed for initializing the
- * {@code KeyPairGenerator} that works with
- * <a href="{@docRoot}training/articles/keystore.html">Android KeyStore
- * facility</a>. The Android KeyStore facility is accessed through a
- * {@link java.security.KeyPairGenerator} API using the {@code AndroidKeyStore}
- * provider. The {@code context} passed in may be used to pop up some UI to ask
- * the user to unlock or initialize the Android KeyStore facility.
- * <p>
- * After generation, the {@code keyStoreAlias} is used with the
- * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter)}
- * interface to retrieve the {@link PrivateKey} and its associated
- * {@link Certificate} chain.
- * <p>
- * The KeyPair generator will create a self-signed certificate with the subject
- * as its X.509v3 Subject Distinguished Name and as its X.509v3 Issuer
- * Distinguished Name along with the other parameters specified with the
- * {@link Builder}.
- * <p>
- * The self-signed X.509 certificate may be replaced at a later time by a
- * certificate signed by a real Certificate Authority.
+ * {@link AlgorithmParameterSpec} for initializing a {@link KeyPairGenerator} of the
+ * <a href="{@docRoot}training/articles/keystore.html">Android KeyStore facility</a>. This class
+ * specifies whether user authentication is required for using the private key, what uses the
+ * private key is authorized for (e.g., only for signing -- decryption not permitted), whether the
+ * private key should be encrypted at rest, the private key's and validity start and end dates.
+ *
+ * <p>To generate a key pair, create an instance of this class using the {@link Builder}, initialize
+ * a {@code KeyPairGenerator} of the desired key type (e.g., {@code EC} or {@code RSA}) from the
+ * {@code AndroidKeyStore} provider with the {@code KeyPairGeneratorSpec} instance, and then
+ * generate a key pair using {@link KeyPairGenerator#generateKeyPair()}.
+ *
+ * <p>The generated key pair will be returned by the {@code KeyPairGenerator} and also stored in the
+ * Android KeyStore under the alias specified in this {@code KeyPairGeneratorSpec}. To obtain the
+ * private key from the Android KeyStore use
+ * {@link java.security.KeyStore#getKey(String, char[]) KeyStore.getKey(String, null)} or
+ * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter) KeyStore.getEntry(String, null)}.
+ * To obtain the public key from the Android KeyStore use
+ * {@link java.security.KeyStore#getCertificate(String)} and then
+ * {@link Certificate#getPublicKey()}.
+ *
+ * <p>A self-signed X.509 certificate will be also generated and stored in the Android KeyStore.
+ * This is because the {@link java.security.KeyStore} abstraction does not support storing key pairs
+ * without a certificate. The subject, serial number, and validity dates of the certificate can be
+ * specified in this {@code KeyPairGeneratorSpec}. The self-signed certificate may be replaced at a
+ * later time by a certificate signed by a Certificate Authority (CA).
+ *
+ * <p>NOTE: The key material of the private keys generating using the {@code KeyPairGeneratorSpec}
+ * is not accessible. The key material of the public keys is accessible.
+ *
+ * <p><h3>Example</h3>
+ * The following example illustrates how to generate an EC key pair in the Android KeyStore under
+ * alias {@code key2} authorized to be used only for signing using SHA-256, SHA-384, or SHA-512
+ * digest and only if the user has been authenticated within the last five minutes.
+ * <pre> {@code
+ * KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(
+ * KeyStoreKeyProperties.Algorithm.EC,
+ * "AndroidKeyStore");
+ * keyPairGenerator.initialize(
+ * new KeyGeneratorSpec.Builder(context)
+ * .setAlias("key2")
+ * .setPurposes(KeyStoreKeyProperties.Purpose.SIGN
+ * | KeyStoreKeyProperties.Purpose.VERIFY)
+ * .setDigests(KeyStoreKeyProperties.Digest.SHA256
+ * | KeyStoreKeyProperties.Digest.SHA384
+ * | KeyStoreKeyProperties.Digest.SHA512)
+ * // Only permit this key to be used if the user authenticated
+ * // within the last five minutes.
+ * .setUserAuthenticationRequired(true)
+ * .setUserAuthenticationValidityDurationSeconds(5 * 60)
+ * .build());
+ * KeyPair keyPair = keyPairGenerator.generateKey();
+ *
+ * // The key pair can also be obtained from the Android KeyStore any time as follows:
+ * KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
+ * keyStore.load(null);
+ * PrivateKey privateKey = (PrivateKey) keyStore.getKey("key2", null);
+ * PublicKey publicKey = keyStore.getCertificate("key2").getPublicKey();
+ * }</pre>
*/
public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
@@ -307,8 +347,8 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
}
/**
- * Returns {@code true} if this parameter will require generated keys to be
- * encrypted in the {@link java.security.KeyStore}.
+ * Returns {@code true} if the key must be encrypted at rest. This will protect the key pair
+ * with the secure lock screen credential (e.g., password, PIN, or pattern).
*/
public boolean isEncryptionRequired() {
return (mFlags & KeyStore.FLAG_ENCRYPTED) != 0;
@@ -614,10 +654,13 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
}
/**
- * Indicates that this key must be encrypted at rest on storage. Note
- * that enabling this will require that the user enable a strong lock
- * screen (e.g., PIN, password) before creating or using the generated
- * key is successful.
+ * Indicates that this key must be encrypted at rest. This will protect the key pair with
+ * the secure lock screen credential (e.g., password, PIN, or pattern).
+ *
+ * <p>Note that this feature requires that the secure lock screen (e.g., password, PIN,
+ * pattern) is set up. Otherwise key pair generation will fail.
+ *
+ * @see KeyguardManager#isDeviceSecure()
*/
public Builder setEncryptionRequired() {
mFlags |= KeyStore.FLAG_ENCRYPTED;
@@ -689,6 +732,12 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
*
* <p>This must be specified for all keys. There is no default.
*
+ * <p>If the set of purposes for which the key can be used does not contain
+ * {@link KeyStoreKeyProperties.Purpose#SIGN}, the self-signed certificate generated by
+ * {@link KeyPairGenerator} of {@code AndroidKeyStore} provider will contain an invalid
+ * signature. This is OK if the certificate is only used for obtaining the public key from
+ * Android KeyStore.
+ *
* <p><b>NOTE: This has currently no effect.
*/
public Builder setPurposes(@KeyStoreKeyProperties.PurposeEnum int purposes) {
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 304d2772312a..53963a6b0820 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -24,8 +24,10 @@ import android.content.Context;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Binder;
import android.os.IBinder;
+import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserHandle;
import android.security.keymaster.ExportResult;
import android.security.keymaster.KeyCharacteristics;
import android.security.keymaster.KeymasterArguments;
@@ -212,15 +214,6 @@ public class KeyStore {
}
}
- public boolean password(String password) {
- try {
- return mBinder.password(password) == NO_ERROR;
- } catch (RemoteException e) {
- Log.w(TAG, "Cannot connect to keystore", e);
- return false;
- }
- }
-
public boolean lock() {
try {
return mBinder.lock() == NO_ERROR;
@@ -230,9 +223,20 @@ public class KeyStore {
}
}
- public boolean unlock(String password) {
+ /**
+ * Attempt to unlock the keystore for {@code user} with the password {@code password}.
+ * This is required before keystore entries created with FLAG_ENCRYPTED can be accessed or
+ * created.
+ *
+ * @param user Android user ID to operate on
+ * @param password user's keystore password. Should be the most recent value passed to
+ * {@link #onUserPasswordChanged} for the user.
+ *
+ * @return whether the keystore was unlocked.
+ */
+ public boolean unlock(int userId, String password) {
try {
- mError = mBinder.unlock(password);
+ mError = mBinder.unlock(userId, password);
return mError == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
@@ -240,6 +244,10 @@ public class KeyStore {
}
}
+ public boolean unlock(String password) {
+ return unlock(UserHandle.getUserId(Process.myUid()), password);
+ }
+
public boolean isEmpty() {
try {
return mBinder.zero() == KEY_NOT_FOUND;
@@ -540,6 +548,30 @@ public class KeyStore {
}
/**
+ * Notify keystore that a user's password has changed.
+ *
+ * @param userId the user whose password changed.
+ * @param newPassword the new password or "" if the password was removed.
+ */
+ public boolean onUserPasswordChanged(int userId, String newPassword) {
+ // Parcel.cpp doesn't support deserializing null strings and treats them as "". Make that
+ // explicit here.
+ if (newPassword == null) {
+ newPassword = "";
+ }
+ try {
+ return mBinder.onUserPasswordChanged(userId, newPassword) == NO_ERROR;
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return false;
+ }
+ }
+
+ public boolean onUserPasswordChanged(String newPassword) {
+ return onUserPasswordChanged(UserHandle.getUserId(Process.myUid()), newPassword);
+ }
+
+ /**
* Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error
* code.
*/
diff --git a/keystore/java/android/security/KeyStoreKeyProperties.java b/keystore/java/android/security/KeyStoreKeyProperties.java
index 1c3e3005acff..1cf6a7a6d36e 100644
--- a/keystore/java/android/security/KeyStoreKeyProperties.java
+++ b/keystore/java/android/security/KeyStoreKeyProperties.java
@@ -656,7 +656,7 @@ public abstract class KeyStoreKeyProperties {
public static final int IMPORTED = 1 << 1;
/**
- * Origin of the key is unknown. This can occur only for keys backed by an old TEE
+ * Origin of the key is unknown. This can occur only for keys backed by an old TEE-backed
* implementation which does not record origin information.
*/
public static final int UNKNOWN = 1 << 2;
diff --git a/keystore/java/android/security/KeyStoreKeySpec.java b/keystore/java/android/security/KeyStoreKeySpec.java
index 7533bdc83279..0a9acbb43698 100644
--- a/keystore/java/android/security/KeyStoreKeySpec.java
+++ b/keystore/java/android/security/KeyStoreKeySpec.java
@@ -16,17 +16,54 @@
package android.security;
+import java.security.PrivateKey;
import java.security.spec.KeySpec;
import java.util.Date;
+import javax.crypto.SecretKey;
+
/**
* Information about a key from the <a href="{@docRoot}training/articles/keystore.html">Android
- * KeyStore</a>.
+ * KeyStore</a>. This class describes whether the key material is available in
+ * plaintext outside of secure hardware, whether user authentication is required for using the key
+ * and whether this requirement is enforced by secure hardware, the key's origin, what uses the key
+ * is authorized for (e.g., only in {@code CBC} mode, or signing only), whether the key should be
+ * encrypted at rest, the key's and validity start and end dates.
+ *
+ * <p><h3>Example: Symmetric Key</h3>
+ * The following example illustrates how to obtain a {@link KeyStoreKeySpec} describing the provided
+ * Android KeyStore {@link SecretKey}.
+ * <pre> {@code
+ * SecretKey key = ...; // Android KeyStore key
+ *
+ * SecretKeyFactory factory = SecretKeyFactory.getInstance(key.getAlgorithm(), "AndroidKeyStore");
+ * KeyStoreKeySpec spec;
+ * try &#123;
+ * spec = (KeyStoreKeySpec) factory.getKeySpec(key, KeyStoreKeySpec.class);
+ * &#125; catch (InvalidKeySpecException e) &#123;
+ * // Not an Android KeyStore key.
+ * &#125;
+ * }</pre>
+ *
+ * <p><h3>Example: Private Key</h3>
+ * The following example illustrates how to obtain a {@link KeyStoreKeySpec} describing the provided
+ * Android KeyStore {@link PrivateKey}.
+ * <pre> {@code
+ * PrivateKey key = ...; // Android KeyStore key
+ *
+ * KeyFactory factory = KeyFactory.getInstance(key.getAlgorithm(), "AndroidKeyStore");
+ * KeyStoreKeySpec spec;
+ * try &#123;
+ * spec = factory.getKeySpec(key, KeyStoreKeySpec.class);
+ * &#125; catch (InvalidKeySpecException e) &#123;
+ * // Not an Android KeyStore key.
+ * &#125;
+ * }</pre>
*/
public class KeyStoreKeySpec implements KeySpec {
private final String mKeystoreAlias;
private final int mKeySize;
- private final boolean mTeeBacked;
+ private final boolean mInsideSecureHardware;
private final @KeyStoreKeyProperties.OriginEnum int mOrigin;
private final Date mKeyValidityStart;
private final Date mKeyValidityForOriginationEnd;
@@ -38,13 +75,13 @@ public class KeyStoreKeySpec implements KeySpec {
private final @KeyStoreKeyProperties.BlockModeEnum String[] mBlockModes;
private final boolean mUserAuthenticationRequired;
private final int mUserAuthenticationValidityDurationSeconds;
- private final boolean mUserAuthenticationRequirementTeeEnforced;
+ private final boolean mUserAuthenticationRequirementEnforcedBySecureHardware;
/**
* @hide
*/
KeyStoreKeySpec(String keystoreKeyAlias,
- boolean teeBacked,
+ boolean insideSecureHardware,
@KeyStoreKeyProperties.OriginEnum int origin,
int keySize,
Date keyValidityStart,
@@ -57,9 +94,9 @@ public class KeyStoreKeySpec implements KeySpec {
@KeyStoreKeyProperties.BlockModeEnum String[] blockModes,
boolean userAuthenticationRequired,
int userAuthenticationValidityDurationSeconds,
- boolean userAuthenticationRequirementTeeEnforced) {
+ boolean userAuthenticationRequirementEnforcedBySecureHardware) {
mKeystoreAlias = keystoreKeyAlias;
- mTeeBacked = teeBacked;
+ mInsideSecureHardware = insideSecureHardware;
mOrigin = origin;
mKeySize = keySize;
mKeyValidityStart = keyValidityStart;
@@ -74,7 +111,8 @@ public class KeyStoreKeySpec implements KeySpec {
mBlockModes = ArrayUtils.cloneIfNotEmpty(ArrayUtils.nullToEmpty(blockModes));
mUserAuthenticationRequired = userAuthenticationRequired;
mUserAuthenticationValidityDurationSeconds = userAuthenticationValidityDurationSeconds;
- mUserAuthenticationRequirementTeeEnforced = userAuthenticationRequirementTeeEnforced;
+ mUserAuthenticationRequirementEnforcedBySecureHardware =
+ userAuthenticationRequirementEnforcedBySecureHardware;
}
/**
@@ -85,11 +123,12 @@ public class KeyStoreKeySpec implements KeySpec {
}
/**
- * Returns {@code true} if the key is TEE-backed. Key material of TEE-backed keys is available
- * in plaintext only inside the TEE.
+ * Returns {@code true} if the key resides inside secure hardware (e.g., Trusted Execution
+ * Environment (TEE) or Secure Element (SE)). Key material of such keys is available in
+ * plaintext only inside the secure hardware and is not exposed outside of it.
*/
- public boolean isTeeBacked() {
- return mTeeBacked;
+ public boolean isInsideSecureHardware() {
+ return mInsideSecureHardware;
}
/**
@@ -192,11 +231,12 @@ public class KeyStoreKeySpec implements KeySpec {
/**
* Returns {@code true} if the requirement that this key can only be used if the user has been
- * authenticated if enforced by the TEE.
+ * authenticated if enforced by secure hardware (e.g., Trusted Execution Environment (TEE) or
+ * Secure Element (SE)).
*
* @see #isUserAuthenticationRequired()
*/
- public boolean isUserAuthenticationRequirementTeeEnforced() {
- return mUserAuthenticationRequirementTeeEnforced;
+ public boolean isUserAuthenticationRequirementEnforcedBySecureHardware() {
+ return mUserAuthenticationRequirementEnforcedBySecureHardware;
}
}
diff --git a/keystore/java/android/security/KeyStoreParameter.java b/keystore/java/android/security/KeyStoreParameter.java
index 8d7a19f18162..ea5ca7110f40 100644
--- a/keystore/java/android/security/KeyStoreParameter.java
+++ b/keystore/java/android/security/KeyStoreParameter.java
@@ -16,27 +16,89 @@
package android.security;
+import android.app.KeyguardManager;
import android.content.Context;
import java.security.Key;
import java.security.KeyStore.ProtectionParameter;
+import java.security.cert.Certificate;
import java.util.Date;
import javax.crypto.Cipher;
/**
- * Parameters specifying how to secure and restrict the use of a key being
- * imported into the
- * <a href="{@docRoot}training/articles/keystore.html">Android KeyStore
- * facility</a>. The Android KeyStore facility is accessed through a
- * {@link java.security.KeyStore} API using the {@code AndroidKeyStore}
- * provider. The {@code context} passed in may be used to pop up some UI to ask
- * the user to unlock or initialize the Android KeyStore facility.
- * <p>
- * Any entries placed in the {@code KeyStore} may be retrieved later. Note that
- * there is only one logical instance of the {@code KeyStore} per application
- * UID so apps using the {@code sharedUid} facility will also share a
- * {@code KeyStore}.
+ * Parameters specifying how to secure and restrict the use of a key or key pair being imported into
+ * the <a href="{@docRoot}training/articles/keystore.html">Android KeyStore facility</a>. This class
+ * specifies whether user authentication is required for using the key, what uses the key is
+ * authorized for (e.g., only in {@code CTR} mode, or only for signing -- decryption not permitted),
+ * whether the key should be encrypted at rest, the key's and validity start and end dates.
+ *
+ * <p>To import a key or key pair into the Android KeyStore, create an instance of this class using
+ * the {@link Builder} and pass the instance into {@link java.security.KeyStore#setEntry(String, java.security.KeyStore.Entry, ProtectionParameter) KeyStore.setEntry}
+ * with the key or key pair being imported.
+ *
+ * <p>To obtain the secret/symmetric or private key from the Android KeyStore use
+ * {@link java.security.KeyStore#getKey(String, char[]) KeyStore.getKey(String, null)} or
+ * {@link java.security.KeyStore#getEntry(String, java.security.KeyStore.ProtectionParameter) KeyStore.getEntry(String, null)}.
+ * To obtain the public key from the Android KeyStore use
+ * {@link java.security.KeyStore#getCertificate(String)} and then
+ * {@link Certificate#getPublicKey()}.
+ *
+ * <p>NOTE: The key material of keys stored in the Android KeyStore is not accessible.
+ *
+ * <p><h3>Example: Symmetric Key</h3>
+ * The following example illustrates how to import an AES key into the Android KeyStore under alias
+ * {@code key1} authorized to be used only for encryption/decryption in CBC mode with PKCS#7
+ * padding. The key must export its key material via {@link Key#getEncoded()} in {@code RAW} format.
+ * <pre> {@code
+ * SecretKey key = ...; // AES key
+ *
+ * KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
+ * keyStore.load(null);
+ * keyStore.setEntry(
+ * "key1",
+ * new KeyStore.SecretKeyEntry(key),
+ * new KeyStoreParameter.Builder(context)
+ * .setPurposes(KeyStoreKeyProperties.Purpose.ENCRYPT
+ * | KeyStoreKeyProperties.Purpose.DECRYPT)
+ * .setBlockMode(KeyStoreKeyProperties.BlockMode.CBC)
+ * .setEncryptionPaddings(
+ * KeyStoreKeyProperties.EncryptionPaddings.PKCS7)
+ * .build());
+ * // Key imported, obtain a reference to it.
+ * SecretKey keyStoreKey = (SecretKey) keyStore.getKey("key1", null);
+ * // The original key can now be thrown away.
+ * }</pre>
+ *
+ * <p><h3>Example: Asymmetric Key Pair</h3>
+ * The following example illustrates how to import an EC key pair into the Android KeyStore under
+ * alias {@code key2} authorized to be used only for signing with SHA-256 digest and only if
+ * the user has been authenticated within the last ten minutes. Both the private and the public key
+ * must export their key material via {@link Key#getEncoded()} in {@code PKCS#8} and {@code X.509}
+ * format respectively.
+ * <pre> {@code
+ * PrivateKey privateKey = ...; // EC private key
+ * Certificate[] certChain = ...; // Certificate chain with the first certificate
+ * // containing the corresponding EC public key.
+ *
+ * KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
+ * keyStore.load(null);
+ * keyStore.setEntry(
+ * "key2",
+ * new KeyStore.PrivateKeyEntry(privateKey, certChain),
+ * new KeyStoreParameter.Builder(context)
+ * .setPurposes(KeyStoreKeyProperties.Purpose.SIGN)
+ * .setDigests(KeyStoreKeyProperties.Digest.SHA256)
+ * // Only permit this key to be used if the user
+ * // authenticated within the last ten minutes.
+ * .setUserAuthenticationRequired(true)
+ * .setUserAuthenticationValidityDurationSeconds(10 * 60)
+ * .build());
+ * // Key pair imported, obtain a reference to it.
+ * PrivateKey keyStorePrivateKey = (PrivateKey) keyStore.getKey("key2", null);
+ * PublicKey publicKey = keyStore.getCertificate("key2").getPublicKey();
+ * // The original private key can now be thrown away.
+ * }</pre>
*/
public final class KeyStoreParameter implements ProtectionParameter {
private final Context mContext;
@@ -107,8 +169,9 @@ public final class KeyStoreParameter implements ProtectionParameter {
}
/**
- * Returns {@code true} if this parameter requires entries to be encrypted
- * on the disk.
+ * Returns {@code true} if the {@link java.security.KeyStore} entry must be encrypted at rest.
+ * This will protect the entry with the secure lock screen credential (e.g., password, PIN, or
+ * pattern).
*/
public boolean isEncryptionRequired() {
return (mFlags & KeyStore.FLAG_ENCRYPTED) != 0;
@@ -275,10 +338,14 @@ public final class KeyStoreParameter implements ProtectionParameter {
}
/**
- * Indicates that this key must be encrypted at rest on storage. Note
- * that enabling this will require that the user enable a strong lock
- * screen (e.g., PIN, password) before creating or using the generated
- * key is successful.
+ * Indicates that this {@link java.security.KeyStore} entry must be encrypted at rest. This
+ * will protect the entry with the secure lock screen credential (e.g., password, PIN, or
+ * pattern).
+ *
+ * <p>Note that enabling this feature requires that the secure lock screen (e.g., password,
+ * PIN, pattern) is set up. Otherwise setting the {@code KeyStore} entry will fail.
+ *
+ * @see KeyguardManager#isDeviceSecure()
*/
public Builder setEncryptionRequired(boolean required) {
if (required) {
diff --git a/keystore/java/android/security/KeyStoreSecretKeyFactorySpi.java b/keystore/java/android/security/KeyStoreSecretKeyFactorySpi.java
index ff79b7a4a4ff..548296b07c5d 100644
--- a/keystore/java/android/security/KeyStoreSecretKeyFactorySpi.java
+++ b/keystore/java/android/security/KeyStoreSecretKeyFactorySpi.java
@@ -74,7 +74,7 @@ public class KeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi {
+ " Keystore error: " + errorCode);
}
- boolean teeBacked;
+ boolean insideSecureHardware;
@KeyStoreKeyProperties.OriginEnum int origin;
int keySize;
@KeyStoreKeyProperties.PurposeEnum int purposes;
@@ -85,11 +85,11 @@ public class KeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi {
int keymasterHwEnforcedUserAuthenticators;
try {
if (keyCharacteristics.hwEnforced.containsTag(KeymasterDefs.KM_TAG_ORIGIN)) {
- teeBacked = true;
+ insideSecureHardware = true;
origin = KeyStoreKeyProperties.Origin.fromKeymaster(
keyCharacteristics.hwEnforced.getInt(KeymasterDefs.KM_TAG_ORIGIN, -1));
} else if (keyCharacteristics.swEnforced.containsTag(KeymasterDefs.KM_TAG_ORIGIN)) {
- teeBacked = false;
+ insideSecureHardware = false;
origin = KeyStoreKeyProperties.Origin.fromKeymaster(
keyCharacteristics.swEnforced.getInt(KeymasterDefs.KM_TAG_ORIGIN, -1));
} else {
@@ -150,12 +150,12 @@ public class KeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi {
!keyCharacteristics.getBoolean(KeymasterDefs.KM_TAG_NO_AUTH_REQUIRED);
int userAuthenticationValidityDurationSeconds =
keyCharacteristics.getInt(KeymasterDefs.KM_TAG_AUTH_TIMEOUT, -1);
- boolean userAuthenticationRequirementEnforcedInTee = (userAuthenticationRequired)
+ boolean userAuthenticationRequirementEnforcedBySecureHardware = (userAuthenticationRequired)
&& (keymasterHwEnforcedUserAuthenticators != 0)
&& (keymasterSwEnforcedUserAuthenticators == 0);
return new KeyStoreKeySpec(entryAlias,
- teeBacked,
+ insideSecureHardware,
origin,
keySize,
keyValidityStart,
@@ -168,7 +168,7 @@ public class KeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi {
blockModes,
userAuthenticationRequired,
userAuthenticationValidityDurationSeconds,
- userAuthenticationRequirementEnforcedInTee);
+ userAuthenticationRequirementEnforcedBySecureHardware);
}
@Override
diff --git a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
index 95d14b77fffd..9c2f3586e03f 100644
--- a/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
+++ b/keystore/tests/src/android/security/AndroidKeyPairGeneratorTest.java
@@ -73,7 +73,7 @@ public class AndroidKeyPairGeneratorTest extends AndroidTestCase {
}
private void setupPassword() {
- assertTrue(mAndroidKeyStore.password("1111"));
+ assertTrue(mAndroidKeyStore.onUserPasswordChanged("1111"));
assertTrue(mAndroidKeyStore.isUnlocked());
String[] aliases = mAndroidKeyStore.saw("");
@@ -288,7 +288,7 @@ public class AndroidKeyPairGeneratorTest extends AndroidTestCase {
} catch (IllegalStateException expected) {
}
- assertTrue(mAndroidKeyStore.password("1111"));
+ assertTrue(mAndroidKeyStore.onUserPasswordChanged("1111"));
assertTrue(mAndroidKeyStore.isUnlocked());
final KeyPair pair2 = mGenerator.generateKeyPair();
diff --git a/keystore/tests/src/android/security/AndroidKeyStoreTest.java b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
index a7046dd29cec..4b2b9b5ac243 100644
--- a/keystore/tests/src/android/security/AndroidKeyStoreTest.java
+++ b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
@@ -736,7 +736,7 @@ public class AndroidKeyStoreTest extends AndroidTestCase {
}
private void setupPassword() {
- assertTrue(mAndroidKeyStore.password("1111"));
+ assertTrue(mAndroidKeyStore.onUserPasswordChanged("1111"));
assertTrue(mAndroidKeyStore.isUnlocked());
assertEquals(0, mAndroidKeyStore.saw("").length);
@@ -2089,7 +2089,7 @@ public class AndroidKeyStoreTest extends AndroidTestCase {
} catch (KeyStoreException success) {
}
- assertTrue(mAndroidKeyStore.password("1111"));
+ assertTrue(mAndroidKeyStore.onUserPasswordChanged("1111"));
assertTrue(mAndroidKeyStore.isUnlocked());
mKeyStore.setEntry(TEST_ALIAS_1, entry,
diff --git a/keystore/tests/src/android/security/KeyStoreTest.java b/keystore/tests/src/android/security/KeyStoreTest.java
index 916b1ba9ac46..f261079bd6c9 100644
--- a/keystore/tests/src/android/security/KeyStoreTest.java
+++ b/keystore/tests/src/android/security/KeyStoreTest.java
@@ -152,13 +152,13 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testPassword() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertEquals(KeyStore.State.UNLOCKED, mKeyStore.state());
}
public void testGet() throws Exception {
assertNull(mKeyStore.get(TEST_KEYNAME));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertNull(mKeyStore.get(TEST_KEYNAME));
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
KeyStore.FLAG_ENCRYPTED));
@@ -170,7 +170,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
KeyStore.FLAG_ENCRYPTED));
assertFalse(mKeyStore.contains(TEST_KEYNAME));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
KeyStore.FLAG_ENCRYPTED));
assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));
@@ -181,7 +181,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID,
KeyStore.FLAG_ENCRYPTED));
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID,
KeyStore.FLAG_ENCRYPTED));
assertTrue(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID));
@@ -192,7 +192,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID,
KeyStore.FLAG_ENCRYPTED));
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID,
KeyStore.FLAG_ENCRYPTED));
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID));
@@ -202,7 +202,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertFalse(mKeyStore.put(TEST_I18N_KEY, TEST_I18N_VALUE, KeyStore.UID_SELF,
KeyStore.FLAG_ENCRYPTED));
assertFalse(mKeyStore.contains(TEST_I18N_KEY));
- mKeyStore.password(TEST_I18N_KEY);
+ mKeyStore.onUserPasswordChanged(TEST_I18N_KEY);
assertTrue(mKeyStore.put(TEST_I18N_KEY, TEST_I18N_VALUE, KeyStore.UID_SELF,
KeyStore.FLAG_ENCRYPTED));
assertTrue(mKeyStore.contains(TEST_I18N_KEY));
@@ -210,7 +210,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testDelete() throws Exception {
assertFalse(mKeyStore.delete(TEST_KEYNAME));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertFalse(mKeyStore.delete(TEST_KEYNAME));
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
@@ -222,7 +222,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testDelete_grantedUid_Wifi() throws Exception {
assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.WIFI_UID));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.WIFI_UID));
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID,
@@ -234,7 +234,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testDelete_ungrantedUid_Bluetooth() throws Exception {
assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.BLUETOOTH_UID));
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertFalse(mKeyStore.delete(TEST_KEYNAME, Process.BLUETOOTH_UID));
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID,
@@ -247,7 +247,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testContains() throws Exception {
assertFalse(mKeyStore.contains(TEST_KEYNAME));
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.contains(TEST_KEYNAME));
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
@@ -258,7 +258,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testContains_grantedUid_Wifi() throws Exception {
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID));
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.WIFI_UID));
assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.WIFI_UID,
@@ -269,7 +269,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testContains_grantedUid_Bluetooth() throws Exception {
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID));
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.contains(TEST_KEYNAME, Process.BLUETOOTH_UID));
assertFalse(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, Process.BLUETOOTH_UID,
@@ -282,7 +282,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertNotNull(emptyResult);
assertEquals(0, emptyResult.length);
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED);
mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED);
@@ -296,7 +296,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
String[] results1 = mKeyStore.saw(TEST_KEYNAME, Process.BLUETOOTH_UID);
assertEquals(0, results1.length);
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED);
mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED);
@@ -309,7 +309,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertNotNull(results1);
assertEquals(0, results1.length);
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, Process.WIFI_UID, KeyStore.FLAG_ENCRYPTED);
mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, Process.WIFI_UID, KeyStore.FLAG_ENCRYPTED);
@@ -324,7 +324,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertNotNull(results1);
assertEquals(0, results1.length);
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
mKeyStore.put(TEST_KEYNAME1, TEST_KEYVALUE, Process.VPN_UID, KeyStore.FLAG_ENCRYPTED);
mKeyStore.put(TEST_KEYNAME2, TEST_KEYVALUE, Process.VPN_UID, KeyStore.FLAG_ENCRYPTED);
@@ -337,7 +337,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testLock() throws Exception {
assertFalse(mKeyStore.lock());
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertEquals(KeyStore.State.UNLOCKED, mKeyStore.state());
assertTrue(mKeyStore.lock());
@@ -345,7 +345,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testUnlock() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertEquals(KeyStore.State.UNLOCKED, mKeyStore.state());
mKeyStore.lock();
@@ -355,7 +355,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testIsEmpty() throws Exception {
assertTrue(mKeyStore.isEmpty());
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertTrue(mKeyStore.isEmpty());
mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED);
assertFalse(mKeyStore.isEmpty());
@@ -370,7 +370,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGenerate_Locked_Fail() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
mKeyStore.lock();
assertFalse("Should fail when keystore is locked",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -378,7 +378,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGenerate_Success() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key when unlocked",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -388,7 +388,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGenerate_grantedUid_Wifi_Success() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key when unlocked",
mKeyStore.generate(TEST_KEYNAME, Process.WIFI_UID, NativeConstants.EVP_PKEY_RSA,
@@ -398,7 +398,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGenerate_ungrantedUid_Bluetooth_Failure() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.generate(TEST_KEYNAME, Process.BLUETOOTH_UID,
NativeConstants.EVP_PKEY_RSA, RSA_KEY_SIZE, KeyStore.FLAG_ENCRYPTED, null));
@@ -408,7 +408,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testImport_Success() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key when unlocked", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -417,7 +417,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testImport_grantedUid_Wifi_Success() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key when unlocked", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, Process.WIFI_UID, KeyStore.FLAG_ENCRYPTED));
@@ -426,7 +426,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testImport_ungrantedUid_Bluetooth_Failure() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.importKey(TEST_KEYNAME, PRIVKEY_BYTES, Process.BLUETOOTH_UID,
KeyStore.FLAG_ENCRYPTED));
@@ -436,7 +436,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testImport_Failure_BadEncoding() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertFalse("Invalid DER-encoded key should not be imported", mKeyStore.importKey(
TEST_KEYNAME, TEST_DATA, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -445,7 +445,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testSign_Success() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertTrue(mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
RSA_KEY_SIZE, KeyStore.FLAG_ENCRYPTED, null));
@@ -456,7 +456,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testVerify_Success() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertTrue(mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
RSA_KEY_SIZE, KeyStore.FLAG_ENCRYPTED, null));
@@ -475,7 +475,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testSign_NotGenerated_Failure() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
assertNull("Should not be able to sign without first generating keys",
mKeyStore.sign(TEST_KEYNAME, TEST_DATA));
@@ -483,7 +483,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testGrant_Generated_Success() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key for testcase",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -494,7 +494,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGrant_Imported_Success() throws Exception {
- assertTrue("Password should work for keystore", mKeyStore.password(TEST_PASSWD));
+ assertTrue("Password should work for keystore", mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key for testcase", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -504,7 +504,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testGrant_NoKey_Failure() throws Exception {
assertTrue("Should be able to unlock keystore for test",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse("Should not be able to grant without first initializing the keystore",
mKeyStore.grant(TEST_KEYNAME, 0));
@@ -517,7 +517,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testUngrant_Generated_Success() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key for testcase",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -532,7 +532,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testUngrant_Imported_Success() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key for testcase", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -551,7 +551,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testUngrant_NoGrant_Failure() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key for testcase",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -563,7 +563,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testUngrant_DoubleUngrant_Failure() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key for testcase",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -581,7 +581,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testUngrant_DoubleGrantUngrant_Failure() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to generate key for testcase",
mKeyStore.generate(TEST_KEYNAME, KeyStore.UID_SELF, NativeConstants.EVP_PKEY_RSA,
@@ -601,7 +601,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testDuplicate_grantedUid_Wifi_Success() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.contains(TEST_KEYNAME));
@@ -640,7 +640,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testDuplicate_ungrantedUid_Bluetooth_Failure() throws Exception {
- assertTrue(mKeyStore.password(TEST_PASSWD));
+ assertTrue(mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertFalse(mKeyStore.contains(TEST_KEYNAME));
@@ -666,7 +666,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testGetmtime_Success() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key when unlocked", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -697,7 +697,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
public void testGetmtime_NonExist_Failure() throws Exception {
assertTrue("Password should work for keystore",
- mKeyStore.password(TEST_PASSWD));
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD));
assertTrue("Should be able to import key when unlocked", mKeyStore.importKey(TEST_KEYNAME,
PRIVKEY_BYTES, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED));
@@ -752,7 +752,7 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testGetKeyCharacteristicsSuccess() throws Exception {
- mKeyStore.password(TEST_PASSWD);
+ mKeyStore.onUserPasswordChanged(TEST_PASSWD);
String name = "test";
KeyCharacteristics gen = generateRsaKey(name);
KeyCharacteristics call = new KeyCharacteristics();
@@ -950,4 +950,28 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
assertEquals("Update should require authorization",
KeymasterDefs.KM_ERROR_KEY_USER_NOT_AUTHENTICATED, result.resultCode);
}
+
+ public void testPasswordRemovalEncryptedEntry() throws Exception {
+ mKeyStore.onUserPasswordChanged("test");
+ assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
+ KeyStore.FLAG_ENCRYPTED));
+ assertTrue(mKeyStore.contains(TEST_KEYNAME));
+ assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));
+ mKeyStore.onUserPasswordChanged("");
+ // Removing the password should have deleted all entries using FLAG_ENCRYPTED
+ assertNull(mKeyStore.get(TEST_KEYNAME));
+ assertFalse(mKeyStore.contains(TEST_KEYNAME));
+ }
+
+ public void testPasswordRemovalUnencryptedEntry() throws Exception {
+ mKeyStore.onUserPasswordChanged("test");
+ assertTrue(mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE, KeyStore.UID_SELF,
+ KeyStore.FLAG_NONE));
+ assertTrue(mKeyStore.contains(TEST_KEYNAME));
+ assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));
+ mKeyStore.onUserPasswordChanged("");
+ // Removing the password should not delete unencrypted entries.
+ assertTrue(mKeyStore.contains(TEST_KEYNAME));
+ assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));
+ }
}
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index fd32b6f80dfa..723a177317fc 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -28,6 +28,8 @@ bool Properties::drawReorderDisabled = false;
bool Properties::debugLayersUpdates = false;
bool Properties::debugOverdraw = false;
bool Properties::showDirtyRegions = false;
+bool Properties::skipEmptyFrames = true;
+bool Properties::swapBuffersWithDamage = false;
DebugLevel Properties::debugLevel = kDebugDisabled;
OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default;
@@ -101,6 +103,9 @@ bool Properties::load() {
debugLevel = (DebugLevel) atoi(property);
}
+ skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true);
+ swapBuffersWithDamage = property_get_bool(PROPERTY_SWAP_WITH_DAMAGE, false);
+
return (prevDebugLayersUpdates != debugLayersUpdates)
|| (prevDebugOverdraw != debugOverdraw)
|| (prevDebugStencilClip != debugStencilClip);
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 46fa940bc76f..cb5560f132ea 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -158,6 +158,21 @@ enum DebugLevel {
*/
#define PROPERTY_DISABLE_DRAW_REORDER "debug.hwui.disable_draw_reorder"
+/**
+ * Setting this property will enable or disable the dropping of frames with
+ * empty damage. Default is "true".
+ */
+#define PROPERTY_SKIP_EMPTY_DAMAGE "debug.hwui.skip_empty_damage"
+
+/**
+ * Setting this property will enable usage of EGL_KHR_swap_buffers_with_damage
+ * See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_swap_buffers_with_damage.txt
+ * Default is "false" temporarily
+ * TODO: Change to "true", make sure to remove the log in EglManager::swapBuffers
+ * before changing this to default to true!
+ */
+#define PROPERTY_SWAP_WITH_DAMAGE "debug.hwui.swap_with_damage"
+
///////////////////////////////////////////////////////////////////////////////
// Runtime configuration properties
///////////////////////////////////////////////////////////////////////////////
@@ -288,6 +303,10 @@ public:
static bool debugLayersUpdates;
static bool debugOverdraw;
static bool showDirtyRegions;
+ // TODO: Remove after stabilization period
+ static bool skipEmptyFrames;
+ // TODO: Remove after stabilization period
+ static bool swapBuffersWithDamage;
static DebugLevel debugLevel;
static OverdrawColorSet overdrawColorSet;
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 3de3086a2f86..733e5e08967a 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -16,36 +16,25 @@
#include "CanvasContext.h"
+#include "AnimationContext.h"
+#include "Caches.h"
+#include "DeferredLayerUpdater.h"
#include "EglManager.h"
+#include "LayerRenderer.h"
+#include "OpenGLRenderer.h"
+#include "Properties.h"
#include "RenderThread.h"
-#include "../AnimationContext.h"
-#include "../Caches.h"
-#include "../DeferredLayerUpdater.h"
-#include "../renderstate/RenderState.h"
-#include "../renderstate/Stencil.h"
-#include "../LayerRenderer.h"
-#include "../OpenGLRenderer.h"
+#include "renderstate/RenderState.h"
+#include "renderstate/Stencil.h"
#include <algorithm>
+#include <strings.h>
#include <cutils/properties.h>
#include <private/hwui/DrawGlInfo.h>
-#include <strings.h>
#define TRIM_MEMORY_COMPLETE 80
#define TRIM_MEMORY_UI_HIDDEN 20
-#define PROPERTY_SKIP_EMPTY_DAMAGE "debug.hwui.skip_empty_damage"
-
-static bool sInitialized = false;
-static bool sSkipEmptyDamage = true;
-
-static void initGlobals() {
- if (sInitialized) return;
- sInitialized = true;
- sSkipEmptyDamage = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE,
- sSkipEmptyDamage);
-}
-
namespace android {
namespace uirenderer {
namespace renderthread {
@@ -58,9 +47,6 @@ CanvasContext::CanvasContext(RenderThread& thread, bool translucent,
, mAnimationContext(contextFactory->createAnimationContext(mRenderThread.timeLord()))
, mRootRenderNode(rootRenderNode)
, mJankTracker(thread.timeLord().frameIntervalNanos()) {
- // Done lazily at first draw instead of at library load to avoid
- // running pre-zygote fork
- initGlobals();
mRenderThread.renderState().registerCanvasContext(this);
mProfiler.setDensity(mRenderThread.mainDisplayInfo().density);
}
@@ -106,8 +92,8 @@ void CanvasContext::setSurface(ANativeWindow* window) {
}
}
-void CanvasContext::swapBuffers() {
- if (CC_UNLIKELY(!mEglManager.swapBuffers(mEglSurface))) {
+void CanvasContext::swapBuffers(const SkRect& dirty, EGLint width, EGLint height) {
+ if (CC_UNLIKELY(!mEglManager.swapBuffers(mEglSurface, dirty, width, height))) {
setSurface(nullptr);
}
mHaveNewSurface = false;
@@ -185,6 +171,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo) {
}
if (CC_UNLIKELY(!mNativeWindow.get())) {
+ mCurrentFrameInfo->addFlag(FrameInfoFlags::kSkippedFrame);
info.out.canDrawThisFrame = false;
return;
}
@@ -197,6 +184,10 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo) {
NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND, &runningBehind);
info.out.canDrawThisFrame = !runningBehind;
+ if (!info.out.canDrawThisFrame) {
+ mCurrentFrameInfo->addFlag(FrameInfoFlags::kSkippedFrame);
+ }
+
if (info.out.hasAnimations || !info.out.canDrawThisFrame) {
if (!info.out.requiresUiRedraw) {
// If animationsNeedsRedraw is set don't bother posting for an RT anim
@@ -222,7 +213,7 @@ void CanvasContext::draw() {
SkRect dirty;
mDamageAccumulator.finish(&dirty);
- if (dirty.isEmpty() && sSkipEmptyDamage) {
+ if (dirty.isEmpty() && Properties::skipEmptyFrames) {
mCurrentFrameInfo->addFlag(FrameInfoFlags::kSkippedFrame);
return;
}
@@ -267,7 +258,7 @@ void CanvasContext::draw() {
mCurrentFrameInfo->markSwapBuffers();
if (drew) {
- swapBuffers();
+ swapBuffers(dirty, width, height);
} else {
mEglManager.cancelFrame();
}
@@ -298,8 +289,6 @@ void CanvasContext::doFrame() {
prepareTree(info, frameInfo);
if (info.out.canDrawThisFrame) {
draw();
- } else {
- mCurrentFrameInfo->addFlag(FrameInfoFlags::kSkippedFrame);
}
}
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index f5f1f549d37f..8163b0ff7102 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -29,6 +29,7 @@
#include <cutils/compiler.h>
#include <EGL/egl.h>
#include <SkBitmap.h>
+#include <SkRect.h>
#include <utils/Functor.h>
#include <utils/Vector.h>
@@ -117,7 +118,7 @@ private:
friend class android::uirenderer::RenderState;
void setSurface(ANativeWindow* window);
- void swapBuffers();
+ void swapBuffers(const SkRect& dirty, EGLint width, EGLint height);
void requireSurface();
void requireGlContext();
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 3afca2f38f47..6255f5ef5b14 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -16,9 +16,10 @@
#include "EglManager.h"
-#include "../Caches.h"
-#include "../renderstate/RenderState.h"
+#include "Caches.h"
+#include "Properties.h"
#include "RenderThread.h"
+#include "renderstate/RenderState.h"
#include <cutils/log.h>
#include <cutils/properties.h>
@@ -261,7 +262,8 @@ void EglManager::beginFrame(EGLSurface surface, EGLint* width, EGLint* height) {
mInFrame = true;
}
-bool EglManager::swapBuffers(EGLSurface surface) {
+bool EglManager::swapBuffers(EGLSurface surface, const SkRect& dirty,
+ EGLint width, EGLint height) {
mInFrame = false;
#if WAIT_FOR_GPU_COMPLETION
@@ -271,7 +273,37 @@ bool EglManager::swapBuffers(EGLSurface surface) {
}
#endif
+#ifdef EGL_KHR_swap_buffers_with_damage
+ if (CC_UNLIKELY(Properties::swapBuffersWithDamage)) {
+ SkIRect idirty;
+ dirty.roundOut(&idirty);
+ /*
+ * EGL_KHR_swap_buffers_with_damage spec states:
+ *
+ * The rectangles are specified relative to the bottom-left of the surface
+ * and the x and y components of each rectangle specify the bottom-left
+ * position of that rectangle.
+ *
+ * HWUI does everything with 0,0 being top-left, so need to map
+ * the rect
+ */
+ EGLint y = height - (idirty.y() + idirty.height());
+ // layout: {x, y, width, height}
+ EGLint rects[4] = { idirty.x(), y, idirty.width(), idirty.height() };
+ EGLint numrects = dirty.isEmpty() ? 0 : 1;
+ // TODO: Remove prior to enabling this path by default
+ ALOGD("Swap buffers with damage %d: %d, %d, %d, %d (src="
+ RECT_STRING ")",
+ dirty.isEmpty() ? 0 : 1, rects[0], rects[1], rects[2], rects[3],
+ SK_RECT_ARGS(dirty));
+ eglSwapBuffersWithDamageKHR(mEglDisplay, surface, rects, numrects);
+ } else {
+ eglSwapBuffers(mEglDisplay, surface);
+ }
+#else
eglSwapBuffers(mEglDisplay, surface);
+#endif
+
EGLint err = eglGetError();
if (CC_LIKELY(err == EGL_SUCCESS)) {
return true;
diff --git a/libs/hwui/renderthread/EglManager.h b/libs/hwui/renderthread/EglManager.h
index b1a18a96a83a..08555168f7d8 100644
--- a/libs/hwui/renderthread/EglManager.h
+++ b/libs/hwui/renderthread/EglManager.h
@@ -18,6 +18,7 @@
#include <cutils/compiler.h>
#include <EGL/egl.h>
+#include <SkRect.h>
#include <ui/GraphicBuffer.h>
#include <utils/StrongPointer.h>
@@ -47,7 +48,7 @@ public:
// Returns true if the current surface changed, false if it was already current
bool makeCurrent(EGLSurface surface);
void beginFrame(EGLSurface surface, EGLint* width, EGLint* height);
- bool swapBuffers(EGLSurface surface);
+ bool swapBuffers(EGLSurface surface, const SkRect& dirty, EGLint width, EGLint height);
void cancelFrame();
// Returns true iff the surface is now preserving buffers.
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 19900d001683..56f0400fdca7 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -3402,7 +3402,17 @@ public class AudioManager {
* @hide
*/
public static int listAudioPorts(ArrayList<AudioPort> ports) {
- return updateAudioPortCache(ports, null);
+ return updateAudioPortCache(ports, null, null);
+ }
+
+ /**
+ * Returns a list of descriptors for all audio ports managed by the audio framework as
+ * it was before the last update calback.
+ * @param ports An AudioPort ArrayList where the list will be returned.
+ * @hide
+ */
+ public static int listPreviousAudioPorts(ArrayList<AudioPort> ports) {
+ return updateAudioPortCache(null, null, ports);
}
/**
@@ -3411,19 +3421,44 @@ public class AudioManager {
* @hide
*/
public static int listAudioDevicePorts(ArrayList<AudioDevicePort> devices) {
+ if (devices == null) {
+ return ERROR_BAD_VALUE;
+ }
ArrayList<AudioPort> ports = new ArrayList<AudioPort>();
- int status = updateAudioPortCache(ports, null);
+ int status = updateAudioPortCache(ports, null, null);
if (status == SUCCESS) {
- devices.clear();
- for (int i = 0; i < ports.size(); i++) {
- if (ports.get(i) instanceof AudioDevicePort) {
- devices.add((AudioDevicePort)ports.get(i));
- }
- }
+ filterDevicePorts(ports, devices);
+ }
+ return status;
+ }
+
+ /**
+ * Specialized version of listPreviousAudioPorts() listing only audio devices (AudioDevicePort)
+ * @see listPreviousAudioPorts(ArrayList<AudioPort>)
+ * @hide
+ */
+ public static int listPreviousAudioDevicePorts(ArrayList<AudioDevicePort> devices) {
+ if (devices == null) {
+ return ERROR_BAD_VALUE;
+ }
+ ArrayList<AudioPort> ports = new ArrayList<AudioPort>();
+ int status = updateAudioPortCache(null, null, ports);
+ if (status == SUCCESS) {
+ filterDevicePorts(ports, devices);
}
return status;
}
+ private static void filterDevicePorts(ArrayList<AudioPort> ports,
+ ArrayList<AudioDevicePort> devices) {
+ devices.clear();
+ for (int i = 0; i < ports.size(); i++) {
+ if (ports.get(i) instanceof AudioDevicePort) {
+ devices.add((AudioDevicePort)ports.get(i));
+ }
+ }
+ }
+
/**
* Create a connection between two or more devices. The framework will reject the request if
* device types are not compatible or the implementation does not support the requested
@@ -3474,7 +3509,7 @@ public class AudioManager {
* @hide
*/
public static int listAudioPatches(ArrayList<AudioPatch> patches) {
- return updateAudioPortCache(null, patches);
+ return updateAudioPortCache(null, patches, null);
}
/**
@@ -3540,6 +3575,7 @@ public class AudioManager {
static final int AUDIOPORT_GENERATION_INIT = 0;
static Integer sAudioPortGeneration = new Integer(AUDIOPORT_GENERATION_INIT);
static ArrayList<AudioPort> sAudioPortsCached = new ArrayList<AudioPort>();
+ static ArrayList<AudioPort> sPreviousAudioPortsCached = new ArrayList<AudioPort>();
static ArrayList<AudioPatch> sAudioPatchesCached = new ArrayList<AudioPatch>();
static int resetAudioPortGeneration() {
@@ -3551,7 +3587,8 @@ public class AudioManager {
return generation;
}
- static int updateAudioPortCache(ArrayList<AudioPort> ports, ArrayList<AudioPatch> patches) {
+ static int updateAudioPortCache(ArrayList<AudioPort> ports, ArrayList<AudioPatch> patches,
+ ArrayList<AudioPort> previousPorts) {
synchronized (sAudioPortGeneration) {
if (sAudioPortGeneration == AUDIOPORT_GENERATION_INIT) {
@@ -3610,6 +3647,7 @@ public class AudioManager {
}
}
+ sPreviousAudioPortsCached = sAudioPortsCached;
sAudioPortsCached = newPorts;
sAudioPatchesCached = newPatches;
sAudioPortGeneration = portGeneration[0];
@@ -3622,6 +3660,10 @@ public class AudioManager {
patches.clear();
patches.addAll(sAudioPatchesCached);
}
+ if (previousPorts != null) {
+ previousPorts.clear();
+ previousPorts.addAll(sPreviousAudioPortsCached);
+ }
}
return SUCCESS;
}
diff --git a/media/java/android/media/AudioPortEventHandler.java b/media/java/android/media/AudioPortEventHandler.java
index c49e8c29aebd..c152245d4f9a 100644
--- a/media/java/android/media/AudioPortEventHandler.java
+++ b/media/java/android/media/AudioPortEventHandler.java
@@ -84,7 +84,7 @@ class AudioPortEventHandler {
ArrayList<AudioPort> ports = new ArrayList<AudioPort>();
ArrayList<AudioPatch> patches = new ArrayList<AudioPatch>();
if (msg.what != AUDIOPORT_EVENT_SERVICE_DIED) {
- int status = AudioManager.updateAudioPortCache(ports, patches);
+ int status = AudioManager.updateAudioPortCache(ports, patches, null);
if (status != AudioManager.SUCCESS) {
return;
}
diff --git a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
index 63a8da722665..0ccbf6af2c61 100644
--- a/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
+++ b/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/BluetoothMidiDevice.java
@@ -92,7 +92,6 @@ public final class BluetoothMidiDevice {
mBluetoothGatt.discoverServices());
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
Log.i(TAG, "Disconnected from GATT server.");
- // FIXME synchronize?
close();
}
}
@@ -121,8 +120,8 @@ public final class BluetoothMidiDevice {
}
}
} else {
- Log.w(TAG, "onServicesDiscovered received: " + status);
- // FIXME - report error back to client?
+ Log.e(TAG, "onServicesDiscovered received: " + status);
+ close();
}
}
@@ -137,9 +136,12 @@ public final class BluetoothMidiDevice {
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
CLIENT_CHARACTERISTIC_CONFIG);
- // FIXME null check
- descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
- mBluetoothGatt.writeDescriptor(descriptor);
+ if (descriptor != null) {
+ descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
+ mBluetoothGatt.writeDescriptor(descriptor);
+ } else {
+ Log.e(TAG, "No CLIENT_CHARACTERISTIC_CONFIG for device " + mBluetoothDevice);
+ }
}
@Override
@@ -244,16 +246,18 @@ public final class BluetoothMidiDevice {
}.start();
}
- void close() {
+ private void close() {
+ synchronized (mBluetoothDevice) {
mEventScheduler.close();
- if (mDeviceServer != null) {
- IoUtils.closeQuietly(mDeviceServer);
- mDeviceServer = null;
- mService.deviceClosed(mBluetoothDevice);
- }
- if (mBluetoothGatt != null) {
- mBluetoothGatt.close();
- mBluetoothGatt = null;
+ if (mDeviceServer != null) {
+ IoUtils.closeQuietly(mDeviceServer);
+ mDeviceServer = null;
+ mService.deviceClosed(mBluetoothDevice);
+ }
+ if (mBluetoothGatt != null) {
+ mBluetoothGatt.close();
+ mBluetoothGatt = null;
+ }
}
}
diff --git a/native/graphics/jni/Android.mk b/native/graphics/jni/Android.mk
index f89a5af42058..1b684bb4e28b 100644
--- a/native/graphics/jni/Android.mk
+++ b/native/graphics/jni/Android.mk
@@ -32,7 +32,7 @@ LOCAL_MODULE:= libjnigraphics
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
# TODO: This is to work around b/19059885. Remove after root cause is fixed
-LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv
+LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
include $(BUILD_SHARED_LIBRARY)
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 9511f545b186..e856a9357447 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -1695,6 +1695,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
vis = 0;
}
mImeWindowVis = vis;
+ mInputShown = ((mImeWindowVis & InputMethodService.IME_VISIBLE) != 0);
mBackDisposition = backDisposition;
final boolean iconVisibility = ((vis & (InputMethodService.IME_ACTIVE)) != 0)
&& (mWindowManagerService.isHardKeyboardAvailable()
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 5df74c5edd05..ed2de4a9e485 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -356,28 +356,23 @@ public class LockSettingsService extends ILockSettings.Stub {
return mStorage.hasPattern(userId);
}
- private void maybeUpdateKeystore(String password, int userHandle) {
+ private void setKeystorePassword(String password, int userHandle) {
final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
final KeyStore ks = KeyStore.getInstance();
final List<UserInfo> profiles = um.getProfiles(userHandle);
- boolean shouldReset = TextUtils.isEmpty(password);
-
- // For historical reasons, don't wipe a non-empty keystore if we have a single user with a
- // single profile.
- if (userHandle == UserHandle.USER_OWNER && profiles.size() == 1) {
- if (!ks.isEmpty()) {
- shouldReset = false;
- }
+ for (UserInfo pi : profiles) {
+ ks.onUserPasswordChanged(pi.id, password);
}
+ }
+
+ private void unlockKeystore(String password, int userHandle) {
+ final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
+ final KeyStore ks = KeyStore.getInstance();
+ final List<UserInfo> profiles = um.getProfiles(userHandle);
for (UserInfo pi : profiles) {
- final int profileUid = UserHandle.getUid(pi.id, Process.SYSTEM_UID);
- if (shouldReset) {
- ks.resetUid(profileUid);
- } else {
- ks.passwordUid(password, profileUid);
- }
+ ks.unlock(pi.id, password);
}
}
@@ -423,7 +418,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (pattern == null) {
getGateKeeperService().clearSecureUserId(userId);
mStorage.writePatternHash(null, userId);
- maybeUpdateKeystore(null, userId);
+ setKeystorePassword(null, userId);
return;
}
@@ -451,7 +446,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (password == null) {
getGateKeeperService().clearSecureUserId(userId);
mStorage.writePasswordHash(null, userId);
- maybeUpdateKeystore(null, userId);
+ setKeystorePassword(null, userId);
return;
}
@@ -484,7 +479,7 @@ public class LockSettingsService extends ILockSettings.Stub {
toEnrollBytes);
if (hash != null) {
- maybeUpdateKeystore(toEnroll, userId);
+ setKeystorePassword(toEnroll, userId);
}
return hash;
@@ -530,7 +525,7 @@ public class LockSettingsService extends ILockSettings.Stub {
byte[] hash = mLockPatternUtils.patternToHash(
mLockPatternUtils.stringToPattern(pattern));
if (Arrays.equals(hash, storedHash.hash)) {
- maybeUpdateKeystore(pattern, userId);
+ unlockKeystore(pattern, userId);
// migrate password to GateKeeper
setLockPattern(pattern, null, userId);
if (!hasChallenge) {
@@ -556,7 +551,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
// pattern has matched
- maybeUpdateKeystore(pattern, userId);
+ unlockKeystore(pattern, userId);
return token;
}
@@ -599,7 +594,7 @@ public class LockSettingsService extends ILockSettings.Stub {
if (storedHash.version == CredentialHash.VERSION_LEGACY) {
byte[] hash = mLockPatternUtils.passwordToHash(password, userId);
if (Arrays.equals(hash, storedHash.hash)) {
- maybeUpdateKeystore(password, userId);
+ unlockKeystore(password, userId);
// migrate password to GateKeeper
setLockPassword(password, null, userId);
if (!hasChallenge) {
@@ -625,7 +620,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
// password has matched
- maybeUpdateKeystore(password, userId);
+ unlockKeystore(password, userId);
return token;
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 82dbfeec2483..d1df7e26c99c 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -14121,6 +14121,7 @@ public final class ActivityManagerService extends ActivityManagerNative
boolean dumpDetails = false;
boolean dumpFullDetails = false;
boolean dumpDalvik = false;
+ boolean dumpSummaryOnly = false;
boolean oomOnly = false;
boolean isCompact = false;
boolean localOnly = false;
@@ -14141,6 +14142,9 @@ public final class ActivityManagerService extends ActivityManagerNative
dumpDalvik = true;
} else if ("-c".equals(opt)) {
isCompact = true;
+ } else if ("-s".equals(opt)) {
+ dumpDetails = true;
+ dumpSummaryOnly = true;
} else if ("--oom".equals(opt)) {
oomOnly = true;
} else if ("--local".equals(opt)) {
@@ -14148,10 +14152,11 @@ public final class ActivityManagerService extends ActivityManagerNative
} else if ("--package".equals(opt)) {
packages = true;
} else if ("-h".equals(opt)) {
- pw.println("meminfo dump options: [-a] [-d] [-c] [--oom] [process]");
+ pw.println("meminfo dump options: [-a] [-d] [-c] [-s] [--oom] [process]");
pw.println(" -a: include all available information for each process.");
pw.println(" -d: include dalvik details.");
pw.println(" -c: dump in a compact machine-parseable representation.");
+ pw.println(" -s: dump only summary of application memory usage.");
pw.println(" --oom: only show processes organized by oom adj.");
pw.println(" --local: only collect details locally, don't call process.");
pw.println(" --package: interpret process arg as package, dumping all");
@@ -14212,7 +14217,7 @@ public final class ActivityManagerService extends ActivityManagerNative
mi.dalvikPrivateDirty = (int)tmpLong[0];
}
ActivityThread.dumpMemInfoTable(pw, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, pid, r.baseName, 0, 0, 0, 0, 0, 0);
+ dumpDalvik, dumpSummaryOnly, pid, r.baseName, 0, 0, 0, 0, 0, 0);
if (isCheckinRequest) {
pw.println();
}
@@ -14278,7 +14283,7 @@ public final class ActivityManagerService extends ActivityManagerNative
if (dumpDetails) {
if (localOnly) {
ActivityThread.dumpMemInfoTable(pw, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, pid, r.processName, 0, 0, 0, 0, 0, 0);
+ dumpDalvik, dumpSummaryOnly, pid, r.processName, 0, 0, 0, 0, 0, 0);
if (isCheckinRequest) {
pw.println();
}
@@ -14286,7 +14291,7 @@ public final class ActivityManagerService extends ActivityManagerNative
try {
pw.flush();
thread.dumpMemInfo(fd, mi, isCheckinRequest, dumpFullDetails,
- dumpDalvik, innerArgs);
+ dumpDalvik, dumpSummaryOnly, innerArgs);
} catch (RemoteException e) {
if (!isCheckinRequest) {
pw.println("Got RemoteException!");
diff --git a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
index 6f59b54d56ce..7f961ae84840 100644
--- a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
@@ -82,7 +82,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
appToken.linkToDeath(device, 0);
} catch (RemoteException ex) {
mVirtualDisplayDevices.remove(appToken);
- device.destroyLocked();
+ device.destroyLocked(false);
return null;
}
@@ -110,7 +110,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
public DisplayDevice releaseVirtualDisplayLocked(IBinder appToken) {
VirtualDisplayDevice device = mVirtualDisplayDevices.remove(appToken);
if (device != null) {
- device.destroyLocked();
+ device.destroyLocked(true);
appToken.unlinkToDeath(device, 0);
}
@@ -147,7 +147,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
if (device != null) {
Slog.i(TAG, "Virtual display device released because application token died: "
+ device.mOwnerPackageName);
- device.destroyLocked();
+ device.destroyLocked(false);
sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_REMOVED);
}
}
@@ -205,19 +205,19 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
@Override
public void binderDied() {
synchronized (getSyncRoot()) {
- if (mSurface != null) {
- handleBinderDiedLocked(mAppToken);
- }
+ handleBinderDiedLocked(mAppToken);
}
}
- public void destroyLocked() {
+ public void destroyLocked(boolean binderAlive) {
if (mSurface != null) {
mSurface.release();
mSurface = null;
}
SurfaceControl.destroyDisplay(getDisplayTokenLocked());
- mCallback.dispatchDisplayStopped();
+ if (binderAlive) {
+ mCallback.dispatchDisplayStopped();
+ }
}
@Override
diff --git a/services/core/java/com/android/server/notification/CalendarTracker.java b/services/core/java/com/android/server/notification/CalendarTracker.java
index 28da73ccb3ed..71d7f19ef2fc 100644
--- a/services/core/java/com/android/server/notification/CalendarTracker.java
+++ b/services/core/java/com/android/server/notification/CalendarTracker.java
@@ -16,6 +16,8 @@
package com.android.server.notification;
+import static android.service.notification.ZenModeConfig.EventInfo.ANY_CALENDAR;
+
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
@@ -150,7 +152,7 @@ public class CalendarTracker {
eventId, owner, calendarId));
final boolean meetsTime = time >= begin && time < end;
final boolean meetsCalendar = visible
- && (filter.calendar == 0 || filter.calendar == calendarId)
+ && (filter.calendar == ANY_CALENDAR || filter.calendar == calendarId)
&& availability != Instances.AVAILABILITY_FREE;
if (meetsCalendar) {
if (DEBUG) Log.d(TAG, " MEETS CALENDAR");
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index b92c734365d3..6f8e3cac058b 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -189,6 +189,10 @@ abstract public class ManagedServices {
}
}
+ public boolean isComponentEnabledForPackage(String pkg) {
+ return mEnabledServicesPackageNames.contains(pkg);
+ }
+
public void onPackagesChanged(boolean queryReplace, String[] pkgList) {
if (DEBUG) Slog.d(TAG, "onPackagesChanged queryReplace=" + queryReplace
+ " pkgList=" + (pkgList == null ? null : Arrays.asList(pkgList))
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 25998da26785..791c1de42b95 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -37,7 +37,6 @@ import android.app.NotificationManager.Policy;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.app.usage.UsageEvents;
-import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManagerInternal;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -233,7 +232,7 @@ public class NotificationManagerService extends SystemService {
new ArrayMap<String, NotificationRecord>();
final ArrayList<ToastRecord> mToastQueue = new ArrayList<ToastRecord>();
final ArrayMap<String, NotificationRecord> mSummaryByGroupKey = new ArrayMap<>();
- private final ArrayMap<String, Policy.Token> mPolicyTokens = new ArrayMap<>();
+ private final ArrayMap<String, Boolean> mPolicyAccess = new ArrayMap<>();
// The last key in this list owns the hardware.
@@ -899,6 +898,7 @@ public class NotificationManagerService extends SystemService {
@Override
void onZenModeChanged() {
+ sendRegisteredOnlyBroadcast(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED);
synchronized(mNotificationList) {
updateInterruptionFilterLocked();
}
@@ -906,9 +906,12 @@ public class NotificationManagerService extends SystemService {
@Override
void onPolicyChanged() {
- getContext().sendBroadcast(
- new Intent(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED)
- .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
+ sendRegisteredOnlyBroadcast(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED);
+ }
+
+ private void sendRegisteredOnlyBroadcast(String action) {
+ getContext().sendBroadcast(new Intent(action)
+ .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
}
});
final File systemDir = new File(Environment.getDataDirectory(), "system");
@@ -1607,6 +1610,19 @@ public class NotificationManagerService extends SystemService {
}
@Override
+ public void setInterruptionFilter(String pkg, int filter) throws RemoteException {
+ enforcePolicyAccess(pkg, "setInterruptionFilter");
+ final int zen = NotificationManager.zenModeFromInterruptionFilter(filter, -1);
+ if (zen == -1) throw new IllegalArgumentException("Invalid filter: " + filter);
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mZenModeHelper.setManualZenMode(zen, null, "setInterruptionFilter");
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
public void notifyConditions(String pkg, IConditionProvider provider,
Condition[] conditions) {
final ManagedServiceInfo info = mConditionProviders.checkServiceToken(provider);
@@ -1641,16 +1657,19 @@ public class NotificationManagerService extends SystemService {
message);
}
- private void enforcePolicyToken(Policy.Token token, String method) {
- if (!checkPolicyToken(token)) {
- Slog.w(TAG, "Invalid notification policy token calling " + method);
- throw new SecurityException("Invalid notification policy token");
+ private void enforcePolicyAccess(String pkg, String method) {
+ if (!checkPolicyAccess(pkg)) {
+ Slog.w(TAG, "Notification policy access denied calling " + method);
+ throw new SecurityException("Notification policy access denied");
}
}
- private boolean checkPolicyToken(Policy.Token token) {
- return mPolicyTokens.containsValue(token)
- || mListeners.mPolicyTokens.containsValue(token);
+ private boolean checkPackagePolicyAccess(String pkg) {
+ return Boolean.TRUE.equals(mPolicyAccess.get(pkg));
+ }
+
+ private boolean checkPolicyAccess(String pkg) {
+ return checkPackagePolicyAccess(pkg) || mListeners.isComponentEnabledForPackage(pkg);
}
@Override
@@ -1702,52 +1721,76 @@ public class NotificationManagerService extends SystemService {
}
@Override
- public Policy.Token getPolicyTokenFromListener(INotificationListener listener) {
+ public void requestNotificationPolicyAccess(String pkg,
+ INotificationManagerCallback callback) throws RemoteException {
+ if (callback == null) {
+ Slog.w(TAG, "requestNotificationPolicyAccess: no callback specified");
+ return;
+ }
+ if (pkg == null) {
+ Slog.w(TAG, "requestNotificationPolicyAccess denied: no package specified");
+ callback.onPolicyRequestResult(false);
+ return;
+ }
final long identity = Binder.clearCallingIdentity();
try {
- return mListeners.getPolicyToken(listener);
+ synchronized (mNotificationList) {
+ // immediately grant for now
+ mPolicyAccess.put(pkg, true);
+ if (DBG) Slog.w(TAG, "requestNotificationPolicyAccess granted for " + pkg);
+ }
} finally {
Binder.restoreCallingIdentity(identity);
}
+ callback.onPolicyRequestResult(true);
}
@Override
- public void requestNotificationPolicyToken(String pkg,
- INotificationManagerCallback callback) throws RemoteException {
- if (callback == null) {
- Slog.w(TAG, "requestNotificationPolicyToken: no callback specified");
- return;
- }
- if (pkg == null) {
- Slog.w(TAG, "requestNotificationPolicyToken denied: no package specified");
- callback.onPolicyToken(null);
- return;
- }
- Policy.Token token = null;
+ public boolean isNotificationPolicyAccessGranted(String pkg) {
+ return checkPolicyAccess(pkg);
+ }
+
+ @Override
+ public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) {
+ enforceSystemOrSystemUI("request policy access status for another package");
+ return checkPackagePolicyAccess(pkg);
+ }
+
+ @Override
+ public String[] getPackagesRequestingNotificationPolicyAccess()
+ throws RemoteException {
+ enforceSystemOrSystemUI("request policy access packages");
final long identity = Binder.clearCallingIdentity();
try {
synchronized (mNotificationList) {
- token = mPolicyTokens.get(pkg);
- if (token == null) {
- token = new Policy.Token(new Binder());
- mPolicyTokens.put(pkg, token);
+ final String[] rt = new String[mPolicyAccess.size()];
+ for (int i = 0; i < mPolicyAccess.size(); i++) {
+ rt[i] = mPolicyAccess.keyAt(i);
}
- if (DBG) Slog.w(TAG, "requestNotificationPolicyToken granted for " + pkg);
+ return rt;
}
} finally {
Binder.restoreCallingIdentity(identity);
}
- callback.onPolicyToken(token);
}
@Override
- public boolean isNotificationPolicyTokenValid(String pkg, Policy.Token token) {
- return checkPolicyToken(token);
+ public void setNotificationPolicyAccessGranted(String pkg, boolean granted)
+ throws RemoteException {
+ enforceSystemOrSystemUI("grant notification policy access");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ synchronized (mNotificationList) {
+ mPolicyAccess.put(pkg, granted);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
@Override
- public Policy getNotificationPolicy(Policy.Token token) {
- enforcePolicyToken(token, "getNotificationPolicy");
+ public Policy getNotificationPolicy(String pkg) {
+ enforcePolicyAccess(pkg, "getNotificationPolicy");
final long identity = Binder.clearCallingIdentity();
try {
return mZenModeHelper.getNotificationPolicy();
@@ -1757,8 +1800,8 @@ public class NotificationManagerService extends SystemService {
}
@Override
- public void setNotificationPolicy(Policy.Token token, Policy policy) {
- enforcePolicyToken(token, "setNotificationPolicy");
+ public void setNotificationPolicy(String pkg, Policy policy) {
+ enforcePolicyAccess(pkg, "setNotificationPolicy");
final long identity = Binder.clearCallingIdentity();
try {
mZenModeHelper.setNotificationPolicy(policy);
@@ -1881,11 +1924,9 @@ public class NotificationManagerService extends SystemService {
pw.print(listener.component);
}
pw.println(')');
- pw.print(" mPolicyTokens.keys: ");
- pw.println(TextUtils.join(",", mPolicyTokens.keySet()));
- pw.print(" mListeners.mPolicyTokens.keys: ");
- pw.println(TextUtils.join(",", mListeners.mPolicyTokens.keySet()));
}
+ pw.println("\n Policy access:");
+ pw.print(" mPolicyAccess: "); pw.println(mPolicyAccess);
pw.println("\n Condition providers:");
mConditionProviders.dump(pw, filter);
@@ -3138,18 +3179,12 @@ public class NotificationManagerService extends SystemService {
public class NotificationListeners extends ManagedServices {
private final ArraySet<ManagedServiceInfo> mLightTrimListeners = new ArraySet<>();
- private final ArrayMap<ComponentName, Policy.Token> mPolicyTokens = new ArrayMap<>();
private boolean mNotificationGroupsDesired;
public NotificationListeners() {
super(getContext(), mHandler, mNotificationList, mUserProfiles);
}
- public Policy.Token getPolicyToken(INotificationListener listener) {
- final ManagedServiceInfo info = checkServiceTokenLocked(listener);
- return info == null ? null : mPolicyTokens.get(info.component);
- }
-
@Override
protected Config getConfig() {
Config c = new Config();
@@ -3174,7 +3209,6 @@ public class NotificationManagerService extends SystemService {
synchronized (mNotificationList) {
updateNotificationGroupsDesiredLocked();
update = makeRankingUpdateLocked(info);
- mPolicyTokens.put(info.component, new Policy.Token(new Binder()));
}
try {
listener.onListenerConnected(update);
@@ -3191,7 +3225,6 @@ public class NotificationManagerService extends SystemService {
}
mLightTrimListeners.remove(removed);
updateNotificationGroupsDesiredLocked();
- mPolicyTokens.remove(removed.component);
}
public void setOnNotificationPostedTrimLocked(ManagedServiceInfo info, int trim) {
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index e97def82d436..aeb6b78e39e1 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -22,6 +22,7 @@ import static android.media.AudioAttributes.USAGE_NOTIFICATION;
import static android.media.AudioAttributes.USAGE_NOTIFICATION_RINGTONE;
import android.app.AppOpsManager;
+import android.app.NotificationManager;
import android.app.NotificationManager.Policy;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -42,6 +43,7 @@ import android.provider.Settings.Global;
import android.service.notification.IConditionListener;
import android.service.notification.NotificationListenerService;
import android.service.notification.ZenModeConfig;
+import android.service.notification.ZenModeConfig.EventInfo;
import android.service.notification.ZenModeConfig.ScheduleInfo;
import android.service.notification.ZenModeConfig.ZenRule;
import android.util.ArraySet;
@@ -90,6 +92,7 @@ public class ZenModeHelper {
mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
mDefaultConfig = readDefaultConfig(context.getResources());
appendDefaultScheduleRules(mDefaultConfig);
+ appendDefaultEventRules(mDefaultConfig);
mConfig = mDefaultConfig;
mSettingsObserver = new SettingsObserver(mHandler);
mSettingsObserver.observe();
@@ -142,11 +145,11 @@ public class ZenModeHelper {
}
public int getZenModeListenerInterruptionFilter() {
- return getZenModeListenerInterruptionFilter(mZenMode);
+ return NotificationManager.zenModeToInterruptionFilter(mZenMode);
}
- public void requestFromListener(ComponentName name, int interruptionFilter) {
- final int newZen = zenModeFromListenerInterruptionFilter(interruptionFilter, -1);
+ public void requestFromListener(ComponentName name, int filter) {
+ final int newZen = NotificationManager.zenModeFromInterruptionFilter(filter, -1);
if (newZen != -1) {
setManualZenMode(newZen, null,
"listener:" + (name != null ? name.flattenToShortString() : null));
@@ -393,37 +396,6 @@ public class ZenModeHelper {
}
}
- private static int getZenModeListenerInterruptionFilter(int zen) {
- switch (zen) {
- case Global.ZEN_MODE_OFF:
- return NotificationListenerService.INTERRUPTION_FILTER_ALL;
- case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
- return NotificationListenerService.INTERRUPTION_FILTER_PRIORITY;
- case Global.ZEN_MODE_ALARMS:
- return NotificationListenerService.INTERRUPTION_FILTER_ALARMS;
- case Global.ZEN_MODE_NO_INTERRUPTIONS:
- return NotificationListenerService.INTERRUPTION_FILTER_NONE;
- default:
- return 0;
- }
- }
-
- private static int zenModeFromListenerInterruptionFilter(int listenerInterruptionFilter,
- int defValue) {
- switch (listenerInterruptionFilter) {
- case NotificationListenerService.INTERRUPTION_FILTER_ALL:
- return Global.ZEN_MODE_OFF;
- case NotificationListenerService.INTERRUPTION_FILTER_PRIORITY:
- return Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
- case NotificationListenerService.INTERRUPTION_FILTER_ALARMS:
- return Global.ZEN_MODE_ALARMS;
- case NotificationListenerService.INTERRUPTION_FILTER_NONE:
- return Global.ZEN_MODE_NO_INTERRUPTIONS;
- default:
- return defValue;
- }
- }
-
private ZenModeConfig readDefaultConfig(Resources resources) {
XmlResourceParser parser = null;
try {
@@ -469,6 +441,20 @@ public class ZenModeHelper {
config.automaticRules.put(config.newRuleId(), rule2);
}
+ private void appendDefaultEventRules(ZenModeConfig config) {
+ if (config == null) return;
+
+ final EventInfo events = new EventInfo();
+ events.calendar = EventInfo.ANY_CALENDAR;
+ events.reply = EventInfo.REPLY_YES_OR_MAYBE;
+ final ZenRule rule = new ZenRule();
+ rule.enabled = false;
+ rule.name = mContext.getResources().getString(R.string.zen_mode_default_events_name);
+ rule.conditionId = ZenModeConfig.toEventConditionId(events);
+ rule.zenMode = Global.ZEN_MODE_ALARMS;
+ config.automaticRules.put(config.newRuleId(), rule);
+ }
+
private static int zenSeverity(int zen) {
switch (zen) {
case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: return 1;
@@ -511,6 +497,7 @@ public class ZenModeHelper {
Log.i(TAG, "No existing V1 downtime found, generating default schedules");
appendDefaultScheduleRules(rt);
}
+ appendDefaultEventRules(rt);
return rt;
}
};
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index e79a20618139..e6f5e3d0c12e 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -234,6 +234,14 @@ public class UserManagerService extends IUserManager.Stub {
mUserListFile = new File(mUsersDir, USER_LIST_FILENAME);
initDefaultGuestRestrictions();
readUserListLocked();
+ sInstance = this;
+ }
+ }
+ }
+
+ void systemReady() {
+ synchronized (mInstallLock) {
+ synchronized (mPackagesLock) {
// Prune out any partially created/partially removed users.
ArrayList<UserInfo> partials = new ArrayList<UserInfo>();
for (int i = 0; i < mUsers.size(); i++) {
@@ -248,12 +256,8 @@ public class UserManagerService extends IUserManager.Stub {
+ " (name=" + ui.name + ")");
removeUserStateLocked(ui.id);
}
- sInstance = this;
}
}
- }
-
- void systemReady() {
userForeground(UserHandle.USER_OWNER);
mAppOpsService = IAppOpsService.Stub.asInterface(
ServiceManager.getService(Context.APP_OPS_SERVICE));
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 6f01ca02b580..67c198fe6d54 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2897,7 +2897,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
boolean callerIsDeviceOwnerAdmin = isCallerDeviceOwnerOrInitializer(callingUid);
boolean doNotAskCredentialsOnBoot =
- (flags & DevicePolicyManager.DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
+ (flags & DevicePolicyManager.RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT) != 0;
if (callerIsDeviceOwnerAdmin && doNotAskCredentialsOnBoot) {
setDoNotAskCredentialsOnBoot();
}
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 0424548fd1ad..e682697ab338 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -179,7 +179,6 @@ public abstract class Conference implements Conferenceable {
/**
* Returns VideoProvider of the primary call. This can be null.
- * @hide
*/
public VideoProvider getVideoProvider() {
return null;
@@ -187,7 +186,6 @@ public abstract class Conference implements Conferenceable {
/**
* Returns video state of the primary call.
- * @hide
*/
public int getVideoState() {
return VideoProfile.VideoState.AUDIO_ONLY;
@@ -373,7 +371,6 @@ public abstract class Conference implements Conferenceable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @param videoState The new video state.
- * @hide
*/
public final void setVideoState(Connection c, int videoState) {
Log.d(this, "setVideoState Conference: %s Connection: %s VideoState: %s",
@@ -387,7 +384,6 @@ public abstract class Conference implements Conferenceable {
* Sets the video connection provider.
*
* @param videoProvider The video provider.
- * @hide
*/
public final void setVideoProvider(Connection c, Connection.VideoProvider videoProvider) {
Log.d(this, "setVideoProvider Conference: %s Connection: %s VideoState: %s",
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 4bc639b7b101..0bf91189b87d 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -106,38 +106,32 @@ public abstract class Connection implements Conferenceable {
/**
* Local device supports receiving video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_RX = 0x00000100;
/**
* Local device supports transmitting video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_TX = 0x00000200;
/**
* Local device supports bidirectional video calling.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL =
CAPABILITY_SUPPORTS_VT_LOCAL_RX | CAPABILITY_SUPPORTS_VT_LOCAL_TX;
/**
* Remote device supports receiving video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 0x00000400;
/**
* Remote device supports transmitting video.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 0x00000800;
/**
* Remote device supports bidirectional video calling.
- * @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL =
CAPABILITY_SUPPORTS_VT_REMOTE_RX | CAPABILITY_SUPPORTS_VT_REMOTE_TX;
@@ -187,14 +181,12 @@ public abstract class Connection implements Conferenceable {
/**
* Call can be upgraded to a video call.
- * @hide
*/
public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 0x00080000;
/**
* For video calls, indicates whether the outgoing video for the call can be paused using
* the {@link android.telecom.VideoProfile.VideoState#PAUSED} VideoState.
- * @hide
*/
public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000;
@@ -1041,7 +1033,6 @@ public abstract class Connection implements Conferenceable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @param videoState The new video state.
- * @hide
*/
public final void setVideoState(int videoState) {
checkImmutable();
@@ -1105,7 +1096,6 @@ public abstract class Connection implements Conferenceable {
/**
* Sets the video connection provider.
* @param videoProvider The video provider.
- * @hide
*/
public final void setVideoProvider(VideoProvider videoProvider) {
checkImmutable();
@@ -1414,7 +1404,6 @@ public abstract class Connection implements Conferenceable {
* a request to accept.
*
* @param videoState The video state in which to answer the connection.
- * @hide
*/
public void onAnswer(int videoState) {}
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index 71b481b89c77..f5cceea80060 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -50,7 +50,6 @@ public final class ConnectionRequest implements Parcelable {
* @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
* @param extras Application-specific extra data.
* @param videoState Determines the video state for the connection.
- * @hide
*/
public ConnectionRequest(
PhoneAccountHandle accountHandle,
@@ -95,7 +94,6 @@ public final class ConnectionRequest implements Parcelable {
* {@link VideoProfile.VideoState#RX_ENABLED}.
*
* @return The video state for the connection.
- * @hide
*/
public int getVideoState() {
return mVideoState;
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 41856515f434..13eb016e8ec1 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -147,7 +147,6 @@ public abstract class ConnectionService extends Service {
}
@Override
- /** @hide */
public void answerVideo(String callId, int videoState) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
diff --git a/tests/VoiceInteraction/res/layout/main.xml b/tests/VoiceInteraction/res/layout/main.xml
index 34a7563f4eb2..092d37dc4a20 100644
--- a/tests/VoiceInteraction/res/layout/main.xml
+++ b/tests/VoiceInteraction/res/layout/main.xml
@@ -34,12 +34,6 @@
android:text="@string/asyncStructure"
/>
- <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:assistBlocked="true"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="This won't be included in assist."
- />
-
</LinearLayout>
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AsyncStructure.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AsyncStructure.java
index 73e04e525878..ae8e9e49aad1 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AsyncStructure.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AsyncStructure.java
@@ -20,7 +20,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
-import android.view.ViewAssistStructure;
+import android.view.ViewStructure;
import android.widget.TextView;
/**
@@ -32,9 +32,9 @@ public class AsyncStructure extends TextView {
}
@Override
- public void onProvideVirtualAssistStructure(ViewAssistStructure structure) {
+ public void onProvideVirtualStructure(ViewStructure structure) {
structure.setChildCount(1);
- final ViewAssistStructure child = structure.asyncNewChild(0);
+ final ViewStructure child = structure.asyncNewChild(0);
final int width = getWidth();
final int height = getHeight();
(new Thread() {