summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt346
-rw-r--r--cmds/idmap/scan.cpp3
-rw-r--r--core/java/android/app/ActivityThread.java4
-rw-r--r--core/java/android/app/ApplicationPackageManager.java2
-rw-r--r--core/java/android/app/ContextImpl.java5
-rw-r--r--core/java/android/app/LoadedApk.java98
-rw-r--r--core/java/android/app/ResourcesManager.java19
-rw-r--r--core/java/android/content/res/AssetManager.java14
-rw-r--r--core/java/android/content/res/TypedArray.java7
-rw-r--r--core/java/android/content/res/XmlBlock.java10
-rw-r--r--core/java/android/hardware/camera2/CameraMetadata.java25
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java1
-rw-r--r--core/java/android/net/http/CertificateChainValidator.java100
-rw-r--r--core/java/android/net/http/DelegatingSSLSession.java172
-rw-r--r--core/java/android/net/http/DelegatingSocketWrapper.java127
-rw-r--r--core/java/android/net/http/X509TrustManagerExtensions.java22
-rw-r--r--core/java/android/os/storage/IMountService.java60
-rw-r--r--core/java/android/provider/Settings.java9
-rw-r--r--core/java/android/view/RenderNode.java10
-rw-r--r--core/java/android/view/View.java18
-rw-r--r--core/java/com/android/internal/widget/ILockSettings.aidl1
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java14
-rw-r--r--core/jni/android_util_AssetManager.cpp50
-rw-r--r--core/jni/android_util_XmlBlock.cpp7
-rw-r--r--core/jni/android_view_RenderNode.cpp16
-rw-r--r--core/res/res/color/background_cache_hint_selector_holo_dark.xml (renamed from core/res/res/drawable/background_cache_hint_selector_holo_dark.xml)0
-rw-r--r--core/res/res/color/background_cache_hint_selector_holo_light.xml (renamed from core/res/res/drawable/background_cache_hint_selector_holo_light.xml)0
-rw-r--r--core/res/res/color/background_cache_hint_selector_quantum_dark.xml (renamed from core/res/res/drawable/background_cache_hint_selector_quantum_dark.xml)0
-rw-r--r--core/res/res/color/background_cache_hint_selector_quantum_light.xml (renamed from core/res/res/drawable/background_cache_hint_selector_quantum_light.xml)0
-rw-r--r--core/res/res/drawable/ab_transparent_quantum.xml (renamed from core/res/res/drawable/ab_transparent_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ab_transparent_quantum_light.xml19
-rw-r--r--core/res/res/drawable/activated_background_quantum.xml (renamed from core/res/res/drawable/activated_background_quantum_dark.xml)8
-rw-r--r--core/res/res/drawable/activated_background_quantum_light.xml20
-rw-r--r--core/res/res/drawable/btn_borderless_quantum.xml (renamed from core/res/res/drawable/btn_borderless_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/btn_borderless_quantum_light.xml19
-rw-r--r--core/res/res/drawable/btn_check_quantum.xml (renamed from core/res/res/drawable/btn_check_quantum_dark.xml)8
-rw-r--r--core/res/res/drawable/btn_check_quantum_light.xml34
-rw-r--r--core/res/res/drawable/btn_color_quantum.xml (renamed from core/res/res/drawable/btn_color_quantum_dark.xml)6
-rw-r--r--core/res/res/drawable/btn_color_quantum_light.xml29
-rw-r--r--core/res/res/drawable/btn_default_quantum.xml (renamed from core/res/res/drawable/btn_default_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/btn_default_quantum_light.xml21
-rw-r--r--core/res/res/drawable/btn_radio_quantum.xml (renamed from core/res/res/drawable/btn_radio_quantum_dark.xml)8
-rw-r--r--core/res/res/drawable/btn_radio_quantum_light.xml34
-rw-r--r--core/res/res/drawable/btn_star_quantum.xml (renamed from core/res/res/drawable/btn_star_quantum_dark.xml)6
-rw-r--r--core/res/res/drawable/btn_star_quantum_light.xml30
-rw-r--r--core/res/res/drawable/edit_text_quantum.xml (renamed from core/res/res/drawable/edit_text_quantum_dark.xml)12
-rw-r--r--core/res/res/drawable/edit_text_quantum_light.xml42
-rw-r--r--core/res/res/drawable/expander_group_quantum.xml (renamed from core/res/res/drawable/expander_group_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/expander_group_quantum_light.xml26
-rw-r--r--core/res/res/drawable/fastscroll_thumb_quantum.xml (renamed from core/res/res/drawable/fastscroll_thumb_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/fastscroll_thumb_quantum_light.xml26
-rw-r--r--core/res/res/drawable/fastscroll_track_quantum.xml (renamed from core/res/res/drawable/fastscroll_track_quantum_light.xml)2
-rw-r--r--core/res/res/drawable/fastscroll_track_quantum_dark.xml19
-rw-r--r--core/res/res/drawable/ic_ab_back_quantum.xml (renamed from core/res/res/drawable/ic_ab_back_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_ab_back_quantum_light.xml20
-rw-r--r--core/res/res/drawable/ic_cab_done_quantum.xml (renamed from core/res/res/drawable/ic_cab_done_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_cab_done_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_dialog_alert_quantum.xml (renamed from core/res/res/drawable/ic_dialog_alert_quantum_light.xml)2
-rw-r--r--core/res/res/drawable/ic_dialog_alert_quantum_dark.xml19
-rw-r--r--core/res/res/drawable/ic_find_next_quantum.xml (renamed from core/res/res/drawable/ic_find_next_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_find_next_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_find_previous_quantum.xml (renamed from core/res/res/drawable/ic_find_previous_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_find_previous_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_copy_quantum.xml (renamed from core/res/res/drawable/ic_menu_copy_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_copy_quantum_light.xml20
-rw-r--r--core/res/res/drawable/ic_menu_cut_quantum.xml (renamed from core/res/res/drawable/ic_menu_cut_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_cut_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_find_quantum.xml (renamed from core/res/res/drawable/ic_menu_find_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_find_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_moreoverflow_quantum.xml (renamed from core/res/res/drawable/ic_menu_moreoverflow_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_moreoverflow_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_paste_quantum.xml (renamed from core/res/res/drawable/ic_menu_paste_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_paste_quantum_light.xml20
-rw-r--r--core/res/res/drawable/ic_menu_search_quantum.xml (renamed from core/res/res/drawable/ic_menu_search_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_search_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_selectall_quantum.xml (renamed from core/res/res/drawable/ic_menu_selectall_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_selectall_quantum_light.xml19
-rw-r--r--core/res/res/drawable/ic_menu_share_quantum.xml (renamed from core/res/res/drawable/ic_menu_share_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/ic_menu_share_quantum_light.xml19
-rw-r--r--core/res/res/drawable/item_background_borderless_quantum_light.xml18
-rw-r--r--core/res/res/drawable/item_background_quantum.xml (renamed from core/res/res/drawable/item_background_borderless_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/item_background_quantum_dark.xml18
-rw-r--r--core/res/res/drawable/item_background_quantum_light.xml18
-rw-r--r--core/res/res/drawable/list_divider_quantum.xml (renamed from core/res/res/drawable/list_divider_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/list_divider_quantum_light.xml19
-rw-r--r--core/res/res/drawable/list_section_divider_quantum.xml (renamed from core/res/res/drawable/list_section_divider_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/list_section_divider_quantum_light.xml19
-rw-r--r--core/res/res/drawable/progress_horizontal_quantum.xml (renamed from core/res/res/drawable/progress_horizontal_quantum_dark.xml)6
-rw-r--r--core/res/res/drawable/progress_horizontal_quantum_light.xml34
-rw-r--r--core/res/res/drawable/scrollbar_handle_quantum.xml (renamed from core/res/res/drawable/scrollbar_handle_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/scrollbar_handle_quantum_light.xml19
-rw-r--r--core/res/res/drawable/scrubber_control_selector_quantum.xml (renamed from core/res/res/drawable/scrubber_control_selector_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/scrubber_control_selector_quantum_light.xml26
-rw-r--r--core/res/res/drawable/scrubber_progress_horizontal_quantum.xml (renamed from core/res/res/drawable/scrubber_progress_horizontal_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/scrubber_progress_horizontal_quantum_light.xml26
-rw-r--r--core/res/res/drawable/spinner_background_quantum.xml (renamed from core/res/res/drawable/spinner_background_quantum_dark.xml)6
-rw-r--r--core/res/res/drawable/spinner_background_quantum_light.xml31
-rw-r--r--core/res/res/drawable/switch_inner_quantum.xml (renamed from core/res/res/drawable/switch_inner_quantum_dark.xml)8
-rw-r--r--core/res/res/drawable/switch_inner_quantum_light.xml34
-rw-r--r--core/res/res/drawable/switch_track_quantum.xml (renamed from core/res/res/drawable/switch_track_quantum_dark.xml)4
-rw-r--r--core/res/res/drawable/switch_track_quantum_light.xml26
-rw-r--r--core/res/res/drawable/tab_indicator_quantum.xml (renamed from core/res/res/drawable/tab_indicator_quantum_dark.xml)12
-rw-r--r--core/res/res/drawable/tab_indicator_quantum_light.xml43
-rw-r--r--core/res/res/drawable/text_cursor_quantum.xml (renamed from core/res/res/drawable/text_cursor_quantum_dark.xml)2
-rw-r--r--core/res/res/drawable/text_cursor_quantum_light.xml19
-rw-r--r--core/res/res/values/attrs.xml10
-rw-r--r--core/res/res/values/colors_quantum.xml12
-rw-r--r--core/res/res/values/public.xml29
-rw-r--r--core/res/res/values/styles_quantum.xml727
-rw-r--r--core/res/res/values/themes.xml4
-rw-r--r--core/res/res/values/themes_micro.xml26
-rw-r--r--core/res/res/values/themes_quantum.xml134
-rw-r--r--data/fonts/Android.mk2
-rw-r--r--data/fonts/RobotoCondensed-Light.ttfbin0 -> 160800 bytes
-rwxr-xr-xdata/fonts/RobotoCondensed-LightItalic.ttfbin0 -> 164432 bytes
-rw-r--r--data/fonts/fonts.mk2
-rw-r--r--data/fonts/system_fonts.xml11
-rw-r--r--docs/html/google/play-services/index.jd2
-rw-r--r--docs/html/images/tools/as-buildvariants.pngbin0 -> 7739 bytes
-rw-r--r--docs/html/images/tools/as-demoflavordirs.pngbin0 -> 21279 bytes
-rw-r--r--docs/html/images/tools/as-gradlebutton.pngbin0 -> 1297 bytes
-rw-r--r--docs/html/images/tools/as-gradleconsole.pngbin0 -> 29196 bytes
-rw-r--r--docs/html/images/tools/as-gradlepanel.pngbin0 -> 33680 bytes
-rw-r--r--docs/html/images/tools/as-gradlesync.pngbin0 -> 23107 bytes
-rw-r--r--docs/html/images/tools/as-mainscreen.pngbin0 -> 178076 bytes
-rw-r--r--docs/html/sdk/index.jd55
-rw-r--r--docs/html/sdk/installing/installing-adt.jd33
-rw-r--r--docs/html/sdk/installing/studio-build.jd1065
-rw-r--r--docs/html/sdk/installing/studio.jd41
-rw-r--r--docs/html/tools/revisions/platforms.jd15
-rw-r--r--docs/html/tools/sdk/eclipse-adt.jd50
-rw-r--r--docs/html/tools/sdk/tools-notes.jd39
-rw-r--r--docs/html/tools/support-library/index.jd28
-rw-r--r--docs/html/tools/tools_toc.cs2
-rw-r--r--docs/html/wear/design/index.html6
-rw-r--r--docs/html/wear/images/screens/cuecard.gifbin4050297 -> 2586171 bytes
-rw-r--r--docs/html/wear/images/screens/stream.gifbin12667541 -> 6111583 bytes
-rw-r--r--docs/html/wear/index.html19
-rw-r--r--docs/html/wear/notifications/creating.html10
-rw-r--r--docs/html/wear/notifications/remote-input.html2
-rw-r--r--docs/html/wear/preview/start.html5
-rw-r--r--include/androidfw/AssetManager.h2
-rw-r--r--include/androidfw/ResourceTypes.h86
-rw-r--r--libs/androidfw/AssetManager.cpp45
-rw-r--r--libs/androidfw/ResourceTypes.cpp359
-rw-r--r--libs/androidfw/tests/ObbFile_test.cpp2
-rw-r--r--libs/hwui/DisplayListOp.h34
-rw-r--r--libs/hwui/OpenGLRenderer.cpp7
-rw-r--r--libs/hwui/OpenGLRenderer.h2
-rw-r--r--libs/hwui/Outline.h1
-rw-r--r--libs/hwui/Patch.cpp1
-rw-r--r--libs/hwui/PatchCache.cpp17
-rw-r--r--libs/hwui/RenderNode.cpp29
-rw-r--r--libs/hwui/RenderProperties.cpp41
-rw-r--r--libs/hwui/RenderProperties.h29
-rw-r--r--libs/hwui/RevealClip.h78
-rw-r--r--media/java/android/media/MediaFocusControl.java484
-rw-r--r--media/java/android/media/PlayerRecord.java (renamed from media/java/android/media/MediaController.java)202
-rw-r--r--media/jni/android_mtp_MtpDatabase.cpp11
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java7
-rw-r--r--packages/SystemUI/res/values-land/dimens.xml3
-rw-r--r--packages/SystemUI/res/values-sw600dp/dimens.xml3
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java505
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java40
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java2
-rw-r--r--packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java7
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java41
-rw-r--r--services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java2
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java41
-rw-r--r--services/core/java/com/android/server/MountService.java51
-rw-r--r--services/core/java/com/android/server/connectivity/Tethering.java1
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java13
-rw-r--r--services/core/java/com/android/server/pm/Settings.java1
-rw-r--r--services/core/java/com/android/server/storage/DeviceStorageMonitorService.java1
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephonyListener.aidl11
-rw-r--r--tests/SharedLibrary/client/Android.mk2
-rw-r--r--tests/SharedLibrary/client/AndroidManifest.xml2
-rw-r--r--tests/SharedLibrary/client/res/layout/main.xml25
-rw-r--r--tests/SharedLibrary/client/res/values/strings.xml1
-rw-r--r--tests/SharedLibrary/client/res/values/themes.xml6
-rw-r--r--tests/SharedLibrary/client/src/com/google/android/test/lib_client/ActivityMain.java23
-rw-r--r--tests/SharedLibrary/lib/Android.mk7
-rw-r--r--tests/SharedLibrary/lib/proguard.proguard7
-rw-r--r--tests/SharedLibrary/lib/res/layout/address.xml16
-rw-r--r--tests/SharedLibrary/lib/res/values/attrs.xml13
-rw-r--r--tests/SharedLibrary/lib/res/values/public.xml17
-rw-r--r--tests/SharedLibrary/lib/res/values/strings.xml9
-rw-r--r--tests/SharedLibrary/lib/res/values/themes.xml18
-rw-r--r--tests/SharedLibrary/lib/src/com/google/android/test/shared_library/AddressView.java44
-rw-r--r--tools/aapt/AaptAssets.cpp5
-rw-r--r--tools/aapt/AaptAssets.h1
-rw-r--r--tools/aapt/Bundle.h4
-rw-r--r--tools/aapt/Main.cpp6
-rw-r--r--tools/aapt/ResourceIdCache.cpp8
-rw-r--r--tools/aapt/ResourceIdCache.h14
-rw-r--r--tools/aapt/ResourceTable.cpp70
-rw-r--r--tools/aapt/ResourceTable.h2
-rw-r--r--tools/aapt/printapk.cpp4
204 files changed, 4123 insertions, 2924 deletions
diff --git a/api/current.txt b/api/current.txt
index 1ea4f14..dfee226 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -381,6 +381,12 @@ package android {
field public static final int colorActivatedHighlight = 16843664; // 0x1010390
field public static final int colorBackground = 16842801; // 0x1010031
field public static final int colorBackgroundCacheHint = 16843435; // 0x10102ab
+ field public static final int colorButtonNormal = 16843781; // 0x1010405
+ field public static final int colorButtonNormalColored = 16843783; // 0x1010407
+ field public static final int colorButtonPressed = 16843782; // 0x1010406
+ field public static final int colorButtonPressedColored = 16843784; // 0x1010408
+ field public static final int colorControlActivated = 16843780; // 0x1010404
+ field public static final int colorControlNormal = 16843779; // 0x1010403
field public static final int colorFocusedHighlight = 16843663; // 0x101038f
field public static final int colorForeground = 16842800; // 0x1010030
field public static final int colorForegroundInverse = 16843270; // 0x1010206
@@ -1680,12 +1686,6 @@ package android {
field public static final int MediaButton_Play = 16973882; // 0x103003a
field public static final int MediaButton_Previous = 16973880; // 0x1030038
field public static final int MediaButton_Rew = 16973884; // 0x103003c
- field public static final int Quantum_ButtonBar = 16974498; // 0x10302a2
- field public static final int Quantum_ButtonBar_AlertDialog = 16974497; // 0x10302a1
- field public static final int Quantum_Light_ButtonBar = 16974501; // 0x10302a5
- field public static final int Quantum_Light_ButtonBar_AlertDialog = 16974500; // 0x10302a4
- field public static final int Quantum_Light_SegmentedButton = 16974502; // 0x10302a6
- field public static final int Quantum_SegmentedButton = 16974499; // 0x10302a3
field public static final int TextAppearance = 16973886; // 0x103003e
field public static final int TextAppearance_DeviceDefault = 16974253; // 0x10301ad
field public static final int TextAppearance_DeviceDefault_DialogWindowTitle = 16974264; // 0x10301b8
@@ -1775,25 +1775,21 @@ package android {
field public static final int TextAppearance_Quantum_Widget = 16974330; // 0x10301fa
field public static final int TextAppearance_Quantum_Widget_ActionBar_Menu = 16974331; // 0x10301fb
field public static final int TextAppearance_Quantum_Widget_ActionBar_Subtitle = 16974332; // 0x10301fc
- field public static final int TextAppearance_Quantum_Widget_ActionBar_Subtitle_Inverse = 16974333; // 0x10301fd
- field public static final int TextAppearance_Quantum_Widget_ActionBar_Title = 16974334; // 0x10301fe
- field public static final int TextAppearance_Quantum_Widget_ActionBar_Title_Inverse = 16974335; // 0x10301ff
- field public static final int TextAppearance_Quantum_Widget_ActionMode_Subtitle = 16974336; // 0x1030200
- field public static final int TextAppearance_Quantum_Widget_ActionMode_Subtitle_Inverse = 16974337; // 0x1030201
- field public static final int TextAppearance_Quantum_Widget_ActionMode_Title = 16974338; // 0x1030202
- field public static final int TextAppearance_Quantum_Widget_ActionMode_Title_Inverse = 16974339; // 0x1030203
- field public static final int TextAppearance_Quantum_Widget_Button = 16974340; // 0x1030204
- field public static final int TextAppearance_Quantum_Widget_DropDownHint = 16974341; // 0x1030205
- field public static final int TextAppearance_Quantum_Widget_DropDownItem = 16974342; // 0x1030206
- field public static final int TextAppearance_Quantum_Widget_EditText = 16974343; // 0x1030207
- field public static final int TextAppearance_Quantum_Widget_IconMenu_Item = 16974344; // 0x1030208
- field public static final int TextAppearance_Quantum_Widget_PopupMenu = 16974345; // 0x1030209
- field public static final int TextAppearance_Quantum_Widget_PopupMenu_Large = 16974346; // 0x103020a
- field public static final int TextAppearance_Quantum_Widget_PopupMenu_Small = 16974347; // 0x103020b
- field public static final int TextAppearance_Quantum_Widget_TabWidget = 16974348; // 0x103020c
- field public static final int TextAppearance_Quantum_Widget_TextView = 16974349; // 0x103020d
- field public static final int TextAppearance_Quantum_Widget_TextView_PopupMenu = 16974350; // 0x103020e
- field public static final int TextAppearance_Quantum_Widget_TextView_SpinnerItem = 16974351; // 0x103020f
+ field public static final int TextAppearance_Quantum_Widget_ActionBar_Title = 16974333; // 0x10301fd
+ field public static final int TextAppearance_Quantum_Widget_ActionMode_Subtitle = 16974334; // 0x10301fe
+ field public static final int TextAppearance_Quantum_Widget_ActionMode_Title = 16974335; // 0x10301ff
+ field public static final int TextAppearance_Quantum_Widget_Button = 16974336; // 0x1030200
+ field public static final int TextAppearance_Quantum_Widget_DropDownHint = 16974337; // 0x1030201
+ field public static final int TextAppearance_Quantum_Widget_DropDownItem = 16974338; // 0x1030202
+ field public static final int TextAppearance_Quantum_Widget_EditText = 16974339; // 0x1030203
+ field public static final int TextAppearance_Quantum_Widget_IconMenu_Item = 16974340; // 0x1030204
+ field public static final int TextAppearance_Quantum_Widget_PopupMenu = 16974341; // 0x1030205
+ field public static final int TextAppearance_Quantum_Widget_PopupMenu_Large = 16974342; // 0x1030206
+ field public static final int TextAppearance_Quantum_Widget_PopupMenu_Small = 16974343; // 0x1030207
+ field public static final int TextAppearance_Quantum_Widget_TabWidget = 16974344; // 0x1030208
+ field public static final int TextAppearance_Quantum_Widget_TextView = 16974345; // 0x1030209
+ field public static final int TextAppearance_Quantum_Widget_TextView_PopupMenu = 16974346; // 0x103020a
+ field public static final int TextAppearance_Quantum_Widget_TextView_SpinnerItem = 16974347; // 0x103020b
field public static final int TextAppearance_Quantum_WindowTitle = 16974329; // 0x10301f9
field public static final int TextAppearance_Small = 16973894; // 0x1030046
field public static final int TextAppearance_Small_Inverse = 16973895; // 0x1030047
@@ -1889,34 +1885,34 @@ package android {
field public static final int Theme_NoTitleBar_Fullscreen = 16973831; // 0x1030007
field public static final int Theme_NoTitleBar_OverlayActionModes = 16973930; // 0x103006a
field public static final int Theme_Panel = 16973913; // 0x1030059
- field public static final int Theme_Quantum = 16974352; // 0x1030210
- field public static final int Theme_Quantum_Dialog = 16974353; // 0x1030211
- field public static final int Theme_Quantum_DialogWhenLarge = 16974357; // 0x1030215
- field public static final int Theme_Quantum_DialogWhenLarge_NoActionBar = 16974358; // 0x1030216
- field public static final int Theme_Quantum_Dialog_MinWidth = 16974354; // 0x1030212
- field public static final int Theme_Quantum_Dialog_NoActionBar = 16974355; // 0x1030213
- field public static final int Theme_Quantum_Dialog_NoActionBar_MinWidth = 16974356; // 0x1030214
- field public static final int Theme_Quantum_InputMethod = 16974359; // 0x1030217
- field public static final int Theme_Quantum_Light = 16974367; // 0x103021f
- field public static final int Theme_Quantum_Light_DarkActionBar = 16974368; // 0x1030220
- field public static final int Theme_Quantum_Light_Dialog = 16974369; // 0x1030221
- field public static final int Theme_Quantum_Light_DialogWhenLarge = 16974373; // 0x1030225
- field public static final int Theme_Quantum_Light_DialogWhenLarge_NoActionBar = 16974374; // 0x1030226
- field public static final int Theme_Quantum_Light_Dialog_MinWidth = 16974370; // 0x1030222
- field public static final int Theme_Quantum_Light_Dialog_NoActionBar = 16974371; // 0x1030223
- field public static final int Theme_Quantum_Light_Dialog_NoActionBar_MinWidth = 16974372; // 0x1030224
- field public static final int Theme_Quantum_Light_NoActionBar = 16974375; // 0x1030227
- field public static final int Theme_Quantum_Light_NoActionBar_Fullscreen = 16974376; // 0x1030228
- field public static final int Theme_Quantum_Light_NoActionBar_Overscan = 16974377; // 0x1030229
- field public static final int Theme_Quantum_Light_NoActionBar_TranslucentDecor = 16974378; // 0x103022a
- field public static final int Theme_Quantum_Light_Panel = 16974379; // 0x103022b
- field public static final int Theme_Quantum_NoActionBar = 16974360; // 0x1030218
- field public static final int Theme_Quantum_NoActionBar_Fullscreen = 16974361; // 0x1030219
- field public static final int Theme_Quantum_NoActionBar_Overscan = 16974362; // 0x103021a
- field public static final int Theme_Quantum_NoActionBar_TranslucentDecor = 16974363; // 0x103021b
- field public static final int Theme_Quantum_Panel = 16974364; // 0x103021c
- field public static final int Theme_Quantum_Wallpaper = 16974365; // 0x103021d
- field public static final int Theme_Quantum_Wallpaper_NoTitleBar = 16974366; // 0x103021e
+ field public static final int Theme_Quantum = 16974348; // 0x103020c
+ field public static final int Theme_Quantum_Dialog = 16974349; // 0x103020d
+ field public static final int Theme_Quantum_DialogWhenLarge = 16974353; // 0x1030211
+ field public static final int Theme_Quantum_DialogWhenLarge_NoActionBar = 16974354; // 0x1030212
+ field public static final int Theme_Quantum_Dialog_MinWidth = 16974350; // 0x103020e
+ field public static final int Theme_Quantum_Dialog_NoActionBar = 16974351; // 0x103020f
+ field public static final int Theme_Quantum_Dialog_NoActionBar_MinWidth = 16974352; // 0x1030210
+ field public static final int Theme_Quantum_InputMethod = 16974355; // 0x1030213
+ field public static final int Theme_Quantum_Light = 16974363; // 0x103021b
+ field public static final int Theme_Quantum_Light_DarkActionBar = 16974364; // 0x103021c
+ field public static final int Theme_Quantum_Light_Dialog = 16974365; // 0x103021d
+ field public static final int Theme_Quantum_Light_DialogWhenLarge = 16974369; // 0x1030221
+ field public static final int Theme_Quantum_Light_DialogWhenLarge_NoActionBar = 16974370; // 0x1030222
+ field public static final int Theme_Quantum_Light_Dialog_MinWidth = 16974366; // 0x103021e
+ field public static final int Theme_Quantum_Light_Dialog_NoActionBar = 16974367; // 0x103021f
+ field public static final int Theme_Quantum_Light_Dialog_NoActionBar_MinWidth = 16974368; // 0x1030220
+ field public static final int Theme_Quantum_Light_NoActionBar = 16974371; // 0x1030223
+ field public static final int Theme_Quantum_Light_NoActionBar_Fullscreen = 16974372; // 0x1030224
+ field public static final int Theme_Quantum_Light_NoActionBar_Overscan = 16974373; // 0x1030225
+ field public static final int Theme_Quantum_Light_NoActionBar_TranslucentDecor = 16974374; // 0x1030226
+ field public static final int Theme_Quantum_Light_Panel = 16974375; // 0x1030227
+ field public static final int Theme_Quantum_NoActionBar = 16974356; // 0x1030214
+ field public static final int Theme_Quantum_NoActionBar_Fullscreen = 16974357; // 0x1030215
+ field public static final int Theme_Quantum_NoActionBar_Overscan = 16974358; // 0x1030216
+ field public static final int Theme_Quantum_NoActionBar_TranslucentDecor = 16974359; // 0x1030217
+ field public static final int Theme_Quantum_Panel = 16974360; // 0x1030218
+ field public static final int Theme_Quantum_Wallpaper = 16974361; // 0x1030219
+ field public static final int Theme_Quantum_Wallpaper_NoTitleBar = 16974362; // 0x103021a
field public static final int Theme_Translucent = 16973839; // 0x103000f
field public static final int Theme_Translucent_NoTitleBar = 16973840; // 0x1030010
field public static final int Theme_Translucent_NoTitleBar_Fullscreen = 16973841; // 0x1030011
@@ -2204,127 +2200,128 @@ package android {
field public static final int Widget_ProgressBar_Large_Inverse = 16973916; // 0x103005c
field public static final int Widget_ProgressBar_Small = 16973854; // 0x103001e
field public static final int Widget_ProgressBar_Small_Inverse = 16973917; // 0x103005d
- field public static final int Widget_Quantum = 16974380; // 0x103022c
- field public static final int Widget_Quantum_ActionBar = 16974381; // 0x103022d
- field public static final int Widget_Quantum_ActionBar_Solid = 16974382; // 0x103022e
- field public static final int Widget_Quantum_ActionBar_TabBar = 16974383; // 0x103022f
- field public static final int Widget_Quantum_ActionBar_TabText = 16974384; // 0x1030230
- field public static final int Widget_Quantum_ActionBar_TabView = 16974385; // 0x1030231
- field public static final int Widget_Quantum_ActionButton = 16974386; // 0x1030232
- field public static final int Widget_Quantum_ActionButton_CloseMode = 16974387; // 0x1030233
- field public static final int Widget_Quantum_ActionButton_Overflow = 16974388; // 0x1030234
- field public static final int Widget_Quantum_ActionButton_TextButton = 16974389; // 0x1030235
- field public static final int Widget_Quantum_ActionMode = 16974390; // 0x1030236
- field public static final int Widget_Quantum_AutoCompleteTextView = 16974391; // 0x1030237
- field public static final int Widget_Quantum_Button = 16974392; // 0x1030238
- field public static final int Widget_Quantum_Button_Borderless = 16974393; // 0x1030239
- field public static final int Widget_Quantum_Button_Borderless_Small = 16974394; // 0x103023a
- field public static final int Widget_Quantum_Button_Inset = 16974395; // 0x103023b
- field public static final int Widget_Quantum_Button_Paper = 16974503; // 0x10302a7
- field public static final int Widget_Quantum_Button_Paper_Color = 16974504; // 0x10302a8
- field public static final int Widget_Quantum_Button_Small = 16974396; // 0x103023c
- field public static final int Widget_Quantum_Button_Toggle = 16974397; // 0x103023d
- field public static final int Widget_Quantum_CalendarView = 16974398; // 0x103023e
- field public static final int Widget_Quantum_CheckedTextView = 16974399; // 0x103023f
- field public static final int Widget_Quantum_CompoundButton_CheckBox = 16974400; // 0x1030240
- field public static final int Widget_Quantum_CompoundButton_RadioButton = 16974401; // 0x1030241
- field public static final int Widget_Quantum_CompoundButton_Star = 16974402; // 0x1030242
- field public static final int Widget_Quantum_DatePicker = 16974403; // 0x1030243
- field public static final int Widget_Quantum_DropDownItem = 16974404; // 0x1030244
- field public static final int Widget_Quantum_DropDownItem_Spinner = 16974405; // 0x1030245
- field public static final int Widget_Quantum_EditText = 16974406; // 0x1030246
- field public static final int Widget_Quantum_ExpandableListView = 16974407; // 0x1030247
- field public static final int Widget_Quantum_FastScroll = 16974408; // 0x1030248
- field public static final int Widget_Quantum_FragmentBreadCrumbs = 16974409; // 0x1030249
- field public static final int Widget_Quantum_GridView = 16974410; // 0x103024a
- field public static final int Widget_Quantum_HorizontalScrollView = 16974411; // 0x103024b
- field public static final int Widget_Quantum_ImageButton = 16974412; // 0x103024c
- field public static final int Widget_Quantum_Light = 16974436; // 0x1030264
- field public static final int Widget_Quantum_Light_ActionBar = 16974437; // 0x1030265
- field public static final int Widget_Quantum_Light_ActionBar_Solid = 16974438; // 0x1030266
- field public static final int Widget_Quantum_Light_ActionBar_Solid_Inverse = 16974439; // 0x1030267
- field public static final int Widget_Quantum_Light_ActionBar_TabBar = 16974440; // 0x1030268
- field public static final int Widget_Quantum_Light_ActionBar_TabBar_Inverse = 16974441; // 0x1030269
- field public static final int Widget_Quantum_Light_ActionBar_TabText = 16974442; // 0x103026a
- field public static final int Widget_Quantum_Light_ActionBar_TabText_Inverse = 16974443; // 0x103026b
- field public static final int Widget_Quantum_Light_ActionBar_TabView = 16974444; // 0x103026c
- field public static final int Widget_Quantum_Light_ActionBar_TabView_Inverse = 16974445; // 0x103026d
- field public static final int Widget_Quantum_Light_ActionButton = 16974446; // 0x103026e
- field public static final int Widget_Quantum_Light_ActionButton_CloseMode = 16974447; // 0x103026f
- field public static final int Widget_Quantum_Light_ActionButton_Overflow = 16974448; // 0x1030270
- field public static final int Widget_Quantum_Light_ActionMode = 16974450; // 0x1030272
- field public static final int Widget_Quantum_Light_ActionMode_Inverse = 16974449; // 0x1030271
- field public static final int Widget_Quantum_Light_AutoCompleteTextView = 16974451; // 0x1030273
- field public static final int Widget_Quantum_Light_Button = 16974452; // 0x1030274
- field public static final int Widget_Quantum_Light_Button_Borderless_Small = 16974453; // 0x1030275
- field public static final int Widget_Quantum_Light_Button_Inset = 16974454; // 0x1030276
- field public static final int Widget_Quantum_Light_Button_Paper = 16974505; // 0x10302a9
- field public static final int Widget_Quantum_Light_Button_Paper_Color = 16974506; // 0x10302aa
- field public static final int Widget_Quantum_Light_Button_Small = 16974455; // 0x1030277
- field public static final int Widget_Quantum_Light_Button_Toggle = 16974456; // 0x1030278
- field public static final int Widget_Quantum_Light_CalendarView = 16974457; // 0x1030279
- field public static final int Widget_Quantum_Light_CheckedTextView = 16974458; // 0x103027a
- field public static final int Widget_Quantum_Light_CompoundButton_CheckBox = 16974459; // 0x103027b
- field public static final int Widget_Quantum_Light_CompoundButton_RadioButton = 16974460; // 0x103027c
- field public static final int Widget_Quantum_Light_CompoundButton_Star = 16974461; // 0x103027d
- field public static final int Widget_Quantum_Light_DropDownItem = 16974462; // 0x103027e
- field public static final int Widget_Quantum_Light_DropDownItem_Spinner = 16974463; // 0x103027f
- field public static final int Widget_Quantum_Light_EditText = 16974464; // 0x1030280
- field public static final int Widget_Quantum_Light_ExpandableListView = 16974465; // 0x1030281
- field public static final int Widget_Quantum_Light_FastScroll = 16974466; // 0x1030282
- field public static final int Widget_Quantum_Light_FragmentBreadCrumbs = 16974467; // 0x1030283
- field public static final int Widget_Quantum_Light_GridView = 16974468; // 0x1030284
- field public static final int Widget_Quantum_Light_HorizontalScrollView = 16974469; // 0x1030285
- field public static final int Widget_Quantum_Light_ImageButton = 16974470; // 0x1030286
- field public static final int Widget_Quantum_Light_ListPopupWindow = 16974471; // 0x1030287
- field public static final int Widget_Quantum_Light_ListView = 16974472; // 0x1030288
- field public static final int Widget_Quantum_Light_ListView_DropDown = 16974473; // 0x1030289
- field public static final int Widget_Quantum_Light_MediaRouteButton = 16974474; // 0x103028a
- field public static final int Widget_Quantum_Light_PopupMenu = 16974475; // 0x103028b
- field public static final int Widget_Quantum_Light_PopupWindow = 16974476; // 0x103028c
- field public static final int Widget_Quantum_Light_ProgressBar = 16974477; // 0x103028d
- field public static final int Widget_Quantum_Light_ProgressBar_Horizontal = 16974478; // 0x103028e
- field public static final int Widget_Quantum_Light_ProgressBar_Inverse = 16974479; // 0x103028f
- field public static final int Widget_Quantum_Light_ProgressBar_Large = 16974480; // 0x1030290
- field public static final int Widget_Quantum_Light_ProgressBar_Large_Inverse = 16974481; // 0x1030291
- field public static final int Widget_Quantum_Light_ProgressBar_Small = 16974482; // 0x1030292
- field public static final int Widget_Quantum_Light_ProgressBar_Small_Inverse = 16974483; // 0x1030293
- field public static final int Widget_Quantum_Light_ProgressBar_Small_Title = 16974484; // 0x1030294
- field public static final int Widget_Quantum_Light_RatingBar = 16974485; // 0x1030295
- field public static final int Widget_Quantum_Light_RatingBar_Indicator = 16974486; // 0x1030296
- field public static final int Widget_Quantum_Light_RatingBar_Small = 16974487; // 0x1030297
- field public static final int Widget_Quantum_Light_ScrollView = 16974488; // 0x1030298
- field public static final int Widget_Quantum_Light_SeekBar = 16974489; // 0x1030299
- field public static final int Widget_Quantum_Light_Spinner = 16974490; // 0x103029a
- field public static final int Widget_Quantum_Light_Tab = 16974491; // 0x103029b
- field public static final int Widget_Quantum_Light_TabWidget = 16974492; // 0x103029c
- field public static final int Widget_Quantum_Light_TextView = 16974493; // 0x103029d
- field public static final int Widget_Quantum_Light_TextView_SpinnerItem = 16974494; // 0x103029e
- field public static final int Widget_Quantum_Light_WebTextView = 16974495; // 0x103029f
- field public static final int Widget_Quantum_Light_WebView = 16974496; // 0x10302a0
- field public static final int Widget_Quantum_ListPopupWindow = 16974413; // 0x103024d
- field public static final int Widget_Quantum_ListView = 16974414; // 0x103024e
- field public static final int Widget_Quantum_ListView_DropDown = 16974415; // 0x103024f
- field public static final int Widget_Quantum_MediaRouteButton = 16974416; // 0x1030250
- field public static final int Widget_Quantum_PopupMenu = 16974417; // 0x1030251
- field public static final int Widget_Quantum_PopupWindow = 16974418; // 0x1030252
- field public static final int Widget_Quantum_ProgressBar = 16974419; // 0x1030253
- field public static final int Widget_Quantum_ProgressBar_Horizontal = 16974420; // 0x1030254
- field public static final int Widget_Quantum_ProgressBar_Large = 16974421; // 0x1030255
- field public static final int Widget_Quantum_ProgressBar_Small = 16974422; // 0x1030256
- field public static final int Widget_Quantum_ProgressBar_Small_Title = 16974423; // 0x1030257
- field public static final int Widget_Quantum_RatingBar = 16974424; // 0x1030258
- field public static final int Widget_Quantum_RatingBar_Indicator = 16974425; // 0x1030259
- field public static final int Widget_Quantum_RatingBar_Small = 16974426; // 0x103025a
- field public static final int Widget_Quantum_ScrollView = 16974427; // 0x103025b
- field public static final int Widget_Quantum_SeekBar = 16974428; // 0x103025c
- field public static final int Widget_Quantum_Spinner = 16974429; // 0x103025d
- field public static final int Widget_Quantum_Tab = 16974430; // 0x103025e
- field public static final int Widget_Quantum_TabWidget = 16974431; // 0x103025f
- field public static final int Widget_Quantum_TextView = 16974432; // 0x1030260
- field public static final int Widget_Quantum_TextView_SpinnerItem = 16974433; // 0x1030261
- field public static final int Widget_Quantum_WebTextView = 16974434; // 0x1030262
- field public static final int Widget_Quantum_WebView = 16974435; // 0x1030263
+ field public static final int Widget_Quantum = 16974376; // 0x1030228
+ field public static final int Widget_Quantum_ActionBar = 16974377; // 0x1030229
+ field public static final int Widget_Quantum_ActionBar_Solid = 16974378; // 0x103022a
+ field public static final int Widget_Quantum_ActionBar_TabBar = 16974379; // 0x103022b
+ field public static final int Widget_Quantum_ActionBar_TabText = 16974380; // 0x103022c
+ field public static final int Widget_Quantum_ActionBar_TabView = 16974381; // 0x103022d
+ field public static final int Widget_Quantum_ActionButton = 16974382; // 0x103022e
+ field public static final int Widget_Quantum_ActionButton_CloseMode = 16974383; // 0x103022f
+ field public static final int Widget_Quantum_ActionButton_Overflow = 16974384; // 0x1030230
+ field public static final int Widget_Quantum_ActionButton_TextButton = 16974385; // 0x1030231
+ field public static final int Widget_Quantum_ActionMode = 16974386; // 0x1030232
+ field public static final int Widget_Quantum_AutoCompleteTextView = 16974387; // 0x1030233
+ field public static final int Widget_Quantum_Button = 16974388; // 0x1030234
+ field public static final int Widget_Quantum_ButtonBar = 16974394; // 0x103023a
+ field public static final int Widget_Quantum_ButtonBar_AlertDialog = 16974395; // 0x103023b
+ field public static final int Widget_Quantum_Button_Borderless = 16974389; // 0x1030235
+ field public static final int Widget_Quantum_Button_Borderless_Small = 16974390; // 0x1030236
+ field public static final int Widget_Quantum_Button_Inset = 16974391; // 0x1030237
+ field public static final int Widget_Quantum_Button_Paper = 16974494; // 0x103029e
+ field public static final int Widget_Quantum_Button_Paper_Color = 16974495; // 0x103029f
+ field public static final int Widget_Quantum_Button_Small = 16974392; // 0x1030238
+ field public static final int Widget_Quantum_Button_Toggle = 16974393; // 0x1030239
+ field public static final int Widget_Quantum_CalendarView = 16974396; // 0x103023c
+ field public static final int Widget_Quantum_CheckedTextView = 16974397; // 0x103023d
+ field public static final int Widget_Quantum_CompoundButton_CheckBox = 16974398; // 0x103023e
+ field public static final int Widget_Quantum_CompoundButton_RadioButton = 16974399; // 0x103023f
+ field public static final int Widget_Quantum_CompoundButton_Star = 16974400; // 0x1030240
+ field public static final int Widget_Quantum_DatePicker = 16974401; // 0x1030241
+ field public static final int Widget_Quantum_DropDownItem = 16974402; // 0x1030242
+ field public static final int Widget_Quantum_DropDownItem_Spinner = 16974403; // 0x1030243
+ field public static final int Widget_Quantum_EditText = 16974404; // 0x1030244
+ field public static final int Widget_Quantum_ExpandableListView = 16974405; // 0x1030245
+ field public static final int Widget_Quantum_FastScroll = 16974406; // 0x1030246
+ field public static final int Widget_Quantum_FragmentBreadCrumbs = 16974407; // 0x1030247
+ field public static final int Widget_Quantum_GridView = 16974408; // 0x1030248
+ field public static final int Widget_Quantum_HorizontalScrollView = 16974409; // 0x1030249
+ field public static final int Widget_Quantum_ImageButton = 16974410; // 0x103024a
+ field public static final int Widget_Quantum_Light = 16974435; // 0x1030263
+ field public static final int Widget_Quantum_Light_ActionBar = 16974436; // 0x1030264
+ field public static final int Widget_Quantum_Light_ActionBar_Solid = 16974437; // 0x1030265
+ field public static final int Widget_Quantum_Light_ActionBar_TabBar = 16974438; // 0x1030266
+ field public static final int Widget_Quantum_Light_ActionBar_TabText = 16974439; // 0x1030267
+ field public static final int Widget_Quantum_Light_ActionBar_TabView = 16974440; // 0x1030268
+ field public static final int Widget_Quantum_Light_ActionButton = 16974441; // 0x1030269
+ field public static final int Widget_Quantum_Light_ActionButton_CloseMode = 16974442; // 0x103026a
+ field public static final int Widget_Quantum_Light_ActionButton_Overflow = 16974443; // 0x103026b
+ field public static final int Widget_Quantum_Light_ActionMode = 16974444; // 0x103026c
+ field public static final int Widget_Quantum_Light_AutoCompleteTextView = 16974445; // 0x103026d
+ field public static final int Widget_Quantum_Light_Button = 16974446; // 0x103026e
+ field public static final int Widget_Quantum_Light_ButtonBar = 16974451; // 0x1030273
+ field public static final int Widget_Quantum_Light_ButtonBar_AlertDialog = 16974452; // 0x1030274
+ field public static final int Widget_Quantum_Light_Button_Borderless_Small = 16974447; // 0x103026f
+ field public static final int Widget_Quantum_Light_Button_Inset = 16974448; // 0x1030270
+ field public static final int Widget_Quantum_Light_Button_Paper = 16974496; // 0x10302a0
+ field public static final int Widget_Quantum_Light_Button_Paper_Color = 16974497; // 0x10302a1
+ field public static final int Widget_Quantum_Light_Button_Small = 16974449; // 0x1030271
+ field public static final int Widget_Quantum_Light_Button_Toggle = 16974450; // 0x1030272
+ field public static final int Widget_Quantum_Light_CalendarView = 16974453; // 0x1030275
+ field public static final int Widget_Quantum_Light_CheckedTextView = 16974454; // 0x1030276
+ field public static final int Widget_Quantum_Light_CompoundButton_CheckBox = 16974455; // 0x1030277
+ field public static final int Widget_Quantum_Light_CompoundButton_RadioButton = 16974456; // 0x1030278
+ field public static final int Widget_Quantum_Light_CompoundButton_Star = 16974457; // 0x1030279
+ field public static final int Widget_Quantum_Light_DropDownItem = 16974458; // 0x103027a
+ field public static final int Widget_Quantum_Light_DropDownItem_Spinner = 16974459; // 0x103027b
+ field public static final int Widget_Quantum_Light_EditText = 16974460; // 0x103027c
+ field public static final int Widget_Quantum_Light_ExpandableListView = 16974461; // 0x103027d
+ field public static final int Widget_Quantum_Light_FastScroll = 16974462; // 0x103027e
+ field public static final int Widget_Quantum_Light_FragmentBreadCrumbs = 16974463; // 0x103027f
+ field public static final int Widget_Quantum_Light_GridView = 16974464; // 0x1030280
+ field public static final int Widget_Quantum_Light_HorizontalScrollView = 16974465; // 0x1030281
+ field public static final int Widget_Quantum_Light_ImageButton = 16974466; // 0x1030282
+ field public static final int Widget_Quantum_Light_ListPopupWindow = 16974467; // 0x1030283
+ field public static final int Widget_Quantum_Light_ListView = 16974468; // 0x1030284
+ field public static final int Widget_Quantum_Light_ListView_DropDown = 16974469; // 0x1030285
+ field public static final int Widget_Quantum_Light_MediaRouteButton = 16974470; // 0x1030286
+ field public static final int Widget_Quantum_Light_PopupMenu = 16974471; // 0x1030287
+ field public static final int Widget_Quantum_Light_PopupWindow = 16974472; // 0x1030288
+ field public static final int Widget_Quantum_Light_ProgressBar = 16974473; // 0x1030289
+ field public static final int Widget_Quantum_Light_ProgressBar_Horizontal = 16974474; // 0x103028a
+ field public static final int Widget_Quantum_Light_ProgressBar_Inverse = 16974475; // 0x103028b
+ field public static final int Widget_Quantum_Light_ProgressBar_Large = 16974476; // 0x103028c
+ field public static final int Widget_Quantum_Light_ProgressBar_Large_Inverse = 16974477; // 0x103028d
+ field public static final int Widget_Quantum_Light_ProgressBar_Small = 16974478; // 0x103028e
+ field public static final int Widget_Quantum_Light_ProgressBar_Small_Inverse = 16974479; // 0x103028f
+ field public static final int Widget_Quantum_Light_ProgressBar_Small_Title = 16974480; // 0x1030290
+ field public static final int Widget_Quantum_Light_RatingBar = 16974481; // 0x1030291
+ field public static final int Widget_Quantum_Light_RatingBar_Indicator = 16974482; // 0x1030292
+ field public static final int Widget_Quantum_Light_RatingBar_Small = 16974483; // 0x1030293
+ field public static final int Widget_Quantum_Light_ScrollView = 16974484; // 0x1030294
+ field public static final int Widget_Quantum_Light_SeekBar = 16974485; // 0x1030295
+ field public static final int Widget_Quantum_Light_SegmentedButton = 16974486; // 0x1030296
+ field public static final int Widget_Quantum_Light_Spinner = 16974487; // 0x1030297
+ field public static final int Widget_Quantum_Light_Tab = 16974488; // 0x1030298
+ field public static final int Widget_Quantum_Light_TabWidget = 16974489; // 0x1030299
+ field public static final int Widget_Quantum_Light_TextView = 16974490; // 0x103029a
+ field public static final int Widget_Quantum_Light_TextView_SpinnerItem = 16974491; // 0x103029b
+ field public static final int Widget_Quantum_Light_WebTextView = 16974492; // 0x103029c
+ field public static final int Widget_Quantum_Light_WebView = 16974493; // 0x103029d
+ field public static final int Widget_Quantum_ListPopupWindow = 16974411; // 0x103024b
+ field public static final int Widget_Quantum_ListView = 16974412; // 0x103024c
+ field public static final int Widget_Quantum_ListView_DropDown = 16974413; // 0x103024d
+ field public static final int Widget_Quantum_MediaRouteButton = 16974414; // 0x103024e
+ field public static final int Widget_Quantum_PopupMenu = 16974415; // 0x103024f
+ field public static final int Widget_Quantum_PopupWindow = 16974416; // 0x1030250
+ field public static final int Widget_Quantum_ProgressBar = 16974417; // 0x1030251
+ field public static final int Widget_Quantum_ProgressBar_Horizontal = 16974418; // 0x1030252
+ field public static final int Widget_Quantum_ProgressBar_Large = 16974419; // 0x1030253
+ field public static final int Widget_Quantum_ProgressBar_Small = 16974420; // 0x1030254
+ field public static final int Widget_Quantum_ProgressBar_Small_Title = 16974421; // 0x1030255
+ field public static final int Widget_Quantum_RatingBar = 16974422; // 0x1030256
+ field public static final int Widget_Quantum_RatingBar_Indicator = 16974423; // 0x1030257
+ field public static final int Widget_Quantum_RatingBar_Small = 16974424; // 0x1030258
+ field public static final int Widget_Quantum_ScrollView = 16974425; // 0x1030259
+ field public static final int Widget_Quantum_SeekBar = 16974426; // 0x103025a
+ field public static final int Widget_Quantum_SegmentedButton = 16974427; // 0x103025b
+ field public static final int Widget_Quantum_Spinner = 16974428; // 0x103025c
+ field public static final int Widget_Quantum_Tab = 16974429; // 0x103025d
+ field public static final int Widget_Quantum_TabWidget = 16974430; // 0x103025e
+ field public static final int Widget_Quantum_TextView = 16974431; // 0x103025f
+ field public static final int Widget_Quantum_TextView_SpinnerItem = 16974432; // 0x1030260
+ field public static final int Widget_Quantum_WebTextView = 16974433; // 0x1030261
+ field public static final int Widget_Quantum_WebView = 16974434; // 0x1030262
field public static final int Widget_RatingBar = 16973857; // 0x1030021
field public static final int Widget_ScrollView = 16973869; // 0x103002d
field public static final int Widget_SeekBar = 16973856; // 0x1030020
@@ -11618,6 +11615,7 @@ package android.hardware.camera2 {
field public static final int FLASH_MODE_TORCH = 2; // 0x2
field public static final int FLASH_STATE_CHARGING = 1; // 0x1
field public static final int FLASH_STATE_FIRED = 3; // 0x3
+ field public static final int FLASH_STATE_PARTIAL = 4; // 0x4
field public static final int FLASH_STATE_READY = 2; // 0x2
field public static final int FLASH_STATE_UNAVAILABLE = 0; // 0x0
field public static final int HOT_PIXEL_MODE_FAST = 1; // 0x1
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
index c5fc941..1153f38 100644
--- a/cmds/idmap/scan.cpp
+++ b/cmds/idmap/scan.cpp
@@ -119,7 +119,8 @@ namespace {
int parse_manifest(const void *data, size_t size, const char *target_package_name)
{
- ResXMLTree parser(data, size);
+ ResXMLTree parser;
+ parser.setTo(data, size);
if (parser.getError() != NO_ERROR) {
ALOGD("%s failed to init xml parser, error=0x%08x\n", __FUNCTION__, parser.getError());
return -1;
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 69ada6a..965f815 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -1592,10 +1592,10 @@ public final class ActivityThread {
/**
* Creates the top level resources for the given package.
*/
- Resources getTopLevelResources(String resDir, String[] overlayDirs,
+ Resources getTopLevelResources(String resDir, String[] overlayDirs, String[] libDirs,
int displayId, Configuration overrideConfiguration,
LoadedApk pkgInfo) {
- return mResourcesManager.getTopLevelResources(resDir, overlayDirs, displayId,
+ return mResourcesManager.getTopLevelResources(resDir, overlayDirs, libDirs, displayId,
overrideConfiguration, pkgInfo.getCompatibilityInfo(), null);
}
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 8165fa1..0615bd9 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -805,7 +805,7 @@ final class ApplicationPackageManager extends PackageManager {
}
Resources r = mContext.mMainThread.getTopLevelResources(
app.uid == Process.myUid() ? app.sourceDir : app.publicSourceDir,
- app.resourceDirs, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo);
+ app.resourceDirs, null, Display.DEFAULT_DISPLAY, null, mContext.mPackageInfo);
if (r != null) {
return r;
}
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 87f47a1..589c82f 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -2044,8 +2044,9 @@ class ContextImpl extends Context {
|| (compatInfo != null && compatInfo.applicationScale
!= resources.getCompatibilityInfo().applicationScale)) {
resources = mResourcesManager.getTopLevelResources(
- packageInfo.getResDir(), packageInfo.getOverlayDirs(), displayId,
- overrideConfiguration, compatInfo, activityToken);
+ packageInfo.getResDir(), packageInfo.getOverlayDirs(),
+ packageInfo.getApplicationInfo().sharedLibraryFiles,
+ displayId, overrideConfiguration, compatInfo, activityToken);
}
}
mResources = resources;
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index d409352..3ae8bfc 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -41,6 +41,7 @@ import android.os.Trace;
import android.os.UserHandle;
import android.util.AndroidRuntimeException;
import android.util.Slog;
+import android.util.SparseArray;
import android.view.DisplayAdjustments;
import android.view.Display;
@@ -48,6 +49,8 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.Enumeration;
@@ -485,7 +488,7 @@ public final class LoadedApk {
public Resources getResources(ActivityThread mainThread) {
if (mResources == null) {
mResources = mainThread.getTopLevelResources(mResDir, mOverlayDirs,
- Display.DEFAULT_DISPLAY, null, this);
+ mApplicationInfo.sharedLibraryFiles, Display.DEFAULT_DISPLAY, null, this);
}
return mResources;
}
@@ -530,10 +533,101 @@ public final class LoadedApk {
}
}
}
-
+
+ // Rewrite the R 'constants' for all library apks.
+ SparseArray<String> packageIdentifiers = getAssets(mActivityThread)
+ .getAssignedPackageIdentifiers();
+ final int N = packageIdentifiers.size();
+ for (int i = 0; i < N; i++) {
+ final int id = packageIdentifiers.keyAt(i);
+ if (id == 0x01 || id == 0x7f) {
+ continue;
+ }
+
+ rewriteRValues(getClassLoader(), packageIdentifiers.valueAt(i), id);
+ }
+
return app;
}
+ private void rewriteIntField(Field field, int packageId) throws IllegalAccessException {
+ int requiredModifiers = Modifier.STATIC | Modifier.PUBLIC;
+ int bannedModifiers = Modifier.FINAL;
+
+ int mod = field.getModifiers();
+ if ((mod & requiredModifiers) != requiredModifiers ||
+ (mod & bannedModifiers) != 0) {
+ throw new IllegalArgumentException("Field " + field.getName() +
+ " is not rewritable");
+ }
+
+ if (field.getType() != int.class && field.getType() != Integer.class) {
+ throw new IllegalArgumentException("Field " + field.getName() +
+ " is not an integer");
+ }
+
+ try {
+ int resId = field.getInt(null);
+ field.setInt(null, (resId & 0x00ffffff) | (packageId << 24));
+ } catch (IllegalAccessException e) {
+ // This should not occur (we check above if we can write to it)
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ private void rewriteIntArrayField(Field field, int packageId) {
+ int requiredModifiers = Modifier.STATIC | Modifier.PUBLIC;
+
+ if ((field.getModifiers() & requiredModifiers) != requiredModifiers) {
+ throw new IllegalArgumentException("Field " + field.getName() +
+ " is not rewritable");
+ }
+
+ if (field.getType() != int[].class) {
+ throw new IllegalArgumentException("Field " + field.getName() +
+ " is not an integer array");
+ }
+
+ try {
+ int[] array = (int[]) field.get(null);
+ for (int i = 0; i < array.length; i++) {
+ array[i] = (array[i] & 0x00ffffff) | (packageId << 24);
+ }
+ } catch (IllegalAccessException e) {
+ // This should not occur (we check above if we can write to it)
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ private void rewriteRValues(ClassLoader cl, String packageName, int id) {
+ try {
+ final Class<?> rClazz = cl.loadClass(packageName + ".R");
+ Class<?>[] declaredClasses = rClazz.getDeclaredClasses();
+ for (Class<?> clazz : declaredClasses) {
+ try {
+ if (clazz.getSimpleName().equals("styleable")) {
+ for (Field field : clazz.getDeclaredFields()) {
+ if (field.getType() == int[].class) {
+ rewriteIntArrayField(field, id);
+ }
+ }
+
+ } else {
+ for (Field field : clazz.getDeclaredFields()) {
+ rewriteIntField(field, id);
+ }
+ }
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Failed to rewrite R values for " +
+ clazz.getName(), e);
+ }
+ }
+
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Failed to rewrite R values", e);
+ }
+ }
+
public void removeContextRegistrations(Context context,
String who, String what) {
final boolean reportRegistrationLeaks = StrictMode.vmRegistrationLeaksEnabled();
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index 728f372..a67faa0 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -144,14 +144,16 @@ public class ResourcesManager {
* Creates the top level Resources for applications with the given compatibility info.
*
* @param resDir the resource directory.
+ * @param overlayDirs the resource overlay directories.
+ * @param libDirs the shared library resource dirs this app references.
* @param compatInfo the compability info. Must not be null.
* @param token the application token for determining stack bounds.
*/
- public Resources getTopLevelResources(String resDir, String[] overlayDirs, int displayId,
- Configuration overrideConfiguration, CompatibilityInfo compatInfo, IBinder token) {
+ public Resources getTopLevelResources(String resDir, String[] overlayDirs, String[] libDirs,
+ int displayId, Configuration overrideConfiguration, CompatibilityInfo compatInfo,
+ IBinder token) {
final float scale = compatInfo.applicationScale;
- ResourcesKey key = new ResourcesKey(resDir, displayId, overrideConfiguration, scale,
- token);
+ ResourcesKey key = new ResourcesKey(resDir, displayId, overrideConfiguration, scale, token);
Resources r;
synchronized (this) {
// Resources is app scale dependent.
@@ -186,6 +188,15 @@ public class ResourcesManager {
}
}
+ if (libDirs != null) {
+ for (String libDir : libDirs) {
+ if (assets.addAssetPath(libDir) == 0) {
+ Slog.w(TAG, "Asset path '" + libDir +
+ "' does not exist or contains no resources.");
+ }
+ }
+ }
+
//Slog.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics);
DisplayMetrics dm = getDisplayMetricsLocked(displayId);
Configuration config;
diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java
index 2f8dd53..0c04401 100644
--- a/core/java/android/content/res/AssetManager.java
+++ b/core/java/android/content/res/AssetManager.java
@@ -18,6 +18,7 @@ package android.content.res;
import android.os.ParcelFileDescriptor;
import android.util.Log;
+import android.util.SparseArray;
import android.util.TypedValue;
import java.io.FileNotFoundException;
@@ -266,11 +267,9 @@ public final class AssetManager {
}
}
- /*package*/ final CharSequence getPooledString(int block, int id) {
- //System.out.println("Get pooled: block=" + block
- // + ", id=#" + Integer.toHexString(id)
- // + ", blocks=" + mStringBlocks);
- return mStringBlocks[block-1].get(id);
+ /*package*/ final CharSequence getPooledStringForCookie(int cookie, int id) {
+ // Cookies map to string blocks starting at 1.
+ return mStringBlocks[cookie - 1].get(id);
}
/**
@@ -740,6 +739,11 @@ public final class AssetManager {
/**
* {@hide}
*/
+ public native final SparseArray<String> getAssignedPackageIdentifiers();
+
+ /**
+ * {@hide}
+ */
public native static final int getGlobalAssetCount();
/**
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java
index baf887e..9fb2846 100644
--- a/core/java/android/content/res/TypedArray.java
+++ b/core/java/android/content/res/TypedArray.java
@@ -793,10 +793,9 @@ public class TypedArray {
public int[] extractThemeAttrs() {
int[] attrs = null;
- final int N = getIndexCount();
+ final int N = length();
for (int i = 0; i < N; i++) {
- final int index = getIndex(i);
- final int attrId = getThemeAttributeId(index, 0);
+ final int attrId = getThemeAttributeId(i, 0);
if (attrId != 0) {
if (attrs == null) {
attrs = new int[N];
@@ -834,7 +833,7 @@ public class TypedArray {
}
return null;
}
- return mAssets.getPooledString(cookie, data[index+AssetManager.STYLE_DATA]);
+ return mAssets.getPooledStringForCookie(cookie, data[index+AssetManager.STYLE_DATA]);
}
/*package*/ TypedArray(Resources resources, int[] data, int[] indices, int len) {
diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java
index 3ad357f..2f4d69b 100644
--- a/core/java/android/content/res/XmlBlock.java
+++ b/core/java/android/content/res/XmlBlock.java
@@ -375,7 +375,7 @@ final class XmlBlock {
boolean defaultValue) {
int t = nativeGetAttributeDataType(mParseState, idx);
// Note: don't attempt to convert any other types, because
- // we want to count on appt doing the conversion for us.
+ // we want to count on aapt doing the conversion for us.
if (t >= TypedValue.TYPE_FIRST_INT &&
t <= TypedValue.TYPE_LAST_INT) {
return nativeGetAttributeData(mParseState, idx) != 0;
@@ -385,7 +385,7 @@ final class XmlBlock {
public int getAttributeResourceValue(int idx, int defaultValue) {
int t = nativeGetAttributeDataType(mParseState, idx);
// Note: don't attempt to convert any other types, because
- // we want to count on appt doing the conversion for us.
+ // we want to count on aapt doing the conversion for us.
if (t == TypedValue.TYPE_REFERENCE) {
return nativeGetAttributeData(mParseState, idx);
}
@@ -394,7 +394,7 @@ final class XmlBlock {
public int getAttributeIntValue(int idx, int defaultValue) {
int t = nativeGetAttributeDataType(mParseState, idx);
// Note: don't attempt to convert any other types, because
- // we want to count on appt doing the conversion for us.
+ // we want to count on aapt doing the conversion for us.
if (t >= TypedValue.TYPE_FIRST_INT &&
t <= TypedValue.TYPE_LAST_INT) {
return nativeGetAttributeData(mParseState, idx);
@@ -404,7 +404,7 @@ final class XmlBlock {
public int getAttributeUnsignedIntValue(int idx, int defaultValue) {
int t = nativeGetAttributeDataType(mParseState, idx);
// Note: don't attempt to convert any other types, because
- // we want to count on appt doing the conversion for us.
+ // we want to count on aapt doing the conversion for us.
if (t >= TypedValue.TYPE_FIRST_INT &&
t <= TypedValue.TYPE_LAST_INT) {
return nativeGetAttributeData(mParseState, idx);
@@ -414,7 +414,7 @@ final class XmlBlock {
public float getAttributeFloatValue(int idx, float defaultValue) {
int t = nativeGetAttributeDataType(mParseState, idx);
// Note: don't attempt to convert any other types, because
- // we want to count on appt doing the conversion for us.
+ // we want to count on aapt doing the conversion for us.
if (t == TypedValue.TYPE_FLOAT) {
return Float.intBitsToFloat(
nativeGetAttributeData(mParseState, idx));
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index a3fbfbe..42c8e3d 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -1625,38 +1625,37 @@ public abstract class CameraMetadata {
//
/**
- * <p>No flash on camera</p>
+ * <p>No flash on camera.</p>
* @see CaptureResult#FLASH_STATE
*/
public static final int FLASH_STATE_UNAVAILABLE = 0;
/**
- * <p>if {@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is true Flash is
- * charging and cannot be fired</p>
- *
- * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
+ * <p>Flash is charging and cannot be fired.</p>
* @see CaptureResult#FLASH_STATE
*/
public static final int FLASH_STATE_CHARGING = 1;
/**
- * <p>if {@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is true Flash is
- * ready to fire</p>
- *
- * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
+ * <p>Flash is ready to fire.</p>
* @see CaptureResult#FLASH_STATE
*/
public static final int FLASH_STATE_READY = 2;
/**
- * <p>if {@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is true Flash fired
- * for this capture</p>
- *
- * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
+ * <p>Flash fired for this capture.</p>
* @see CaptureResult#FLASH_STATE
*/
public static final int FLASH_STATE_FIRED = 3;
+ /**
+ * <p>Flash partially illuminated this frame. This is usually due to the next
+ * or previous frame having the flash fire, and the flash spilling into this capture
+ * due to hardware limitations.</p>
+ * @see CaptureResult#FLASH_STATE
+ */
+ public static final int FLASH_STATE_PARTIAL = 4;
+
//
// Enumeration values for CaptureResult#LENS_STATE
//
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 9bf1b98..b3bce3b 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -1164,6 +1164,7 @@ public final class CaptureResult extends CameraMetadata {
* @see #FLASH_STATE_CHARGING
* @see #FLASH_STATE_READY
* @see #FLASH_STATE_FIRED
+ * @see #FLASH_STATE_PARTIAL
*/
public static final Key<Integer> FLASH_STATE =
new Key<Integer>("android.flash.state", int.class);
diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java
index 1e476fc..a28b5a7 100644
--- a/core/java/android/net/http/CertificateChainValidator.java
+++ b/core/java/android/net/http/CertificateChainValidator.java
@@ -16,22 +16,26 @@
package android.net.http;
-import com.android.org.conscrypt.SSLParametersImpl;
-import com.android.org.conscrypt.TrustManagerImpl;
+import android.util.Slog;
import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.lang.reflect.Method;
import java.security.GeneralSecurityException;
-import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
-import javax.net.ssl.DefaultHostnameVerifier;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
-import javax.net.ssl.X509TrustManager;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509ExtendedTrustManager;
/**
* Class responsible for all server certificate validation functionality
@@ -39,28 +43,51 @@ import javax.net.ssl.X509TrustManager;
* {@hide}
*/
public class CertificateChainValidator {
+ private static final String TAG = "CertificateChainValidator";
- /**
- * The singleton instance of the certificate chain validator
- */
- private static final CertificateChainValidator sInstance
- = new CertificateChainValidator();
+ private static class NoPreloadHolder {
+ /**
+ * The singleton instance of the certificate chain validator.
+ */
+ private static final CertificateChainValidator sInstance = new CertificateChainValidator();
+
+ /**
+ * The singleton instance of the hostname verifier.
+ */
+ private static final HostnameVerifier sVerifier = HttpsURLConnection
+ .getDefaultHostnameVerifier();
+ }
- private static final DefaultHostnameVerifier sVerifier
- = new DefaultHostnameVerifier();
+ private X509ExtendedTrustManager mTrustManager;
/**
* @return The singleton instance of the certificates chain validator
*/
public static CertificateChainValidator getInstance() {
- return sInstance;
+ return NoPreloadHolder.sInstance;
}
/**
* Creates a new certificate chain validator. This is a private constructor.
* If you need a Certificate chain validator, call getInstance().
*/
- private CertificateChainValidator() {}
+ private CertificateChainValidator() {
+ try {
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance("X.509");
+ for (TrustManager tm : tmf.getTrustManagers()) {
+ if (tm instanceof X509ExtendedTrustManager) {
+ mTrustManager = (X509ExtendedTrustManager) tm;
+ }
+ }
+ } catch (NoSuchAlgorithmException e) {
+ throw new RuntimeException("X.509 TrustManager factory must be available", e);
+ }
+
+ if (mTrustManager == null) {
+ throw new RuntimeException(
+ "None of the X.509 TrustManagers are X509ExtendedTrustManager");
+ }
+ }
/**
* Performs the handshake and server certificates validation
@@ -136,14 +163,27 @@ public class CertificateChainValidator {
* Handles updates to credential storage.
*/
public static void handleTrustStorageUpdate() {
-
+ TrustManagerFactory tmf;
try {
- X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultX509TrustManager();
- if( x509TrustManager instanceof TrustManagerImpl ) {
- TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
- trustManager.handleTrustStorageUpdate();
+ tmf = TrustManagerFactory.getInstance("X.509");
+ } catch (NoSuchAlgorithmException e) {
+ Slog.w(TAG, "Couldn't find default X.509 TrustManagerFactory");
+ return;
+ }
+
+ TrustManager[] tms = tmf.getTrustManagers();
+ boolean sentUpdate = false;
+ for (TrustManager tm : tms) {
+ try {
+ Method updateMethod = tm.getClass().getDeclaredMethod("handleTrustStorageUpdate");
+ updateMethod.setAccessible(true);
+ updateMethod.invoke(tm);
+ sentUpdate = true;
+ } catch (Exception e) {
}
- } catch (KeyManagementException ignored) {
+ }
+ if (!sentUpdate) {
+ Slog.w(TAG, "Didn't find a TrustManager to handle CA list update");
}
}
@@ -166,7 +206,8 @@ public class CertificateChainValidator {
boolean valid = domain != null
&& !domain.isEmpty()
- && sVerifier.verify(domain, currCertificate);
+ && NoPreloadHolder.sVerifier.verify(domain,
+ new DelegatingSSLSession.CertificateWrap(currCertificate));
if (!valid) {
if (HttpLog.LOGV) {
HttpLog.v("certificate not for this host: " + domain);
@@ -175,13 +216,8 @@ public class CertificateChainValidator {
}
try {
- X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultX509TrustManager();
- if (x509TrustManager instanceof TrustManagerImpl) {
- TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
- trustManager.checkServerTrusted(chain, authType, domain);
- } else {
- x509TrustManager.checkServerTrusted(chain, authType);
- }
+ getInstance().getTrustManager().checkServerTrusted(chain, authType,
+ new DelegatingSocketWrapper(domain));
return null; // No errors.
} catch (GeneralSecurityException e) {
if (HttpLog.LOGV) {
@@ -192,6 +228,12 @@ public class CertificateChainValidator {
}
}
+ /**
+ * Returns the platform default {@link X509ExtendedTrustManager}.
+ */
+ private X509ExtendedTrustManager getTrustManager() {
+ return mTrustManager;
+ }
private void closeSocketThrowException(
SSLSocket socket, String errorMessage, String defaultErrorMessage)
@@ -217,4 +259,4 @@ public class CertificateChainValidator {
throw new SSLHandshakeException(errorMessage);
}
-}
+} \ No newline at end of file
diff --git a/core/java/android/net/http/DelegatingSSLSession.java b/core/java/android/net/http/DelegatingSSLSession.java
new file mode 100644
index 0000000..ff75b24
--- /dev/null
+++ b/core/java/android/net/http/DelegatingSSLSession.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.http;
+
+import java.security.Principal;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSessionContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.X509ExtendedTrustManager;
+
+/**
+ * This is used when only a {@code hostname} is available but usage of the new API
+ * {@link X509ExtendedTrustManager#checkServerTrusted(X509Certificate[], String, Socket)}
+ * requires a {@link SSLSocket}.
+ *
+ * @hide
+ */
+public class DelegatingSSLSession implements SSLSession {
+ protected DelegatingSSLSession() {
+ }
+
+ public static class HostnameWrap extends DelegatingSSLSession {
+ private final String mHostname;
+
+ public HostnameWrap(String hostname) {
+ mHostname = hostname;
+ }
+
+ @Override
+ public String getPeerHost() {
+ return mHostname;
+ }
+ }
+
+ public static class CertificateWrap extends DelegatingSSLSession {
+ private final Certificate mCertificate;
+
+ public CertificateWrap(Certificate certificate) {
+ mCertificate = certificate;
+ }
+
+ @Override
+ public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
+ return new Certificate[] { mCertificate };
+ }
+ }
+
+
+ @Override
+ public int getApplicationBufferSize() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getCipherSuite() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long getCreationTime() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public byte[] getId() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long getLastAccessedTime() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Certificate[] getLocalCertificates() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Principal getLocalPrincipal() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getPacketBufferSize() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public javax.security.cert.X509Certificate[] getPeerCertificateChain()
+ throws SSLPeerUnverifiedException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getPeerHost() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getPeerPort() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getProtocol() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SSLSessionContext getSessionContext() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object getValue(String name) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String[] getValueNames() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void invalidate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isValid() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void putValue(String name, Object value) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void removeValue(String name) {
+ throw new UnsupportedOperationException();
+ }
+} \ No newline at end of file
diff --git a/core/java/android/net/http/DelegatingSocketWrapper.java b/core/java/android/net/http/DelegatingSocketWrapper.java
new file mode 100644
index 0000000..230d017
--- /dev/null
+++ b/core/java/android/net/http/DelegatingSocketWrapper.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.http;
+
+import java.io.IOException;
+
+import javax.net.ssl.HandshakeCompletedListener;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.X509ExtendedTrustManager;
+
+/**
+ * This is used when only a {@code hostname} is available for
+ * {@link X509ExtendedTrustManager#checkServerTrusted(java.security.cert.X509Certificate[], String, Socket)}
+ * but we want to use the new API that requires a {@link SSLSocket}.
+ */
+class DelegatingSocketWrapper extends SSLSocket {
+ private String hostname;
+
+ public DelegatingSocketWrapper(String hostname) {
+ this.hostname = hostname;
+ }
+
+ @Override
+ public String[] getSupportedCipherSuites() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String[] getEnabledCipherSuites() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setEnabledCipherSuites(String[] suites) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String[] getSupportedProtocols() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String[] getEnabledProtocols() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setEnabledProtocols(String[] protocols) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SSLSession getSession() {
+ return new DelegatingSSLSession.HostnameWrap(hostname);
+ }
+
+ @Override
+ public void addHandshakeCompletedListener(HandshakeCompletedListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void removeHandshakeCompletedListener(HandshakeCompletedListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void startHandshake() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setUseClientMode(boolean mode) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean getUseClientMode() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setNeedClientAuth(boolean need) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setWantClientAuth(boolean want) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean getNeedClientAuth() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean getWantClientAuth() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setEnableSessionCreation(boolean flag) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean getEnableSessionCreation() {
+ throw new UnsupportedOperationException();
+ }
+} \ No newline at end of file
diff --git a/core/java/android/net/http/X509TrustManagerExtensions.java b/core/java/android/net/http/X509TrustManagerExtensions.java
index db71279..a500bcf 100644
--- a/core/java/android/net/http/X509TrustManagerExtensions.java
+++ b/core/java/android/net/http/X509TrustManagerExtensions.java
@@ -22,14 +22,25 @@ import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.List;
+import javax.net.ssl.SSLParameters;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.X509ExtendedTrustManager;
import javax.net.ssl.X509TrustManager;
/**
* X509TrustManager wrapper exposing Android-added features.
- *
- * <p> The checkServerTrusted method allows callers to perform additional
- * verification of certificate chains after they have been successfully
- * verified by the platform.</p>
+ * <p>
+ * The checkServerTrusted method allows callers to perform additional
+ * verification of certificate chains after they have been successfully verified
+ * by the platform.
+ * </p>
+ * <p>
+ * If the returned certificate list is not needed, see also
+ * {@code X509ExtendedTrustManager#checkServerTrusted(X509Certificate[], String, java.net.Socket)}
+ * where an {@link SSLSocket} can be used to verify the given hostname during
+ * handshake using
+ * {@code SSLParameters#setEndpointIdentificationAlgorithm(String)}.
+ * </p>
*/
public class X509TrustManagerExtensions {
@@ -61,7 +72,8 @@ public class X509TrustManagerExtensions {
*/
public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType,
String host) throws CertificateException {
- return mDelegate.checkServerTrusted(chain, authType, host);
+ return mDelegate.checkServerTrusted(chain, authType,
+ new DelegatingSSLSession.HostnameWrap(host));
}
/**
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index 4180860..b97734e 100644
--- a/core/java/android/os/storage/IMountService.java
+++ b/core/java/android/os/storage/IMountService.java
@@ -694,36 +694,6 @@ public interface IMountService extends IInterface {
return _result;
}
- public String getPassword() throws RemoteException {
- Parcel _data = Parcel.obtain();
- Parcel _reply = Parcel.obtain();
- String _result;
- try {
- _data.writeInterfaceToken(DESCRIPTOR);
- mRemote.transact(Stub.TRANSACTION_getPassword, _data, _reply, 0);
- _reply.readException();
- _result = _reply.readString();
- } finally {
- _reply.recycle();
- _data.recycle();
- }
- return _result;
- }
-
- public void clearPassword() throws RemoteException {
- Parcel _data = Parcel.obtain();
- Parcel _reply = Parcel.obtain();
- String _result;
- try {
- _data.writeInterfaceToken(DESCRIPTOR);
- mRemote.transact(Stub.TRANSACTION_clearPassword, _data, _reply, 0);
- _reply.readException();
- } finally {
- _reply.recycle();
- _data.recycle();
- }
- }
-
public StorageVolume[] getVolumeList() throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
@@ -876,11 +846,7 @@ public interface IMountService extends IInterface {
static final int TRANSACTION_mkdirs = IBinder.FIRST_CALL_TRANSACTION + 34;
- static final int TRANSACTION_getPasswordType = IBinder.FIRST_CALL_TRANSACTION + 35;
-
- static final int TRANSACTION_getPassword = IBinder.FIRST_CALL_TRANSACTION + 36;
-
- static final int TRANSACTION_clearPassword = IBinder.FIRST_CALL_TRANSACTION + 37;
+ static final int TRANSACTION_getPasswordType = IBinder.FIRST_CALL_TRANSACTION + 36;
/**
* Cast an IBinder object into an IMountService interface, generating a
@@ -1242,19 +1208,6 @@ public interface IMountService extends IInterface {
reply.writeInt(result);
return true;
}
- case TRANSACTION_getPassword: {
- data.enforceInterface(DESCRIPTOR);
- String result = getPassword();
- reply.writeNoException();
- reply.writeString(result);
- return true;
- }
- case TRANSACTION_clearPassword: {
- data.enforceInterface(DESCRIPTOR);
- clearPassword();
- reply.writeNoException();
- return true;
- }
}
return super.onTransact(code, data, reply, flags);
}
@@ -1493,15 +1446,4 @@ public interface IMountService extends IInterface {
* @return PasswordType
*/
public int getPasswordType() throws RemoteException;
-
- /**
- * Get password from vold
- * @return password or empty string
- */
- public String getPassword() throws RemoteException;
-
- /**
- * Securely clear password from vold
- */
- public void clearPassword() throws RemoteException;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 7777334..7062933 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6098,21 +6098,18 @@ public final class Settings {
"lock_screen_show_notifications";
/**
- * Defines global zen mode. One of ZEN_MODE_OFF, ZEN_MODE_LIMITED, ZEN_MODE_FULL.
+ * Defines global zen mode. ZEN_MODE_OFF or ZEN_MODE_ON.
*
* @hide
*/
public static final String ZEN_MODE = "zen_mode";
/** @hide */ public static final int ZEN_MODE_OFF = 0;
- /** @hide */ public static final int ZEN_MODE_LIMITED = 1;
- /** @hide */ public static final int ZEN_MODE_FULL = 2;
+ /** @hide */ public static final int ZEN_MODE_ON = 1;
/** @hide */ public static String zenModeToString(int mode) {
if (mode == ZEN_MODE_OFF) return "ZEN_MODE_OFF";
- if (mode == ZEN_MODE_LIMITED) return "ZEN_MODE_LIMITED";
- if (mode == ZEN_MODE_FULL) return "ZEN_MODE_FULL";
- throw new IllegalArgumentException("Invalid zen mode: " + mode);
+ return "ZEN_MODE_ON";
}
/**
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java
index 60fb7ac..6c8c3c7 100644
--- a/core/java/android/view/RenderNode.java
+++ b/core/java/android/view/RenderNode.java
@@ -361,6 +361,14 @@ public class RenderNode {
}
/**
+ * Controls the RenderNode's circular reveal clip.
+ */
+ public void setRevealClip(boolean shouldClip, boolean inverseClip,
+ float x, float y, float radius) {
+ nSetRevealClip(mNativeDisplayList, shouldClip, inverseClip, x, y, radius);
+ }
+
+ /**
* Set the static matrix on the display list. The specified matrix is combined with other
* transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.)
*
@@ -856,6 +864,8 @@ public class RenderNode {
private static native void nSetOutlineConvexPath(long displayList, long nativePath);
private static native void nSetOutlineEmpty(long displayList);
private static native void nSetClipToOutline(long displayList, boolean clipToOutline);
+ private static native void nSetRevealClip(long displayList,
+ boolean shouldClip, boolean inverseClip, float x, float y, float radius);
private static native void nSetAlpha(long displayList, float alpha);
private static native void nSetHasOverlappingRendering(long displayList,
boolean hasOverlappingRendering);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 5e512b6..f2b9b96 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -33,7 +33,6 @@ import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
-import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PorterDuff;
@@ -5726,7 +5725,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @hide
*/
public int getAccessibilityWindowId() {
- return mAttachInfo != null ? mAttachInfo.mAccessibilityWindowId : NO_ID;
+ return mAttachInfo != null ? mAttachInfo.mAccessibilityWindowId
+ : AccessibilityNodeInfo.UNDEFINED_ITEM_ID;
}
/**
@@ -10883,6 +10883,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
+ * Private API to be used for reveal animation
+ *
+ * @hide
+ */
+ public void setRevealClip(boolean shouldClip, boolean inverseClip,
+ float x, float y, float radius) {
+ if (mDisplayList != null) {
+ mDisplayList.setRevealClip(shouldClip, inverseClip, x, y, radius);
+ }
+ }
+
+ /**
* Hit rectangle in parent's coordinates
*
* @param outRect The hit rectangle of the view.
@@ -19725,7 +19737,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* The id of the window for accessibility purposes.
*/
- int mAccessibilityWindowId = View.NO_ID;
+ int mAccessibilityWindowId = AccessibilityNodeInfo.UNDEFINED_ITEM_ID;
/**
* Flags related to accessibility processing.
diff --git a/core/java/com/android/internal/widget/ILockSettings.aidl b/core/java/com/android/internal/widget/ILockSettings.aidl
index 9501f92..91056f1 100644
--- a/core/java/com/android/internal/widget/ILockSettings.aidl
+++ b/core/java/com/android/internal/widget/ILockSettings.aidl
@@ -28,7 +28,6 @@ interface ILockSettings {
boolean checkPattern(in String pattern, int userId);
void setLockPassword(in String password, int userId);
boolean checkPassword(in String password, int userId);
- boolean checkVoldPassword(int userId);
boolean havePattern(int userId);
boolean havePassword(int userId);
void removeUser(int userId);
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index e5aaf7e..2d79491 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -313,20 +313,6 @@ public class LockPatternUtils {
}
/**
- * Check to see if vold already has the password.
- * Note that this also clears vold's copy of the password.
- * @return Whether the vold password matches or not.
- */
- public boolean checkVoldPassword() {
- final int userId = getCurrentOrCallingUserId();
- try {
- return getLockSettings().checkVoldPassword(userId);
- } catch (RemoteException re) {
- return false;
- }
- }
-
- /**
* Check to see if a password matches any of the passwords stored in the
* password history.
*
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 9dde701..4147608 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -73,6 +73,13 @@ static struct assetmanager_offsets_t
jfieldID mObject;
} gAssetManagerOffsets;
+static struct sparsearray_offsets_t
+{
+ jclass classObject;
+ jmethodID constructor;
+ jmethodID put;
+} gSparseArrayOffsets;
+
jclass g_stringClass = NULL;
// ----------------------------------------------------------------------------
@@ -905,6 +912,26 @@ static jstring android_content_AssetManager_getCookieName(JNIEnv* env, jobject c
return str;
}
+static jobject android_content_AssetManager_getAssignedPackageIdentifiers(JNIEnv* env, jobject clazz)
+{
+ AssetManager* am = assetManagerForJavaObject(env, clazz);
+ if (am == NULL) {
+ return 0;
+ }
+
+ const ResTable& res = am->getResources();
+
+ jobject sparseArray = env->NewObject(gSparseArrayOffsets.classObject,
+ gSparseArrayOffsets.constructor);
+ const size_t N = res.getBasePackageCount();
+ for (size_t i = 0; i < N; i++) {
+ const String16 name = res.getBasePackageName(i);
+ env->CallVoidMethod(sparseArray, gSparseArrayOffsets.put, (jint) res.getBasePackageId(i),
+ env->NewString(name, name.size()));
+ }
+ return sparseArray;
+}
+
static jlong android_content_AssetManager_newTheme(JNIEnv* env, jobject clazz)
{
AssetManager* am = assetManagerForJavaObject(env, clazz);
@@ -1675,16 +1702,19 @@ static jlong android_content_AssetManager_openXmlAssetNative(JNIEnv* env, jobjec
return 0;
}
- Asset* a = cookie
- ? am->openNonAsset(static_cast<int32_t>(cookie), fileName8.c_str(), Asset::ACCESS_BUFFER)
- : am->openNonAsset(fileName8.c_str(), Asset::ACCESS_BUFFER);
+ int32_t assetCookie = static_cast<int32_t>(cookie);
+ Asset* a = assetCookie
+ ? am->openNonAsset(assetCookie, fileName8.c_str(), Asset::ACCESS_BUFFER)
+ : am->openNonAsset(fileName8.c_str(), Asset::ACCESS_BUFFER, &assetCookie);
if (a == NULL) {
jniThrowException(env, "java/io/FileNotFoundException", fileName8.c_str());
return 0;
}
- ResXMLTree* block = new ResXMLTree();
+ const DynamicRefTable* dynamicRefTable =
+ am->getResources().getDynamicRefTableForCookie(assetCookie);
+ ResXMLTree* block = new ResXMLTree(dynamicRefTable);
status_t err = block->setTo(a->getBuffer(true), a->getLength(), true);
a->close();
delete a;
@@ -1972,6 +2002,8 @@ static JNINativeMethod gAssetManagerMethods[] = {
(void*) android_content_AssetManager_getNativeStringBlock },
{ "getCookieName","(I)Ljava/lang/String;",
(void*) android_content_AssetManager_getCookieName },
+ { "getAssignedPackageIdentifiers","()Landroid/util/SparseArray;",
+ (void*) android_content_AssetManager_getAssignedPackageIdentifiers },
// Themes.
{ "newTheme", "()J",
@@ -2068,6 +2100,16 @@ int register_android_content_AssetManager(JNIEnv* env)
g_stringClass = (jclass)env->NewGlobalRef(stringClass);
LOG_FATAL_IF(g_stringClass == NULL, "Unable to create global reference for class java/lang/String");
+ jclass sparseArrayClass = env->FindClass("android/util/SparseArray");
+ LOG_FATAL_IF(sparseArrayClass == NULL, "Unable to find class android/util/SparseArray");
+ gSparseArrayOffsets.classObject = (jclass) env->NewGlobalRef(sparseArrayClass);
+ gSparseArrayOffsets.constructor =
+ env->GetMethodID(gSparseArrayOffsets.classObject, "<init>", "()V");
+ LOG_FATAL_IF(gSparseArrayOffsets.constructor == NULL, "Unable to find SparseArray.<init>()");
+ gSparseArrayOffsets.put =
+ env->GetMethodID(gSparseArrayOffsets.classObject, "put", "(ILjava/lang/Object;)V");
+ LOG_FATAL_IF(gSparseArrayOffsets.put == NULL, "Unable to find SparseArray.put(int, V)");
+
return AndroidRuntime::registerNativeMethods(env,
"android/content/res/AssetManager", gAssetManagerMethods, NELEM(gAssetManagerMethods));
}
diff --git a/core/jni/android_util_XmlBlock.cpp b/core/jni/android_util_XmlBlock.cpp
index 03de5c0..2cccb83 100644
--- a/core/jni/android_util_XmlBlock.cpp
+++ b/core/jni/android_util_XmlBlock.cpp
@@ -47,10 +47,11 @@ static jlong android_content_XmlBlock_nativeCreate(JNIEnv* env, jobject clazz,
}
jbyte* b = env->GetByteArrayElements(bArray, NULL);
- ResXMLTree* osb = new ResXMLTree(b+off, len, true);
+ ResXMLTree* osb = new ResXMLTree();
+ osb->setTo(b+off, len, true);
env->ReleaseByteArrayElements(bArray, b, 0);
- if (osb == NULL || osb->getError() != NO_ERROR) {
+ if (osb->getError() != NO_ERROR) {
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
return 0;
}
@@ -113,6 +114,8 @@ static jint android_content_XmlBlock_nativeNext(JNIEnv* env, jobject clazz,
return 1;
case ResXMLParser::BAD_DOCUMENT:
goto bad;
+ default:
+ break;
}
} while (true);
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp
index 5c7e773..3e359d4 100644
--- a/core/jni/android_view_RenderNode.cpp
+++ b/core/jni/android_view_RenderNode.cpp
@@ -115,23 +115,38 @@ static void android_view_RenderNode_setOutlineRoundRect(JNIEnv* env,
jint right, jint bottom, jfloat radius) {
RenderNode* displayList = reinterpret_cast<RenderNode*>(displayListPtr);
displayList->mutateStagingProperties().mutableOutline().setRoundRect(left, top, right, bottom, radius);
+ displayList->mutateStagingProperties().updateClipPath();
}
+
static void android_view_RenderNode_setOutlineConvexPath(JNIEnv* env,
jobject clazz, jlong displayListPtr, jlong outlinePathPtr) {
RenderNode* displayList = reinterpret_cast<RenderNode*>(displayListPtr);
SkPath* outlinePath = reinterpret_cast<SkPath*>(outlinePathPtr);
displayList->mutateStagingProperties().mutableOutline().setConvexPath(outlinePath);
+ displayList->mutateStagingProperties().updateClipPath();
}
+
static void android_view_RenderNode_setOutlineEmpty(JNIEnv* env,
jobject clazz, jlong displayListPtr) {
RenderNode* displayList = reinterpret_cast<RenderNode*>(displayListPtr);
displayList->mutateStagingProperties().mutableOutline().setEmpty();
+ displayList->mutateStagingProperties().updateClipPath();
}
static void android_view_RenderNode_setClipToOutline(JNIEnv* env,
jobject clazz, jlong displayListPtr, jboolean clipToOutline) {
RenderNode* displayList = reinterpret_cast<RenderNode*>(displayListPtr);
displayList->mutateStagingProperties().mutableOutline().setShouldClip(clipToOutline);
+ displayList->mutateStagingProperties().updateClipPath();
+}
+
+static void android_view_RenderNode_setRevealClip(JNIEnv* env,
+ jobject clazz, jlong displayListPtr, jboolean shouldClip, jboolean inverseClip,
+ jfloat x, jfloat y, jfloat radius) {
+ RenderNode* displayList = reinterpret_cast<RenderNode*>(displayListPtr);
+ displayList->mutateStagingProperties().mutableRevealClip().set(
+ shouldClip, inverseClip, x, y, radius);
+ displayList->mutateStagingProperties().updateClipPath();
}
static void android_view_RenderNode_setAlpha(JNIEnv* env,
@@ -396,6 +411,7 @@ static JNINativeMethod gMethods[] = {
{ "nSetOutlineConvexPath", "(JJ)V", (void*) android_view_RenderNode_setOutlineConvexPath },
{ "nSetOutlineEmpty", "(J)V", (void*) android_view_RenderNode_setOutlineEmpty },
{ "nSetClipToOutline", "(JZ)V", (void*) android_view_RenderNode_setClipToOutline },
+ { "nSetRevealClip", "(JZZFFF)V", (void*) android_view_RenderNode_setRevealClip },
{ "nSetAlpha", "(JF)V", (void*) android_view_RenderNode_setAlpha },
{ "nSetHasOverlappingRendering", "(JZ)V",
diff --git a/core/res/res/drawable/background_cache_hint_selector_holo_dark.xml b/core/res/res/color/background_cache_hint_selector_holo_dark.xml
index b18c5b7..b18c5b7 100644
--- a/core/res/res/drawable/background_cache_hint_selector_holo_dark.xml
+++ b/core/res/res/color/background_cache_hint_selector_holo_dark.xml
diff --git a/core/res/res/drawable/background_cache_hint_selector_holo_light.xml b/core/res/res/color/background_cache_hint_selector_holo_light.xml
index 9d80944..9d80944 100644
--- a/core/res/res/drawable/background_cache_hint_selector_holo_light.xml
+++ b/core/res/res/color/background_cache_hint_selector_holo_light.xml
diff --git a/core/res/res/drawable/background_cache_hint_selector_quantum_dark.xml b/core/res/res/color/background_cache_hint_selector_quantum_dark.xml
index ab66501..ab66501 100644
--- a/core/res/res/drawable/background_cache_hint_selector_quantum_dark.xml
+++ b/core/res/res/color/background_cache_hint_selector_quantum_dark.xml
diff --git a/core/res/res/drawable/background_cache_hint_selector_quantum_light.xml b/core/res/res/color/background_cache_hint_selector_quantum_light.xml
index fb940a9..fb940a9 100644
--- a/core/res/res/drawable/background_cache_hint_selector_quantum_light.xml
+++ b/core/res/res/color/background_cache_hint_selector_quantum_light.xml
diff --git a/core/res/res/drawable/ab_transparent_quantum_dark.xml b/core/res/res/drawable/ab_transparent_quantum.xml
index 9ac2fc0..495bfb6 100644
--- a/core/res/res/drawable/ab_transparent_quantum_dark.xml
+++ b/core/res/res/drawable/ab_transparent_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ab_transparent_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ab_transparent_quantum_light.xml b/core/res/res/drawable/ab_transparent_quantum_light.xml
deleted file mode 100644
index bc49848..0000000
--- a/core/res/res/drawable/ab_transparent_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ab_transparent_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/activated_background_quantum_dark.xml b/core/res/res/drawable/activated_background_quantum.xml
index a9e3fea..e06c9f2 100644
--- a/core/res/res/drawable/activated_background_quantum_dark.xml
+++ b/core/res/res/drawable/activated_background_quantum.xml
@@ -15,6 +15,10 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_activated="true" android:drawable="@color/control_activated_foreground_quantum_dark" />
- <item android:drawable="@color/transparent" />
+ <item android:state_activated="true">
+ <color android:color="?attr/colorControlActivated" />
+ </item>
+ <item>
+ <color android:color="@color/transparent" />
+ </item>
</selector>
diff --git a/core/res/res/drawable/activated_background_quantum_light.xml b/core/res/res/drawable/activated_background_quantum_light.xml
deleted file mode 100644
index 5d10ea2..0000000
--- a/core/res/res/drawable/activated_background_quantum_light.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_activated="true" android:drawable="@color/control_activated_foreground_quantum_light" />
- <item android:drawable="@color/transparent" />
-</selector>
diff --git a/core/res/res/drawable/btn_borderless_quantum_dark.xml b/core/res/res/drawable/btn_borderless_quantum.xml
index 2c0d3b7..703fd11 100644
--- a/core/res/res/drawable/btn_borderless_quantum_dark.xml
+++ b/core/res/res/drawable/btn_borderless_quantum.xml
@@ -15,5 +15,5 @@
-->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/btn_default_pressed_quantum_dark"
+ android:tint="?attr/colorButtonPressed"
android:mask="@drawable/btn_qntm_alpha" />
diff --git a/core/res/res/drawable/btn_borderless_quantum_light.xml b/core/res/res/drawable/btn_borderless_quantum_light.xml
deleted file mode 100644
index 2faec20..0000000
--- a/core/res/res/drawable/btn_borderless_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/btn_default_pressed_quantum_light"
- android:mask="@drawable/btn_qntm_alpha" />
diff --git a/core/res/res/drawable/btn_check_quantum_dark.xml b/core/res/res/drawable/btn_check_quantum.xml
index a35bec4..6ceba60 100644
--- a/core/res/res/drawable/btn_check_quantum_dark.xml
+++ b/core/res/res/drawable/btn_check_quantum.xml
@@ -17,18 +17,18 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_pressed="true">
<bitmap android:src="@drawable/btn_check_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_check_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_pressed="true">
<bitmap android:src="@drawable/btn_check_off_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/btn_check_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/btn_check_quantum_light.xml b/core/res/res/drawable/btn_check_quantum_light.xml
deleted file mode 100644
index 8588fce..0000000
--- a/core/res/res/drawable/btn_check_quantum_light.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true" android:state_pressed="true">
- <bitmap android:src="@drawable/btn_check_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_checked="true">
- <bitmap android:src="@drawable/btn_check_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_pressed="true">
- <bitmap android:src="@drawable/btn_check_off_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/btn_check_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/btn_color_quantum_dark.xml b/core/res/res/drawable/btn_color_quantum.xml
index 0507755..e923003 100644
--- a/core/res/res/drawable/btn_color_quantum_dark.xml
+++ b/core/res/res/drawable/btn_color_quantum.xml
@@ -15,15 +15,15 @@
-->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/theme_color_300">
+ android:tint="?attr/colorButtonPressedColored">
<selector>
<item android:state_enabled="false">
<nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/btn_default_normal_quantum_dark" />
+ android:tint="?attr/colorButtonNormal" />
</item>
<item>
<nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/theme_color_500" />
+ android:tint="?attr/colorButtonNormalColored" />
</item>
</selector>
</touch-feedback>
diff --git a/core/res/res/drawable/btn_color_quantum_light.xml b/core/res/res/drawable/btn_color_quantum_light.xml
deleted file mode 100644
index 9166b8d..0000000
--- a/core/res/res/drawable/btn_color_quantum_light.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/theme_color_700">
- <selector>
- <item android:state_enabled="false">
- <nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/btn_default_normal_quantum_dark" />
- </item>
- <item>
- <nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/theme_color_500" />
- </item>
- </selector>
-</touch-feedback>
diff --git a/core/res/res/drawable/btn_default_quantum_dark.xml b/core/res/res/drawable/btn_default_quantum.xml
index 29c3e24..4cb8301 100644
--- a/core/res/res/drawable/btn_default_quantum_dark.xml
+++ b/core/res/res/drawable/btn_default_quantum.xml
@@ -15,7 +15,7 @@
-->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/btn_default_pressed_quantum_dark">
+ android:tint="?attr/colorButtonPressed">
<nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/btn_default_normal_quantum_dark" />
+ android:tint="?attr/colorButtonNormal" />
</touch-feedback>
diff --git a/core/res/res/drawable/btn_default_quantum_light.xml b/core/res/res/drawable/btn_default_quantum_light.xml
deleted file mode 100644
index c6e828c..0000000
--- a/core/res/res/drawable/btn_default_quantum_light.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/btn_default_pressed_quantum_light">
- <nine-patch android:src="@drawable/btn_qntm_alpha"
- android:tint="@color/btn_default_normal_quantum_light" />
-</touch-feedback>
diff --git a/core/res/res/drawable/btn_radio_quantum_dark.xml b/core/res/res/drawable/btn_radio_quantum.xml
index 54f4f9a..152e3d3 100644
--- a/core/res/res/drawable/btn_radio_quantum_dark.xml
+++ b/core/res/res/drawable/btn_radio_quantum.xml
@@ -17,18 +17,18 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_enabled="true" android:state_pressed="true">
<bitmap android:src="@drawable/btn_radio_on_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_radio_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_enabled="true" android:state_pressed="true">
<bitmap android:src="@drawable/btn_radio_off_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/btn_radio_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/btn_radio_quantum_light.xml b/core/res/res/drawable/btn_radio_quantum_light.xml
deleted file mode 100644
index c1ace70..0000000
--- a/core/res/res/drawable/btn_radio_quantum_light.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true" android:state_enabled="true" android:state_pressed="true">
- <bitmap android:src="@drawable/btn_radio_on_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_checked="true">
- <bitmap android:src="@drawable/btn_radio_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_enabled="true" android:state_pressed="true">
- <bitmap android:src="@drawable/btn_radio_off_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/btn_radio_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/btn_star_quantum_dark.xml b/core/res/res/drawable/btn_star_quantum.xml
index 7b26a3c..512cd57 100644
--- a/core/res/res/drawable/btn_star_quantum_dark.xml
+++ b/core/res/res/drawable/btn_star_quantum.xml
@@ -17,14 +17,14 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_pressed="true">
<bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/btn_star_quantum_light.xml b/core/res/res/drawable/btn_star_quantum_light.xml
deleted file mode 100644
index df2cc91..0000000
--- a/core/res/res/drawable/btn_star_quantum_light.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true">
- <bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_pressed="true">
- <bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/btn_star_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/edit_text_quantum_dark.xml b/core/res/res/drawable/edit_text_quantum.xml
index ea3fc52..d1f9831 100644
--- a/core/res/res/drawable/edit_text_quantum_dark.xml
+++ b/core/res/res/drawable/edit_text_quantum.xml
@@ -17,26 +17,26 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true">
<nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item android:state_window_focused="false" android:state_enabled="false">
<nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item android:state_enabled="true" android:state_focused="true">
<nine-patch android:src="@drawable/textfield_activated_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_enabled="true" android:state_activated="true">
<nine-patch android:src="@drawable/textfield_activated_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_enabled="true">
<nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item>
<nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/edit_text_quantum_light.xml b/core/res/res/drawable/edit_text_quantum_light.xml
deleted file mode 100644
index dd7fe53..0000000
--- a/core/res/res/drawable/edit_text_quantum_light.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true">
- <nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
- <item android:state_window_focused="false" android:state_enabled="false">
- <nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
- <item android:state_enabled="true" android:state_focused="true">
- <nine-patch android:src="@drawable/textfield_activated_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_enabled="true" android:state_activated="true">
- <nine-patch android:src="@drawable/textfield_activated_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_enabled="true">
- <nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/textfield_default_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/expander_group_quantum_dark.xml b/core/res/res/drawable/expander_group_quantum.xml
index 7250e01..48245ea 100644
--- a/core/res/res/drawable/expander_group_quantum_dark.xml
+++ b/core/res/res/drawable/expander_group_quantum.xml
@@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_expanded="true">
<nine-patch android:src="@drawable/expander_close_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item>
<nine-patch android:src="@drawable/expander_open_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/expander_group_quantum_light.xml b/core/res/res/drawable/expander_group_quantum_light.xml
deleted file mode 100644
index 62af983..0000000
--- a/core/res/res/drawable/expander_group_quantum_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_expanded="true">
- <nine-patch android:src="@drawable/expander_close_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/expander_open_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/fastscroll_thumb_quantum_dark.xml b/core/res/res/drawable/fastscroll_thumb_quantum.xml
index 53c7fdd..496b2ae 100644
--- a/core/res/res/drawable/fastscroll_thumb_quantum_dark.xml
+++ b/core/res/res/drawable/fastscroll_thumb_quantum.xml
@@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<bitmap android:src="@drawable/fastscroll_thumb_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/fastscroll_thumb_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/fastscroll_thumb_quantum_light.xml b/core/res/res/drawable/fastscroll_thumb_quantum_light.xml
deleted file mode 100644
index 3bc87e9..0000000
--- a/core/res/res/drawable/fastscroll_thumb_quantum_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true">
- <bitmap android:src="@drawable/fastscroll_thumb_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/fastscroll_thumb_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/fastscroll_track_quantum_light.xml b/core/res/res/drawable/fastscroll_track_quantum.xml
index 627c079..59c35db 100644
--- a/core/res/res/drawable/fastscroll_track_quantum_light.xml
+++ b/core/res/res/drawable/fastscroll_track_quantum.xml
@@ -16,4 +16,4 @@
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/fastscroll_track_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/fastscroll_track_quantum_dark.xml b/core/res/res/drawable/fastscroll_track_quantum_dark.xml
deleted file mode 100644
index 0ae57d2..0000000
--- a/core/res/res/drawable/fastscroll_track_quantum_dark.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/fastscroll_track_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_ab_back_quantum_dark.xml b/core/res/res/drawable/ic_ab_back_quantum.xml
index 628d53e..65c7584 100644
--- a/core/res/res/drawable/ic_ab_back_quantum_dark.xml
+++ b/core/res/res/drawable/ic_ab_back_quantum.xml
@@ -17,4 +17,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_ab_back_qntm_am_alpha"
android:autoMirrored="true"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_ab_back_quantum_light.xml b/core/res/res/drawable/ic_ab_back_quantum_light.xml
deleted file mode 100644
index 01f5362..0000000
--- a/core/res/res/drawable/ic_ab_back_quantum_light.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_ab_back_qntm_am_alpha"
- android:autoMirrored="true"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_cab_done_quantum_dark.xml b/core/res/res/drawable/ic_cab_done_quantum.xml
index 472996e..97495a8 100644
--- a/core/res/res/drawable/ic_cab_done_quantum_dark.xml
+++ b/core/res/res/drawable/ic_cab_done_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_cab_done_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_cab_done_quantum_light.xml b/core/res/res/drawable/ic_cab_done_quantum_light.xml
deleted file mode 100644
index d70a3f1..0000000
--- a/core/res/res/drawable/ic_cab_done_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_cab_done_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_dialog_alert_quantum_light.xml b/core/res/res/drawable/ic_dialog_alert_quantum.xml
index 8b8cb0c..05f3630 100644
--- a/core/res/res/drawable/ic_dialog_alert_quantum_light.xml
+++ b/core/res/res/drawable/ic_dialog_alert_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_dialog_alert_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_dialog_alert_quantum_dark.xml b/core/res/res/drawable/ic_dialog_alert_quantum_dark.xml
deleted file mode 100644
index 8b8cb0c..0000000
--- a/core/res/res/drawable/ic_dialog_alert_quantum_dark.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_dialog_alert_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
diff --git a/core/res/res/drawable/ic_find_next_quantum_dark.xml b/core/res/res/drawable/ic_find_next_quantum.xml
index 929bea3..fee196c 100644
--- a/core/res/res/drawable/ic_find_next_quantum_dark.xml
+++ b/core/res/res/drawable/ic_find_next_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_find_next_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_find_next_quantum_light.xml b/core/res/res/drawable/ic_find_next_quantum_light.xml
deleted file mode 100644
index 9c20327..0000000
--- a/core/res/res/drawable/ic_find_next_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_find_next_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_find_previous_quantum_dark.xml b/core/res/res/drawable/ic_find_previous_quantum.xml
index e944223..28f887a 100644
--- a/core/res/res/drawable/ic_find_previous_quantum_dark.xml
+++ b/core/res/res/drawable/ic_find_previous_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_find_previous_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_find_previous_quantum_light.xml b/core/res/res/drawable/ic_find_previous_quantum_light.xml
deleted file mode 100644
index b037094..0000000
--- a/core/res/res/drawable/ic_find_previous_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_find_previous_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_copy_quantum_dark.xml b/core/res/res/drawable/ic_menu_copy_quantum.xml
index 285b752..5f6ce51 100644
--- a/core/res/res/drawable/ic_menu_copy_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_copy_quantum.xml
@@ -16,5 +16,5 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_copy_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark"
+ android:tint="?attr/colorControlNormal"
android:autoMirrored="true" />
diff --git a/core/res/res/drawable/ic_menu_copy_quantum_light.xml b/core/res/res/drawable/ic_menu_copy_quantum_light.xml
deleted file mode 100644
index a40b219..0000000
--- a/core/res/res/drawable/ic_menu_copy_quantum_light.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_copy_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_light"
- android:autoMirrored="true" />
diff --git a/core/res/res/drawable/ic_menu_cut_quantum_dark.xml b/core/res/res/drawable/ic_menu_cut_quantum.xml
index 563400b..1e4996e 100644
--- a/core/res/res/drawable/ic_menu_cut_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_cut_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_cut_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_cut_quantum_light.xml b/core/res/res/drawable/ic_menu_cut_quantum_light.xml
deleted file mode 100644
index 36c9442..0000000
--- a/core/res/res/drawable/ic_menu_cut_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_cut_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_find_quantum_dark.xml b/core/res/res/drawable/ic_menu_find_quantum.xml
index 8803463..a69c673 100644
--- a/core/res/res/drawable/ic_menu_find_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_find_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_find_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_find_quantum_light.xml b/core/res/res/drawable/ic_menu_find_quantum_light.xml
deleted file mode 100644
index 9b3bd73..0000000
--- a/core/res/res/drawable/ic_menu_find_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_find_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_moreoverflow_quantum_dark.xml b/core/res/res/drawable/ic_menu_moreoverflow_quantum.xml
index 9f39a68..7d3fcac 100644
--- a/core/res/res/drawable/ic_menu_moreoverflow_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_moreoverflow_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_moreoverflow_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_moreoverflow_quantum_light.xml b/core/res/res/drawable/ic_menu_moreoverflow_quantum_light.xml
deleted file mode 100644
index e15eaec..0000000
--- a/core/res/res/drawable/ic_menu_moreoverflow_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_moreoverflow_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_paste_quantum_dark.xml b/core/res/res/drawable/ic_menu_paste_quantum.xml
index 7033404..f590904 100644
--- a/core/res/res/drawable/ic_menu_paste_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_paste_quantum.xml
@@ -16,5 +16,5 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_paste_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark"
+ android:tint="?attr/colorControlNormal"
android:autoMirrored="true" />
diff --git a/core/res/res/drawable/ic_menu_paste_quantum_light.xml b/core/res/res/drawable/ic_menu_paste_quantum_light.xml
deleted file mode 100644
index 155ec34..0000000
--- a/core/res/res/drawable/ic_menu_paste_quantum_light.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_paste_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_light"
- android:autoMirrored="true" />
diff --git a/core/res/res/drawable/ic_menu_search_quantum_dark.xml b/core/res/res/drawable/ic_menu_search_quantum.xml
index 1c6efcd..2ca8c20 100644
--- a/core/res/res/drawable/ic_menu_search_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_search_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_search_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_search_quantum_light.xml b/core/res/res/drawable/ic_menu_search_quantum_light.xml
deleted file mode 100644
index ba6efb6..0000000
--- a/core/res/res/drawable/ic_menu_search_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_search_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_selectall_quantum_dark.xml b/core/res/res/drawable/ic_menu_selectall_quantum.xml
index c1d3e69..fd72ebf 100644
--- a/core/res/res/drawable/ic_menu_selectall_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_selectall_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_selectall_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_selectall_quantum_light.xml b/core/res/res/drawable/ic_menu_selectall_quantum_light.xml
deleted file mode 100644
index 4de8962..0000000
--- a/core/res/res/drawable/ic_menu_selectall_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_selectall_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/ic_menu_share_quantum_dark.xml b/core/res/res/drawable/ic_menu_share_quantum.xml
index a7c5afc..f44e06c 100644
--- a/core/res/res/drawable/ic_menu_share_quantum_dark.xml
+++ b/core/res/res/drawable/ic_menu_share_quantum.xml
@@ -16,4 +16,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_menu_share_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/ic_menu_share_quantum_light.xml b/core/res/res/drawable/ic_menu_share_quantum_light.xml
deleted file mode 100644
index 9257c25..0000000
--- a/core/res/res/drawable/ic_menu_share_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_menu_share_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/item_background_borderless_quantum_light.xml b/core/res/res/drawable/item_background_borderless_quantum_light.xml
deleted file mode 100644
index 09f6ae9..0000000
--- a/core/res/res/drawable/item_background_borderless_quantum_light.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/darker_gray" />
diff --git a/core/res/res/drawable/item_background_borderless_quantum_dark.xml b/core/res/res/drawable/item_background_quantum.xml
index 3f32850..f668ca0 100644
--- a/core/res/res/drawable/item_background_borderless_quantum_dark.xml
+++ b/core/res/res/drawable/item_background_quantum.xml
@@ -15,4 +15,4 @@
-->
<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/lighter_gray" />
+ android:tint="?attr/colorButtonPressed" />
diff --git a/core/res/res/drawable/item_background_quantum_dark.xml b/core/res/res/drawable/item_background_quantum_dark.xml
deleted file mode 100644
index 3f32850..0000000
--- a/core/res/res/drawable/item_background_quantum_dark.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/lighter_gray" />
diff --git a/core/res/res/drawable/item_background_quantum_light.xml b/core/res/res/drawable/item_background_quantum_light.xml
deleted file mode 100644
index 09f6ae9..0000000
--- a/core/res/res/drawable/item_background_quantum_light.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<touch-feedback xmlns:android="http://schemas.android.com/apk/res/android"
- android:tint="@color/darker_gray" />
diff --git a/core/res/res/drawable/list_divider_quantum_dark.xml b/core/res/res/drawable/list_divider_quantum.xml
index 9d05b2f..e3d4ba2 100644
--- a/core/res/res/drawable/list_divider_quantum_dark.xml
+++ b/core/res/res/drawable/list_divider_quantum.xml
@@ -16,4 +16,4 @@
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/list_divider_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/list_divider_quantum_light.xml b/core/res/res/drawable/list_divider_quantum_light.xml
deleted file mode 100644
index d312e2d..0000000
--- a/core/res/res/drawable/list_divider_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/list_divider_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/list_section_divider_quantum_dark.xml b/core/res/res/drawable/list_section_divider_quantum.xml
index 6344c7e..87a1439 100644
--- a/core/res/res/drawable/list_section_divider_quantum_dark.xml
+++ b/core/res/res/drawable/list_section_divider_quantum.xml
@@ -16,4 +16,4 @@
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/list_section_divider_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/list_section_divider_quantum_light.xml b/core/res/res/drawable/list_section_divider_quantum_light.xml
deleted file mode 100644
index 98ede38..0000000
--- a/core/res/res/drawable/list_section_divider_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/list_section_divider_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/progress_horizontal_quantum_dark.xml b/core/res/res/drawable/progress_horizontal_quantum.xml
index fb4b67e..1c2d494 100644
--- a/core/res/res/drawable/progress_horizontal_quantum_dark.xml
+++ b/core/res/res/drawable/progress_horizontal_quantum.xml
@@ -17,18 +17,18 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/background">
<nine-patch android:src="@drawable/progress_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item android:id="@id/secondaryProgress">
<scale android:scaleWidth="100%">
<nine-patch android:src="@drawable/progress_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</scale>
</item>
<item android:id="@id/progress">
<scale android:scaleWidth="100%">
<nine-patch android:src="@drawable/progress_primary_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</scale>
</item>
</layer-list>
diff --git a/core/res/res/drawable/progress_horizontal_quantum_light.xml b/core/res/res/drawable/progress_horizontal_quantum_light.xml
deleted file mode 100644
index 1ceb2e2..0000000
--- a/core/res/res/drawable/progress_horizontal_quantum_light.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@id/background">
- <nine-patch android:src="@drawable/progress_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
- <item android:id="@id/secondaryProgress">
- <scale android:scaleWidth="100%">
- <nine-patch android:src="@drawable/progress_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </scale>
- </item>
- <item android:id="@id/progress">
- <scale android:scaleWidth="100%">
- <nine-patch android:src="@drawable/progress_primary_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </scale>
- </item>
-</layer-list>
diff --git a/core/res/res/drawable/scrollbar_handle_quantum_dark.xml b/core/res/res/drawable/scrollbar_handle_quantum.xml
index 2d4e37d..f2de252 100644
--- a/core/res/res/drawable/scrollbar_handle_quantum_dark.xml
+++ b/core/res/res/drawable/scrollbar_handle_quantum.xml
@@ -16,4 +16,4 @@
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/scrollbar_handle_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
diff --git a/core/res/res/drawable/scrollbar_handle_quantum_light.xml b/core/res/res/drawable/scrollbar_handle_quantum_light.xml
deleted file mode 100644
index d4d4b8d..0000000
--- a/core/res/res/drawable/scrollbar_handle_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/scrollbar_handle_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
diff --git a/core/res/res/drawable/scrubber_control_selector_quantum_dark.xml b/core/res/res/drawable/scrubber_control_selector_quantum.xml
index 521bcca..e31c2c1 100644
--- a/core/res/res/drawable/scrubber_control_selector_quantum_dark.xml
+++ b/core/res/res/drawable/scrubber_control_selector_quantum.xml
@@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<bitmap android:src="@drawable/scrubber_control_on_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/scrubber_control_on_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/scrubber_control_selector_quantum_light.xml b/core/res/res/drawable/scrubber_control_selector_quantum_light.xml
deleted file mode 100644
index 8d009b7..0000000
--- a/core/res/res/drawable/scrubber_control_selector_quantum_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_enabled="true" android:state_pressed="true">
- <bitmap android:src="@drawable/scrubber_control_on_pressed_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/scrubber_control_on_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/scrubber_progress_horizontal_quantum_dark.xml b/core/res/res/drawable/scrubber_progress_horizontal_quantum.xml
index fa0d631..7b124ac 100644
--- a/core/res/res/drawable/scrubber_progress_horizontal_quantum_dark.xml
+++ b/core/res/res/drawable/scrubber_progress_horizontal_quantum.xml
@@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<bitmap android:src="@drawable/scrubber_primary_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<bitmap android:src="@drawable/scrubber_primary_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/scrubber_progress_horizontal_quantum_light.xml b/core/res/res/drawable/scrubber_progress_horizontal_quantum_light.xml
deleted file mode 100644
index 053f542..0000000
--- a/core/res/res/drawable/scrubber_progress_horizontal_quantum_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true">
- <bitmap android:src="@drawable/scrubber_primary_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <bitmap android:src="@drawable/scrubber_primary_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/spinner_background_quantum_dark.xml b/core/res/res/drawable/spinner_background_quantum.xml
index d1e7407..727a78f 100644
--- a/core/res/res/drawable/spinner_background_quantum_dark.xml
+++ b/core/res/res/drawable/spinner_background_quantum.xml
@@ -18,14 +18,14 @@
android:autoMirrored="true">
<item android:state_checked="true">
<nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_pressed="true">
<nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/spinner_background_quantum_light.xml b/core/res/res/drawable/spinner_background_quantum_light.xml
deleted file mode 100644
index b01628d..0000000
--- a/core/res/res/drawable/spinner_background_quantum_light.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- android:autoMirrored="true">
- <item android:state_checked="true">
- <nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_pressed="true">
- <nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/spinner_qntm_am_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/switch_inner_quantum_dark.xml b/core/res/res/drawable/switch_inner_quantum.xml
index 927a55e..915377e 100644
--- a/core/res/res/drawable/switch_inner_quantum_dark.xml
+++ b/core/res/res/drawable/switch_inner_quantum.xml
@@ -17,18 +17,18 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_pressed="true">
<nine-patch android:src="@drawable/switch_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_checked="true">
<nine-patch android:src="@drawable/switch_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_pressed="true">
<nine-patch android:src="@drawable/switch_off_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<nine-patch android:src="@drawable/switch_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/switch_inner_quantum_light.xml b/core/res/res/drawable/switch_inner_quantum_light.xml
deleted file mode 100644
index b5aa47b..0000000
--- a/core/res/res/drawable/switch_inner_quantum_light.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true" android:state_pressed="true">
- <nine-patch android:src="@drawable/switch_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_checked="true">
- <nine-patch android:src="@drawable/switch_on_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_pressed="true">
- <nine-patch android:src="@drawable/switch_off_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/switch_off_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/switch_track_quantum_dark.xml b/core/res/res/drawable/switch_track_quantum.xml
index c018bd2..8c4e6b71 100644
--- a/core/res/res/drawable/switch_track_quantum_dark.xml
+++ b/core/res/res/drawable/switch_track_quantum.xml
@@ -17,10 +17,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<nine-patch android:src="@drawable/switch_track_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<nine-patch android:src="@drawable/switch_track_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/switch_track_quantum_light.xml b/core/res/res/drawable/switch_track_quantum_light.xml
deleted file mode 100644
index ab87a57..0000000
--- a/core/res/res/drawable/switch_track_quantum_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true">
- <nine-patch android:src="@drawable/switch_track_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/switch_track_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/tab_indicator_quantum_dark.xml b/core/res/res/drawable/tab_indicator_quantum.xml
index 9b57c33..6fabe23 100644
--- a/core/res/res/drawable/tab_indicator_quantum_dark.xml
+++ b/core/res/res/drawable/tab_indicator_quantum.xml
@@ -17,27 +17,27 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:state_pressed="true">
<nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_selected="true" android:state_focused="true">
<nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_selected="true">
<nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
<item android:state_pressed="true">
<nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item android:state_focused="true">
<nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
</item>
<item>
<nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_dark" />
+ android:tint="?attr/colorControlNormal" />
</item>
</selector>
diff --git a/core/res/res/drawable/tab_indicator_quantum_light.xml b/core/res/res/drawable/tab_indicator_quantum_light.xml
deleted file mode 100644
index 371322a..0000000
--- a/core/res/res/drawable/tab_indicator_quantum_light.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_selected="true" android:state_pressed="true">
- <nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_selected="true" android:state_focused="true">
- <nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_selected="true">
- <nine-patch android:src="@drawable/tab_indicator_selected_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-
- <item android:state_pressed="true">
- <nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item android:state_focused="true">
- <nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
- </item>
- <item>
- <nine-patch android:src="@drawable/tab_indicator_normal_qntm_alpha"
- android:tint="@color/control_normal_foreground_quantum_light" />
- </item>
-</selector>
diff --git a/core/res/res/drawable/text_cursor_quantum_dark.xml b/core/res/res/drawable/text_cursor_quantum.xml
index bd0d66f..23d4ae0 100644
--- a/core/res/res/drawable/text_cursor_quantum_dark.xml
+++ b/core/res/res/drawable/text_cursor_quantum.xml
@@ -16,4 +16,4 @@
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/text_cursor_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_dark" />
+ android:tint="?attr/colorControlActivated" />
diff --git a/core/res/res/drawable/text_cursor_quantum_light.xml b/core/res/res/drawable/text_cursor_quantum_light.xml
deleted file mode 100644
index 0ec7f01..0000000
--- a/core/res/res/drawable/text_cursor_quantum_light.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/text_cursor_qntm_alpha"
- android:tint="@color/control_activated_foreground_quantum_light" />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index eaaf0d9..1f03ace 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -910,6 +910,16 @@
<!-- Drawable for WebView find-on-page dialogue's "previous" button. @hide -->
<attr name="findOnPagePreviousDrawable" format="reference" />
+ <!-- ============= -->
+ <!-- Color palette -->
+ <!-- ============= -->
+ <attr name="colorControlNormal" format="color" />
+ <attr name="colorControlActivated" format="color" />
+ <attr name="colorButtonNormal" format="color" />
+ <attr name="colorButtonPressed" format="color" />
+ <attr name="colorButtonNormalColored" format="color" />
+ <attr name="colorButtonPressedColored" format="color" />
+
</declare-styleable>
<!-- **************************************************************** -->
diff --git a/core/res/res/values/colors_quantum.xml b/core/res/res/values/colors_quantum.xml
index c8083f4..d10f7c0 100644
--- a/core/res/res/values/colors_quantum.xml
+++ b/core/res/res/values/colors_quantum.xml
@@ -148,13 +148,13 @@
<!-- Text & foreground colors -->
- <color name="primary_text_quantum_light">#ff000000</color>
- <color name="secondary_text_quantum_light">#de000000</color>
- <color name="tertiary_text_quantum_light">#8a000000</color>
+ <color name="primary_text_quantum_light">#de000000</color>
+ <color name="secondary_text_quantum_light">#8a000000</color>
+ <color name="tertiary_text_quantum_light">#4d000000</color>
- <color name="primary_text_quantum_dark">#ffffffff</color>
- <color name="secondary_text_quantum_dark">#deffffff</color>
- <color name="tertiary_text_quantum_dark">#8affffff</color>
+ <color name="primary_text_quantum_dark">#deffffff</color>
+ <color name="secondary_text_quantum_dark">#8affffff</color>
+ <color name="tertiary_text_quantum_dark">#4dffffff</color>
<!-- "Theme" colors to be replaced by attrs when available -->
<color name="theme_color_100">@color/quantum_teal_100</color>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index d96bbc1..6aec77f 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2134,6 +2134,12 @@
<public type="attr" name="limitTo" />
<public type="attr" name="requiredForProfile"/>
<public type="attr" name="pinned" />
+ <public type="attr" name="colorControlNormal" />
+ <public type="attr" name="colorControlActivated" />
+ <public type="attr" name="colorButtonNormal" />
+ <public type="attr" name="colorButtonPressed" />
+ <public type="attr" name="colorButtonNormalColored" />
+ <public type="attr" name="colorButtonPressedColored" />
<public type="dimen" name="recents_thumbnail_height" />
<public type="dimen" name="recents_thumbnail_width" />
@@ -2166,13 +2172,9 @@
<public type="style" name="TextAppearance.Quantum.Widget" />
<public type="style" name="TextAppearance.Quantum.Widget.ActionBar.Menu" />
<public type="style" name="TextAppearance.Quantum.Widget.ActionBar.Subtitle" />
- <public type="style" name="TextAppearance.Quantum.Widget.ActionBar.Subtitle.Inverse" />
<public type="style" name="TextAppearance.Quantum.Widget.ActionBar.Title" />
- <public type="style" name="TextAppearance.Quantum.Widget.ActionBar.Title.Inverse" />
<public type="style" name="TextAppearance.Quantum.Widget.ActionMode.Subtitle" />
- <public type="style" name="TextAppearance.Quantum.Widget.ActionMode.Subtitle.Inverse" />
<public type="style" name="TextAppearance.Quantum.Widget.ActionMode.Title" />
- <public type="style" name="TextAppearance.Quantum.Widget.ActionMode.Title.Inverse" />
<public type="style" name="TextAppearance.Quantum.Widget.Button" />
<public type="style" name="TextAppearance.Quantum.Widget.DropDownHint" />
<public type="style" name="TextAppearance.Quantum.Widget.DropDownItem" />
@@ -2234,6 +2236,8 @@
<public type="style" name="Widget.Quantum.Button.Inset" />
<public type="style" name="Widget.Quantum.Button.Small" />
<public type="style" name="Widget.Quantum.Button.Toggle" />
+ <public type="style" name="Widget.Quantum.ButtonBar" />
+ <public type="style" name="Widget.Quantum.ButtonBar.AlertDialog" />
<public type="style" name="Widget.Quantum.CalendarView" />
<public type="style" name="Widget.Quantum.CheckedTextView" />
<public type="style" name="Widget.Quantum.CompoundButton.CheckBox" />
@@ -2265,6 +2269,7 @@
<public type="style" name="Widget.Quantum.RatingBar.Small" />
<public type="style" name="Widget.Quantum.ScrollView" />
<public type="style" name="Widget.Quantum.SeekBar" />
+ <public type="style" name="Widget.Quantum.SegmentedButton" />
<public type="style" name="Widget.Quantum.Spinner" />
<public type="style" name="Widget.Quantum.Tab" />
<public type="style" name="Widget.Quantum.TabWidget" />
@@ -2276,17 +2281,12 @@
<public type="style" name="Widget.Quantum.Light" />
<public type="style" name="Widget.Quantum.Light.ActionBar" />
<public type="style" name="Widget.Quantum.Light.ActionBar.Solid" />
- <public type="style" name="Widget.Quantum.Light.ActionBar.Solid.Inverse" />
<public type="style" name="Widget.Quantum.Light.ActionBar.TabBar" />
- <public type="style" name="Widget.Quantum.Light.ActionBar.TabBar.Inverse" />
<public type="style" name="Widget.Quantum.Light.ActionBar.TabText" />
- <public type="style" name="Widget.Quantum.Light.ActionBar.TabText.Inverse" />
<public type="style" name="Widget.Quantum.Light.ActionBar.TabView" />
- <public type="style" name="Widget.Quantum.Light.ActionBar.TabView.Inverse" />
<public type="style" name="Widget.Quantum.Light.ActionButton" />
<public type="style" name="Widget.Quantum.Light.ActionButton.CloseMode" />
<public type="style" name="Widget.Quantum.Light.ActionButton.Overflow" />
- <public type="style" name="Widget.Quantum.Light.ActionMode.Inverse" />
<public type="style" name="Widget.Quantum.Light.ActionMode" />
<public type="style" name="Widget.Quantum.Light.AutoCompleteTextView" />
<public type="style" name="Widget.Quantum.Light.Button" />
@@ -2294,6 +2294,8 @@
<public type="style" name="Widget.Quantum.Light.Button.Inset" />
<public type="style" name="Widget.Quantum.Light.Button.Small" />
<public type="style" name="Widget.Quantum.Light.Button.Toggle" />
+ <public type="style" name="Widget.Quantum.Light.ButtonBar" />
+ <public type="style" name="Widget.Quantum.Light.ButtonBar.AlertDialog" />
<public type="style" name="Widget.Quantum.Light.CalendarView" />
<public type="style" name="Widget.Quantum.Light.CheckedTextView" />
<public type="style" name="Widget.Quantum.Light.CompoundButton.CheckBox" />
@@ -2327,6 +2329,7 @@
<public type="style" name="Widget.Quantum.Light.RatingBar.Small" />
<public type="style" name="Widget.Quantum.Light.ScrollView" />
<public type="style" name="Widget.Quantum.Light.SeekBar" />
+ <public type="style" name="Widget.Quantum.Light.SegmentedButton" />
<public type="style" name="Widget.Quantum.Light.Spinner" />
<public type="style" name="Widget.Quantum.Light.Tab" />
<public type="style" name="Widget.Quantum.Light.TabWidget" />
@@ -2335,14 +2338,6 @@
<public type="style" name="Widget.Quantum.Light.WebTextView" />
<public type="style" name="Widget.Quantum.Light.WebView" />
- <public type="style" name="Quantum.ButtonBar.AlertDialog" />
- <public type="style" name="Quantum.ButtonBar" />
- <public type="style" name="Quantum.SegmentedButton" />
-
- <public type="style" name="Quantum.Light.ButtonBar.AlertDialog" />
- <public type="style" name="Quantum.Light.ButtonBar" />
- <public type="style" name="Quantum.Light.SegmentedButton" />
-
<public type="style" name="Widget.Quantum.Button.Paper" />
<public type="style" name="Widget.Quantum.Button.Paper.Color" />
diff --git a/core/res/res/values/styles_quantum.xml b/core/res/res/values/styles_quantum.xml
index 44cdb5f..2020fea 100644
--- a/core/res/res/values/styles_quantum.xml
+++ b/core/res/res/values/styles_quantum.xml
@@ -30,7 +30,7 @@ please see styles_device_defaults.xml.
-->
<resources>
<!-- Preference styles -->
- <eat-comment />
+ <eat-comment/>
<style name="Preference.Quantum">
<item name="layout">@layout/preference_holo</item>
@@ -90,16 +90,98 @@ please see styles_device_defaults.xml.
<!-- Text styles -->
- <style name="TextAppearance.Quantum" parent="TextAppearance"/>
+ <style name="TextAppearance.Quantum">
+ <item name="textColor">?textColorPrimary</item>
+ <item name="textColorHint">?textColorHint</item>
+ <item name="textColorHighlight">?textColorHighlight</item>
+ <item name="textColorLink">?textColorLink</item>
+ <item name="textSize">@dimen/text_size_body_1_quantum</item>
+ <item name="fontFamily">@string/font_family_body_1_quantum</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Display4">
+ <item name="textSize">@dimen/text_size_display_4_quantum</item>
+ <item name="fontFamily">@string/font_family_display_4_quantum</item>
+ <item name="textColor">?textColorSecondary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Display3">
+ <item name="textSize">@dimen/text_size_display_3_quantum</item>
+ <item name="fontFamily">@string/font_family_display_3_quantum</item>
+ <item name="textColor">?textColorSecondary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Display2">
+ <item name="textSize">@dimen/text_size_display_2_quantum</item>
+ <item name="fontFamily">@string/font_family_display_2_quantum</item>
+ <item name="textColor">?textColorSecondary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Display1">
+ <item name="textSize">@dimen/text_size_display_1_quantum</item>
+ <item name="fontFamily">@string/font_family_display_1_quantum</item>
+ <item name="textColor">?textColorSecondary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Headline">
+ <item name="textSize">@dimen/text_size_headline_quantum</item>
+ <item name="fontFamily">@string/font_family_headline_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Title">
+ <item name="textSize">@dimen/text_size_title_quantum</item>
+ <item name="fontFamily">@string/font_family_title_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Subhead">
+ <item name="textSize">@dimen/text_size_subhead_quantum</item>
+ <item name="fontFamily">@string/font_family_subhead_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Body2">
+ <item name="textSize">@dimen/text_size_body_2_quantum</item>
+ <item name="fontFamily">@string/font_family_body_2_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Body1">
+ <item name="textSize">@dimen/text_size_body_1_quantum</item>
+ <item name="fontFamily">@string/font_family_body_1_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Caption">
+ <item name="textSize">@dimen/text_size_caption_quantum</item>
+ <item name="fontFamily">@string/font_family_caption_quantum</item>
+ <item name="textColor">?textColorSecondary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Menu">
+ <item name="textSize">@dimen/text_size_menu_quantum</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <style name="TextAppearance.Quantum.Button">
+ <item name="textSize">@dimen/text_size_button_quantum</item>
+ <item name="fontFamily">@string/font_family_button_quantum</item>
+ <item name="textAllCaps">true</item>
+ <item name="textColor">?textColorPrimary</item>
+ </style>
+
+ <!-- Deprecated text styles -->
- <style name="TextAppearance.Quantum.Inverse" parent="TextAppearance.Inverse">
+ <style name="TextAppearance.Quantum.Inverse">
<item name="textColor">?attr/textColorPrimaryInverse</item>
<item name="textColorHint">?attr/textColorHintInverse</item>
<item name="textColorHighlight">?attr/textColorHighlightInverse</item>
<item name="textColorLink">?attr/textColorLinkInverse</item>
</style>
- <style name="TextAppearance.Quantum.Large" parent="TextAppearance.Large"/>
+ <style name="TextAppearance.Quantum.Large" parent="TextAppearance.Quantum.Headline" />
<style name="TextAppearance.Quantum.Large.Inverse">
<item name="textColor">?attr/textColorPrimaryInverse</item>
@@ -108,7 +190,7 @@ please see styles_device_defaults.xml.
<item name="textColorLink">?attr/textColorLinkInverse</item>
</style>
- <style name="TextAppearance.Quantum.Medium" parent="TextAppearance.Medium"/>
+ <style name="TextAppearance.Quantum.Medium" parent="TextAppearance.Quantum.Body1" />
<style name="TextAppearance.Quantum.Medium.Inverse">
<item name="textColor">?attr/textColorSecondaryInverse</item>
@@ -117,65 +199,50 @@ please see styles_device_defaults.xml.
<item name="textColorLink">?attr/textColorLinkInverse</item>
</style>
- <style name="TextAppearance.Quantum.Small" parent="TextAppearance.Small"/>
+ <style name="TextAppearance.Quantum.Small" parent="TextAppearance.Quantum.Caption" />
<style name="TextAppearance.Quantum.Small.Inverse">
- <item name="textColor">?attr/textColorSecondaryInverse</item>
+ <item name="textColor">?attr/textColorTertiaryInverse</item>
<item name="textColorHint">?attr/textColorHintInverse</item>
<item name="textColorHighlight">?attr/textColorHighlightInverse</item>
<item name="textColorLink">?attr/textColorLinkInverse</item>
</style>
<style name="TextAppearance.Quantum.SearchResult">
- <item name="textStyle">normal</item>
- <item name="textColor">?attr/textColorPrimary</item>
- <item name="textColorHint">?attr/textColorHint</item>
- </style>
-
- <style name="TextAppearance.Quantum.SearchResult.Title">
- <item name="textSize">18sp</item>
</style>
- <style name="TextAppearance.Quantum.SearchResult.Subtitle">
- <item name="textSize">14sp</item>
- <item name="textColor">?attr/textColorSecondary</item>
- </style>
+ <style name="TextAppearance.Quantum.SearchResult.Title" parent="TextAppearance.Quantum.Title" />
+ <style name="TextAppearance.Quantum.SearchResult.Subtitle" parent="TextAppearance.Quantum.Subhead" />
- <style name="TextAppearance.Quantum.Widget" parent="TextAppearance.Widget"/>
-
- <style name="TextAppearance.Quantum.Widget.Button">
- <item name="fontFamily">@string/font_family_button_quantum</item>
- <item name="textSize">@dimen/text_size_button_quantum</item>
- <item name="textAllCaps">true</item>
- <item name="textColor">?attr/textColorPrimary</item>
- <item name="textStyle">normal</item>
- </style>
+ <style name="TextAppearance.Quantum.Widget"/>
+ <style name="TextAppearance.Quantum.Widget.Button" parent="TextAppearance.Quantum.Button" />
<style name="TextAppearance.Quantum.Widget.EditText">
- <item name="textColor">?textColorPrimaryInverse</item>
- <item name="textColorHint">?textColorHintInverse</item>
+ <item name="textColor">?attr/textColorPrimaryInverse</item>
+ <item name="textColorHint">?attr/textColorHintInverse</item>
</style>
- <style name="TextAppearance.Quantum.Widget.Switch" parent="TextAppearance.Quantum.Small">
- <item name="textColor">@color/secondary_text_quantum_dark</item>
+ <style name="TextAppearance.Quantum.Widget.Switch">
+ <item name="textSize">14sp</item>
</style>
- <style name="TextAppearance.Quantum.Widget.PopupMenu" parent="TextAppearance.Widget.PopupMenu">
- <item name="textColor">?attr/textColorPrimary</item>
- </style>
+ <style name="TextAppearance.Quantum.Widget.PopupMenu"/>
<style name="TextAppearance.Quantum.Widget.PopupMenu.Large">
- <item name="textSize">18sp</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textSize">@dimen/text_size_menu_quantum</item>>
</style>
<style name="TextAppearance.Quantum.Widget.PopupMenu.Small">
- <item name="textSize">14sp</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textSize">@dimen/text_size_menu_quantum</item>>
</style>
<style name="TextAppearance.Quantum.Widget.DropDownHint">
- <item name="textColor">?attr/textColorPrimary</item>
- <item name="textSize">14sp</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textSize">@dimen/text_size_menu_quantum</item>>
</style>
+
<style name="TextAppearance.Quantum.Widget.IconMenu.Item" parent="TextAppearance.Quantum.Small">
<item name="textColor">?attr/textColorPrimary</item>
</style>
@@ -194,10 +261,11 @@ please see styles_device_defaults.xml.
</style>
<style name="TextAppearance.Quantum.Widget.TextView.PopupMenu">
- <item name="textSize">18sp</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textSize">@dimen/text_size_menu_quantum</item>
</style>
- <style name="TextAppearance.Quantum.Widget.TextView.SpinnerItem" />
+ <style name="TextAppearance.Quantum.Widget.TextView.SpinnerItem"/>
<style name="TextAppearance.Quantum.Widget.DropDownItem">
<item name="textColor">?attr/textColorPrimaryDisableOnly</item>
@@ -223,106 +291,85 @@ please see styles_device_defaults.xml.
<item name="textSize">@dimen/action_bar_subtitle_text_size_quantum</item>
</style>
- <style name="TextAppearance.Quantum.Widget.ActionBar.Title.Inverse" parent="TextAppearance.Quantum.Medium.Inverse">
- <item name="textSize">@dimen/action_bar_title_text_size_quantum</item>
- </style>
-
- <style name="TextAppearance.Quantum.Widget.ActionBar.Subtitle.Inverse" parent="TextAppearance.Quantum.Small.Inverse">
- <item name="textSize">@dimen/action_bar_subtitle_text_size_quantum</item>
- </style>
-
<style name="TextAppearance.Quantum.Widget.ActionBar.Menu" parent="TextAppearance.Quantum.Small">
- <item name="textSize">12sp</item>
- <item name="textStyle">bold</item>
+ <item name="fontFamily">@string/font_family_menu_quantum</item>
+ <item name="textSize">@dimen/text_size_menu_quantum</item>>
<item name="textColor">?attr/actionMenuTextColor</item>
<item name="textAllCaps">@bool/config_actionMenuItemAllCaps</item>
</style>
- <style name="TextAppearance.Quantum.Widget.ActionMode.Title.Inverse" parent="TextAppearance.Quantum.Medium.Inverse">
- <item name="textSize">@dimen/action_bar_title_text_size_quantum</item>
- </style>
-
- <style name="TextAppearance.Quantum.Widget.ActionMode.Subtitle.Inverse" parent="TextAppearance.Quantum.Small.Inverse">
- <item name="textSize">@dimen/action_bar_subtitle_text_size_quantum</item>
- </style>
-
<style name="TextAppearance.Quantum.WindowTitle">
<item name="textColor">?attr/textColorPrimary</item>
- <item name="textSize">14sp</item>
- <item name="textStyle">bold</item>
+ <item name="fontFamily">@string/font_family_headline_quantum</item>
+ <item name="textSize">@dimen/text_size_headline_quantum</item>
</style>
<style name="TextAppearance.Quantum.DialogWindowTitle">
- <item name="textSize">22sp</item>
+ <item name="fontFamily">@string/font_family_headline_quantum</item>
+ <item name="textSize">@dimen/text_size_headline_quantum</item>
<item name="textColor">?attr/textColorPrimary</item>
</style>
- <style name="TextAppearance.Quantum.CalendarViewWeekDayView" parent="TextAppearance.Small.CalendarViewWeekDayView">
+ <style name="TextAppearance.Quantum.CalendarViewWeekDayView" parent="TextAppearance.Quantum.Small">
+ <item name="textStyle">bold</item>
<item name="textColor">#505050</item>
</style>
- <!-- Light text styles -->
- <style name="TextAppearance.Quantum.Light" parent="TextAppearance.Quantum"/>
+ <style name="TextAppearance.Quantum.TimePicker.TimeLabel" parent="TextAppearance.Quantum">
+ <item name="textSize">@dimen/timepicker_time_label_size</item>
+ <item name="textColor">@color/timepicker_default_text_color_quantum_dark</item>
+ </style>
- <style name="TextAppearance.Quantum.Light.Inverse" parent="TextAppearance.Quantum.Inverse" />
+ <style name="TextAppearance.Quantum.TimePicker.AmPmLabel" parent="TextAppearance.Quantum">
+ <item name="textSize">@dimen/timepicker_ampm_label_size</item>
+ <item name="textAllCaps">true</item>
+ <item name="textColor">@color/timepicker_default_text_color_quantum_dark</item>
+ <item name="textStyle">bold</item>
+ </style>
+ <!-- Light text styles -->
+ <style name="TextAppearance.Quantum.Light" parent="TextAppearance.Quantum"/>
+ <style name="TextAppearance.Quantum.Light.Inverse" parent="TextAppearance.Quantum.Inverse"/>
<style name="TextAppearance.Quantum.Light.Large" parent="TextAppearance.Quantum.Large"/>
-
+ <style name="TextAppearance.Quantum.Light.Large.Inverse" parent="TextAppearance.Quantum.Large.Inverse"/>
<style name="TextAppearance.Quantum.Light.Medium" parent="TextAppearance.Quantum.Medium"/>
-
+ <style name="TextAppearance.Quantum.Light.Medium.Inverse" parent="TextAppearance.Quantum.Medium.Inverse"/>
<style name="TextAppearance.Quantum.Light.Small" parent="TextAppearance.Quantum.Small"/>
-
- <style name="TextAppearance.Quantum.Light.Large.Inverse" parent="TextAppearance.Quantum.Large.Inverse" />
-
- <style name="TextAppearance.Quantum.Light.Medium.Inverse" parent="TextAppearance.Quantum.Medium.Inverse" />
-
- <style name="TextAppearance.Quantum.Light.Small.Inverse" parent="TextAppearance.Quantum.Small.Inverse" />
-
- <style name="TextAppearance.Quantum.Light.SearchResult" parent="TextAppearance.Quantum.SearchResult" />
-
- <style name="TextAppearance.Quantum.Light.SearchResult.Title" parent="TextAppearance.Quantum.SearchResult.Title" />
-
- <style name="TextAppearance.Quantum.Light.SearchResult.Subtitle" parent="TextAppearance.Quantum.SearchResult.Subtitle" />
-
- <style name="TextAppearance.Quantum.Light.Widget" parent="TextAppearance.Widget"/>
-
- <style name="TextAppearance.Quantum.Light.Widget.Button" parent="TextAppearance.Quantum.Widget.Button" />
-
- <style name="TextAppearance.Quantum.Light.Widget.EditText" parent="TextAppearance.Quantum.Widget.EditText" />
-
- <style name="TextAppearance.Quantum.Light.Widget.Switch" parent="TextAppearance.Quantum.Small">
- <item name="textColor">@color/secondary_text_quantum_dark</item>
- </style>
-
+ <style name="TextAppearance.Quantum.Light.Small.Inverse" parent="TextAppearance.Quantum.Small.Inverse"/>
+ <style name="TextAppearance.Quantum.Light.SearchResult" parent="TextAppearance.Quantum.SearchResult"/>
+ <style name="TextAppearance.Quantum.Light.SearchResult.Title" parent="TextAppearance.Quantum.SearchResult.Title"/>
+ <style name="TextAppearance.Quantum.Light.SearchResult.Subtitle" parent="TextAppearance.Quantum.SearchResult.Subtitle"/>
+ <style name="TextAppearance.Quantum.Light.Widget" parent="TextAppearance.Quantum.Widget"/>
+ <style name="TextAppearance.Quantum.Light.Widget.Button" parent="TextAppearance.Quantum.Widget.Button"/>
+ <style name="TextAppearance.Quantum.Light.Widget.EditText" parent="TextAppearance.Quantum.Widget.EditText"/>
+ <style name="TextAppearance.Quantum.Light.Widget.Switch" parent="TextAppearance.Quantum.Widget.Switch"/>
<style name="TextAppearance.Quantum.Light.Widget.PopupMenu" parent="TextAppearance.Quantum.Widget.PopupMenu"/>
-
<style name="TextAppearance.Quantum.Light.Widget.PopupMenu.Large" parent="TextAppearance.Quantum.Widget.PopupMenu.Large"/>
-
<style name="TextAppearance.Quantum.Light.Widget.PopupMenu.Small" parent="TextAppearance.Quantum.Widget.PopupMenu.Small"/>
-
<style name="TextAppearance.Quantum.Light.Widget.DropDownHint" parent="TextAppearance.Quantum.Widget.DropDownHint"/>
+ <style name="TextAppearance.Quantum.Light.Widget.ActionMode.Title" parent="TextAppearance.Quantum.Widget.ActionMode.Title"/>
+ <style name="TextAppearance.Quantum.Light.Widget.ActionMode.Subtitle" parent="TextAppearance.Quantum.Widget.ActionMode.Subtitle"/>
+ <style name="TextAppearance.Quantum.Light.WindowTitle" parent="TextAppearance.Quantum.WindowTitle"/>
+ <style name="TextAppearance.Quantum.Light.DialogWindowTitle" parent="TextAppearance.Quantum.DialogWindowTitle"/>
+ <style name="TextAppearance.Quantum.Light.CalendarViewWeekDayView" parent="TextAppearance.Quantum.CalendarViewWeekDayView"/>
- <style name="TextAppearance.Quantum.Light.Widget.ActionMode.Title" parent="TextAppearance.Widget.ActionMode.Title"/>
-
- <style name="TextAppearance.Quantum.Light.Widget.ActionMode.Subtitle" parent="TextAppearance.Widget.ActionMode.Subtitle"/>
-
- <style name="TextAppearance.Quantum.Light.WindowTitle" parent="TextAppearance.Quantum.WindowTitle" />
-
- <style name="TextAppearance.Quantum.Light.DialogWindowTitle" parent="TextAppearance.Quantum.DialogWindowTitle" />
+ <style name="TextAppearance.Quantum.Light.TimePicker.TimeLabel" parent="TextAppearance.Quantum.TimePicker.TimeLabel">
+ <item name="textColor">@color/timepicker_default_text_color_quantum_light</item>
+ </style>
- <style name="TextAppearance.Quantum.Light.CalendarViewWeekDayView" parent="TextAppearance.Small.CalendarViewWeekDayView"/>
+ <style name="TextAppearance.Quantum.Light.TimePicker.AmPmLabel" parent="TextAppearance.Quantum.TimePicker.AmPmLabel">
+ <item name="textColor">@color/timepicker_default_text_color_quantum_light</item>
+ </style>
<!-- Widget Styles -->
-
- <style name="Quantum" />
- <style name="Quantum.Light" />
-
+ <style name="Quantum"/>
+ <style name="Quantum.Light"/>
<style name="Widget.Quantum" parent="Widget" />
<!-- Bordered ink button -->
<style name="Widget.Quantum.Button" parent="Widget.Button">
- <item name="background">@drawable/btn_default_quantum_dark</item>
+ <item name="background">@drawable/btn_default_quantum</item>
<item name="textAppearance">?attr/textAppearanceButton</item>
<item name="minHeight">48dip</item>
<item name="minWidth">96dip</item>
@@ -341,12 +388,12 @@ please see styles_device_defaults.xml.
<!-- Bordered paper button with color -->
<style name="Widget.Quantum.Button.Paper.Color">
- <item name="background">@drawable/btn_color_quantum_dark</item>
+ <item name="background">@drawable/btn_color_quantum</item>
</style>
<!-- Borderless ink button -->
<style name="Widget.Quantum.Button.Borderless">
- <item name="background">@drawable/btn_borderless_quantum_dark</item>
+ <item name="background">@drawable/btn_borderless_quantum</item>
</style>
<!-- Small borderless ink button -->
@@ -359,6 +406,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Button.Borderless.Paper">
<!-- TODO: Specify pressed state animation. -->
</style>
+
<style name="Widget.Quantum.Button.Inset">
<item name="background">@drawable/button_inset</item>
</style>
@@ -371,7 +419,7 @@ please see styles_device_defaults.xml.
<item name="minHeight">48dip</item>
</style>
- <style name="Quantum.ButtonBar" parent="ButtonBar">
+ <style name="Widget.Quantum.ButtonBar">
<item name="paddingTop">0dip</item>
<item name="paddingStart">0dip</item>
<item name="paddingEnd">0dip</item>
@@ -382,15 +430,17 @@ please see styles_device_defaults.xml.
<item name="background">@null</item>
</style>
- <style name="Quantum.SegmentedButton" parent="SegmentedButton">
- <item name="background">@drawable/btn_group_holo_dark</item>
- </style>
-
- <style name="Quantum.ButtonBar.AlertDialog">
+ <style name="Widget.Quantum.ButtonBar.AlertDialog">
<item name="background">@null</item>
<item name="dividerPadding">0dp</item>
</style>
+ <style name="Widget.Quantum.ButtonBar.Button"/>
+
+ <style name="Widget.Quantum.SegmentedButton" parent="SegmentedButton">
+ <item name="background">@drawable/btn_group_holo_dark</item>
+ </style>
+
<style name="Widget.Quantum.StackView">
<item name="resOutColor">@color/holo_blue_light</item>
<item name="clickColor">@color/holo_blue_light</item>
@@ -398,17 +448,20 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.TextView" parent="Widget.TextView"/>
- <style name="Widget.Quantum.CheckedTextView" parent="Widget.CheckedTextView"/>
-
<style name="Widget.Quantum.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
- <item name="background">@drawable/list_section_divider_quantum_dark</item>
+ <item name="background">@drawable/list_section_divider_quantum</item>
<item name="textAllCaps">true</item>
</style>
- <style name="Widget.Quantum.TextSelectHandle" parent="Widget.TextSelectHandle"/>
+ <style name="Widget.Quantum.TextView.SpinnerItem" parent="Widget.TextView.SpinnerItem">
+ <item name="textAppearance">@style/TextAppearance.Quantum.Widget.TextView.SpinnerItem</item>
+ <item name="paddingStart">8dp</item>
+ <item name="paddingEnd">8dp</item>
+ </style>
+ <style name="Widget.Quantum.CheckedTextView" parent="Widget.CheckedTextView"/>
+ <style name="Widget.Quantum.TextSelectHandle" parent="Widget.TextSelectHandle"/>
<style name="Widget.Quantum.TextSuggestionsPopupWindow" parent="Widget.TextSuggestionsPopupWindow"/>
-
<style name="Widget.Quantum.AbsListView" parent="Widget.AbsListView"/>
<style name="Widget.Quantum.AutoCompleteTextView" parent="Widget.AutoCompleteTextView">
@@ -417,31 +470,38 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.CompoundButton" parent="Widget.CompoundButton"/>
-
<style name="Widget.Quantum.CompoundButton.CheckBox" parent="Widget.CompoundButton.CheckBox"/>
+ <style name="Widget.Quantum.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton"/>
- <style name="Widget.Quantum.ListView.DropDown"/>
+ <style name="Widget.Quantum.CompoundButton.Star" parent="Widget.CompoundButton.Star">
+ <item name="button">@drawable/btn_star_quantum</item>
+ </style>
+
+ <style name="Widget.Quantum.CompoundButton.Switch">
+ <item name="track">@drawable/switch_track_quantum</item>
+ <item name="thumb">@drawable/switch_inner_quantum</item>
+ <item name="switchTextAppearance">@style/TextAppearance.Quantum.Widget.Switch</item>
+ <item name="textOn"></item>
+ <item name="textOff"></item>
+ <item name="thumbTextPadding">12dip</item>
+ <item name="switchMinWidth">72dip</item>
+ <item name="switchPadding">16dip</item>
+ </style>
<style name="Widget.Quantum.EditText" parent="Widget.EditText"/>
<style name="Widget.Quantum.ExpandableListView" parent="Widget.Quantum.ListView">
- <item name="groupIndicator">@drawable/expander_group_quantum_dark</item>
+ <item name="groupIndicator">@drawable/expander_group_quantum</item>
<item name="indicatorLeft">?attr/expandableListPreferredItemIndicatorLeft</item>
<item name="indicatorRight">?attr/expandableListPreferredItemIndicatorRight</item>
<item name="childDivider">?attr/listDivider</item>
</style>
<style name="Widget.Quantum.ExpandableListView.White"/>
-
<style name="Widget.Quantum.FragmentBreadCrumbs" parent="Widget.FragmentBreadCrumbs"/>
-
<style name="Widget.Quantum.Gallery" parent="Widget.Gallery"/>
-
<style name="Widget.Quantum.GestureOverlayView" parent="Widget.GestureOverlayView"/>
-
- <style name="Widget.Quantum.GridView" parent="Widget.GridView">
- <item name="listSelector">?attr/selectableItemBackground</item>
- </style>
+ <style name="Widget.Quantum.GridView" parent="Widget.GridView"/>
<style name="Widget.Quantum.CalendarView" parent="Widget.CalendarView">
<item name="selectedWeekBackgroundColor">#330099FF</item>
@@ -454,7 +514,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.ImageButton" parent="Widget.ImageButton">
- <item name="background">@drawable/btn_default_quantum_dark</item>
+ <item name="background">@drawable/btn_default_quantum</item>
</style>
<style name="Widget.Quantum.NumberPicker" parent="Widget.NumberPicker">
@@ -489,7 +549,6 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.ActivityChooserView" parent="Widget.ActivityChooserView"/>
-
<style name="Widget.Quantum.ImageWell" parent="Widget.ImageWell"/>
<style name="Widget.Quantum.ListView" parent="Widget.ListView">
@@ -497,6 +556,7 @@ please see styles_device_defaults.xml.
<item name="listSelector">?attr/listChoiceBackgroundIndicator</item>
</style>
+ <style name="Widget.Quantum.ListView.DropDown"/>
<style name="Widget.Quantum.ListView.White"/>
<style name="Widget.Quantum.PopupWindow" parent="Widget.PopupWindow"/>
@@ -510,8 +570,10 @@ please see styles_device_defaults.xml.
<item name="indeterminateDrawable">@drawable/progress_medium_holo</item>
</style>
+ <style name="Widget.Quantum.ProgressBar.Inverse"/>
+
<style name="Widget.Quantum.ProgressBar.Horizontal" parent="Widget.ProgressBar.Horizontal">
- <item name="progressDrawable">@drawable/progress_horizontal_quantum_dark</item>
+ <item name="progressDrawable">@drawable/progress_horizontal_quantum</item>
<item name="indeterminateDrawable">@drawable/progress_indeterminate_horizontal_holo</item>
<item name="minHeight">16dip</item>
<item name="maxHeight">16dip</item>
@@ -521,25 +583,22 @@ please see styles_device_defaults.xml.
<item name="indeterminateDrawable">@drawable/progress_small_holo</item>
</style>
+ <style name="Widget.Quantum.ProgressBar.Small.Inverse"/>
<style name="Widget.Quantum.ProgressBar.Small.Title"/>
<style name="Widget.Quantum.ProgressBar.Large" parent="Widget.ProgressBar.Large">
<item name="indeterminateDrawable">@drawable/progress_large_holo</item>
</style>
- <style name="Widget.Quantum.ProgressBar.Inverse"/>
-
- <style name="Widget.Quantum.ProgressBar.Small.Inverse"/>
-
<style name="Widget.Quantum.ProgressBar.Large.Inverse"/>
<style name="Widget.Quantum.SeekBar">
<item name="indeterminateOnly">false</item>
- <item name="progressDrawable">@drawable/scrubber_progress_horizontal_quantum_dark</item>
- <item name="indeterminateDrawable">@drawable/scrubber_progress_horizontal_quantum_dark</item>
+ <item name="progressDrawable">@drawable/scrubber_progress_horizontal_quantum</item>
+ <item name="indeterminateDrawable">@drawable/scrubber_progress_horizontal_quantum</item>
<item name="minHeight">13dip</item>
<item name="maxHeight">13dip</item>
- <item name="thumb">@drawable/scrubber_control_selector_quantum_dark</item>
+ <item name="thumb">@drawable/scrubber_control_selector_quantum</item>
<item name="thumbOffset">16dip</item>
<item name="focusable">true</item>
<item name="paddingStart">16dip</item>
@@ -566,14 +625,11 @@ please see styles_device_defaults.xml.
<item name="maxHeight">16dip</item>
</style>
- <style name="Widget.Quantum.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton"/>
-
<style name="Widget.Quantum.ScrollView" parent="Widget.ScrollView"/>
-
<style name="Widget.Quantum.HorizontalScrollView" parent="Widget.HorizontalScrollView"/>
<style name="Widget.Quantum.Spinner" parent="Widget.Spinner.DropDown">
- <item name="background">@drawable/spinner_background_quantum_dark</item>
+ <item name="background">@drawable/spinner_background_quantum</item>
<item name="dropDownSelector">@drawable/list_selector_holo_dark</item>
<item name="popupBackground">?attr/colorBackground</item>
<item name="dropDownVerticalOffset">0dip</item>
@@ -587,11 +643,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Spinner.DropDown"/>
<style name="Widget.Quantum.Spinner.DropDown.ActionBar">
- <item name="background">@drawable/spinner_background_quantum_dark</item>
- </style>
-
- <style name="Widget.Quantum.CompoundButton.Star" parent="Widget.CompoundButton.Star">
- <item name="button">@drawable/btn_star_quantum_dark</item>
+ <item name="background">@drawable/spinner_background_quantum</item>
</style>
<style name="Widget.Quantum.TabWidget" parent="Widget.TabWidget">
@@ -606,7 +658,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.Tab" parent="Widget.Quantum.ActionBar.TabView">
- <item name="background">@drawable/tab_indicator_quantum_dark</item>
+ <item name="background">@drawable/tab_indicator_quantum</item>
<item name="layout_width">0dip</item>
<item name="layout_weight">1</item>
<item name="minWidth">80dip</item>
@@ -628,24 +680,12 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.DropDownItem.Spinner"/>
- <style name="Widget.Quantum.TextView.SpinnerItem" parent="Widget.TextView.SpinnerItem">
- <item name="textAppearance">@style/TextAppearance.Quantum.Widget.TextView.SpinnerItem</item>
- <item name="paddingStart">8dp</item>
- <item name="paddingEnd">8dp</item>
- </style>
-
<style name="Widget.Quantum.KeyboardView" parent="Widget.KeyboardView"/>
-
<style name="Widget.Quantum.QuickContactBadge.WindowSmall" parent="Widget.QuickContactBadge.WindowSmall"/>
-
<style name="Widget.Quantum.QuickContactBadge.WindowMedium" parent="Widget.QuickContactBadge.WindowMedium"/>
-
<style name="Widget.Quantum.QuickContactBadge.WindowLarge" parent="Widget.QuickContactBadge.WindowLarge"/>
-
<style name="Widget.Quantum.QuickContactBadgeSmall.WindowSmall" parent="Widget.QuickContactBadgeSmall.WindowSmall"/>
-
<style name="Widget.Quantum.QuickContactBadgeSmall.WindowMedium" parent="Widget.QuickContactBadgeSmall.WindowMedium"/>
-
<style name="Widget.Quantum.QuickContactBadgeSmall.WindowLarge" parent="Widget.QuickContactBadgeSmall.WindowLarge"/>
<style name="Widget.Quantum.ListPopupWindow" parent="Widget.ListPopupWindow">
@@ -658,12 +698,6 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.PopupMenu" parent="Widget.Quantum.ListPopupWindow"/>
- <style name="Widget.Quantum.ButtonBar">
- <item name="divider">?attr/dividerVertical</item>
- </style>
-
- <style name="Widget.Quantum.ButtonBar.Button"/>
-
<style name="Widget.Quantum.ActionButton" parent="Widget.ActionButton">
<item name="minWidth">@dimen/action_button_min_width</item>
<item name="gravity">center</item>
@@ -673,8 +707,12 @@ please see styles_device_defaults.xml.
<item name="maxLines">2</item>
</style>
+ <style name="Widget.Quantum.ActionButton.CloseMode">
+ <item name="background">@drawable/btn_cab_done_holo_dark</item>
+ </style>
+
<style name="Widget.Quantum.ActionButton.Overflow">
- <item name="src">@drawable/ic_menu_moreoverflow_quantum_dark</item>
+ <item name="src">@drawable/ic_menu_moreoverflow_quantum</item>
<item name="background">?attr/actionBarItemBackground</item>
<item name="contentDescription">@string/action_menu_overflow_description</item>
</style>
@@ -682,7 +720,7 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.ActionButton.TextButton" parent="Widget.Quantum.ButtonBar.Button"/>
<style name="Widget.Quantum.ActionBar.TabView" parent="Widget.ActionBar.TabView">
- <item name="background">@drawable/tab_indicator_quantum_dark</item>
+ <item name="background">@drawable/tab_indicator_quantum</item>
<item name="paddingStart">16dip</item>
<item name="paddingEnd">16dip</item>
</style>
@@ -703,19 +741,10 @@ please see styles_device_defaults.xml.
<item name="maxLines">2</item>
</style>
- <style name="Widget.Quantum.ActionMode" parent="Widget.ActionMode">
- <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Title</item>
- <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Subtitle</item>
- </style>
-
- <style name="Widget.Quantum.ActionButton.CloseMode">
- <item name="background">@drawable/btn_cab_done_holo_dark</item>
- </style>
-
<style name="Widget.Quantum.ActionBar" parent="Widget.ActionBar">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
- <item name="background">@drawable/ab_transparent_quantum_dark</item>
+ <item name="background">@drawable/ab_transparent_quantum</item>
<item name="backgroundStacked">@drawable/ab_stacked_transparent_dark_holo</item>
<item name="backgroundSplit">@drawable/ab_bottom_transparent_dark_holo</item>
<item name="divider">?attr/dividerVertical</item>
@@ -738,61 +767,43 @@ please see styles_device_defaults.xml.
<item name="itemPadding">8dip</item>
</style>
- <style name="Widget.Quantum.CompoundButton.Switch">
- <item name="track">@drawable/switch_track_quantum_dark</item>
- <item name="thumb">@drawable/switch_inner_quantum_dark</item>
- <item name="switchTextAppearance">@style/TextAppearance.Quantum.Widget.Switch</item>
- <item name="textOn"></item>
- <item name="textOff"></item>
- <item name="thumbTextPadding">12dip</item>
- <item name="switchMinWidth">72dip</item>
- <item name="switchPadding">16dip</item>
- </style>
-
- <!-- Light widget styles -->
-
- <style name="Widget.Quantum.Light" parent="Widget" />
-
- <!-- Bordered ink button -->
- <style name="Widget.Quantum.Light.Button" parent="Widget.Quantum.Button">
- <item name="background">@drawable/btn_default_quantum_light</item>
- <item name="textAppearance">?attr/textAppearanceButton</item>
- <item name="minHeight">48dip</item>
- <item name="minWidth">96dip</item>
- </style>
-
- <!-- Small bordered ink button -->
- <style name="Widget.Quantum.Light.Button.Small">
- <item name="minHeight">48dip</item>
- <item name="minWidth">48dip</item>
+ <style name="Widget.Quantum.ActionMode" parent="Widget.ActionMode">
+ <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Title</item>
+ <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Subtitle</item>
</style>
- <!-- Bordered paper button -->
- <style name="Widget.Quantum.Light.Button.Paper">
- <!-- TODO: Specify pressed state animation. -->
+ <style name="Widget.Quantum.FastScroll" parent="Widget.FastScroll">
+ <item name="thumbMinWidth">0dp</item>
+ <item name="thumbMinHeight">0dp</item>
</style>
- <!-- Bordered paper button with color -->
- <style name="Widget.Quantum.Light.Button.Paper.Color">
- <item name="background">@drawable/btn_color_quantum_light</item>
+ <style name="Widget.Quantum.PreferenceFrameLayout">
+ <item name="borderTop">0dip</item>
+ <item name="borderBottom">@dimen/preference_fragment_padding_bottom</item>
+ <item name="borderLeft">?attr/preferenceFragmentPaddingSide</item>
+ <item name="borderRight">?attr/preferenceFragmentPaddingSide</item>
</style>
- <!-- Borderless ink button -->
- <style name="Widget.Quantum.Light.Button.Borderless">
- <item name="background">@drawable/btn_borderless_quantum_light</item>
+ <style name="Widget.Quantum.MediaRouteButton">
+ <item name="background">?attr/selectableItemBackground</item>
+ <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_dark</item>
+ <item name="minWidth">56dp</item>
+ <item name="minHeight">48dp</item>
+ <item name="focusable">true</item>
+ <item name="contentDescription">@string/media_route_button_content_description</item>
</style>
- <!-- Small borderless ink button -->
- <style name="Widget.Quantum.Light.Button.Borderless.Small">
- <item name="minHeight">48dip</item>
- <item name="minWidth">48dip</item>
- </style>
+ <!-- Light widget styles -->
- <!-- Borderless paper button -->
- <style name="Widget.Quantum.Light.Button.Borderless.Paper">
- <!-- TODO: Specify pressed state animation. -->
- </style>
- <style name="Widget.Quantum.Light.Button.Inset"/>
+ <style name="Widget.Quantum.Light" parent="Widget.Quantum"/>
+ <style name="Widget.Quantum.Light.Button" parent="Widget.Quantum.Button"/>
+ <style name="Widget.Quantum.Light.Button.Small" parent="Widget.Quantum.Button.Small"/>
+ <style name="Widget.Quantum.Light.Button.Paper" parent="Widget.Quantum.Button.Paper"/>
+ <style name="Widget.Quantum.Light.Button.Paper.Color" parent="Widget.Quantum.Button.Paper.Color"/>
+ <style name="Widget.Quantum.Light.Button.Borderless" parent="Widget.Quantum.Button.Borderless"/>
+ <style name="Widget.Quantum.Light.Button.Borderless.Small" parent="Widget.Quantum.Button.Borderless.Small"/>
+ <style name="Widget.Quantum.Light.Button.Borderless.Paper" parent="Widget.Quantum.Button.Borderless.Paper"/>
+ <style name="Widget.Quantum.Light.Button.Inset" parent="Widget.Quantum.Button.Inset"/>
<style name="Widget.Quantum.Light.Button.Toggle">
<item name="background">@drawable/btn_toggle_holo_light</item>
@@ -802,63 +813,36 @@ please see styles_device_defaults.xml.
<item name="minHeight">48dip</item>
</style>
- <style name="Quantum.Light.ButtonBar" parent="Quantum.ButtonBar"/>
+ <style name="Widget.Quantum.Light.ButtonBar" parent="Widget.Quantum.ButtonBar"/>
+ <style name="Widget.Quantum.Light.ButtonBar.AlertDialog" parent="Widget.Quantum.ButtonBar.AlertDialog"/>
- <style name="Quantum.Light.ButtonBar.AlertDialog">
- <item name="background">@null</item>
- <item name="dividerPadding">0dp</item>
- </style>
-
- <style name="Quantum.Light.SegmentedButton" parent="SegmentedButton">
+ <style name="Widget.Quantum.Light.SegmentedButton" parent="Widget.Quantum.SegmentedButton">
<item name="background">@drawable/btn_group_holo_light</item>
</style>
- <style name="Widget.Quantum.Light.TextView" parent="Widget.TextView"/>
-
- <style name="Widget.Quantum.Light.CheckedTextView" parent="Widget.CheckedTextView"/>
-
- <style name="Widget.Quantum.Light.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
- <item name="background">@drawable/list_section_divider_quantum_light</item>
- <item name="textAllCaps">true</item>
- </style>
-
- <style name="Widget.Quantum.Light.TextSelectHandle" parent="Widget.TextSelectHandle"/>
-
- <style name="Widget.Quantum.Light.TextSuggestionsPopupWindow" parent="Widget.TextSuggestionsPopupWindow"/>
-
- <style name="Widget.Quantum.Light.AbsListView" parent="Widget.AbsListView"/>
+ <style name="Widget.Quantum.Light.TextView" parent="Widget.Quantum.TextView"/>
+ <style name="Widget.Quantum.Light.TextView.ListSeparator" parent="Widget.Quantum.TextView.ListSeparator"/>
+ <style name="Widget.Quantum.Light.TextView.SpinnerItem" parent="Widget.Quantum.TextView.SpinnerItem"/>
+ <style name="Widget.Quantum.Light.CheckedTextView" parent="Widget.Quantum.CheckedTextView"/>
+ <style name="Widget.Quantum.Light.TextSelectHandle" parent="Widget.Quantum.TextSelectHandle"/>
+ <style name="Widget.Quantum.Light.TextSuggestionsPopupWindow" parent="Widget.Quantum.TextSuggestionsPopupWindow"/>
+ <style name="Widget.Quantum.Light.AbsListView" parent="Widget.Quantum.AbsListView"/>
<style name="Widget.Quantum.Light.AutoCompleteTextView" parent="Widget.AutoCompleteTextView">
<item name="dropDownSelector">@drawable/list_selector_holo_light</item>
<item name="popupBackground">?attr/colorBackground</item>
</style>
- <style name="Widget.Quantum.Light.CompoundButton.CheckBox" parent="Widget.CompoundButton.CheckBox"/>
-
- <style name="Widget.Quantum.Light.ListView.DropDown"/>
-
+ <style name="Widget.Quantum.Light.CompoundButton.CheckBox" parent="Widget.Quantum.CompoundButton.CheckBox"/>
+ <style name="Widget.Quantum.Light.ListView.DropDown" parent="Widget.Quantum.ListView.DropDown"/>
<style name="Widget.Quantum.Light.EditText" parent="Widget.Quantum.EditText"/>
-
- <style name="Widget.Quantum.Light.ExpandableListView" parent="Widget.Quantum.Light.ListView">
- <item name="groupIndicator">@drawable/expander_group_quantum_light</item>
- <item name="indicatorLeft">?attr/expandableListPreferredItemIndicatorLeft</item>
- <item name="indicatorRight">?attr/expandableListPreferredItemIndicatorRight</item>
- <item name="childDivider">?attr/listDivider</item>
- </style>
-
- <style name="Widget.Quantum.Light.ExpandableListView.White"/>
-
- <style name="Widget.Quantum.Light.FragmentBreadCrumbs" parent="Widget.FragmentBreadCrumbs"/>
-
- <style name="Widget.Quantum.Light.Gallery" parent="Widget.Gallery"/>
-
- <style name="Widget.Quantum.Light.GestureOverlayView" parent="Widget.GestureOverlayView"/>
-
+ <style name="Widget.Quantum.Light.ExpandableListView" parent="Widget.Quantum.ExpandableListView"/>
+ <style name="Widget.Quantum.Light.ExpandableListView.White" parent="Widget.Quantum.ExpandableListView.White"/>
+ <style name="Widget.Quantum.Light.FragmentBreadCrumbs" parent="Widget.Quantum.FragmentBreadCrumbs"/>
+ <style name="Widget.Quantum.Light.Gallery" parent="Widget.Quantum.Gallery"/>
+ <style name="Widget.Quantum.Light.GestureOverlayView" parent="Widget.Quantum.GestureOverlayView"/>
<style name="Widget.Quantum.Light.GridView" parent="Widget.Quantum.GridView"/>
-
- <style name="Widget.Quantum.Light.ImageButton" parent="Widget.Quantum.ImageButton">
- <item name="background">@drawable/btn_default_quantum_light</item>
- </style>
+ <style name="Widget.Quantum.Light.ImageButton" parent="Widget.Quantum.ImageButton"/>
<style name="Widget.Quantum.Light.CalendarView" parent="Widget.CalendarView">
<item name="selectedWeekBackgroundColor">#330066ff</item>
@@ -892,13 +876,10 @@ please see styles_device_defaults.xml.
<item name="background">@drawable/ab_share_pack_holo_light</item>
</style>
- <style name="Widget.Quantum.Light.ImageWell" parent="Widget.ImageWell"/>
-
+ <style name="Widget.Quantum.Light.ImageWell" parent="Widget.Quantum.ImageWell"/>
<style name="Widget.Quantum.Light.ListView" parent="Widget.Quantum.ListView"/>
-
- <style name="Widget.Quantum.Light.ListView.White"/>
-
- <style name="Widget.Quantum.Light.PopupWindow" parent="Widget.PopupWindow"/>
+ <style name="Widget.Quantum.Light.ListView.White" parent="Widget.Quantum.ListView.White"/>
+ <style name="Widget.Quantum.Light.PopupWindow" parent="Widget.Quantum.PopupWindow"/>
<style name="Widget.Quantum.Light.PopupWindow.ActionMode">
<item name="popupBackground">@color/white</item>
@@ -906,28 +887,14 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Quantum.Light.ProgressBar" parent="Widget.Quantum.ProgressBar"/>
-
- <style name="Widget.Quantum.Light.ProgressBar.Horizontal" parent="Widget.Quantum.ProgressBar.Horizontal">
- <item name="progressDrawable">@drawable/progress_horizontal_quantum_light</item>
- </style>
-
+ <style name="Widget.Quantum.Light.ProgressBar.Horizontal" parent="Widget.Quantum.ProgressBar.Horizontal"/>
<style name="Widget.Quantum.Light.ProgressBar.Small" parent="Widget.Quantum.ProgressBar.Small"/>
-
<style name="Widget.Quantum.Light.ProgressBar.Small.Title" parent="Widget.Quantum.ProgressBar.Small.Title"/>
-
<style name="Widget.Quantum.Light.ProgressBar.Large" parent="Widget.Quantum.ProgressBar.Large"/>
-
<style name="Widget.Quantum.Light.ProgressBar.Inverse" parent="Widget.Quantum.ProgressBar.Inverse"/>
-
<style name="Widget.Quantum.Light.ProgressBar.Small.Inverse" parent="Widget.Quantum.ProgressBar.Small.Inverse"/>
-
<style name="Widget.Quantum.Light.ProgressBar.Large.Inverse" parent="Widget.Quantum.ProgressBar.Large.Inverse"/>
-
- <style name="Widget.Quantum.Light.SeekBar" parent="Widget.Quantum.SeekBar">
- <item name="progressDrawable">@drawable/scrubber_progress_horizontal_quantum_light</item>
- <item name="indeterminateDrawable">@drawable/scrubber_progress_horizontal_quantum_light</item>
- <item name="thumb">@drawable/scrubber_control_selector_quantum_light</item>
- </style>
+ <style name="Widget.Quantum.Light.SeekBar" parent="Widget.Quantum.SeekBar"/>
<style name="Widget.Quantum.Light.RatingBar" parent="Widget.RatingBar">
<item name="progressDrawable">@drawable/ratingbar_full_holo_light</item>
@@ -948,14 +915,12 @@ please see styles_device_defaults.xml.
<item name="maxHeight">16dip</item>
</style>
- <style name="Widget.Quantum.Light.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton"/>
-
- <style name="Widget.Quantum.Light.ScrollView" parent="Widget.ScrollView"/>
-
- <style name="Widget.Quantum.Light.HorizontalScrollView" parent="Widget.HorizontalScrollView"/>
+ <style name="Widget.Quantum.Light.CompoundButton.RadioButton" parent="Widget.Quantum.CompoundButton.RadioButton"/>
+ <style name="Widget.Quantum.Light.ScrollView" parent="Widget.Quantum.ScrollView"/>
+ <style name="Widget.Quantum.Light.HorizontalScrollView" parent="Widget.Quantum.HorizontalScrollView"/>
<style name="Widget.Quantum.Light.Spinner" parent="Widget.Quantum.Spinner">
- <item name="background">@drawable/spinner_background_quantum_light</item>
+ <item name="background">@drawable/spinner_background_quantum</item>
<item name="dropDownSelector">@drawable/list_selector_holo_light</item>
<item name="popupBackground">?attr/colorBackground</item>
<item name="dropDownVerticalOffset">0dip</item>
@@ -964,41 +929,21 @@ please see styles_device_defaults.xml.
<item name="popupPromptView">@layout/simple_dropdown_hint</item>
</style>
- <style name="Widget.Quantum.Light.Spinner.DropDown"/>
-
- <style name="Widget.Quantum.Light.Spinner.DropDown.ActionBar">
- <item name="background">@drawable/spinner_background_quantum_light</item>
- </style>
-
- <style name="Widget.Quantum.Light.CompoundButton.Star" parent="Widget.CompoundButton.Star">
- <item name="button">@drawable/btn_star_quantum_light</item>
- </style>
-
+ <style name="Widget.Quantum.Light.Spinner.DropDown" parent="Widget.Quantum.Spinner.DropDown"/>
+ <style name="Widget.Quantum.Light.Spinner.DropDown.ActionBar" parent="Widget.Quantum.Spinner.DropDown.ActionBar"/>
+ <style name="Widget.Quantum.Light.CompoundButton.Star" parent="Widget.Quantum.CompoundButton.Star"/>
<style name="Widget.Quantum.Light.TabWidget" parent="Widget.Quantum.TabWidget"/>
-
- <style name="Widget.Quantum.Light.WebTextView" parent="Widget.WebTextView"/>
-
- <style name="Widget.Quantum.Light.WebView" parent="Widget.WebView"/>
-
+ <style name="Widget.Quantum.Light.WebTextView" parent="Widget.Quantum.WebTextView"/>
+ <style name="Widget.Quantum.Light.WebView" parent="Widget.Quantum.WebView"/>
<style name="Widget.Quantum.Light.DropDownItem" parent="Widget.Quantum.DropDownItem"/>
-
- <style name="Widget.Quantum.Light.DropDownItem.Spinner"/>
-
- <style name="Widget.Quantum.Light.TextView.SpinnerItem" parent="Widget.Quantum.TextView.SpinnerItem"/>
-
- <style name="Widget.Quantum.Light.KeyboardView" parent="Widget.KeyboardView"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadge.WindowSmall" parent="Widget.QuickContactBadge.WindowSmall"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadge.WindowMedium" parent="Widget.QuickContactBadge.WindowMedium"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadge.WindowLarge" parent="Widget.QuickContactBadge.WindowLarge"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowSmall" parent="Widget.QuickContactBadgeSmall.WindowSmall"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowMedium" parent="Widget.QuickContactBadgeSmall.WindowMedium"/>
-
- <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowLarge" parent="Widget.QuickContactBadgeSmall.WindowLarge"/>
+ <style name="Widget.Quantum.Light.DropDownItem.Spinner" parent="Widget.Quantum.DropDownItem.Spinner"/>
+ <style name="Widget.Quantum.Light.KeyboardView" parent="Widget.Quantum.KeyboardView"/>
+ <style name="Widget.Quantum.Light.QuickContactBadge.WindowSmall" parent="Widget.Quantum.QuickContactBadge.WindowSmall"/>
+ <style name="Widget.Quantum.Light.QuickContactBadge.WindowMedium" parent="Widget.Quantum.QuickContactBadge.WindowMedium"/>
+ <style name="Widget.Quantum.Light.QuickContactBadge.WindowLarge" parent="Widget.Quantum.QuickContactBadge.WindowLarge"/>
+ <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowSmall" parent="Widget.Quantum.QuickContactBadgeSmall.WindowSmall"/>
+ <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowMedium" parent="Widget.Quantum.QuickContactBadgeSmall.WindowMedium"/>
+ <style name="Widget.Quantum.Light.QuickContactBadgeSmall.WindowLarge" parent="Widget.Quantum.QuickContactBadgeSmall.WindowLarge"/>
<style name="Widget.Quantum.Light.ListPopupWindow" parent="Widget.ListPopupWindow">
<item name="dropDownSelector">@drawable/list_selector_holo_light</item>
@@ -1011,44 +956,17 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.PopupMenu" parent="Widget.Quantum.Light.ListPopupWindow"/>
<style name="Widget.Quantum.Light.ActionButton" parent="Widget.Quantum.ActionButton"/>
-
- <style name="Widget.Quantum.Light.ActionButton.Overflow">
- <item name="src">@drawable/ic_menu_moreoverflow_quantum_light</item>
- <item name="contentDescription">@string/action_menu_overflow_description</item>
- </style>
-
- <style name="Widget.Quantum.Light.ActionBar.TabView" parent="Widget.Quantum.ActionBar.TabView">
- <item name="background">@drawable/tab_indicator_quantum_light</item>
- </style>
-
- <style name="Widget.Quantum.Light.Tab" parent="Widget.Quantum.Light.ActionBar.TabView">
- <item name="layout_width">0dip</item>
- <item name="layout_weight">1</item>
- <item name="minWidth">80dip</item>
- </style>
-
+ <style name="Widget.Quantum.Light.ActionButton.Overflow" parent="Widget.Quantum.ActionButton.Overflow"/>
+ <style name="Widget.Quantum.Light.Tab" parent="Widget.Quantum.Tab"/>
+ <style name="Widget.Quantum.Light.ActionBar.TabView" parent="Widget.Quantum.ActionBar.TabView"/>
<style name="Widget.Quantum.Light.ActionBar.TabBar" parent="Widget.Quantum.ActionBar.TabBar"/>
-
<style name="Widget.Quantum.Light.ActionBar.TabText" parent="Widget.Quantum.ActionBar.TabText"/>
- <style name="Widget.Quantum.Light.ActionBar.TabView.Inverse"/>
-
- <style name="Widget.Quantum.Light.ActionBar.TabBar.Inverse"/>
-
- <style name="Widget.Quantum.Light.ActionBar.TabText.Inverse">
- <item name="textColor">?attr/textColorPrimaryInverse</item>
- </style>
-
<style name="Widget.Quantum.Light.ActionMode" parent="Widget.Quantum.ActionMode">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Subtitle</item>
</style>
- <style name="Widget.Quantum.Light.ActionMode.Inverse" parent="Widget.ActionMode">
- <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Title.Inverse</item>
- <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionMode.Subtitle.Inverse</item>
- </style>
-
<style name="Widget.Quantum.Light.ActionButton.CloseMode">
<item name="background">@drawable/btn_cab_done_holo_light</item>
</style>
@@ -1056,10 +974,10 @@ please see styles_device_defaults.xml.
<style name="Widget.Quantum.Light.ActionBar" parent="Widget.Quantum.ActionBar">
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
- <item name="background">@drawable/ab_transparent_quantum_light</item>
+ <item name="background">@drawable/ab_transparent_quantum</item>
<item name="backgroundStacked">@drawable/ab_stacked_transparent_light_holo</item>
<item name="backgroundSplit">@drawable/ab_bottom_transparent_light_holo</item>
- <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum_light</item>
+ <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum</item>
<item name="progressBarStyle">@style/Widget.Quantum.Light.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.Light.ProgressBar</item>
</style>
@@ -1077,36 +995,20 @@ please see styles_device_defaults.xml.
<item name="itemPadding">8dip</item>
</style>
- <style name="Widget.Quantum.Light.ActionBar.Solid.Inverse">
- <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title.Inverse</item>
- <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle.Inverse</item>
- <item name="background">@drawable/ab_solid_dark_holo</item>
- <item name="backgroundStacked">@drawable/ab_stacked_solid_dark_holo</item>
- <item name="backgroundSplit">@drawable/ab_bottom_solid_inverse_holo</item>
- <item name="divider">@drawable/list_divider_quantum_dark</item>
- <item name="progressBarStyle">@style/Widget.Quantum.ProgressBar.Horizontal</item>
- <item name="indeterminateProgressStyle">@style/Widget.Quantum.ProgressBar</item>
- <item name="progressBarPadding">32dip</item>
- <item name="itemPadding">8dip</item>
+ <style name="Widget.Quantum.Light.CompoundButton.Switch" parent="Widget.Quantum.CompoundButton.Switch">
+ <item name="switchTextAppearance">@style/TextAppearance.Quantum.Light.Widget.Switch</item>
</style>
- <style name="Widget.Quantum.Light.CompoundButton.Switch" parent="Widget.CompoundButton.Switch">
- <item name="track">@drawable/switch_track_quantum_light</item>
- <item name="thumb">@drawable/switch_inner_quantum_light</item>
- <item name="switchTextAppearance">@style/TextAppearance.Quantum.Light.Widget.Switch</item>
- <item name="textOn"></item>
- <item name="textOff"></item>
- <item name="thumbTextPadding">12dip</item>
- <item name="switchMinWidth">96dip</item>
- <item name="switchPadding">16dip</item>
+ <style name="Widget.Quantum.Light.FastScroll" parent="Widget.Quantum.FastScroll"/>
+
+ <style name="Widget.Quantum.Light.MediaRouteButton" parent="Widget.Quantum.MediaRouteButton">
+ <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_light</item>
</style>
<!-- Animation Styles -->
<style name="Animation.Quantum" parent="Animation"/>
-
<style name="Animation.Quantum.Activity" parent="Animation.Activity"/>
-
<style name="Animation.Quantum.Dialog" parent="Animation.Dialog"/>
<!-- Dialog styles -->
@@ -1131,7 +1033,7 @@ please see styles_device_defaults.xml.
<item name="singleChoiceItemLayout">@layout/select_dialog_singlechoice_holo</item>
</style>
- <style name="AlertDialog.Quantum.Light" />
+ <style name="AlertDialog.Quantum.Light"/>
<!-- Window title -->
<style name="WindowTitleBackground.Quantum">
@@ -1152,60 +1054,7 @@ please see styles_device_defaults.xml.
</style>
<style name="DialogWindowTitle.Quantum.Light">
- <item name="maxLines">1</item>
- <item name="scrollHorizontally">true</item>
<item name="textAppearance">@style/TextAppearance.Quantum.Light.DialogWindowTitle</item>
</style>
- <style name="Widget.Quantum.PreferenceFrameLayout">
- <item name="borderTop">0dip</item>
- <item name="borderBottom">@dimen/preference_fragment_padding_bottom</item>
- <item name="borderLeft">?attr/preferenceFragmentPaddingSide</item>
- <item name="borderRight">?attr/preferenceFragmentPaddingSide</item>
- </style>
-
- <style name="Widget.Quantum.MediaRouteButton">
- <item name="background">?attr/selectableItemBackground</item>
- <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_dark</item>
- <item name="minWidth">56dp</item>
- <item name="minHeight">48dp</item>
- <item name="focusable">true</item>
- <item name="contentDescription">@string/media_route_button_content_description</item>
- </style>
-
- <style name="Widget.Quantum.Light.MediaRouteButton" parent="Widget.Quantum.MediaRouteButton">
- <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_light</item>
- </style>
-
- <style name="TextAppearance.Quantum.TimePicker.TimeLabel" parent="TextAppearance.Quantum">
- <item name="textSize">@dimen/timepicker_time_label_size</item>
- <item name="textColor">@color/timepicker_default_text_color_quantum_dark</item>
- </style>
-
- <style name="TextAppearance.Quantum.TimePicker.AmPmLabel" parent="TextAppearance.Quantum">
- <item name="textSize">@dimen/timepicker_ampm_label_size</item>
- <item name="textAllCaps">true</item>
- <item name="textColor">@color/timepicker_default_text_color_quantum_dark</item>
- <item name="textStyle">bold</item>
- </style>
-
- <style name="TextAppearance.Quantum.Light.TimePicker.TimeLabel" parent="TextAppearance.Quantum.Light">
- <item name="textSize">@dimen/timepicker_time_label_size</item>
- <item name="textColor">@color/timepicker_default_text_color_quantum_light</item>
- </style>
-
- <style name="TextAppearance.Quantum.Light.TimePicker.AmPmLabel" parent="TextAppearance.Quantum.Light">
- <item name="textSize">@dimen/timepicker_ampm_label_size</item>
- <item name="textAllCaps">true</item>
- <item name="textColor">@color/timepicker_default_text_color_quantum_light</item>
- <item name="textStyle">bold</item>
- </style>
-
- <style name="Widget.Quantum.FastScroll" parent="Widget.FastScroll">
- <item name="thumbMinWidth">0dp</item>
- <item name="thumbMinHeight">0dp</item>
- </style>
-
- <style name="Widget.Quantum.Light.FastScroll" parent="Widget.Quantum.FastScroll"/>
-
</resources>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 4a0158e..3c4e848 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -927,7 +927,7 @@ please see themes_device_defaults.xml.
<item name="colorForeground">@android:color/bright_foreground_holo_dark</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_inverse_holo_dark</item>
<item name="colorBackground">@android:color/background_holo_dark</item>
- <item name="colorBackgroundCacheHint">@android:drawable/background_cache_hint_selector_holo_dark</item>
+ <item name="colorBackgroundCacheHint">@android:color/background_cache_hint_selector_holo_dark</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -1256,7 +1256,7 @@ please see themes_device_defaults.xml.
<item name="colorForeground">@android:color/bright_foreground_holo_light</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_inverse_holo_light</item>
<item name="colorBackground">@android:color/background_holo_light</item>
- <item name="colorBackgroundCacheHint">@android:drawable/background_cache_hint_selector_holo_light</item>
+ <item name="colorBackgroundCacheHint">@android:color/background_cache_hint_selector_holo_light</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
diff --git a/core/res/res/values/themes_micro.xml b/core/res/res/values/themes_micro.xml
index 7c0b7bc..f51b8df 100644
--- a/core/res/res/values/themes_micro.xml
+++ b/core/res/res/values/themes_micro.xml
@@ -23,7 +23,7 @@
<item name="windowSwipeToDismiss">true</item>
</style>
- <style name="Theme.Micro.NoActionBar" parent="Theme.Holo.NoActionBar">
+ <style name="Theme.Micro.Light" parent="Theme.Holo.Light.NoActionBar">
<item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
<item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
@@ -31,28 +31,4 @@
<item name="windowIsTranslucent">true</item>
<item name="windowSwipeToDismiss">true</item>
</style>
- <style name="Theme.Micro.Light" parent="Theme.Holo.Light">
- <item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
- <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
- <item name="windowIsFloating">false</item>
- <item name="windowIsTranslucent">true</item>
- <item name="windowSwipeToDismiss">true</item>
- </style>
- <style name="Theme.Micro.Light.NoActionBar" parent="Theme.Holo.Light.NoActionBar">
- <item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
- <item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
- <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
- <item name="windowIsFloating">false</item>
- <item name="windowIsTranslucent">true</item>
- <item name="windowSwipeToDismiss">true</item>
- </style>
- <style name="Theme.Micro.Light.DarkActionBar" parent="Theme.Holo.Light.DarkActionBar">
- <item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
- <item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
- <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
- <item name="windowIsFloating">false</item>
- <item name="windowIsTranslucent">true</item>
- <item name="windowSwipeToDismiss">true</item>
- </style>
-
</resources>
diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml
index d2eee28..24abd55 100644
--- a/core/res/res/values/themes_quantum.xml
+++ b/core/res/res/values/themes_quantum.xml
@@ -45,7 +45,7 @@ please see themes_device_defaults.xml.
<item name="colorForeground">@color/bright_foreground_quantum_dark</item>
<item name="colorForegroundInverse">@color/bright_foreground_quantum_light</item>
<item name="colorBackground">@color/background_quantum_dark</item>
- <item name="colorBackgroundCacheHint">@drawable/background_cache_hint_selector_quantum_dark</item>
+ <item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_quantum_dark</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -81,7 +81,7 @@ please see themes_device_defaults.xml.
<item name="textAppearanceButton">@style/TextAppearance.Quantum.Widget.Button</item>
<item name="editTextColor">?attr/textColorPrimary</item>
- <item name="editTextBackground">@drawable/edit_text_quantum_dark</item>
+ <item name="editTextBackground">@drawable/edit_text_quantum</item>
<item name="candidatesTextStyleSpans">@string/candidates_style</item>
@@ -100,9 +100,9 @@ please see themes_device_defaults.xml.
<item name="switchStyle">@style/Widget.Quantum.CompoundButton.Switch</item>
<item name="mediaRouteButtonStyle">@style/Widget.Quantum.MediaRouteButton</item>
- <item name="selectableItemBackground">@drawable/item_background_quantum_dark</item>
+ <item name="selectableItemBackground">@drawable/item_background_quantum</item>
<item name="borderlessButtonStyle">@style/Widget.Quantum.Button.Borderless</item>
- <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum_dark</item>
+ <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
@@ -117,17 +117,17 @@ please see themes_device_defaults.xml.
<!-- @hide -->
<item name="searchResultListItemHeight">58dip</item>
- <item name="listDivider">@drawable/list_divider_quantum_dark</item>
+ <item name="listDivider">@drawable/list_divider_quantum</item>
<item name="listSeparatorTextViewStyle">@style/Widget.Quantum.TextView.ListSeparator</item>
- <item name="listChoiceIndicatorSingle">@drawable/btn_radio_quantum_dark</item>
- <item name="listChoiceIndicatorMultiple">@drawable/btn_check_quantum_dark</item>
+ <item name="listChoiceIndicatorSingle">@drawable/btn_radio_quantum</item>
+ <item name="listChoiceIndicatorMultiple">@drawable/btn_check_quantum</item>
<item name="listChoiceBackgroundIndicator">@drawable/list_selector_holo_dark</item>
- <item name="activatedBackgroundIndicator">@drawable/activated_background_quantum_dark</item>
+ <item name="activatedBackgroundIndicator">@drawable/activated_background_quantum</item>
- <item name="listDividerAlertDialog">@drawable/list_divider_quantum_dark</item>
+ <item name="listDividerAlertDialog">@drawable/list_divider_quantum</item>
<item name="expandableListPreferredItemPaddingLeft">40dip</item>
<item name="expandableListPreferredChildPaddingLeft">?attr/expandableListPreferredItemPaddingLeft</item>
@@ -136,8 +136,8 @@ please see themes_device_defaults.xml.
<item name="expandableListPreferredItemIndicatorRight">0dip</item>
<item name="expandableListPreferredChildIndicatorLeft">?attr/expandableListPreferredItemIndicatorLeft</item>
<item name="expandableListPreferredChildIndicatorRight">?attr/expandableListPreferredItemIndicatorRight</item>
- <item name="findOnPageNextDrawable">@drawable/ic_find_next_quantum_dark</item>
- <item name="findOnPagePreviousDrawable">@drawable/ic_find_previous_quantum_dark</item>
+ <item name="findOnPageNextDrawable">@drawable/ic_find_next_quantum</item>
+ <item name="findOnPagePreviousDrawable">@drawable/ic_find_previous_quantum</item>
<!-- Gallery attributes -->
<item name="galleryItemBackground">@drawable/gallery_item_background</item>
@@ -170,7 +170,7 @@ please see themes_device_defaults.xml.
<item name="alertDialogTheme">@style/Theme.Quantum.Dialog.Alert</item>
<item name="alertDialogStyle">@style/AlertDialog.Quantum</item>
<item name="alertDialogCenterButtons">false</item>
- <item name="alertDialogIcon">@drawable/ic_dialog_alert_quantum_dark</item>
+ <item name="alertDialogIcon">@drawable/ic_dialog_alert_quantum</item>
<!-- Presentation attributes -->
<item name="presentationTheme">@style/Theme.Quantum.Dialog.Presentation</item>
@@ -194,8 +194,8 @@ please see themes_device_defaults.xml.
<item name="scrollbarFadeDuration">250</item>
<item name="scrollbarDefaultDelayBeforeFade">300</item>
<item name="scrollbarSize">10dip</item>
- <item name="scrollbarThumbHorizontal">@drawable/scrollbar_handle_quantum_dark</item>
- <item name="scrollbarThumbVertical">@drawable/scrollbar_handle_quantum_dark</item>
+ <item name="scrollbarThumbHorizontal">@drawable/scrollbar_handle_quantum</item>
+ <item name="scrollbarThumbVertical">@drawable/scrollbar_handle_quantum</item>
<item name="scrollbarTrackHorizontal">@null</item>
<item name="scrollbarTrackVertical">@null</item>
@@ -205,7 +205,7 @@ please see themes_device_defaults.xml.
<item name="textSelectHandle">@drawable/text_select_handle_middle</item>
<item name="textSelectHandleWindowStyle">@style/Widget.Quantum.TextSelectHandle</item>
<item name="textSuggestionsWindowStyle">@style/Widget.Quantum.TextSuggestionsPopupWindow</item>
- <item name="textCursorDrawable">@drawable/text_cursor_quantum_dark</item>
+ <item name="textCursorDrawable">@drawable/text_cursor_quantum</item>
<!-- Widget styles -->
<item name="absListViewStyle">@style/Widget.Quantum.AbsListView</item>
@@ -290,7 +290,7 @@ please see themes_device_defaults.xml.
<item name="actionOverflowButtonStyle">@style/Widget.Quantum.ActionButton.Overflow</item>
<item name="actionModeBackground">@color/theme_color_700</item>
<item name="actionModeSplitBackground">@color/theme_color_700</item>
- <item name="actionModeCloseDrawable">@drawable/ic_cab_done_quantum_dark</item>
+ <item name="actionModeCloseDrawable">@drawable/ic_cab_done_quantum</item>
<item name="actionBarTabStyle">@style/Widget.Quantum.ActionBar.TabView</item>
<item name="actionBarTabBarStyle">@style/Widget.Quantum.ActionBar.TabBar</item>
<item name="actionBarTabTextStyle">@style/Widget.Quantum.ActionBar.TabText</item>
@@ -300,21 +300,21 @@ please see themes_device_defaults.xml.
<item name="actionBarSize">@dimen/action_bar_default_height</item>
<item name="actionModePopupWindowStyle">@style/Widget.Quantum.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">@null</item>
- <item name="actionBarItemBackground">@drawable/item_background_borderless_quantum_dark</item>
+ <item name="actionBarItemBackground">@drawable/item_background_quantum</item>
- <item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum_dark</item>
- <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_quantum_dark</item>
- <item name="actionModePasteDrawable">@drawable/ic_menu_paste_quantum_dark</item>
- <item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_quantum_dark</item>
- <item name="actionModeShareDrawable">@drawable/ic_menu_share_quantum_dark</item>
- <item name="actionModeFindDrawable">@drawable/ic_menu_find_quantum_dark</item>
- <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_quantum_dark</item>
+ <item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum</item>
+ <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_quantum</item>
+ <item name="actionModePasteDrawable">@drawable/ic_menu_paste_quantum</item>
+ <item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_quantum</item>
+ <item name="actionModeShareDrawable">@drawable/ic_menu_share_quantum</item>
+ <item name="actionModeFindDrawable">@drawable/ic_menu_find_quantum</item>
+ <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_quantum</item>
<item name="dividerVertical">?attr/listDivider</item>
<item name="dividerHorizontal">?attr/listDivider</item>
- <item name="buttonBarStyle">@style/Quantum.ButtonBar</item>
+ <item name="buttonBarStyle">@style/Widget.Quantum.ButtonBar</item>
<item name="buttonBarButtonStyle">?attr/borderlessButtonStyle</item>
- <item name="segmentedButtonStyle">@style/Quantum.SegmentedButton</item>
+ <item name="segmentedButtonStyle">@style/Widget.Quantum.SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">@drawable/search_dropdown_dark</item>
@@ -349,11 +349,20 @@ please see themes_device_defaults.xml.
<item name="datePickerStyle">@style/Widget.Quantum.DatePicker</item>
<!-- TODO: This belongs in a FastScroll style -->
- <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_quantum_light</item>
+ <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_quantum</item>
<item name="fastScrollPreviewBackgroundLeft">@drawable/fastscroll_label_left_holo_dark</item>
<item name="fastScrollPreviewBackgroundRight">@drawable/fastscroll_label_right_holo_dark</item>
- <item name="fastScrollTrackDrawable">@drawable/fastscroll_track_quantum_dark</item>
+ <item name="fastScrollTrackDrawable">@drawable/fastscroll_track_quantum</item>
<item name="fastScrollOverlayPosition">atThumb</item>
+
+ <!-- Color palette -->
+ <item name="colorControlNormal">@color/control_normal_foreground_quantum_dark</item>
+ <item name="colorControlActivated">@color/control_activated_foreground_quantum_dark</item>
+ <item name="colorButtonNormal">@color/btn_default_normal_quantum_dark</item>
+ <item name="colorButtonPressed">@color/btn_default_pressed_quantum_dark</item>
+ <!-- TODO: Remove these attrs and move into button style. -->
+ <item name="colorButtonNormalColored">@color/theme_color_500</item>
+ <item name="colorButtonPressedColored">@color/theme_color_300</item>
</style>
<!-- Quantum Paper theme (light version). -->
@@ -361,7 +370,7 @@ please see themes_device_defaults.xml.
<item name="colorForeground">@color/bright_foreground_quantum_light</item>
<item name="colorForegroundInverse">@color/bright_foreground_quantum_dark</item>
<item name="colorBackground">@color/background_quantum_light</item>
- <item name="colorBackgroundCacheHint">@drawable/background_cache_hint_selector_quantum_light</item>
+ <item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_quantum_light</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -398,7 +407,7 @@ please see themes_device_defaults.xml.
<item name="textAppearanceButton">@style/TextAppearance.Quantum.Light.Widget.Button</item>
<item name="editTextColor">?attr/textColorPrimary</item>
- <item name="editTextBackground">@drawable/edit_text_quantum_light</item>
+ <item name="editTextBackground">@drawable/edit_text_quantum</item>
<item name="candidatesTextStyleSpans">@string/candidates_style</item>
@@ -418,9 +427,9 @@ please see themes_device_defaults.xml.
<item name="switchStyle">@style/Widget.Quantum.Light.CompoundButton.Switch</item>
<item name="mediaRouteButtonStyle">@style/Widget.Quantum.Light.MediaRouteButton</item>
- <item name="selectableItemBackground">@drawable/item_background_quantum_light</item>
+ <item name="selectableItemBackground">@drawable/item_background_quantum</item>
<item name="borderlessButtonStyle">@style/Widget.Quantum.Light.Button.Borderless</item>
- <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum_light</item>
+ <item name="homeAsUpIndicator">@drawable/ic_ab_back_quantum</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
@@ -435,15 +444,15 @@ please see themes_device_defaults.xml.
<!-- @hide -->
<item name="searchResultListItemHeight">58dip</item>
- <item name="listDivider">@drawable/list_divider_quantum_light</item>
+ <item name="listDivider">@drawable/list_divider_quantum</item>
<item name="listSeparatorTextViewStyle">@style/Widget.Quantum.Light.TextView.ListSeparator</item>
- <item name="listChoiceIndicatorSingle">@drawable/btn_radio_quantum_light</item>
- <item name="listChoiceIndicatorMultiple">@drawable/btn_check_quantum_light</item>
+ <item name="listChoiceIndicatorSingle">@drawable/btn_radio_quantum</item>
+ <item name="listChoiceIndicatorMultiple">@drawable/btn_check_quantum</item>
<item name="listChoiceBackgroundIndicator">@drawable/list_selector_holo_light</item>
- <item name="activatedBackgroundIndicator">@drawable/activated_background_quantum_light</item>
+ <item name="activatedBackgroundIndicator">@drawable/activated_background_quantum</item>
<item name="expandableListPreferredItemPaddingLeft">40dip</item>
<item name="expandableListPreferredChildPaddingLeft">?attr/expandableListPreferredItemPaddingLeft</item>
@@ -453,9 +462,9 @@ please see themes_device_defaults.xml.
<item name="expandableListPreferredChildIndicatorLeft">?attr/expandableListPreferredItemIndicatorLeft</item>
<item name="expandableListPreferredChildIndicatorRight">?attr/expandableListPreferredItemIndicatorRight</item>
- <item name="listDividerAlertDialog">@drawable/list_divider_quantum_light</item>
- <item name="findOnPageNextDrawable">@drawable/ic_find_next_quantum_light</item>
- <item name="findOnPagePreviousDrawable">@drawable/ic_find_previous_quantum_light</item>
+ <item name="listDividerAlertDialog">@drawable/list_divider_quantum</item>
+ <item name="findOnPageNextDrawable">@drawable/ic_find_next_quantum</item>
+ <item name="findOnPagePreviousDrawable">@drawable/ic_find_previous_quantum</item>
<!-- Gallery attributes -->
<item name="galleryItemBackground">@drawable/gallery_item_background</item>
@@ -487,7 +496,7 @@ please see themes_device_defaults.xml.
<item name="alertDialogTheme">@style/Theme.Quantum.Light.Dialog.Alert</item>
<item name="alertDialogStyle">@style/AlertDialog.Quantum.Light</item>
<item name="alertDialogCenterButtons">false</item>
- <item name="alertDialogIcon">@drawable/ic_dialog_alert_quantum_light</item>
+ <item name="alertDialogIcon">@drawable/ic_dialog_alert_quantum</item>
<!-- Presentation attributes -->
<item name="presentationTheme">@style/Theme.Quantum.Light.Dialog.Presentation</item>
@@ -511,8 +520,8 @@ please see themes_device_defaults.xml.
<item name="scrollbarFadeDuration">250</item>
<item name="scrollbarDefaultDelayBeforeFade">300</item>
<item name="scrollbarSize">10dip</item>
- <item name="scrollbarThumbHorizontal">@drawable/scrollbar_handle_quantum_light</item>
- <item name="scrollbarThumbVertical">@drawable/scrollbar_handle_quantum_light</item>
+ <item name="scrollbarThumbHorizontal">@drawable/scrollbar_handle_quantum</item>
+ <item name="scrollbarThumbVertical">@drawable/scrollbar_handle_quantum</item>
<item name="scrollbarTrackHorizontal">@null</item>
<item name="scrollbarTrackVertical">@null</item>
@@ -522,7 +531,7 @@ please see themes_device_defaults.xml.
<item name="textSelectHandle">@drawable/text_select_handle_middle</item>
<item name="textSelectHandleWindowStyle">@style/Widget.Quantum.TextSelectHandle</item>
<item name="textSuggestionsWindowStyle">@style/Widget.Quantum.Light.TextSuggestionsPopupWindow</item>
- <item name="textCursorDrawable">@drawable/text_cursor_quantum_light</item>
+ <item name="textCursorDrawable">@drawable/text_cursor_quantum</item>
<!-- Widget styles -->
<item name="absListViewStyle">@style/Widget.Quantum.Light.AbsListView</item>
@@ -610,7 +619,7 @@ please see themes_device_defaults.xml.
<item name="actionOverflowButtonStyle">@style/Widget.Quantum.Light.ActionButton.Overflow</item>
<item name="actionModeBackground">@drawable/cab_background_top_holo_light</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_holo_light</item>
- <item name="actionModeCloseDrawable">@drawable/ic_cab_done_quantum_light</item>
+ <item name="actionModeCloseDrawable">@drawable/ic_cab_done_quantum</item>
<item name="actionBarTabStyle">@style/Widget.Quantum.Light.ActionBar.TabView</item>
<item name="actionBarTabBarStyle">@style/Widget.Quantum.Light.ActionBar.TabBar</item>
<item name="actionBarTabTextStyle">@style/Widget.Quantum.Light.ActionBar.TabText</item>
@@ -620,21 +629,21 @@ please see themes_device_defaults.xml.
<item name="actionBarSize">@dimen/action_bar_default_height</item>
<item name="actionModePopupWindowStyle">@style/Widget.Quantum.Light.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">@null</item>
- <item name="actionBarItemBackground">@drawable/item_background_borderless_quantum_light</item>
+ <item name="actionBarItemBackground">@drawable/item_background_quantum</item>
- <item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum_light</item>
- <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_quantum_light</item>
- <item name="actionModePasteDrawable">@drawable/ic_menu_paste_quantum_light</item>
- <item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_quantum_light</item>
- <item name="actionModeShareDrawable">@drawable/ic_menu_share_quantum_light</item>
- <item name="actionModeFindDrawable">@drawable/ic_menu_find_quantum_light</item>
- <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_quantum_light</item>
+ <item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum</item>
+ <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_quantum</item>
+ <item name="actionModePasteDrawable">@drawable/ic_menu_paste_quantum</item>
+ <item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_quantum</item>
+ <item name="actionModeShareDrawable">@drawable/ic_menu_share_quantum</item>
+ <item name="actionModeFindDrawable">@drawable/ic_menu_find_quantum</item>
+ <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_quantum</item>
<item name="dividerVertical">?attr/listDivider</item>
<item name="dividerHorizontal">?attr/listDivider</item>
- <item name="buttonBarStyle">@style/Quantum.Light.ButtonBar</item>
+ <item name="buttonBarStyle">@style/Widget.Quantum.Light.ButtonBar</item>
<item name="buttonBarButtonStyle">?attr/borderlessButtonStyle</item>
- <item name="segmentedButtonStyle">@style/Quantum.Light.SegmentedButton</item>
+ <item name="segmentedButtonStyle">@style/Widget.Quantum.Light.SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">@drawable/search_dropdown_light</item>
@@ -665,11 +674,20 @@ please see themes_device_defaults.xml.
<!-- DatePicker style -->
<item name="datePickerStyle">@style/Widget.Quantum.Light.DatePicker</item>
- <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_quantum_light</item>
+ <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_quantum</item>
<item name="fastScrollPreviewBackgroundLeft">@drawable/fastscroll_label_left_holo_light</item>
<item name="fastScrollPreviewBackgroundRight">@drawable/fastscroll_label_right_holo_light</item>
- <item name="fastScrollTrackDrawable">@drawable/fastscroll_track_quantum_light</item>
+ <item name="fastScrollTrackDrawable">@drawable/fastscroll_track_quantum</item>
<item name="fastScrollOverlayPosition">atThumb</item>
+
+ <!-- Color palette -->
+ <item name="colorControlNormal">@color/control_normal_foreground_quantum_light</item>
+ <item name="colorControlActivated">@color/control_activated_foreground_quantum_light</item>
+ <item name="colorButtonNormal">@color/btn_default_normal_quantum_light</item>
+ <item name="colorButtonPressed">@color/btn_default_pressed_quantum_light</item>
+ <!-- TODO: Remove these attrs and move into button style. -->
+ <item name="colorButtonNormalColored">@color/theme_color_500</item>
+ <item name="colorButtonPressedColored">@color/theme_color_700</item>
</style>
<!-- Variant of the quantum (light) theme that has a solid (opaque) action bar
@@ -841,7 +859,7 @@ please see themes_device_defaults.xml.
<item name="colorBackgroundCacheHint">@null</item>
- <item name="buttonBarStyle">@style/Quantum.ButtonBar.AlertDialog</item>
+ <item name="buttonBarStyle">@style/Widget.Quantum.ButtonBar.AlertDialog</item>
<item name="borderlessButtonStyle">@style/Widget.Quantum.Button.Borderless.Small</item>
<item name="textAppearance">@style/TextAppearance.Quantum</item>
@@ -963,7 +981,7 @@ please see themes_device_defaults.xml.
<item name="colorBackgroundCacheHint">@null</item>
- <item name="buttonBarStyle">@style/Quantum.Light.ButtonBar.AlertDialog</item>
+ <item name="buttonBarStyle">@style/Widget.Quantum.Light.ButtonBar.AlertDialog</item>
<item name="borderlessButtonStyle">@style/Widget.Quantum.Light.Button.Borderless.Small</item>
<item name="textAppearance">@style/TextAppearance.Quantum.Light</item>
diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk
index 0d9a386..97c1b33 100644
--- a/data/fonts/Android.mk
+++ b/data/fonts/Android.mk
@@ -133,6 +133,8 @@ font_src_files += \
RobotoCondensed-Bold.ttf \
RobotoCondensed-Italic.ttf \
RobotoCondensed-BoldItalic.ttf \
+ RobotoCondensed-Light.ttf \
+ RobotoCondensed-LightItalic.ttf \
DroidNaskh-Regular.ttf \
DroidNaskhUI-Regular.ttf \
DroidSansHebrew-Regular.ttf \
diff --git a/data/fonts/RobotoCondensed-Light.ttf b/data/fonts/RobotoCondensed-Light.ttf
new file mode 100644
index 0000000..41d212a
--- /dev/null
+++ b/data/fonts/RobotoCondensed-Light.ttf
Binary files differ
diff --git a/data/fonts/RobotoCondensed-LightItalic.ttf b/data/fonts/RobotoCondensed-LightItalic.ttf
new file mode 100755
index 0000000..dd54971
--- /dev/null
+++ b/data/fonts/RobotoCondensed-LightItalic.ttf
Binary files differ
diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk
index 05cca13..293ecc8 100644
--- a/data/fonts/fonts.mk
+++ b/data/fonts/fonts.mk
@@ -32,6 +32,8 @@ PRODUCT_PACKAGES := \
RobotoCondensed-Bold.ttf \
RobotoCondensed-Italic.ttf \
RobotoCondensed-BoldItalic.ttf \
+ RobotoCondensed-Light.ttf \
+ RobotoCondensed-LightItalic.ttf \
DroidNaskh-Regular.ttf \
DroidNaskhUI-Regular.ttf \
DroidSansHebrew-Regular.ttf \
diff --git a/data/fonts/system_fonts.xml b/data/fonts/system_fonts.xml
index 549f061b..a8d23ee 100644
--- a/data/fonts/system_fonts.xml
+++ b/data/fonts/system_fonts.xml
@@ -65,6 +65,17 @@
<file>RobotoCondensed-BoldItalic.ttf</file>
</fileset>
</family>
+
+ <family>
+ <nameset>
+ <name>sans-serif-condensed-light</name>
+ </nameset>
+ <fileset>
+ <file>RobotoCondensed-Light.ttf</file>
+ <file>RobotoCondensed-LightItalic.ttf</file>
+ </fileset>
+ </family>
+
<family>
<nameset>
<name>serif</name>
diff --git a/docs/html/google/play-services/index.jd b/docs/html/google/play-services/index.jd
index 26b4ccc..5da0b75 100644
--- a/docs/html/google/play-services/index.jd
+++ b/docs/html/google/play-services/index.jd
@@ -71,7 +71,7 @@ announcement <a href="http://android-developers.blogspot.com/2014/03/google-play
</li>
<li><strong>Analytics</strong> - Google Analytics and Tag Manager are now part of Google Play services.
<ul>
- <li><a href="http://developers.google.com/analytics/devguides/collection/android/v3/" class="external-link">Getting Started with the Analytics API in Android</a></li>
+ <li><a href="http://developers.google.com/analytics/devguides/collection/android/v4/" class="external-link">Getting Started with the Analytics API in Android</a></li>
<li><a href="/reference/com/google/android/gms/analytics/package-summary.html">Analytics API reference</a></li>
<li><a href="http://developers.google.com/tag-manager/android/" class="external-link">Getting Started with the Tag Manager API in Android</a></li>
<li><a href="/reference/com/google/android/gms/tagmanager/package-summary.html">Tag Manager API reference</a></li>
diff --git a/docs/html/images/tools/as-buildvariants.png b/docs/html/images/tools/as-buildvariants.png
new file mode 100644
index 0000000..a245163
--- /dev/null
+++ b/docs/html/images/tools/as-buildvariants.png
Binary files differ
diff --git a/docs/html/images/tools/as-demoflavordirs.png b/docs/html/images/tools/as-demoflavordirs.png
new file mode 100644
index 0000000..9d36a6d
--- /dev/null
+++ b/docs/html/images/tools/as-demoflavordirs.png
Binary files differ
diff --git a/docs/html/images/tools/as-gradlebutton.png b/docs/html/images/tools/as-gradlebutton.png
new file mode 100644
index 0000000..091b935
--- /dev/null
+++ b/docs/html/images/tools/as-gradlebutton.png
Binary files differ
diff --git a/docs/html/images/tools/as-gradleconsole.png b/docs/html/images/tools/as-gradleconsole.png
new file mode 100644
index 0000000..c676c94
--- /dev/null
+++ b/docs/html/images/tools/as-gradleconsole.png
Binary files differ
diff --git a/docs/html/images/tools/as-gradlepanel.png b/docs/html/images/tools/as-gradlepanel.png
new file mode 100644
index 0000000..a409462
--- /dev/null
+++ b/docs/html/images/tools/as-gradlepanel.png
Binary files differ
diff --git a/docs/html/images/tools/as-gradlesync.png b/docs/html/images/tools/as-gradlesync.png
new file mode 100644
index 0000000..b312359
--- /dev/null
+++ b/docs/html/images/tools/as-gradlesync.png
Binary files differ
diff --git a/docs/html/images/tools/as-mainscreen.png b/docs/html/images/tools/as-mainscreen.png
new file mode 100644
index 0000000..da399d7
--- /dev/null
+++ b/docs/html/images/tools/as-mainscreen.png
Binary files differ
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 8bb75df..e7f78e8 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -4,44 +4,45 @@ page.template=sdk
header.hide=1
page.metaDescription=Download the official Android SDK to develop apps for Android-powered devices.
+sdk.version=22.6.2
-sdk.linux32_bundle_download=adt-bundle-linux-x86-20131030.zip
-sdk.linux32_bundle_bytes=496876498
-sdk.linux32_bundle_checksum=d389139ad9f59a43bdd34c94bc850509
+sdk.linux32_bundle_download=adt-bundle-linux-x86-20140321.zip
+sdk.linux32_bundle_bytes=527971926
+sdk.linux32_bundle_checksum=943ae4d28fe7c79108c8bf2aafd5e6d2
-sdk.linux64_bundle_download=adt-bundle-linux-x86_64-20131030.zip
-sdk.linux64_bundle_bytes=497171697
-sdk.linux64_bundle_checksum=99b51a4f0526434b083701a896550b72
+sdk.linux64_bundle_download=adt-bundle-linux-x86_64-20140321.zip
+sdk.linux64_bundle_bytes=528187678
+sdk.linux64_bundle_checksum=f2a2153b5c7dbaeb86b550bf4f770c36
-sdk.mac64_bundle_download=adt-bundle-mac-x86_64-20131030.zip
-sdk.mac64_bundle_bytes=470386961
-sdk.mac64_bundle_checksum=3e80e7a92b549029d91bdcf2ae82657f
+sdk.mac64_bundle_download=adt-bundle-mac-x86_64-20140321.zip
+sdk.mac64_bundle_bytes=501955296
+sdk.mac64_bundle_checksum=4a08649cea9b098cdf7349f452294014
-sdk.win32_bundle_download=adt-bundle-windows-x86-20131030.zip
-sdk.win32_bundle_bytes=503599460
-sdk.win32_bundle_checksum=cd490a531ec24667354f6473e999b988
+sdk.win32_bundle_download=adt-bundle-windows-x86-20140321.zip
+sdk.win32_bundle_bytes=535085536
+sdk.win32_bundle_checksum=b61495a6bf591cc374c31bce4fc46ec0
-sdk.win64_bundle_download=adt-bundle-windows-x86_64-20131030.zip
-sdk.win64_bundle_bytes=503735416
-sdk.win64_bundle_checksum=ddddbb1b9028015779d68dde01f96b14
+sdk.win64_bundle_download=adt-bundle-windows-x86_64-20140321.zip
+sdk.win64_bundle_bytes=535287324
+sdk.win64_bundle_checksum=a6f4699bbdc5a29b371ed60610535651
-sdk.linux_download=android-sdk_r22.6.1-linux.tgz
-sdk.linux_bytes=101052129
-sdk.linux_checksum=d95b400600e9b68ed7719e0fd1792e0b
+sdk.linux_download=android-sdk_r22.6.2-linux.tgz
+sdk.linux_bytes=101050024
+sdk.linux_checksum=ff1541418a44d894bedc5cef10622220
-sdk.mac_download=android-sdk_r22.6.1-macosx.zip
-sdk.mac_bytes=74639176
-sdk.mac_checksum=99abc850398ccc220e3a1d6d0ab73ccf
+sdk.mac_download=android-sdk_r22.6.2-macosx.zip
+sdk.mac_bytes=74639394
+sdk.mac_checksum=2a319c862dd1dcf450bfe2a6b3d9c608
-sdk.win_download=android-sdk_r22.6.1-windows.zip
-sdk.win_bytes=108914728
-sdk.win_checksum=88471340a8c99822ffb5efbe3c28167c
+sdk.win_download=android-sdk_r22.6.2-windows.zip
+sdk.win_bytes=108917505
+sdk.win_checksum=6e5bfdb7b9c1d231ed6ec78b31551cbf
-sdk.win_installer=installer_r22.6.1-windows.exe
-sdk.win_installer_bytes=88907175
-sdk.win_installer_checksum=fd664527ed1b1b1bfe2d4546cafc7ada
+sdk.win_installer=installer_r22.6.2-windows.exe
+sdk.win_installer_bytes=87383126
+sdk.win_installer_checksum=2a68b8b22ecd0aba779b1581a914b395
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index 42cb92c..e4cf1bc 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -1,8 +1,8 @@
page.title=Installing the Eclipse Plugin
-adt.zip.version=22.6.0
-adt.zip.download=ADT-22.6.0.zip
-adt.zip.bytes=14585211
-adt.zip.checksum=d95c6d8e678881f6c89f063b58d4162f
+adt.zip.version=22.6.2
+adt.zip.download=ADT-22.6.2.zip
+adt.zip.bytes=14586842
+adt.zip.checksum=f660959fa71262b4285bcb64be284bf5
@jd:body
@@ -35,10 +35,10 @@ Software</strong>.</li>
<li>In the Add Repository dialog that appears, enter "ADT Plugin" for the <em>Name</em> and the
following URL for the <em>Location</em>:
<pre>https://dl-ssl.google.com/android/eclipse/</pre>
+ <p class="note"><strong>Note:</strong> The Android Developer Tools update site requires
+ a secure connection. Make sure the update site URL you enter starts with HTTPS.</p>
</li>
- <li>Click <strong>OK</strong>.
- <p>If you have trouble acquiring the plugin, try using "http" in the Location URL,
-instead of "https" (https is preferred for security reasons).</p></li>
+ <li>Click <strong>OK</strong>.</li>
<li>In the Available Software dialog, select the checkbox next to Developer Tools and click
<strong>Next</strong>.</li>
<li>In the next window, you'll see a list of the tools to be downloaded. Click
@@ -75,7 +75,7 @@ To get these packages for your SDK, continue to
<div class="sidebox-wrapper">
<div class="sidebox">
<h2>App Translations in Google Play</h2>
-<p>Google Play <a href="{@docRoot}distribute/googleplay/publish/localizing.html#gp-trans">App
+<p>Google Play <a href="{@docRoot}distribute/googleplay/publish/localizing.html#gp-trans">App
Translation Service</a> is available in the Developer Console to help you
localize your app for a global user base. You can browse qualified vendors, get
estimates, upload strings for translation, and then import the translations directly
@@ -139,23 +139,16 @@ Software</strong>, uncheck "Contact all update sites during install to find requ
<h2 id="Troubleshooting">Troubleshooting ADT Installation</h2>
-<p> If you are having trouble downloading the ADT plugin after following the
-steps above, here are some suggestions: </p>
-
-<ul>
- <li>If Eclipse can not find the remote update site containing the ADT plugin,
-try changing the remote site URL to use http, rather than https. That is, set
-the Location for the remote site to:
-<pre>http://dl-ssl.google.com/android/eclipse/</pre></li>
-<li>If you are behind a firewall (such as a corporate firewall), make sure that
+<p>If you are having trouble downloading the ADT plugin after following the
+steps above and you are behind a firewall (such as a corporate firewall), make sure that
you have properly configured your proxy settings in Eclipse. In Eclipse,
you can configure proxy information from the main Eclipse menu in
<strong>Window</strong> (on Mac OS X, <strong>Eclipse</strong>) &gt;
<strong>Preferences</strong> &gt; <strong>General</strong> &gt; <strong>Network
-Connections</strong>.</li>
-</ul>
+Connections</strong>.
+</p>
-<p> If you are still unable to use Eclipse to download the ADT plugin as a
+<p>If you are still unable to use Eclipse to download the ADT plugin as a
remote update site, you can download the ADT zip file to your local machine and
manually install it:</p>
diff --git a/docs/html/sdk/installing/studio-build.jd b/docs/html/sdk/installing/studio-build.jd
new file mode 100644
index 0000000..41ad5de
--- /dev/null
+++ b/docs/html/sdk/installing/studio-build.jd
@@ -0,0 +1,1065 @@
+page.title=Building your Project
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>In this document</h2>
+<ol>
+ <li><a href="#overviewBuild">Overview of the Build System</a>
+ <ol>
+ <li><a href="#buildConf">Build configuration</a></li>
+ <li><a href="#buildConv">Build by convention</a></li>
+ <li><a href="#projectModules">Projects and modules</a></li>
+ <li><a href="#dependencies">Dependencies</a></li>
+ <li><a href="#buildTasks">Build tasks</a></li>
+ <li><a href="#gradleWrapper">The Gradle wrapper</a></li>
+ </ol>
+ </li>
+ <li><a href="#creatingBuilding">Create and Build a Project</a>
+ <ol>
+ <li><a href="#createProject">Create a project</a></li>
+ <li><a href="#projectStructure">Project structure</a></li>
+ <li><a href="#addLibModule">Add a library module</a></li>
+ <li><a href="#buildProject">Build the project</a></li>
+ <li><a href="#buildCmd">Build from the command line</a></li>
+ </ol>
+ </li>
+ <li><a href="#configBuild">Configure the Build</a>
+ <ol>
+ <li><a href="#buildFileBasics">Build file basics</a></li>
+ <li><a href="#declareDeps">Declare dependencies</a></li>
+ <li><a href="#runProguard">Run ProGuard</a></li>
+ <li><a href="#configureSigning">Configure signing settings</a></li>
+ <li><a href="#workBuildVariants">Work with build variants</a></li>
+ </ol>
+ </li>
+ <li><a href="#reference">Reference</a></li>
+</ol>
+<h2>See also</h2>
+<ul>
+<li><a href="{@docRoot}sdk/installing/studio.html">
+Getting Started with Android Studio</a></li>
+<li><a href="{@docRoot}sdk/installing/studio-tips.html">
+Android Studio Tips and Tricks</a></li>
+<li><a href="{@docRoot}sdk/installing/migrate.html">
+Migrating from Eclipse</a></li>
+</div>
+</div>
+
+<a class="notice-developers-video"
+href="https://developers.google.com/events/io/sessions/324603352">
+<div>
+ <h3>Video</h3>
+ <p>What's New in Android Developer Tools</p>
+</div>
+</a>
+
+<p>The Android Studio build system is the toolkit you use to build, test, run and package
+your apps. The build system is independent from Android Studio, so you can invoke it from Android
+Studio or from the command line. After you write your application, you can use the features
+of the build system to:</p>
+
+<ul>
+ <li>Customize, configure, and extend the build process.</li>
+ <li>Create multiple APKs for your app with different features using the same project.</li>
+ <li>Reuse code and resources.</li>
+</ul>
+
+<p>The flexibility of the Android Studio build system enables you to achieve all of this without
+modifying your app's core project files.</p>
+
+
+<h2 id="overviewBuild">Overview of the Build System</h2>
+
+<p>The Android Studio build system consists of an Android plugin for <em>Gradle</em>.
+<a href="http://www.gradle.org/">Gradle</a> is an advanced build toolkit that manages dependencies
+and allows you to define custom build logic. Many software projects use Gradle to manage their
+builds. The Android plugin for Gradle does not depend on Android Studio, although Android Studio
+is fully integrated with it. This means that:</p>
+
+<ul>
+ <li>You can build your Android apps from the command line on your machine or on machines
+ where Android Studio is not installed (such as continuous integration servers).</li>
+ <li>You can build your Android apps from Android Studio with the same custom build
+ configuration and logic as when you build from the command line.</li>
+</ul>
+
+<p>The output of the build is the same whether you are building a project from the command line,
+on a remote machine, or using Android Studio.</p>
+
+<h3 id="buildConf">Build configuration</h3>
+
+<p>The build configuration for your project is defined inside <em>Gradle build files</em>,
+which are plain text files that use the syntax and options from Gradle and the Android plugin
+to configure the following aspects of your build:</p>
+
+<ul>
+ <li><em>Build variants</em>. The build system can generate multiple APKs with different
+ configurations for the same project. This is useful when you want to build different
+ versions of your application without having to create a separate project for each of
+ them.</li>
+ <li><em>Dependencies</em>. The build system manages project dependencies and supports
+ dependencies from your local filesystem and from remote repositories. This prevents you
+ from having to search, download, and copy binary packages for your dependencies into your
+ project directory.</li>
+ <li><em>Manifest entries</em>. The build system enables you to specify values for some
+ elements of the manifest file in the build configuration. These new values override the
+ existing values in the manifest file. This is useful if you want to generate multiple APKs
+ for your project where each of them has a different package name, minimum SDK version, or
+ target SDK version.</li>
+ <li><em>Signing</em>. The build system enables you to specify signing settings in the build
+ configuration, and it can sign your APKs during the build process.</li>
+ <li><em>ProGuard</em>. The build system enables you to specify a different
+ <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> rules
+ file for each build variant. The build system can run ProGuard to obfuscate your classes
+ during the build process.</li>
+ <li><em>Testing</em>. The build system generates a test APK from the test sources in your
+ project, so you do not have to create a separate test project. The build system can run
+ your tests during the build process.</li>
+</ul>
+
+<p>Gradle build files use <em>Groovy</em> syntax.
+<a href="http://groovy.codehaus.org/">Groovy</a> is a dynamic language that you can use to
+define custom build logic and to interact with the Android-specific elements provided by the
+Android plugin for Gradle.</p>
+
+<h3 id="buildConv">Build by convention</h3>
+
+<p>The Android Studio build system assumes <em>sensible defaults</em> for the project structure
+and other build options. If your project adheres to these conventions, your Gradle build files are
+very simple. When some these conventions do not apply to your project, the flexibility of the
+build system allows you to configure almost every aspect of the build process. For example, if
+the sources for your project are located in a different directory than the default, you can
+specify this location in the build file.</p>
+
+<h3 id="projectModules">Projects and modules</h3>
+
+<p>A <em>project</em> in Android Studio represents a complete Android app. Android Studio
+projects consist of one or more modules. A <em>module</em> is a component of your app that you can
+build, test, or debug independently. Modules contain the source code and resources for your app.
+Android Studio projects contain three kinds of modules:</p>
+
+<ul>
+ <li><em>Java library modules</em> contain reusable code. The build system generates a
+ JAR package for Java library modules.</li>
+ <li><em>Android library modules</em> contain reusable Android-specific code and resources.
+ The build system generates an AAR (Android ARchive) package for library modules.</li>
+ <li><em>Android application modules</em> contain application code and may depend on library
+ modules, although many Android apps consists of only one application module. The build
+ system generates an APK package for application modules.</li>
+</ul>
+
+<p>Android Studio projects contain a top-level Gradle build file that lists all the modules in
+the project, and each module contains its own Gradle build file.</p>
+
+<h3 id="dependencies">Dependencies</h3>
+
+<p>The Android Studio build system manages project dependencies and supports module dependencies,
+local binary dependencies, and remote binary dependencies.</p>
+
+<dl>
+ <dt><em>Module Dependencies</em></dt>
+ <dd><p>A project module can include in its build file a list of other modules it depends on.
+ When you build this module, the build system assembles and includes the required
+ modules.</p></dd>
+ <dt><em>Local Dependencies</em></dt>
+ <dd><p>If you have binary archives in your local filesystem that a module depends on, such as
+ JAR files, you can declare these dependencies in the build file for that
+ module.</p></dd>
+ <dt><em>Remote Dependencies</em></dt>
+ <dd><p>When some of your dependencies are available in a remote repository, you do not have
+ to download them and copy them into your project. The Android Studio build system supports
+ remote <em>Maven</em> dependencies. <a href="http://maven.apache.org/">Maven</a> is a
+ popular software project management tool that helps organize project dependencies using
+ repositories.</p>
+ <p>Many popular software libraries and tools are available in public Maven repositories.
+ For these dependencies you only have to specify their Maven coordinates, which uniquely
+ identify each element in a remote repository. The format for Maven coordinates used in the
+ build system is <code>group:name:version</code>. For example, the Maven coordinates for
+ version 16.0.1 of the Google Guava libraries are
+ <code>com.google.guava:guava:16.0.1</code>.</p>
+ <p>The <a href="http://search.maven.org">Maven Central Repository</a> is widely used to
+ distribute many libraries and tools.</p>
+ </dd>
+</dl>
+
+<h3 id="buildTasks">Build tasks</h3>
+
+<p>The Android Studio build system defines a hierarchical set of build tasks: the top-level
+tasks invoke the tasks they depend on to produce the necessary outcomes. The build system
+provides project tasks to build your app and module tasks to build modules independently.</p>
+
+<p>You can view the list of available tasks and invoke any task from Android Studio and from
+the command line, as described in
+<a href="#buildProject">Build the project in Android Studio</a> and and
+<a href="#buildCmd">Build the project from the command line</a>.</p>
+
+<h3 id="gradleWrapper">The Gradle wrapper</h3>
+
+<p>Android Studio projects contain the <em>Gradle wrapper</em>, which consists of:</p>
+
+<ul>
+ <li>A JAR file</li>
+ <li>A properties file</li>
+ <li>A shell script for Windows platforms</li>
+ <li>A shell script for Mac and Linux platforms</li>
+</ul>
+
+<p class="note"><strong>Note:</strong> You should submit all of these files to your source
+control system.</p>
+
+<p>Using the Gradle wrapper (instead of the local Gradle installation) ensures that
+you always run the version of Gradle defined in the properties file. To configure your project
+to use a newer version of Gradle, edit the properties file and specify the new version there.
+
+<p>Android Studio reads the properties file from the Gradle wrapper directory inside your project
+and runs the wrapper from this directory, so you can seamlessly work with multiple projects
+that require different versions of Gradle.</p>
+
+<p class="note"><strong>Note:</strong> Android Studio does not use the shell scripts, so any
+changes you make to them won't work when building from the IDE. You should define your custom
+logic inside Gradle build files instead.</p>
+
+<p>You can run the shell scripts to build your project from the command line on your development
+machine and on other machines where Android Studio is not installed.</p>
+
+
+<h2 id="creatingBuilding">Create and Build an Android Studio Project</h2>
+
+<p>This section builds on the concepts presented above and shows you how to:</p>
+
+<ul>
+ <li>Create projects and modules.</li>
+ <li>Work with the project structure.</li>
+ <li>Edit build files to configure the build process.</li>
+ <li>Build and run your app.</li>
+</ul>
+
+<h3 id="createProject">Create a project in Android Studio</h3>
+
+<p>To create a new project in Android Studio:</p>
+
+<ol>
+ <li>Click <strong>File</strong> and select <strong>New Project</strong>.</li>
+ <li>In the window that appears, enter "BuildSystemExample" in the <em>Application</em>
+ name field.</li>
+ <li>Leave the rest of the values unchanged and click <strong>Next</strong>.</li>
+ <li>Leave the default icon settings unchanged and click <strong>Next</strong>.</li>
+ <li>Select <em>Blank Activity</em> and click <strong>Next</strong>.</li>
+ <li>Leave the default activity and layout names unchanged and click
+ <strong>Finish</strong>.</li>
+</ol>
+
+<p>Figure 1 shows how the Android Studio window looks like after creating the project.</p>
+
+<img src="{@docRoot}images/tools/as-mainscreen.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> Previewing your app.</p>
+
+<h3 id="projectStructure">The project structure</h3>
+
+<p>Android Studio projects contain an application module by default (<code>app</code>).
+Table 1 lists where the main components of your app are located inside this module.</p>
+
+<p class="table-caption" id="table1">
+<strong>Table 1.</strong> Default location of the components in an application module.</p>
+<table>
+ <tr>
+ <th scope="col">Component</th>
+ <th scope="col">Location</th>
+ </tr>
+ <tr>
+ <td>Source files</td>
+ <td><code>app/src/main/java/&lt;package>/</code></td>
+ </tr>
+ <tr>
+ <td>Resource files</td>
+ <td><code>app/src/main/res/</code></td>
+ </tr>
+ <tr>
+ <td>Manifest file</td>
+ <td><code>app/src/main/AndroidManifest.xml</code></td>
+ </tr>
+ <tr>
+ <td>Build file</td>
+ <td><code>app/build.gradle</code></td>
+ </tr>
+</table>
+
+<p>When you add additional modules to your project, the directory structure for each module is
+similar to the one shown in table 1, replacing <code>app</code> by the name of the module.</p>
+
+<h3 id="addLibModule">Add a library module</h3>
+
+<p>This section shows you how to add a library module to your project and how to add this
+library as a dependency of an application module.</p>
+
+<h4>Create a new library module</h4>
+
+<p>It is good development practice to group functionality that you may reuse in other apps inside
+a library module. To create a library module inside the <code>BuildSystemExample</code>
+project:</p>
+
+<ol>
+ <li>Click <strong>File</strong> and select <strong>New Module</strong>.</li>
+ <li>On the window that appears, select <strong>Android Library</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Leave the default module name (<code>lib</code>) unchanged and click
+ <strong>Next</strong>.</li>
+ <li>Select <em>Blank Activity</em> and click <strong>Next</strong>.</li>
+ <li>Type "LibActivity1" on the <em>Activity Name</em> field and click
+ <strong>Finish</strong>.</li>
+</ol>
+
+<p>The project now contains two modules, <code>app</code> and <code>lib</code>, with one activity
+in each module.</p>
+
+<h4 id="openActFromLib">Open an activity from a library module</h4>
+
+<p>Library modules contain activities and other logic that one or more application modules reuse.
+In this example, <code>MainActivity</code> in the app module opens <code>LibActivity1</code>
+from the <code>lib</code> module. To open <code>LibActivity1</code> from
+<code>MainActivity</code>:</p>
+
+<ol>
+ <li>
+ <p>Edit the layout file for <code>MainActivity</code> in the <code>app</code> module.
+ This file is located in <code>app/src/main/res/layout/activity_main.xml</code>. Replace
+ the contents of this file with the following:</p>
+ <p><pre>
+&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.buildsystemexample.app.MainActivity">
+
+ &lt;Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button1"
+ android:onClick="onButton1Clicked"/>
+
+&lt;/LinearLayout>
+</pre></p>
+ </li>
+ <li>
+ In this layout file, click on the line that contains
+ <code>android:text="@string/button1"</code> and press <strong>Alt+Enter</strong>. Follow
+ the suggestion from Android Studio to add a string resource with the value
+ "Open LibActivity1".
+ </li>
+ <li>
+ In this layout file, click on the line that contains
+ <code>android:onClick="onButton1Clicked"</code> and press <strong>Alt+Enter</strong>.
+ Follow the suggestion from Android Studio to add the <code>onButton1Clicked</code>
+ method to <code>MainActivity</code>.
+ </li>
+ <li>
+ <p>Copy the following code inside the <code>onButton1Clicked</code> method in
+ <code>MainActivity</code>:</p>
+ <p><pre>
+public void onButton1Clicked(View view) {
+ Intent intent = new Intent(this, LibActivity1.class);
+ startActivity(intent);
+}</pre></p>
+ </li>
+ <li>
+ Click on <code>LibActivity1</code> in the first line inside the
+ <code>onButton1Clicked</code> method of <code>MainActivity</code> and press
+ <strong>Alt+Enter</strong>. Follow the suggestion from Android Studio to add an import
+ for <code>LibActivity1</code> from the lib module.
+ </li>
+</ol>
+
+<p>When the user taps the <strong>Open LibActivity1</strong> button on <code>MainActivity</code>
+(from the <code>app</code> module), <code>LibActivity1</code> (from the <code>lib</code> module)
+starts.</p>
+
+<h4>Add a dependency on a library module</h4>
+
+<p>The <code>app</code> module now depends on the <code>lib</code> module, but the build system
+does not know about this yet. Edit the build file for the <code>app</code> module (
+<code>app/build.gradle</code>) and add a dependency on the <code>lib</code> module:</p>
+
+<pre>
+...
+dependencies {
+ ...
+ compile project(":lib")
+}
+</pre>
+
+<p>The <code>lib</code> module can still be built and tested independently, and the build system
+creates an AAR package for it that you could reuse in other projects.</p>
+
+<h3 id="buildProject">Build the project in Android Studio</h3>
+
+<p>To build the project on Android Studio, click <strong>Build</strong> and select
+<strong>Make Project</strong>. The status bar at the bottom of the window shows the current
+progress of the build:</p>
+
+<p><code>Gradle: Executing tasks: [:app:assembleDebug, :lib:bundleDebug]</code></p>
+
+<p class="note">If your project uses product flavors, Android Studio invokes the task for the
+selected build variant. For more information, see <a href="#workBuildVariants">Work with build
+variants.</a></p>
+
+<p>Click <img src="{@docRoot}images/tools/as-gradlebutton.png" alt=""
+style="vertical-align:bottom;margin:0;"/> on the bottom
+right part of the window to show the <em>Gradle Console</em>, as shown in figure 2.</p>
+
+<img src="{@docRoot}images/tools/as-gradleconsole.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The Gradle Console in Android Studio.</p>
+
+<p>The Gradle Console shows the build tasks and subtasks that the build system runs for
+Android Studio. If the build fails, you can find more details on the console. To hide the Gradle
+Console, click <img src="{@docRoot}images/tools/as-gradlebutton.png" alt=""
+style="vertical-align:bottom;margin:0;"/> again.</p>
+
+<p>To view the list of all available build tasks in Android Studio, click <strong>Gradle</strong>
+on the right side of the IDE window. The <em>Gradle tasks</em> panel appears as shown in
+figure 3. Double-click any build task to run it in Android Studio. To hide the <em>Gradle tasks</em>
+panel, click <strong>Gradle</strong> again.</p>
+
+<img src="{@docRoot}images/tools/as-gradlepanel.png" alt="" />
+<p class="img-caption"><strong>Figure 3.</strong> The list of build tasks in Android Studio.</p>
+
+
+<h3 id="buildCmd">Build the project from the command line</h3>
+
+<p>To build the project from the command line, open a terminal window and navigate to the project
+root. On Windows platforms, type this command:</p>
+
+<pre>
+> gradlew.bat assembleDebug
+</pre>
+
+<p>On Mac OS and Linux platforms, type these commands:</p>
+
+<pre>
+$ chmod +x gradlew
+$ ./gradlew assembleDebug
+</pre>
+
+<p>The first command (<code>chmod</code>) adds the execution permission to the Gradle wrapper
+script and is only necessary the first time you build this project from the command line.</p>
+
+<p>The output of <code>gradlew</code> is similar to the output in the Gradle Console from
+figure 2.</p>
+
+<p>The <code>assembleDebug</code> build task builds the debug version of your app and signs it
+with the default local certificate, so that you can install it on the emulator and on real devices
+for debugging purposes.</p>
+
+<p>After you build the project, the output APK for the app module is located in
+<code>app/build/apk/</code>, and the output AAR for the lib module is located in
+<code>lib/build/libs/</code>.</p>
+
+<p>To see a list of all available build tasks for your project, type this command:</p>
+
+<pre>
+$ ./gradlew tasks
+</pre>
+
+
+<h2 id="configBuild">Configure the Build</h2>
+
+<p>This section uses the <code>BuildSystemExample</code> project from the previous section and
+shows you how to:</p>
+
+<ul>
+ <li>Use the syntax from the Android plugin for Gradle in build files.</li>
+ <li>Declare dependencies.</li>
+ <li>Configure ProGuard settings.</li>
+ <li>Configure signing settings.</li>
+ <li>Work with build variants.</li>
+</ul>
+
+<h3 id="buildFileBasics">Build file basics</h3>
+
+<p>Android Studio projects contain a top-level build file and a build file for each module. The
+build files are called <code>build.gradle</code>, and they are plain text files that use
+<a href="http://groovy.codehaus.org">Groovy</a> syntax to configure the build with the elements
+provided by the Android plugin for Gradle. In most cases, you only need to edit the build files
+at the module level. For example, the build file for the app module in the
+<code>BuildSystemExample</code> project looks like this:</p>
+
+<pre>
+apply plugin: 'android'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "19.0.0"
+
+ defaultConfig {
+ minSdkVersion 8
+ targetSdkVersion 19
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ runProguard true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), \
+ 'proguard-rules.txt'
+ }
+ }
+}
+
+dependencies {
+ compile project(":lib")
+ compile 'com.android.support:appcompat-v7:19.0.1'
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+}
+</pre>
+
+<p><code>apply plugin: 'android'</code> applies the Android plugin for Gradle to this build.
+This adds Android-specific build tasks to the top-level build tasks and makes the
+<code>android {...}</code> element available to specify Android-specific build options.</p>
+
+<p><code>android {...}</code> configures all the Android-specific build options:</p>
+
+<ul>
+ <li>The <code>compileSdkVersion</code> property specifies the compilation target.</li>
+ <li><p>The <code>buildToolsVersion</code> property specifies what version of the build tools
+ to use. To install several versions of the build tools, use the SDK Manager.</p>
+ <p class="note"><strong>Note:</strong> Always use a build tools version whose major
+ revision number is higher or equal to that of your compilation target and target SDK.</p>
+ </li>
+ <li><p>The <code>defaultConfig</code> element configures core settings and
+ entries in the manifest file (<code>AndroidManifest.xml</code>) dynamically from the
+ build system. The values in <code>defaultConfig</code> override those in the manifest
+ file.</p>
+ <p>The configuration specified in the <code>defaultConfig</code> element applies
+ to all build variants, unless the configuration for a build variant overrides some
+ of these values.</p>
+ </li>
+ <li>The <code>buildTypes</code> element controls how to build and package your app.
+ By default, the build system defines two build types: <em>debug</em> and
+ <em>release</em>. The debug build type includes debugging symbols and is signed with
+ the debug key. The release build type is not signed by default.
+ In this example the build file configures the release version to use
+ ProGuard.</li>
+</ul>
+
+<p>The <code>dependencies</code> element is outside and after the <code>android</code> element.
+This element declares the dependencies for this module. Dependencies are covered in the following
+sections.</p>
+
+<p class="note"><strong>Note:</strong> When you make changes to the build files in your project,
+Android Studio requires a project sync to import the build configuration changes. Click
+<strong>Sync Now</strong> on the yellow notification bar that appears for Android Studio
+to import the changes.</p>
+
+<img src="{@docRoot}images/tools/as-gradlesync.png" alt="" />
+<p class="img-caption"><strong>Figure 4.</strong> Sync the project in Android Studio.</p>
+
+<h3 id="declareDeps">Declare dependencies</h3>
+
+<p>The <code>app</code> module in <code>BuildSystemExample</code> declares three
+dependencies:</p>
+
+<pre>
+...
+dependencies {
+ // Module dependency
+ compile project(":lib")
+
+ // Remote binary dependency
+ compile 'com.android.support:appcompat-v7:19.0.1'
+
+ // Local binary dependency
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+}
+</pre>
+
+<p>Each of these dependencies is described below. The build system adds all the
+<code>compile</code> dependencies to the compilation classpath and includes them in the final
+package.</p>
+
+<h4>Module dependencies</h4>
+
+<p>The <code>app</code> module depends on the <code>lib</code> module, because
+<code>MainActivity</code> launches <code>LibActivity1</code> as described in
+<a href="#openActFromLib">Open an Activity from a Library Module</a>.</p>
+
+<p><code>compile project(":lib")</code> declares a dependency on the <code>lib</code>
+module of <code>BuildSystemExample</code>. When you build the <code>app</code> module,
+the build system assembles and includes the <code>lib</code> module.</p>
+
+<h4>Remote binary dependencies</h4>
+
+<p>The <code>app</code> and <code>lib</code> modules both use the <code>ActionBarActivity</code>
+class from the Android Support Library, so these modules depend on it.</p>
+
+<p><code>compile 'com.android.support:appcompat-v7:19.0.1'</code> declares a dependency on
+version 19.0.1 of the Android Support Library by specifying its Maven coordinates. The Android Support
+Library is available in the <em>Android Repository</em> package of the Android SDK. If your
+SDK installation does not have this package, download and install it using the SDK Manager.</p>
+
+Android Studio configures
+projects to use the Maven Central Repository by default. (This configuration is included in the
+top-level build file for the project.)</p>
+
+<h4>Local binary dependencies</h4>
+
+<p>The modules in <code>BuildSystemExample</code> do not use any binary dependencies from the
+local file system. If you have modules that require local binary dependencies, copy the JAR
+files for these dependencies into <code>&lt;moduleName>/libs</code> inside your project.</p>
+
+<p><code>compile fileTree(dir: 'libs', include: ['*.jar'])</code> tells the build system that any
+JAR file inside <code>app/libs</code> is a dependency and should be included in the compilation
+classpath and in the final package.</p>
+
+<p>For more information about dependencies in Gradle, see
+<a href="http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html">Dependency
+Management Basics</a> in the Gradle User Guide.</p>
+
+<h3 id="runProguard">Run ProGuard</h3>
+
+<p>The build system can run
+<a href="http://developer.android.com/tools/help/proguard.html">ProGuard</a> to obfuscate your
+classes during the build process. In <code>BuildSystemExample</code>, modify the build file for
+the app module to run ProGuard for the release build:</p>
+
+<pre>
+...
+android {
+ ...
+ buildTypes {
+ release {
+ runProguard true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), \
+ 'proguard-rules.txt'
+ }
+ }
+}
+...
+</pre>
+
+<p><code>getDefaultProguardFile('proguard-android.txt')</code> obtains the default ProGuard
+settings from the Android SDK installation. Android Studio adds the module-specific rules file
+<code>proguard-rules.txt</code> at the root of the module, where you can add custom ProGuard
+rules.</p>
+
+<p>You can build the release version of your application from the command line or using Android
+Studio. To build it from the command line, invoke the <code>assembleRelease</code> build task using
+the Gradle wrapper script (<code>gradlew assembleRelease</code>). To build it from Android
+Studio:</p>
+
+<ol>
+ <li>Click <strong>Gradle</strong> on the right side of the IDE window.</li>
+ <li>On the <em>All tasks</em> section of the sidebar that appears, expand
+ <strong>BuildSystemExample</strong>.</li>
+ <li>Expand <strong>:app</strong> and double-click <strong>assembleRelease</strong>.</li>
+</ol>
+
+<p>You can use this procedure to invoke any build task from Android Studio.</p>
+
+<h3 id="configureSigning">Configure signing settings</h3>
+
+<p>The debug and the release versions of the app differ on whether the application can be
+debugged on secure devices and on how the APK is signed. The build system signs the debug
+version with a default key and certificate using known credentials to avoid a password prompt at
+build time. The build system does not sign the release version unless you explicitly define a
+signing configuration for this build.</p>
+
+<p>To sign the release version of <code>BuildSystemExample</code>:</p>
+
+<ol>
+ <li><p>Copy your release key to the root directory of the <code>app</code> module
+ (<code>app/</code>).</p>
+ <p>This ensures that the build system can find your key when you move the location of your
+ project or when you build the project on a different machine. If you do not have a release
+ key, you can generate one as described in
+ <a href="{@docRoot}tools/publishing/app-signing.html">Signing your Applications</a>.</p>
+ </li>
+ <li><p>Add the signing configuration to the build file for the <code>app</code> module:</p>
+ <p><pre>
+...
+android {
+ ...
+ defaultConfig { ... }
+ signingConfigs {
+ release {
+ storeFile file("myreleasekey.keystore")
+ storePassword "password"
+ keyAlias "MyReleaseKey"
+ keyPassword "password"
+ }
+ }
+ buildTypes {
+ release {
+ ...
+ signingConfig signingConfigs.release
+ }
+ }
+}
+...
+</pre></p>
+ </li>
+ <li>Invoke the <code>assembleRelease</code> build task from Android Studio or from the command
+ line.</li>
+</ol>
+
+<p>The package in <code>app/build/apk/app-release.apk</code> is now signed with your release key.</p>
+
+<p class="note"><strong>Note:</strong> Including the passwords for your release key and keystore
+inside the build file is not a good security practice. Alternatively, you can configure the build
+file to obtain these passwords from environment variables or have the build process prompt you
+for these passwords.</p>
+
+<p>To obtain these passwords from environment variables:</p>
+
+<pre>
+storePassword System.getenv("KSTOREPWD")
+keyPassword System.getenv("KEYPWD")
+</pre>
+
+<p>To have the build process prompt you for these passwords if you are invoking the build from
+the command line:</p>
+
+<pre>
+storePassword System.console().readLine("\nKeystore password: ")
+keyPassword System.console().readLIne("\nKey password: ")
+</pre>
+
+<h3 id="workBuildVariants">Work with build variants</h3>
+
+<p>This section describes how the build system can help you create different versions of the same
+application from a single project. This is useful when you have a demo version and a paid version
+of your app, or if you want to distribute multiple APKs for different device configurations on
+Google Play.</p>
+
+<p>The build system uses <em>product flavors</em> to create different versions of your app. Each
+version of your app can have different features or device requirements. The build system generates
+a different APK for each version of your app.</p>
+
+<h4>Build variants</h4>
+
+<p>Each version of your app is represented in the build system by a <em>build variant</em>.
+Build variants are combinations of build types and product flavor configurations. Android Studio
+projects define two build types (<em>debug</em> and <em>release</em>) and no product flavors by
+default. These projects consists of two build variants, debug and release, and the build system
+generates an APK for each.</p>
+
+<p>The exercise in this section defines two product flavors, <em>demo</em> and <em>full</em>.
+This generates four build variants:</p>
+
+<ul>
+ <li>demo-debug</li>
+ <li>demo-release</li>
+ <li>full-debug</li>
+ <li>full-release</li>
+</ul>
+
+<p>In this case the build system creates four APKs, one for each of these build variants.</p>
+
+<p>Some projects have complex combinations of features along more than one dimension, but they
+still represent the same app. For example, in addition to having a demo and a full version of the
+app, some games may contain binaries specific to a particular CPU/ABI. The flexibility of
+the build system makes it possible to generate the following build variants for such a project:</p>
+
+<ul>
+ <li>x86-demo-debug</li>
+ <li>x86-demo-release</li>
+ <li>x86-full-debug</li>
+ <li>x86-full-release</li>
+ <li>arm-demo-debug</li>
+ <li>arm-demo-release</li>
+ <li>arm-full-debug</li>
+ <li>arm-full-release</li>
+ <li>mips-demo-debug</li>
+ <li>mips-demo-release</li>
+ <li>mips-full-debug</li>
+ <li>mips-full-release</li>
+</ul>
+
+<p>This project would consist of two build types (<em>debug</em> and <em>release</em>)
+and two <em>dimensions</em> of product flavors, one for app type (demo or full) and one for
+CPU/ABI (x86, ARM, or MIPS). For more information on flavor dimensions, see the
+<a href="http://tools.android.com/tech-docs/new-build-system/user-guide">Gradle Plugin User
+Guide</a>.</p>
+
+<h4>Source directories</h4>
+
+<p>To build each version of your app, the build system combines source code and
+resources from:</p>
+
+<ul>
+ <li><code>src/main/</code> - the main source directory (common to all variants)</li>
+ <li><code>src/&lt;buildType>/</code> - the build type source directory</li>
+ <li><code>src/&lt;flavorName>/</code> - the flavor source directory</li>
+</ul>
+
+<p>The number of flavor source directories used in the build depends on the flavor configuration
+of your project:</p>
+<ul>
+ <li><p>For projects that do not define any flavors, the build system does not use any
+ flavor source directories. For example, to generate the <em>release</em> build variant
+ in projects with no flavors, the build system uses:</p>
+ <ul>
+ <li><code>src/main/</code></li>
+ <li><code>src/release/</code> (build type)</li>
+ </ul>
+ </li>
+ <li><p>For projects that define a set of flavors, the build system uses one flavor source
+ directory. For example, to generate the <em>full-debug</em> build variant in the example
+ in this section, the build system uses:</p>
+ <ul>
+ <li><code>src/main/</code></li>
+ <li><code>src/debug/</code> (build type)</li>
+ <li><code>src/full/</code> (flavor)</li>
+ </ul>
+ </li>
+ <li><p>For projects that use flavor dimensions, the build system uses one flavor source
+ directory per dimension. For example, to generate the <em>arm-demo-release</em> build
+ variant in the previous example, the build system uses:</p>
+ <ul>
+ <li><code>src/main/</code></li>
+ <li><code>src/release/</code> (build type)</li>
+ <li><code>src/demo/</code> (flavor - app type dimension)</li>
+ <li><code>src/arm/</code> (flavor - ABI dimension)</li>
+ </ul>
+ </li>
+</ul>
+
+<p class="note"><strong>Note:</strong> The build type and flavor source directories are optional,
+and Android Studio does not create these directories for you. The build system does not use them
+if they are not present.</p>
+
+<p>The source code from these directories is used together to generate the output for a build
+variant. You can have classes with the same name in different directories as long as those
+directories are not used together in the same variant. The exercise in this section shows you
+how to create different versions of the same activity class in different variants.</p>
+
+<p>The build system merges all the manifests into a single manifest, so each build variant
+can define different components or permissions in the final manifest.</p>
+
+<p>The build system merges all the resources from the all the source directories. If different
+folders contain resources with the same name for a build variant, the priority order is the
+following: build type resources override those from the product flavor, which override the
+resources in the main source directory.</p>
+
+<p class="note"><strong>Note:</strong> Build variants enable you to reuse common activities,
+application logic, and resources across different versions of your app.</p>
+
+<h4>Product flavors in BuildSystemExample</h4>
+
+<p>To create different versions of your app:</p>
+
+<ol>
+ <li>Define product flavors in the build file.</li>
+ <li>Create additional source directories for each flavor.</li>
+ <li>Add the flavor-specific sources to your project.</li>
+</ol>
+
+<p>The rest of this section walks you through these steps in detail using the
+<code>BuildSystemExample</code> project. You create two flavors of the
+<code>BuildSystemExample</code> app, a demo flavor and a full flavor. Both flavors share
+<code>MainActivity</code>, to which you add a new button to launch a new activity,
+<code>SecondActivity</code>. This new activity is different for each flavor, so you simulate a
+situation where the new activity would have more features in the full flavor than in the demo
+flavor. At the end of the exercise, you end up with two different APKs, one for each flavor.</p>
+
+<h4>Define product flavors in the build file</h4>
+
+<p>To define two product flavors, edit the build file for the app module to add the following
+configuration:</p>
+
+<pre>
+...
+android {
+ ...
+ defaultConfig { ... }
+ signingConfigs { ... }
+ buildTypes { ... }
+ productFlavors {
+ demo {
+ packageName "com.buildsystemexample.app.demo"
+ versionName "1.0-demo"
+ }
+ full {
+ packageName "com.buildsystemexample.app.full"
+ versionName "1.0-full"
+ }
+ }
+}
+...
+</pre>
+
+<p>The product flavor definitions support the same properties as the <code>defaultConfig</code>
+element. The base configuration for all flavors is specified in <code>defaultConfig</code>, and each
+flavor can override any value. The build file above assigns a different package name to each flavor:
+since each flavor definition creates a different app, they each need a distinct package name.</p>
+
+<p class="note"><strong>Note:</strong> To distribute your app using
+<a href="{@docRoot}google/play/publishing/multiple-apks.html">Multiple APK Support</a> in
+Google Play, assign the same package name to all variants and give each variant a different
+<code>versionCode</code>. To distribute different variants of your app as separate apps in Google
+Play, assign a different package name to each variant.</p>
+
+<h4>Add additional source directories for each flavor</h4>
+
+<p>Now you create source folders and add a <code>SecondActivity</code> to each flavor. To create
+the source directory structure for the demo flavor:</p>
+
+<ol>
+ <li>On the <em>Project</em> panel, expand <strong>BuildSystemExample</strong>, and then expand
+ the <strong>app</strong> directory.</li>
+ <li>Right click the <strong>src</strong> directory under <em>app</em> and select
+ <strong>New</strong> > <strong>Directory</strong>.</li>
+ <li>Enter "demo" as the name of the new directory and click <strong>OK</strong>.</li>
+ <li><p>Similarly, create the following directories:</p>
+ <ul>
+ <li><code>app/src/demo/java</code></li>
+ <li><code>app/src/demo/res</code></li>
+ <li><code>app/src/demo/res/layout</code></li>
+ <li><code>app/src/demo/res/values</code></li>
+ </ul>
+ </li>
+</ol>
+
+<p>The resulting directory structure looks like figure 5.</p>
+
+<img src="{@docRoot}images/tools/as-demoflavordirs.png" alt="" />
+<p class="img-caption"><strong>Figure 5.</strong> New source directories for the demo flavor.</p>
+
+<h4>Add a new activity to each flavor</h4>
+
+<p>To add <code>SecondActivity</code> to the <code>demo</code> flavor:</p>
+
+<ol>
+ <li>On the <em>Project</em> panel, right click on the <strong>app</strong> module and select
+ <strong>New</strong> > <strong>Activity</strong>.</li>
+ <li>Select <strong>Blank Activity</strong> and click <strong>Next</strong>.</li>
+ <li>Enter "SecondActivity" as the activity name.</li>
+ <li>Enter "com.buildsystemexample.app" as the package name and click
+ <strong>Finish</strong>.</li>
+ <li>Right click on the <strong>java</strong> directory under <em>app/src/demo</em> and select
+ <strong>New</strong> > <strong>Package</strong>.</li>
+ <li>Enter "com.buildsystemexample.app" as the package name and click <strong>OK</strong>.</li>
+ <li>Drag <strong>SecondActivity</strong> and drop it under the new package in
+ <em>app/src/demo/java</em>.</li>
+ <li>Accept the default values and click <strong>Refactor</strong>.</li>
+</ol>
+
+<p>To add the layout for <code>SecondActivity</code> and a strings resource to the demo flavor:</p>
+
+<ol>
+ <li>Drag <strong>activity_second.xml</strong> from <em>app/src/main/res/layout</em> and drop it
+ inside <em>app/src/demo/res/layout</em>.</li>
+ <li>Accept the default values on the window that appears and click <code>OK</code>.</li>
+ <li>Copy <strong>strings.xml</strong> from <em>app/src/main/res</em> into
+ <em>app/src/demo/res</em>.</li>
+ <li><p>Replace the contents of the new copy of <code>strings.xml</code> with the
+ following:</p>
+ <p><pre>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;resources>
+ &lt;string name="hello_world">Demo version only.&lt;/string>
+&lt;/resources>
+</pre></p>
+ </li>
+</ol>
+
+<p>Now you add source folders and <code>SecondActivity</code> to the full flavor by making a copy
+of the <code>demo</code> flavor:</p>
+
+<ol>
+ <li>On the <em>Project</em> panel, right click on the <strong>demo</strong> directory under
+ <em>app/src</em> and select <strong>Copy</strong>.</li>
+ <li>Right-click on the <strong>src/</strong> directory under <em>app/</em> and select
+ <strong>Paste</strong>.</li>
+ <li>On the window that appears, enter "full" as the new name and click <strong>OK</strong>.</li>
+ <li><p>Replace the contents of <strong>strings.xml</strong> under <em>src/full/res/values</em>
+ with the following:</p>
+ <p><pre>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;resources>
+ &lt;string name="hello_world">This is the full version!&lt;/string>
+&lt;/resources>
+</pre></p>
+ </li>
+</ol>
+
+<p class="note"><strong>Note:</strong> From this point on, you could develop
+<code>SecondActivity</code> independently inside each
+flavor. You can add more features to this activity in the <code>full</code> flavor.</p>
+
+<p>To work on files from a particular flavor, click on <strong>Build Variants</strong> on the left
+of the IDE window and select the flavor you want to modify in the <em>Build Variants</em> panel,
+as shown in figure 5. Android Studio may show errors in source files from flavors other than the
+one selected in the <em>Build Variants</em> panel, but this does not affect the outcome of the
+build.</p>
+
+<img src="{@docRoot}images/tools/as-buildvariants.png" alt="" />
+<p class="img-caption"><strong>Figure 6.</strong> The Build Variants panel.</p>
+
+<h4>Launch a flavor-specific activity from the main activity</h4>
+
+<p>Since the flavor-specific activity (<code>SecondActivity</code>) has the same package name and
+activity name in both flavors, you can launch it from the main activity, which is common to all
+flavors. To modify the main activity:</p>
+
+<ol>
+ <li><p>Edit <code>activity_main.xml</code> and add a new button to
+ <code>MainActivity</code>:</p>
+ <p><pre>
+&lt;LinearLayout ...>
+ ...
+ &lt;Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/button2"
+ android:onClick="onButton2Clicked"/>
+&lt;/LinearLayout>
+</pre></p>
+ </li>
+ <li>Click on the areas marked in red in the layout file and press <strong>Alt</strong>+
+ <strong>Enter</strong>. Follow the suggestions from Android Studio to add a new string
+ resource with value “Open Second Activity” and an <code>onButton2Clicked</code> method to
+ <code>MainActivity</code>.</li>
+ <li><p>Add the following code to the <code>onButton2Clicked</code> method of
+ <code>MainActivity</code>:</p>
+ <p><pre>
+public void onButton2Clicked(View view) {
+ Intent intent = new Intent(this, SecondActivity.class);
+ startActivity(intent);
+}
+</pre></p>
+ </li>
+ <li><p>Edit the app's manifest to include a reference to <code>SecondActivity</code>:</p>
+ <p><pre>
+&lt;manifest ...>
+ &lt;application ...>
+ ...
+ &lt;activity
+ android:name="com.buildsystemexample.app.SecondActivity"
+ android:label="@string/title_activity_second" >
+ &lt;/activity>
+ &lt;/application>
+&lt;/manifest>
+</pre></p>
+ </li>
+</ol>
+
+<h4>Build output</h4>
+
+<p>The <code>BuildSystemExample</code> app is now complete. To build it, invoke the
+<code>assemble</code> task from Android Studio or from the command line.</p>
+
+<p>The build generates an APK for each build variant:
+the <code>app/build/apk/</code> directory contains packages named
+<code>app-&lt;flavor>-&lt;buildtype>.apk</code>; for example, <code>app-full-release.apk</code> and
+<code>app-demo-debug.apk</code>.</p>
+
+
+<h2 id="reference">Reference</h2>
+
+<p>The build system is very flexible and has more features than those described here. For a
+complete reference, see the
+<a href="http://tools.android.com/tech-docs/new-build-system/user-guide">Android Plugin for Gradle
+User Guide</a>.</p>
diff --git a/docs/html/sdk/installing/studio.jd b/docs/html/sdk/installing/studio.jd
index feb7a6e..071492d 100644
--- a/docs/html/sdk/installing/studio.jd
+++ b/docs/html/sdk/installing/studio.jd
@@ -253,36 +253,36 @@ download (or continue to use) the
<td>Windows</td>
<td>
<a onclick="return onDownload(this)" id="win-studio"
- href="http://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-windows.exe">
- android-studio-bundle-133.970939-windows.exe
+ href="http://dl.google.com/android/studio/install/0.4.6/android-studio-bundle-133.1028713-windows.exe">
+ android-studio-bundle-133.1028713-windows.exe
</a>
</td>
- <td>515261701 bytes</td>
- <td>1e1ae28b1c00f43d55f17ee35bd4f5d2</td>
+ <td>519592042 bytes</td>
+ <td>9029c18738a75830786326d62c96d557</td>
</tr>
<tr>
<td><nobr>Mac OS X</nobr></td>
<td>
<a onclick="return onDownload(this)" id="mac-studio"
- href="http://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-mac.dmg">
- android-studio-bundle-133.970939-mac.dmg
+ href="http://dl.google.com/android/studio/install/0.4.6/android-studio-bundle-133.1028713-mac.dmg">
+ android-studio-bundle-133.1028713-mac.dmg
</a>
</td>
- <td>491773471 bytes</td>
- <td>6753f67c56acb17617bfbc5bc56384e7</td>
+ <td>497595811 bytes</td>
+ <td>eb2474e6d17537ddfa535e6fe8adcf0d</td>
</tr>
<tr>
<td>Linux</td>
<td>
<a onclick="return onDownload(this)" id="linux-studio"
- href="http://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-linux.tgz">
- android-studio-bundle-133.970939-linux.tgz
+ href="http://dl.google.com/android/studio/install/0.4.6/android-studio-bundle-133.1028713-linux.tgz">
+ android-studio-bundle-133.1028713-linux.tgz
</a>
</td>
- <td>516080363 bytes</td>
- <td>25455787d76e61baf34bf93eaa00ded6</td>
+ <td>522177460 bytes</td>
+ <td>cc847dd6249b3033737dabe0377c8c66</td>
</tr>
</table>
@@ -318,7 +318,7 @@ information about how to resolve them.</p>
<h2 id="Installing">Installing Android Studio</h2>
-<p>Android Studio requires JDK 6 or greater (JRE alone is not sufficient). To check if you
+<p>Android Studio requires JDK 6 or greater (JRE alone is not sufficient). To check if you
have JDK installed (and which version), open a terminal and type <code>javac -version</code>.
If JDK is not available or the version is lower than 6,
<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">download
@@ -430,6 +430,19 @@ style="vertical-align:bottom;margin:0;height:19px" /> in the toolbar.</p>
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>Android Studio v0.4.6</a> <em>(March 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+ <ul>
+ <li>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</li>
+ </ul>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>Android Studio v0.4.2</a> <em>(Jan 2014)</em>
</p>
@@ -637,7 +650,7 @@ for possible resolutions to known issues: <a href="http://tools.android.com/know
if (os) {
/* set up primary ACE download button */
$('#download-ide-button').show();
- $('#download-ide-button').append("Download Android Studio <span class='small'>v0.4.2</span>"
+ $('#download-ide-button').append("Download Android Studio <span class='small'>v0.4.6</span>"
+ "<br/> <span class='small'>for " + os + "</span>");
$('#download-ide-button').click(function() {return onDownload(this,true);}).attr('href', bundlename);
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
index 99a271f..5d1d13b 100644
--- a/docs/html/tools/revisions/platforms.jd
+++ b/docs/html/tools/revisions/platforms.jd
@@ -93,6 +93,21 @@ class="toggle-content-img" alt="" />Revision 1</a> <em>(October 2013)</em>
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png"
+class="toggle-content-img" alt="" />Revision 4</a> <em>(March 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <p>This release includes
+ <a href="{@docRoot}google/play-services/index.html">Google Play services</a> version 4.3,
+ allowing you to test your application in an emulator using the latest Google Play services.</p>
+
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png"
class="toggle-content-img" alt="" />Revision 3</a> <em>(February 2014)</em>
</p>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index a821757..d106f4a 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -57,6 +57,51 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>ADT 22.6.2</a> <em>(March 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 1.6 or higher is required.</li>
+ <li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
+ <li>This version of ADT is designed for use with
+ <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r22.6.2</a>.
+ If you haven't already installed SDK Tools r22.6.2 into your SDK, use the
+ Android SDK Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li><p>Changed the URL for the Android Developer Tools update site to require HTTPS.</p>
+ <p class="note"><strong>Note:</strong> If you are
+ <a href="{@docRoot}sdk/installing/installing-adt.html">updating ADT</a>, make sure
+ you use HTTPS in the URL for the Android Developer Tools update site.</p>
+ </li>
+ <li>Fixed a problem where Eclipse was non-responsive for a few seconds after opening
+ an XML file. (<a href="http://b.android.com/67084">Issue 67084</a>)</li>
+ <li>Fixed a problem where the SDK Manager threw a <code>NullPointerException</code> after
+ removing a virtual device that was created using the Android Wear
+ system image. (<a href="http://b.android.com/67588">Issue 67588</a>)</li>
+ <li>Fixed a problem where the layout preview for large screens in Eclipse showed the
+ resources from the <code>drawable-*</code> directories instead of those from the
+ <code>drawable-large-*</code> directories.</li>
+ <li>Fixed a problem with Nexus 5 Android virtual devices created from the command line
+ where the SD card file system was read-only.</li>
+ </ul>
+ </dd>
+</dl>
+</div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>ADT 22.6.1</a> <em>(March 2014)</em>
</p>
@@ -78,8 +123,8 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dt>General Notes:</dt>
<dd>
<ul>
- <li>Fixed a problem where the Android Virtual Device Manager could not create new virtual
- devices. (<a href="http://b.android.com/66661">Issue 66661</a>)</li>
+ <li>Fixed a problem where the Android Virtual Device Manager could not create new
+ virtual devices. (<a href="http://b.android.com/66661">Issue 66661</a>)</li>
<li><p>Fixed a problem with virtual devices created using ADT 22.3 or earlier.</p>
<p>If you created an Android Virtual Device using ADT 22.3 or earlier, the
AVD may be listed as <em>broken</em> in the AVD Manager in 22.6.1. To fix
@@ -102,7 +147,6 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
</div>
</div>
-
<div class="toggle-content closed">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index 675cde3..14b5505 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -28,6 +28,41 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+ alt=""/>SDK Tools, Revision 22.6.2</a> <em>(March 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Android SDK Platform-tools revision 18 or later.</li>
+ <li>If you are developing in Eclipse with ADT, note that this version of SDK Tools is
+ designed for use with ADT 22.6.2 and later. If you haven't already, update your
+ <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 22.6.2.</li>
+ <li>If you are developing outside Eclipse, you must have
+ <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed a problem where the SDK Manager threw a <code>NullPointerException</code> after
+ removing a virtual device that was created using the Android Wear
+ system image. (<a href="http://b.android.com/67588">Issue 67588</a>)</li>
+ <li>Fixed a problem with Nexus 5 Android virtual devices created from the command line
+ where the SD card file system was read-only.</li>
+ </ul>
+ </dd>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
alt=""/>SDK Tools, Revision 22.6.1</a> <em>(March 2014)</em>
</p>
@@ -124,7 +159,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
</ul>
</li>
<li>Check that production builds do not use mock location providers.</li>
- <li>Look for manifest values that are overwritten by values from Gradle build
+ <li>Look for manifest values that are overwritten by values from Gradle build
scripts.</li>
</ul>
</li>
@@ -148,7 +183,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
(<a href="http://b.android.com/34233">Issue 34233</a>)</li>
</ul>
</li>
- <li>Fixed an issue with RenderScript support. Using RenderScript support mode
+ <li>Fixed an issue with RenderScript support. Using RenderScript support mode
now requires version 19.0.3 of the Build Tools.</li>
</ul>
</dd>
diff --git a/docs/html/tools/support-library/index.jd b/docs/html/tools/support-library/index.jd
index 389238f..e905285 100644
--- a/docs/html/tools/support-library/index.jd
+++ b/docs/html/tools/support-library/index.jd
@@ -58,10 +58,36 @@ page.title=Support Library
<p>This section provides details about the Support Library package releases.</p>
-
<div class="toggle-content opened">
<p><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+/>Android Support Library, revision 19.1.0</a> <em>(March 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <dl>
+ <dt>Changes for v4 support library:</dt>
+ <dd>
+ <ul>
+ <li>Added the {@link android.support.v4.widget.SwipeRefreshLayout} class,
+ which enables users to refresh the contents of a view with a vertical
+ swipe gesture.</li>
+ <li>Fixed accessibility issues with navigation drawers.</li>
+ </ul>
+ </dd>
+
+ <dt>Changes for v7 appcompat library:</dt>
+ <dd>
+ <ul>
+ <li>Fixed background issues with the action bar.</li>
+ </ul>
+ </dd>
+ </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+ <p><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
/>Android Support Library, revision 19.0.1</a> <em>(December 2013)</em>
</p>
<div class="toggle-content-toggleme">
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 382165c..0e543e4 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -36,6 +36,8 @@
Tips and Tricks</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html">
Using the Layout Editor</a></li>
+ <li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html">
+ Building your Project</a></li>
</ul>
</li>
<li><a href="<?cs var:toroot ?>sdk/exploring.html">
diff --git a/docs/html/wear/design/index.html b/docs/html/wear/design/index.html
index 9952490..53ea1f3 100644
--- a/docs/html/wear/design/index.html
+++ b/docs/html/wear/design/index.html
@@ -433,7 +433,8 @@ By providing a smart connection to the rest of the world while respecting the us
<p>Actions appear to the right of your notification, allowing the user to act on your notification. Up to three actions are permitted. The most-used action should be placed first, so that it is a single swipe away from your content.</p>
-<p>Actions consist of an icon and a caption. Icons should be PNG files, white on transparent background, 64 × 64 DP. Captions should be verb-driven and short, and will be automatically truncated at one line.</p>
+<p>Actions consist of an icon and a caption. Icons should be PNG files, white on transparent background, 32 × 32 dp (with 8 dp padding), as specified in the <a href="/design/style/iconography.html#action-bar">Iconography</a> design guide
+for the action bar icons. Captions should be verb-driven and short, and will be automatically truncated at one line.</p>
<p>Actions are optional. Many useful notifications will not need to include actions at all.</p>
@@ -452,7 +453,8 @@ Notifications for Android Wear</a>.</p>
<p>Images appear behind cards in the stream, providing context and additional glanceability. Your image should support the core message of the notification; for example, a card about a sports team could include the team color and logo; a message from a contact should display that person's profile photo.</p>
-<p>Bear in mind that the card will partially cover the lower part of the image. Images should be at least 320 × 320 pixels at hdpi. Image backgrounds move when horizontally swiped, so landscape-oriented images work better on notifications that include pages or actions.</p>
+<p>Bear in mind that the card will partially cover the lower part of the image. Images should be sized as
+appropriate for the notification appearance on handsets, which is 64 x 64 dp. Image backgrounds move when horizontally swiped, so landscape-oriented images work better on notifications that include pages or actions.</p>
<p>To add large images, use <code><a href="/reference/android/support/v4/app/NotificationCompat.Builder.html#setLargeIcon(android.graphics.Bitmap)">setLargeIcon()</a></code> with any notification, as
shown in <a href="/wear/notifications/creating.html">Creating
diff --git a/docs/html/wear/images/screens/cuecard.gif b/docs/html/wear/images/screens/cuecard.gif
index 4b3d2f3..de1f53b 100644
--- a/docs/html/wear/images/screens/cuecard.gif
+++ b/docs/html/wear/images/screens/cuecard.gif
Binary files differ
diff --git a/docs/html/wear/images/screens/stream.gif b/docs/html/wear/images/screens/stream.gif
index 656a277..3c18775 100644
--- a/docs/html/wear/images/screens/stream.gif
+++ b/docs/html/wear/images/screens/stream.gif
Binary files differ
diff --git a/docs/html/wear/index.html b/docs/html/wear/index.html
index 712e1af..9660463 100644
--- a/docs/html/wear/index.html
+++ b/docs/html/wear/index.html
@@ -94,7 +94,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="viewport" content="width=device-width" />
+<meta name="viewport" content="width=970" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<title>Android Wear | Android Developers</title>
@@ -297,8 +297,8 @@ onkeyup="return search_changed(event, false, '/')" />
</div>
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div id="ytapiplayer">
- <a href="http://www.youtube.com/watch?v=i2uvYI6blEE"><img width=600
- src="https://i1.ytimg.com/vi/i2uvYI6blEE/maxresdefault.jpg"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. -->
+ <a href="http://www.youtube.com/watch?v=0xQ3y902DEQ"><img width=940
+ src="https://i1.ytimg.com/vi/0xQ3y902DEQ/maxresdefault.jpg"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. -->
</div>
</div>
</div>
@@ -346,9 +346,14 @@ $("#watchVideo").on("click", function(e) {
});
$("#icon-video-close").on("click", function() {
ytplayer = document.getElementById("ytapiplayer");
- ytplayer.stopVideo();
- $(ytplayer).hide();
- $("#video-container").fadeOut(400);
+ try {
+ ytplayer.stopVideo();
+ $(ytplayer).hide();
+ $("#video-container").fadeOut(400);
+ } catch(e) {
+ console.log('Video not available');
+ $("#video-container").fadeOut(400);
+ }
});
</script>
</div>
@@ -650,7 +655,7 @@ $("#icon-video-close").on("click", function() {
<div class="g-plusone" data-size="medium"></div>
</div>
</div>
- <div id="footer" class="wrap" style="width:940px;position:relative;top:-35px">
+ <div id="footer" class="wrap" style="width:940px;position:relative;top:-35px;z-index:-1">
<div id="copyright">
Except as noted, this content is
licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
diff --git a/docs/html/wear/notifications/creating.html b/docs/html/wear/notifications/creating.html
index e83b57a..7ad6833 100644
--- a/docs/html/wear/notifications/creating.html
+++ b/docs/html/wear/notifications/creating.html
@@ -572,9 +572,9 @@ for users to deliver your app a text response using voice input.</p>
<p>To use these new APIs, pass your instance of
<code><a href="/reference/android/support/v4/app/NotificationCompat.Builder.html">NotificationCompat.Builder</a></code> to the
- <a href="/reference/android/preview/support/notifications/WearableNotifications.html"> <code>WearableNotifications.Builder()</code></a> constructor. You can then add new
+ <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#WearableNotifications.Builder(android.content.Context)"> <code>WearableNotifications.Builder()</code></a> constructor. You can then add new
features to your notification using the
- <a href="/wear/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"
+ <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"
><code>WearableNotifications.Builder</code></a> methods. For example:</p>
<pre>
@@ -592,10 +592,10 @@ Notification notification =
.build();
</pre>
-<p>The <a href="/reference/android/preview/support/notifications/WearableNotifications.Builder.html#setBigActionIcon(int)">
+<p>The <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#setBigActionIcon(int)">
<code>setHintHideIcon()</code></a> method removes your app icon from the notification card.
This method is just one example of new notification features available from the
- <a href="/wear/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"
+ <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"
><code>WearableNotifications.Builder</code></a> class.</p>
<p>When you want to deliver your notifications, be certain to always use the
@@ -616,7 +616,7 @@ features from <a href="/reference/android/preview/support/wearable/notifications
will not work.</p>
<p>To continue enhancing your notifications for wearables using
- <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder"
+ <a href="/reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"
><code>WearableNotifications.Builder</code></a> and other APIs in the
preview support library, see the following developer guides:</p>
diff --git a/docs/html/wear/notifications/remote-input.html b/docs/html/wear/notifications/remote-input.html
index c8f6621..3d869b5 100644
--- a/docs/html/wear/notifications/remote-input.html
+++ b/docs/html/wear/notifications/remote-input.html
@@ -489,7 +489,7 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
// Create wearable notification and add remote input
Notification replyNotification =
new WearableNotifications.Builder(replyNotificationBuilder)
- .addRemoteInputForContentIntent(replyAction)
+ .addRemoteInputForContentIntent(remoteInput)
.build();
</pre>
diff --git a/docs/html/wear/preview/start.html b/docs/html/wear/preview/start.html
index 4aec648..b1861f5 100644
--- a/docs/html/wear/preview/start.html
+++ b/docs/html/wear/preview/start.html
@@ -558,7 +558,10 @@ Gmail or Google account you use with Google Play Store.</p>
The emulator should show the time and an icon that indicates no device is connected.</li>
<li>Open a command line terminal, navigate to your Android SDK's <code>platform-tools/</code>
directory, then execute:
-<pre style="margin-top:.5em">adb -d forward tcp:5601 tcp:5601</pre></li>
+<pre style="margin-top:.5em">adb -d forward tcp:5601 tcp:5601</pre>
+<p class="note"><strong>Note:</strong> You must execute this command each time you connect your
+device over USB.</p>
+</li>
<li>Return to the Android Wear Preview app. It should now indicate that it is connected to
the emulator. The Android Wear emulator should now show the 'g' orb icon, indicating
that is is connected to your device.
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h
index a13dd16..610528c 100644
--- a/include/androidfw/AssetManager.h
+++ b/include/androidfw/AssetManager.h
@@ -161,7 +161,7 @@ public:
* path hierarchy, and will not be seen by "AssetDir" or included
* in our filename cache.
*/
- Asset* openNonAsset(const char* fileName, AccessMode mode);
+ Asset* openNonAsset(const char* fileName, AccessMode mode, int32_t* outCookie = NULL);
/*
* Explicit non-asset file. The file explicitly named by the cookie (the
diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h
index b334aab..7cc10be 100644
--- a/include/androidfw/ResourceTypes.h
+++ b/include/androidfw/ResourceTypes.h
@@ -25,6 +25,7 @@
#include <utils/Errors.h>
#include <utils/String16.h>
#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
#include <utils/threads.h>
@@ -216,7 +217,8 @@ enum {
// Chunk types in RES_TABLE_TYPE
RES_TABLE_PACKAGE_TYPE = 0x0200,
RES_TABLE_TYPE_TYPE = 0x0201,
- RES_TABLE_TYPE_SPEC_TYPE = 0x0202
+ RES_TABLE_TYPE_SPEC_TYPE = 0x0202,
+ RES_TABLE_LIBRARY_TYPE = 0x0203
};
/**
@@ -268,6 +270,9 @@ struct Res_value
// The 'data' holds a complex number encoding a fraction of a
// container.
TYPE_FRACTION = 0x06,
+ // The 'data' holds a dynamic ResTable_ref, which needs to be
+ // resolved before it can be used like a TYPE_REFERENCE.
+ TYPE_DYNAMIC_REFERENCE = 0x07,
// Beginning of integer flavors...
TYPE_FIRST_INT = 0x10,
@@ -457,6 +462,7 @@ public:
ResStringPool(const void* data, size_t size, bool copyData=false);
~ResStringPool();
+ void setToEmpty();
status_t setTo(const void* data, size_t size, bool copyData=false);
status_t getError() const;
@@ -735,14 +741,16 @@ private:
const void* mCurExt;
};
+class DynamicRefTable;
+
/**
* Convenience class for accessing data in a ResXMLTree resource.
*/
class ResXMLTree : public ResXMLParser
{
public:
+ ResXMLTree(const DynamicRefTable* dynamicRefTable);
ResXMLTree();
- ResXMLTree(const void* data, size_t size, bool copyData=false);
~ResXMLTree();
status_t setTo(const void* data, size_t size, bool copyData=false);
@@ -756,6 +764,8 @@ private:
status_t validateNode(const ResXMLTree_node* node) const;
+ const DynamicRefTable* const mDynamicRefTable;
+
status_t mError;
void* mOwnedData;
const ResXMLTree_header* mHeader;
@@ -1290,6 +1300,7 @@ struct ResTable_entry
struct ResTable_map_entry : public ResTable_entry
{
// Resource identifier of the parent mapping, or 0 if there is none.
+ // This is always treated as a TYPE_DYNAMIC_REFERENCE.
ResTable_ref parent;
// Number of name/value pairs that follow for FLAG_COMPLEX.
uint32_t count;
@@ -1385,6 +1396,68 @@ struct ResTable_map
};
/**
+ * A package-id to package name mapping for any shared libraries used
+ * in this resource table. The package-id's encoded in this resource
+ * table may be different than the id's assigned at runtime. We must
+ * be able to translate the package-id's based on the package name.
+ */
+struct ResTable_lib_header
+{
+ struct ResChunk_header header;
+
+ // The number of shared libraries linked in this resource table.
+ uint32_t count;
+};
+
+/**
+ * A shared library package-id to package name entry.
+ */
+struct ResTable_lib_entry
+{
+ // The package-id this shared library was assigned at build time.
+ // We use a uint32 to keep the structure aligned on a uint32 boundary.
+ uint32_t packageId;
+
+ // The package name of the shared library. \0 terminated.
+ char16_t packageName[128];
+};
+
+/**
+ * Holds the shared library ID table. Shared libraries are assigned package IDs at
+ * build time, but they may be loaded in a different order, so we need to maintain
+ * a mapping of build-time package ID to run-time assigned package ID.
+ *
+ * Dynamic references are not currently supported in overlays. Only the base package
+ * may have dynamic references.
+ */
+class DynamicRefTable
+{
+public:
+ DynamicRefTable(uint8_t packageId);
+
+ // Loads an unmapped reference table from the package.
+ status_t load(const ResTable_lib_header* const header);
+
+ // Creates a mapping from build-time package ID to run-time package ID for
+ // the given package.
+ status_t addMapping(const String16& packageName, uint8_t packageId);
+
+ // Performs the actual conversion of build-time resource ID to run-time
+ // resource ID.
+ inline status_t lookupResourceId(uint32_t* resId) const;
+ inline status_t lookupResourceValue(Res_value* value) const;
+
+ inline const KeyedVector<String16, uint8_t>& entries() const {
+ return mEntries;
+ }
+
+private:
+ const uint8_t mAssignedPackageId;
+ uint8_t mLookupTable[256];
+ KeyedVector<String16, uint8_t> mEntries;
+};
+
+/**
* Convenience class for accessing data in a ResTable resource.
*/
class ResTable
@@ -1399,6 +1472,7 @@ public:
const void* idmap = NULL);
status_t add(const void *data, size_t size);
status_t add(ResTable* src);
+ status_t addEmpty(const int32_t cookie);
status_t getError() const;
@@ -1634,7 +1708,7 @@ public:
bool append = false);
size_t getBasePackageCount() const;
- const char16_t* getBasePackageName(size_t idx) const;
+ const String16 getBasePackageName(size_t idx) const;
uint32_t getBasePackageId(size_t idx) const;
// Return the number of resource tables that the object contains.
@@ -1647,6 +1721,8 @@ public:
// Return unique cookie identifier for the given resource table.
int32_t getTableCookie(size_t index) const;
+ const DynamicRefTable* getDynamicRefTableForCookie(int32_t cookie) const;
+
// Return the configurations (ResTable_config) that we know about
void getConfigurations(Vector<ResTable_config>* configs) const;
@@ -1684,7 +1760,7 @@ private:
struct bag_set;
status_t addInternal(const void* data, size_t size, const int32_t cookie,
- Asset* asset, bool copyData, const Asset* idmap);
+ bool copyData, const Asset* idmap);
ssize_t getResourcePackageIndex(uint32_t resID) const;
ssize_t getEntry(
@@ -1712,6 +1788,8 @@ private:
// Mapping from resource package IDs to indices into the internal
// package array.
uint8_t mPackageMap[256];
+
+ uint8_t mNextPackageId;
};
} // namespace android
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 64363d4..91dda75 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -74,6 +74,7 @@ static const char* kAssetsRoot = "assets";
static const char* kAppZipName = NULL; //"classes.jar";
static const char* kSystemAssets = "framework/framework-res.apk";
static const char* kResourceCache = "resource-cache";
+static const char* kAndroidManifest = "AndroidManifest.xml";
static const char* kExcludeExtension = ".EXCLUDE";
@@ -205,6 +206,16 @@ bool AssetManager::addAssetPath(const String8& path, int32_t* cookie)
ALOGV("In %p Asset %s path: %s", this,
ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.string());
+ // Check that the path has an AndroidManifest.xml
+ Asset* manifestAsset = const_cast<AssetManager*>(this)->openNonAssetInPathLocked(
+ kAndroidManifest, Asset::ACCESS_BUFFER, ap);
+ if (manifestAsset == NULL) {
+ // This asset path does not contain any resources.
+ delete manifestAsset;
+ return false;
+ }
+ delete manifestAsset;
+
mAssetPaths.add(ap);
// new paths are always added at the end
@@ -461,7 +472,7 @@ Asset* AssetManager::open(const char* fileName, AccessMode mode)
* The "fileName" is the partial path starting from the application
* name.
*/
-Asset* AssetManager::openNonAsset(const char* fileName, AccessMode mode)
+Asset* AssetManager::openNonAsset(const char* fileName, AccessMode mode, int32_t* outCookie)
{
AutoMutex _l(mLock);
@@ -482,6 +493,7 @@ Asset* AssetManager::openNonAsset(const char* fileName, AccessMode mode)
Asset* pAsset = openNonAssetInPathLocked(
fileName, mode, mAssetPaths.itemAt(i));
if (pAsset != NULL) {
+ if (outCookie != NULL) *outCookie = static_cast<int32_t>(i + 1);
return pAsset != kExcludedAsset ? pAsset : NULL;
}
}
@@ -556,9 +568,14 @@ const ResTable* AssetManager::getResTable(bool required) const
LOG_FATAL_IF(mAssetPaths.size() == 0, "No assets added to AssetManager");
}
- if (mCacheMode != CACHE_OFF && !mCacheValid)
+ if (mCacheMode != CACHE_OFF && !mCacheValid) {
const_cast<AssetManager*>(this)->loadFileNameCacheLocked();
+ }
+
+ mResources = new ResTable();
+ updateResourceParamsLocked();
+ bool onlyEmptyResources = true;
const size_t N = mAssetPaths.size();
for (size_t i=0; i<N; i++) {
Asset* ass = NULL;
@@ -621,35 +638,39 @@ const ResTable* AssetManager::getResTable(bool required) const
ap);
shared = false;
}
+
if ((ass != NULL || sharedRes != NULL) && ass != kExcludedAsset) {
- if (rt == NULL) {
- mResources = rt = new ResTable();
- updateResourceParamsLocked();
- }
ALOGV("Installing resource asset %p in to table %p\n", ass, mResources);
if (sharedRes != NULL) {
ALOGV("Copying existing resources for %s", ap.path.string());
- rt->add(sharedRes);
+ mResources->add(sharedRes);
} else {
ALOGV("Parsing resources for %s", ap.path.string());
- rt->add(ass, i + 1, !shared, idmap);
+ mResources->add(ass, i + 1, !shared, idmap);
}
+ onlyEmptyResources = false;
if (!shared) {
delete ass;
}
+ } else {
+ ALOGW("Installing empty resources in to table %p\n", mResources);
+ mResources->addEmpty(i + 1);
}
+
if (idmap != NULL) {
delete idmap;
}
MY_TRACE_END();
}
- if (required && !rt) ALOGW("Unable to find resources file resources.arsc");
- if (!rt) {
- mResources = rt = new ResTable();
+ if (required && onlyEmptyResources) {
+ ALOGW("Unable to find resources file resources.arsc");
+ delete mResources;
+ mResources = NULL;
}
- return rt;
+
+ return mResources;
}
void AssetManager::updateResourceParamsLocked() const
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 652cd4a..04ca81e 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -42,6 +42,7 @@
#define TABLE_SUPER_NOISY(x) //x
#define LOAD_TABLE_NOISY(x) //x
#define TABLE_THEME(x) //x
+#define LIB_NOISY(x) x
namespace android {
@@ -66,6 +67,9 @@ namespace android {
// size measured in sizeof(uint32_t)
#define IDMAP_HEADER_SIZE (ResTable::IDMAP_HEADER_SIZE_BYTES / sizeof(uint32_t))
+#define APP_PACKAGE_ID 0x7f
+#define SYS_PACKAGE_ID 0x01
+
// Standard C isspace() is only required to look at the low byte of its input, so
// produces incorrect results for UTF-16 characters. For safety's sake, assume that
// any high-byte UTF-16 code point is not whitespace.
@@ -113,7 +117,7 @@ static status_t validate_chunk(const ResChunk_header* chunk,
name, size, headerSize);
return BAD_TYPE;
}
- ALOGW("%s header size 0x%x is too small.",
+ ALOGW("%s header size 0x%04x is too small.",
name, headerSize);
return BAD_TYPE;
}
@@ -264,7 +268,7 @@ static status_t idmapLookup(const uint32_t* map, size_t sizeBytes, uint32_t key,
}
const uint32_t index = typeOffset + 2 + entry - entryOffset;
if (index > size) {
- ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, (int)size);
+ ALOGW("Resource ID map: entry index=%u exceeds size of map=%d\n", index, (int)size);
*outValue = 0;
return NO_ERROR;
}
@@ -279,7 +283,7 @@ static status_t getIdmapPackageId(const uint32_t* map, size_t mapSize, uint32_t
return UNKNOWN_ERROR;
}
if (mapSize <= IDMAP_HEADER_SIZE + 1) {
- ALOGW("corrupt idmap: map size %d too short\n", mapSize);
+ ALOGW("corrupt idmap: map size %d too short\n", (int)mapSize);
return UNKNOWN_ERROR;
}
uint32_t typeCount = *(map + IDMAP_HEADER_SIZE);
@@ -288,7 +292,7 @@ static status_t getIdmapPackageId(const uint32_t* map, size_t mapSize, uint32_t
return UNKNOWN_ERROR;
}
if (IDMAP_HEADER_SIZE + 1 + typeCount > mapSize) {
- ALOGW("corrupt idmap: number of types %d extends past idmap size %d\n", typeCount, mapSize);
+ ALOGW("corrupt idmap: number of types %u extends past idmap size %d\n", typeCount, (int)mapSize);
return UNKNOWN_ERROR;
}
const uint32_t* p = map + IDMAP_HEADER_SIZE + 1;
@@ -304,7 +308,7 @@ static status_t getIdmapPackageId(const uint32_t* map, size_t mapSize, uint32_t
// determine package id from first entry of first type
const uint32_t offset = *p + IDMAP_HEADER_SIZE + 2;
if (offset > mapSize) {
- ALOGW("corrupt idmap: entry offset %d points outside map size %d\n", offset, mapSize);
+ ALOGW("corrupt idmap: entry offset %u points outside map size %d\n", offset, (int)mapSize);
return UNKNOWN_ERROR;
}
*outId = (map[offset] >> 24) & 0x000000ff;
@@ -342,6 +346,22 @@ ResStringPool::~ResStringPool()
uninit();
}
+void ResStringPool::setToEmpty()
+{
+ uninit();
+
+ mOwnedData = calloc(1, sizeof(ResStringPool_header));
+ ResStringPool_header* header = (ResStringPool_header*) mOwnedData;
+ mSize = 0;
+ mEntries = NULL;
+ mStrings = NULL;
+ mStringPoolSize = 0;
+ mEntryStyles = NULL;
+ mStyles = NULL;
+ mStylePoolSize = 0;
+ mHeader = (const ResStringPool_header*) header;
+}
+
status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)
{
if (!data || !size) {
@@ -1111,7 +1131,14 @@ int32_t ResXMLParser::getAttributeDataType(size_t idx) const
(((const uint8_t*)tag)
+ dtohs(tag->attributeStart)
+ (dtohs(tag->attributeSize)*idx));
- return attr->typedValue.dataType;
+ uint8_t type = attr->typedValue.dataType;
+ if (type != Res_value::TYPE_DYNAMIC_REFERENCE) {
+ return type;
+ }
+
+ // This is a dynamic reference. We adjust those references
+ // to regular references at this level, so lie to the caller.
+ return Res_value::TYPE_REFERENCE;
}
}
return Res_value::TYPE_NULL;
@@ -1126,7 +1153,15 @@ int32_t ResXMLParser::getAttributeData(size_t idx) const
(((const uint8_t*)tag)
+ dtohs(tag->attributeStart)
+ (dtohs(tag->attributeSize)*idx));
- return dtohl(attr->typedValue.data);
+ if (attr->typedValue.dataType != Res_value::TYPE_DYNAMIC_REFERENCE ||
+ mTree.mDynamicRefTable == NULL) {
+ return dtohl(attr->typedValue.data);
+ }
+
+ uint32_t data = dtohl(attr->typedValue.data);
+ if (mTree.mDynamicRefTable->lookupResourceId(&data) == NO_ERROR) {
+ return data;
+ }
}
}
return 0;
@@ -1142,6 +1177,10 @@ ssize_t ResXMLParser::getAttributeValue(size_t idx, Res_value* outValue) const
+ dtohs(tag->attributeStart)
+ (dtohs(tag->attributeSize)*idx));
outValue->copyFrom_dtoh(attr->typedValue);
+ if (mTree.mDynamicRefTable != NULL &&
+ mTree.mDynamicRefTable->lookupResourceValue(outValue) != NO_ERROR) {
+ return BAD_TYPE;
+ }
return sizeof(Res_value);
}
}
@@ -1333,25 +1372,26 @@ void ResXMLParser::setPosition(const ResXMLParser::ResXMLPosition& pos)
mCurExt = pos.curExt;
}
-
// --------------------------------------------------------------------
static volatile int32_t gCount = 0;
-ResXMLTree::ResXMLTree()
+ResXMLTree::ResXMLTree(const DynamicRefTable* dynamicRefTable)
: ResXMLParser(*this)
+ , mDynamicRefTable(dynamicRefTable)
, mError(NO_INIT), mOwnedData(NULL)
{
//ALOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1);
restart();
}
-ResXMLTree::ResXMLTree(const void* data, size_t size, bool copyData)
+ResXMLTree::ResXMLTree()
: ResXMLParser(*this)
+ , mDynamicRefTable(NULL)
, mError(NO_INIT), mOwnedData(NULL)
{
//ALOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1);
- setTo(data, size, copyData);
+ restart();
}
ResXMLTree::~ResXMLTree()
@@ -2737,7 +2777,14 @@ struct ResTable::Package
struct ResTable::PackageGroup
{
PackageGroup(ResTable* _owner, const String16& _name, uint32_t _id)
- : owner(_owner), name(_name), id(_id), typeCount(0), bags(NULL) { }
+ : owner(_owner)
+ , name(_name)
+ , id(_id)
+ , typeCount(0)
+ , bags(NULL)
+ , dynamicRefTable(static_cast<uint8_t>(_id))
+ { }
+
~PackageGroup() {
clearBagCache();
const size_t N = packages.size();
@@ -2790,6 +2837,13 @@ struct ResTable::PackageGroup
// Computed attribute bags, first indexed by the type and second
// by the entry in that type.
bag_set*** bags;
+
+ // The table mapping dynamic references to resolved references for
+ // this package group.
+ // TODO: We may be able to support dynamic references in overlays
+ // by having these tables in a per-package scope rather than
+ // per-package-group.
+ DynamicRefTable dynamicRefTable;
};
struct ResTable::bag_set
@@ -3077,7 +3131,7 @@ void ResTable::Theme::dumpToLog() const
}
ResTable::ResTable()
- : mError(NO_INIT)
+ : mError(NO_INIT), mNextPackageId(2)
{
memset(&mParams, 0, sizeof(mParams));
memset(mPackageMap, 0, sizeof(mPackageMap));
@@ -3085,11 +3139,11 @@ ResTable::ResTable()
}
ResTable::ResTable(const void* data, size_t size, const int32_t cookie, bool copyData)
- : mError(NO_INIT)
+ : mError(NO_INIT), mNextPackageId(2)
{
memset(&mParams, 0, sizeof(mParams));
memset(mPackageMap, 0, sizeof(mPackageMap));
- addInternal(data, size, cookie, NULL /* asset */, copyData, NULL /* idMap */);
+ addInternal(data, size, cookie, copyData, NULL /* idMap */);
LOG_FATAL_IF(mError != NO_ERROR, "Error parsing resource table");
//ALOGI("Creating ResTable %p\n", this);
}
@@ -3106,7 +3160,7 @@ inline ssize_t ResTable::getResourcePackageIndex(uint32_t resID) const
}
status_t ResTable::add(const void* data, size_t size) {
- return addInternal(data, size, 0 /* cookie */, NULL /* asset */,
+ return addInternal(data, size, 0 /* cookie */,
false /* copyData */, NULL /* idMap */);
}
@@ -3118,7 +3172,7 @@ status_t ResTable::add(Asset* asset, const int32_t cookie, bool copyData, const
return UNKNOWN_ERROR;
}
size_t size = (size_t)asset->getLength();
- return addInternal(data, size, cookie, asset, copyData,
+ return addInternal(data, size, cookie, copyData,
reinterpret_cast<const Asset*>(idmap));
}
@@ -3146,8 +3200,25 @@ status_t ResTable::add(ResTable* src)
return mError;
}
+status_t ResTable::addEmpty(const int32_t cookie) {
+ Header* header = new Header(this);
+ header->index = mHeaders.size();
+ header->cookie = cookie;
+ header->values.setToEmpty();
+ header->ownedData = calloc(1, sizeof(ResTable_header));
+
+ ResTable_header* resHeader = (ResTable_header*) header->ownedData;
+ resHeader->header.type = RES_TABLE_TYPE;
+ resHeader->header.headerSize = sizeof(ResTable_header);
+ resHeader->header.size = sizeof(ResTable_header);
+
+ header->header = (const ResTable_header*) resHeader;
+ mHeaders.add(header);
+ return NO_ERROR;
+}
+
status_t ResTable::addInternal(const void* data, size_t size, const int32_t cookie,
- Asset* /*asset*/, bool copyData, const Asset* idmap)
+ bool copyData, const Asset* idmap)
{
if (!data) return NO_ERROR;
Header* header = new Header(this);
@@ -3186,8 +3257,6 @@ status_t ResTable::addInternal(const void* data, size_t size, const int32_t cook
//ALOGI("Got size 0x%x, again size 0x%x, raw size 0x%x\n", header->size,
// dtohl(header->header->header.size), header->header->header.size);
LOAD_TABLE_NOISY(ALOGV("Loading ResTable @%p:\n", header->header));
- LOAD_TABLE_NOISY(printHexData(2, header->header, header->size < 256 ? header->size : 256,
- 16, 16, 0, false, printToLogFunc));
if (dtohs(header->header->header.headerSize) > header->size
|| header->size > size) {
ALOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n",
@@ -3474,9 +3543,6 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag
continue;
}
- TABLE_NOISY(aout << "Resource type data: "
- << HexDump(type, dtohl(type->header.size)) << endl);
-
if ((size_t)offset > (dtohl(type->header.size)-sizeof(Res_value))) {
ALOGW("ResTable_item at %d is beyond type chunk data %d",
(int)offset, dtohl(type->header.size));
@@ -3516,6 +3582,18 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag
outValue->res0 = bestValue->res0;
outValue->dataType = bestValue->dataType;
outValue->data = dtohl(bestValue->data);
+
+ // The reference may be pointing to a resource in a shared library. These
+ // references have build-time generated package IDs. These ids may not match
+ // the actual package IDs of the corresponding packages in this ResTable.
+ // We need to fix the package ID based on a mapping.
+ status_t err = grp->dynamicRefTable.lookupResourceValue(outValue);
+ if (err != NO_ERROR) {
+ ALOGW("Failed to resolve referenced package: 0x%08x", outValue->data);
+ rc = BAD_VALUE;
+ goto out;
+ }
+
if (outConfig != NULL) {
*outConfig = bestItem;
}
@@ -3545,8 +3623,8 @@ ssize_t ResTable::resolveReference(Res_value* value, ssize_t blockIndex,
ResTable_config* outConfig) const
{
int count=0;
- while (blockIndex >= 0 && value->dataType == value->TYPE_REFERENCE
- && value->data != 0 && count < 20) {
+ while (blockIndex >= 0 && value->dataType == Res_value::TYPE_REFERENCE
+ && value->data != 0 && count < 20) {
if (outLastRef) *outLastRef = value->data;
uint32_t lastRef = value->data;
uint32_t newFlags = 0;
@@ -3730,7 +3808,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag,
const Type* typeClass;
ALOGV("Getting entry pkg=%p, t=%d, e=%d\n", package, T, E);
ssize_t offset = getEntry(package, T, E, &mParams, &type, &entry, &typeClass);
- ALOGV("Resulting offset=%d\n", offset);
+ ALOGV("Resulting offset=%d\n", (int)offset);
if (offset <= 0) {
// No {entry, appropriate config} pair found in package. If this
// package is an overlay package (ip != 0), this simply means the
@@ -3774,9 +3852,21 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag,
TABLE_NOISY(printf("Creating new bag, entrySize=0x%08x, parent=0x%08x\n",
entrySize, parent));
if (parent) {
+ uint32_t resolvedParent = parent;
+
+ // Bags encode a parent reference without using the standard
+ // Res_value structure. That means we must always try to
+ // resolve a parent reference in case it is actually a
+ // TYPE_DYNAMIC_REFERENCE.
+ status_t err = grp->dynamicRefTable.lookupResourceId(&resolvedParent);
+ if (err != NO_ERROR) {
+ ALOGE("Failed resolving bag parent id 0x%08x", parent);
+ return UNKNOWN_ERROR;
+ }
+
const bag_entry* parentBag;
uint32_t parentTypeSpecFlags = 0;
- const ssize_t NP = getBagLocked(parent, &parentBag, &parentTypeSpecFlags);
+ const ssize_t NP = getBagLocked(resolvedParent, &parentBag, &parentTypeSpecFlags);
const size_t NT = ((NP >= 0) ? NP : 0) + N;
set = (bag_set*)malloc(sizeof(bag_set)+sizeof(bag_entry)*NT);
if (set == NULL) {
@@ -3871,6 +3961,12 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag,
cur->stringBlock = package->header->index;
cur->map.name.ident = newName;
cur->map.value.copyFrom_dtoh(map->value);
+ status_t err = grp->dynamicRefTable.lookupResourceValue(&cur->map.value);
+ if (err != NO_ERROR) {
+ ALOGE("Reference item(0x%08x) in bag could not be resolved.", cur->map.value.data);
+ return UNKNOWN_ERROR;
+ }
+
TABLE_NOISY(printf("Setting entry #%d %p: block=%d, name=0x%08x, type=%d, data=0x%08x\n",
curEntry, cur, cur->stringBlock, cur->map.name.ident,
cur->map.value.dataType, cur->map.value.data));
@@ -4568,16 +4664,20 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
return false;
}
}
- if (!accessor) {
- outValue->data = rid;
- return true;
+
+ if (accessor) {
+ rid = Res_MAKEID(
+ accessor->getRemappedPackage(Res_GETPACKAGE(rid)),
+ Res_GETTYPE(rid), Res_GETENTRY(rid));
+ TABLE_NOISY(printf("Incl %s:%s/%s: 0x%08x\n",
+ String8(package).string(), String8(type).string(),
+ String8(name).string(), rid));
+ }
+
+ uint32_t packageId = Res_GETPACKAGE(rid) + 1;
+ if (packageId != APP_PACKAGE_ID && packageId != SYS_PACKAGE_ID) {
+ outValue->dataType = Res_value::TYPE_DYNAMIC_REFERENCE;
}
- rid = Res_MAKEID(
- accessor->getRemappedPackage(Res_GETPACKAGE(rid)),
- Res_GETTYPE(rid), Res_GETENTRY(rid));
- TABLE_NOISY(printf("Incl %s:%s/%s: 0x%08x\n",
- String8(package).string(), String8(type).string(),
- String8(name).string(), rid));
outValue->data = rid;
return true;
}
@@ -4589,8 +4689,17 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
TABLE_NOISY(printf("Pckg %s:%s/%s: 0x%08x\n",
String8(package).string(), String8(type).string(),
String8(name).string(), rid));
- outValue->data = rid;
- return true;
+ uint32_t packageId = Res_GETPACKAGE(rid) + 1;
+ if (packageId == 0x00) {
+ outValue->data = rid;
+ outValue->dataType = Res_value::TYPE_DYNAMIC_REFERENCE;
+ return true;
+ } else if (packageId == APP_PACKAGE_ID || packageId == SYS_PACKAGE_ID) {
+ // We accept packageId's generated as 0x01 in order to support
+ // building the android system resources
+ outValue->data = rid;
+ return true;
+ }
}
}
}
@@ -5122,15 +5231,15 @@ size_t ResTable::getBasePackageCount() const
return mPackageGroups.size();
}
-const char16_t* ResTable::getBasePackageName(size_t idx) const
+const String16 ResTable::getBasePackageName(size_t idx) const
{
if (mError != NO_ERROR) {
- return 0;
+ return String16();
}
LOG_FATAL_IF(idx >= mPackageGroups.size(),
"Requested package index %d past package count %d",
(int)idx, (int)mPackageGroups.size());
- return mPackageGroups[idx]->name.string();
+ return mPackageGroups[idx]->name;
}
uint32_t ResTable::getBasePackageId(size_t idx) const
@@ -5159,6 +5268,21 @@ int32_t ResTable::getTableCookie(size_t index) const
return mHeaders[index]->cookie;
}
+const DynamicRefTable* ResTable::getDynamicRefTableForCookie(int32_t cookie) const
+{
+ const size_t N = mPackageGroups.size();
+ for (size_t i = 0; i < N; i++) {
+ const PackageGroup* pg = mPackageGroups[i];
+ size_t M = pg->packages.size();
+ for (size_t j = 0; j < M; j++) {
+ if (pg->packages[j]->header->cookie == cookie) {
+ return &pg->dynamicRefTable;
+ }
+ }
+ }
+ return NULL;
+}
+
void ResTable::getConfigurations(Vector<ResTable_config>* configs) const
{
const size_t I = mPackageGroups.size();
@@ -5300,10 +5424,9 @@ ssize_t ResTable::getEntry(
}
offset += dtohl(type->entriesStart);
- TABLE_NOISY(aout << "Looking in resource table " << package->header->header
- << ", typeOff="
- << (void*)(((const char*)type)-((const char*)package->header->header))
- << ", offset=" << (void*)offset << endl);
+ TABLE_NOISY(ALOGD("Looking in resource table %p, typeOff=%p, offset=%p",
+ package->header->header, (void*)(((const char*)type)-((const char*)package->header->header)),
+ (void*)offset));
if (offset > (dtohl(type->header.size)-sizeof(ResTable_entry))) {
ALOGW("ResTable_entry at 0x%x is beyond type chunk data 0x%x",
@@ -5377,6 +5500,11 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
if (package == NULL) {
return (mError=NO_MEMORY);
}
+
+ if (id == 0) {
+ // This is a library so assign an ID
+ id = mNextPackageId++;
+ }
size_t idx = mPackageMap[id];
if (idx == 0) {
@@ -5413,6 +5541,13 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
group->basePackage = package;
mPackageMap[id] = (uint8_t)idx;
+
+ // Find all packages that reference this package
+ size_t N = mPackageGroups.size();
+ for (size_t i = 0; i < N; i++) {
+ mPackageGroups[i]->dynamicRefTable.addMapping(
+ group->name, static_cast<uint8_t>(group->id));
+ }
} else {
group = mPackageGroups.itemAt(idx-1);
if (group == NULL) {
@@ -5457,7 +5592,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
(void*)(base-(const uint8_t*)chunk),
dtohs(typeSpec->header.type),
dtohs(typeSpec->header.headerSize),
- (void*)typeSize));
+ (void*)typeSpecSize));
// look for block overrun or int overflow when multiplying by 4
if ((dtohl(typeSpec->entryCount) > (INT32_MAX/sizeof(uint32_t))
|| dtohs(typeSpec->header.headerSize)+(sizeof(uint32_t)*dtohl(typeSpec->entryCount))
@@ -5543,6 +5678,21 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
ALOGI("Adding config to type %d: %s\n",
type->id, thisConfig.toString().string()));
t->configs.add(type);
+ } else if (ctype == RES_TABLE_LIBRARY_TYPE) {
+ if (group->dynamicRefTable.entries().size() == 0) {
+ status_t err = group->dynamicRefTable.load((const ResTable_lib_header*) chunk);
+ if (err != NO_ERROR) {
+ return (mError=err);
+ }
+
+ // Fill in the reference table with the entries we already know about.
+ size_t N = mPackageGroups.size();
+ for (size_t i = 0; i < N; i++) {
+ group->dynamicRefTable.addMapping(mPackageGroups[i]->name, mPackageGroups[i]->id);
+ }
+ } else {
+ ALOGW("Found multiple library tables, ignoring...");
+ }
} else {
status_t err = validate_chunk(chunk, sizeof(ResChunk_header),
endPos, "ResTable_package:unknown");
@@ -5561,6 +5711,103 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
return NO_ERROR;
}
+DynamicRefTable::DynamicRefTable(uint8_t packageId)
+ : mAssignedPackageId(packageId)
+{
+ memset(mLookupTable, 0, sizeof(mLookupTable));
+
+ // Reserved package ids
+ mLookupTable[APP_PACKAGE_ID] = APP_PACKAGE_ID;
+ mLookupTable[SYS_PACKAGE_ID] = SYS_PACKAGE_ID;
+}
+
+status_t DynamicRefTable::load(const ResTable_lib_header* const header)
+{
+ const uint32_t entryCount = dtohl(header->count);
+ const uint32_t sizeOfEntries = sizeof(ResTable_lib_entry) * entryCount;
+ const uint32_t expectedSize = dtohl(header->header.size) - dtohl(header->header.headerSize);
+ if (sizeOfEntries > expectedSize) {
+ ALOGE("ResTable_lib_header size %u is too small to fit %u entries (x %u).",
+ expectedSize, entryCount, (uint32_t)sizeof(ResTable_lib_entry));
+ return UNKNOWN_ERROR;
+ }
+
+ const ResTable_lib_entry* entry = (const ResTable_lib_entry*)(((uint8_t*) header) +
+ dtohl(header->header.headerSize));
+ for (uint32_t entryIndex = 0; entryIndex < entryCount; entryIndex++) {
+ uint32_t packageId = dtohl(entry->packageId);
+ char16_t tmpName[sizeof(entry->packageName) / sizeof(char16_t)];
+ strcpy16_dtoh(tmpName, entry->packageName, sizeof(entry->packageName) / sizeof(char16_t));
+ LIB_NOISY(ALOGV("Found lib entry %s with id %d\n", String8(tmpName).string(),
+ dtohl(entry->packageId)));
+ if (packageId >= 256) {
+ ALOGE("Bad package id 0x%08x", packageId);
+ return UNKNOWN_ERROR;
+ }
+ mEntries.replaceValueFor(String16(tmpName), (uint8_t) packageId);
+ entry = entry + 1;
+ }
+ return NO_ERROR;
+}
+
+status_t DynamicRefTable::addMapping(const String16& packageName, uint8_t packageId)
+{
+ ssize_t index = mEntries.indexOfKey(packageName);
+ if (index < 0) {
+ return UNKNOWN_ERROR;
+ }
+ mLookupTable[mEntries.valueAt(index)] = packageId;
+ return NO_ERROR;
+}
+
+status_t DynamicRefTable::lookupResourceId(uint32_t* resId) const {
+ uint32_t res = *resId;
+ size_t packageId = Res_GETPACKAGE(res) + 1;
+
+ if (packageId == APP_PACKAGE_ID) {
+ // No lookup needs to be done, app package IDs are absolute.
+ return NO_ERROR;
+ }
+
+ if (packageId == 0) {
+ // The package ID is 0x00. That means that a shared library is accessing
+ // its own local resource, so we fix up the resource with the calling
+ // package ID.
+ *resId |= ((uint32_t) mAssignedPackageId) << 24;
+ return NO_ERROR;
+ }
+
+ // Do a proper lookup.
+ uint8_t translatedId = mLookupTable[packageId];
+ if (translatedId == 0) {
+ ALOGV("DynamicRefTable(0x%02x): No mapping for build-time package ID 0x%02x.",
+ (uint8_t)mAssignedPackageId, (uint8_t)packageId);
+ for (size_t i = 0; i < 256; i++) {
+ if (mLookupTable[i] != 0) {
+ ALOGV("e[0x%02x] -> 0x%02x", (uint8_t)i, mLookupTable[i]);
+ }
+ }
+ return UNKNOWN_ERROR;
+ }
+
+ *resId = (res & 0x00ffffff) | (((uint32_t) translatedId) << 24);
+ return NO_ERROR;
+}
+
+status_t DynamicRefTable::lookupResourceValue(Res_value* value) const {
+ if (value->dataType != Res_value::TYPE_DYNAMIC_REFERENCE) {
+ return NO_ERROR;
+ }
+
+ status_t err = lookupResourceId(&value->data);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ value->dataType = Res_value::TYPE_REFERENCE;
+ return NO_ERROR;
+}
+
status_t ResTable::createIdmap(const ResTable& overlay,
uint32_t targetCrc, uint32_t overlayCrc,
const char* targetPath, const char* overlayPath,
@@ -5701,7 +5948,7 @@ status_t ResTable::createIdmap(const ResTable& overlay,
continue;
}
if (N == 1) { // vector expected to hold (offset) + (N > 0 entries)
- ALOGW("idmap: type %d supposedly has entries, but no entries found\n", i);
+ ALOGW("idmap: type %u supposedly has entries, but no entries found\n", (uint32_t)i);
return UNKNOWN_ERROR;
}
*data++ = htodl(N - 1); // do not count the offset (which is vector's first element)
@@ -5815,6 +6062,8 @@ void ResTable::print_value(const Package* pkg, const Res_value& value) const
printf("(null)\n");
} else if (value.dataType == Res_value::TYPE_REFERENCE) {
printf("(reference) 0x%08x\n", value.data);
+ } else if (value.dataType == Res_value::TYPE_DYNAMIC_REFERENCE) {
+ printf("(dynamic reference) 0x%08x\n", value.data);
} else if (value.dataType == Res_value::TYPE_ATTRIBUTE) {
printf("(attribute) 0x%08x\n", value.data);
} else if (value.dataType == Res_value::TYPE_STRING) {
@@ -5897,6 +6146,11 @@ void ResTable::print(bool inclValues) const
uint32_t resID = (0xff000000 & ((pkg->package->id)<<24))
| (0x00ff0000 & ((typeIndex+1)<<16))
| (0x0000ffff & (entryIndex));
+ // Since we are creating resID without actually
+ // iterating over them, we have no idea which is a
+ // dynamic reference. We must check.
+ pg->dynamicRefTable.lookupResourceId(&resID);
+
resource_name resName;
if (this->getResourceName(resID, true, &resName)) {
String8 type8;
@@ -5956,6 +6210,7 @@ void ResTable::print(bool inclValues) const
uint32_t resID = (0xff000000 & ((pkg->package->id)<<24))
| (0x00ff0000 & ((typeIndex+1)<<16))
| (0x0000ffff & (entryIndex));
+ pg->dynamicRefTable.lookupResourceId(&resID);
resource_name resName;
if (this->getResourceName(resID, true, &resName)) {
String8 type8;
@@ -6034,8 +6289,14 @@ void ResTable::print(bool inclValues) const
const uint8_t* baseMapPtr = (const uint8_t*)ent;
size_t mapOffset = esize;
const ResTable_map* mapPtr = (ResTable_map*)(baseMapPtr+mapOffset);
- printf(" Parent=0x%08x, Count=%d\n",
- dtohl(bagPtr->parent.ident), N);
+ const uint32_t parent = dtohl(bagPtr->parent.ident);
+ uint32_t resolvedParent = parent;
+ status_t err = pg->dynamicRefTable.lookupResourceId(&resolvedParent);
+ if (err != NO_ERROR) {
+ resolvedParent = 0;
+ }
+ printf(" Parent=0x%08x(Resolved=0x%08x), Count=%d\n",
+ parent, resolvedParent, N);
for (int i=0; i<N && mapOffset < (typeSize-sizeof(ResTable_map)); i++) {
printf(" #%i (Key=0x%08x): ",
i, dtohl(mapPtr->name.ident));
diff --git a/libs/androidfw/tests/ObbFile_test.cpp b/libs/androidfw/tests/ObbFile_test.cpp
index 2c9f650..7a4dd13 100644
--- a/libs/androidfw/tests/ObbFile_test.cpp
+++ b/libs/androidfw/tests/ObbFile_test.cpp
@@ -91,7 +91,7 @@ TEST_F(ObbFileTest, WriteThenRead) {
EXPECT_EQ(sizeof(salt), saltLen)
<< "salt sizes were not the same";
- for (int i = 0; i < sizeof(salt); i++) {
+ for (size_t i = 0; i < sizeof(salt); i++) {
EXPECT_EQ(salt[i], newSalt[i])
<< "salt character " << i << " should be equal";
}
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 549b786..9e367fc 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -21,6 +21,8 @@
#define LOG_TAG "OpenGLRenderer"
#endif
+#include <SkPath.h>
+#include <SkPathOps.h>
#include <SkXfermode.h>
#include <private/hwui/DrawGlInfo.h>
@@ -1550,20 +1552,27 @@ private:
*/
class DrawShadowOp : public DrawOp {
public:
- DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float alpha, const SkPath* outline,
- float fallbackWidth, float fallbackHeight)
- : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ),
- mAlpha(alpha), mOutline(outline),
- mFallbackWidth(fallbackWidth), mFallbackHeight(fallbackHeight) {}
+ DrawShadowOp(const mat4& transformXY, const mat4& transformZ, float alpha,
+ float fallbackWidth, float fallbackHeight,
+ const SkPath* outline, const SkPath* revealClip)
+ : DrawOp(NULL), mTransformXY(transformXY), mTransformZ(transformZ), mAlpha(alpha),
+ mFallbackWidth(fallbackWidth), mFallbackHeight(fallbackHeight),
+ mOutline(outline), mRevealClip(revealClip) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
- if (mOutline->isEmpty()) {
- SkPath fakeOutline;
- fakeOutline.addRect(0, 0, mFallbackWidth, mFallbackHeight);
- return renderer.drawShadow(mTransformXY, mTransformZ, mAlpha, &fakeOutline);
+ SkPath casterPerimeter;
+ if (!mOutline || mOutline->isEmpty()) {
+ casterPerimeter.addRect(0, 0, mFallbackWidth, mFallbackHeight);
+ } else {
+ casterPerimeter = *mOutline;
+ }
+
+ if (mRevealClip) {
+ // intersect the outline with the convex reveal clip
+ Op(casterPerimeter, *mRevealClip, kIntersect_PathOp, &casterPerimeter);
}
- return renderer.drawShadow(mTransformXY, mTransformZ, mAlpha, mOutline);
+ return renderer.drawShadow(mTransformXY, mTransformZ, mAlpha, &casterPerimeter);
}
virtual void output(int level, uint32_t logFlags) const {
@@ -1576,9 +1585,12 @@ private:
const mat4 mTransformXY;
const mat4 mTransformZ;
const float mAlpha;
- const SkPath* mOutline;
const float mFallbackWidth;
const float mFallbackHeight;
+
+ // these point at convex SkPaths owned by RenderProperties, or null
+ const SkPath* mOutline;
+ const SkPath* mRevealClip;
};
class DrawLayerOp : public DrawOp {
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index cdd789d..d808735 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1919,6 +1919,7 @@ status_t OpenGLRenderer::drawDisplayList(RenderNode* displayList, Rect& dirty,
// will be performed by the display list itself
if (displayList && displayList->isRenderable()) {
// compute 3d ordering
+ displayList->updateProperties();
displayList->computeOrdering();
if (CC_UNLIKELY(mCaches.drawDeferDisabled)) {
status = startFrame();
@@ -3202,7 +3203,7 @@ static void mapPointFakeZ(Vector3& point, const mat4& transformXY, const mat4& t
}
status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ,
- float casterAlpha, const SkPath* casterOutline) {
+ float casterAlpha, const SkPath* casterPerimeter) {
if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone;
// TODO: use quickRejectWithScissor. For now, always force enable scissor.
@@ -3214,7 +3215,7 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& c
// tessellate caster outline into a 2d polygon
Vector<Vertex> casterVertices2d;
const float casterRefinementThresholdSquared = 20.0f; // TODO: experiment with this value
- PathTessellator::approximatePathOutlineVertices(*casterOutline,
+ PathTessellator::approximatePathOutlineVertices(*casterPerimeter,
casterRefinementThresholdSquared, casterVertices2d);
if (casterVertices2d.size() == 0) {
@@ -3256,7 +3257,7 @@ status_t OpenGLRenderer::drawShadow(const mat4& casterTransformXY, const mat4& c
// We only have ortho projection, so we can just ignore the Z in caster for
// simple rejection calculation.
Rect localClip = mSnapshot->getLocalClip();
- Rect casterBounds(casterOutline->getBounds());
+ Rect casterBounds(casterPerimeter->getBounds());
casterTransformXY.mapRect(casterBounds);
bool isCasterOpaque = (casterAlpha == 1.0f);
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 059c64f..054767e 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -210,7 +210,7 @@ public:
virtual status_t drawRects(const float* rects, int count, const SkPaint* paint);
status_t drawShadow(const mat4& casterTransformXY, const mat4& casterTransformZ,
- float casterAlpha, const SkPath* casterOutline);
+ float casterAlpha, const SkPath* casterPerimeter);
virtual void resetShader();
virtual void setupShader(SkiaShader* shader);
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h
index 4e496e7..530be30 100644
--- a/libs/hwui/Outline.h
+++ b/libs/hwui/Outline.h
@@ -58,7 +58,6 @@ public:
mShouldClip = clip;
}
-
bool willClip() const {
// only round rect outlines can be used for clipping
return mShouldClip && (mType == kOutlineType_RoundRect);
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp
index b2148b0..442e9ba 100644
--- a/libs/hwui/Patch.cpp
+++ b/libs/hwui/Patch.cpp
@@ -36,6 +36,7 @@ Patch::Patch(): vertices(NULL), verticesCount(0), indexCount(0), hasEmptyQuads(f
}
Patch::~Patch() {
+ delete[] vertices;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index 8a44604..2f2debc 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -119,6 +119,17 @@ void PatchCache::remove(Vector<patch_pair_t>& patchesToRemove, Res_png_9patch* p
void PatchCache::removeDeferred(Res_png_9patch* patch) {
Mutex::Autolock _l(mLock);
+
+ // Assert that patch is not already garbage
+ size_t count = mGarbage.size();
+ for (size_t i = 0; i < count; i++) {
+ if (patch == mGarbage[i]) {
+ patch = NULL;
+ break;
+ }
+ }
+ LOG_ALWAYS_FATAL_IF(patch == NULL);
+
mGarbage.push(patch);
}
@@ -143,8 +154,8 @@ void PatchCache::clearGarbage() {
for (size_t i = 0; i < patchesToRemove.size(); i++) {
const patch_pair_t& pair = patchesToRemove[i];
- // Add a new free block to the list
- const Patch* patch = pair.getSecond();
+ // Release the patch and mark the space in the free list
+ Patch* patch = pair.getSecond();
BufferBlock* block = new BufferBlock(patch->offset, patch->getSize());
block->next = mFreeBlocks;
mFreeBlocks = block;
@@ -152,6 +163,7 @@ void PatchCache::clearGarbage() {
mSize -= patch->getSize();
mCache.remove(*pair.getFirst());
+ delete patch;
}
#if DEBUG_PATCHES
@@ -216,6 +228,7 @@ void PatchCache::setupMesh(Patch* newMesh, TextureVertex* vertices) {
} else {
mFreeBlocks = block->next;
}
+ delete block;
} else {
// Resize the block now that it's occupied
block->offset += size;
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index d3daec8..e39e5ae 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -152,18 +152,21 @@ void RenderNode::setViewProperties(OpenGLRenderer& renderer, T& handler,
}
SaveLayerOp* op = new (handler.allocator()) SaveLayerOp(
- 0, 0, properties().getWidth(), properties().getHeight(), properties().getAlpha() * 255, saveFlags);
+ 0, 0, properties().getWidth(), properties().getHeight(),
+ properties().getAlpha() * 255, saveFlags);
handler(op, PROPERTY_SAVECOUNT, properties().getClipToBounds());
}
}
if (clipToBoundsNeeded) {
- ClipRectOp* op = new (handler.allocator()) ClipRectOp(0, 0,
- properties().getWidth(), properties().getHeight(), SkRegion::kIntersect_Op);
+ ClipRectOp* op = new (handler.allocator()) ClipRectOp(
+ 0, 0, properties().getWidth(), properties().getHeight(), SkRegion::kIntersect_Op);
handler(op, PROPERTY_SAVECOUNT, properties().getClipToBounds());
}
- if (CC_UNLIKELY(properties().getOutline().willClip())) {
- ClipPathOp* op = new (handler.allocator()) ClipPathOp(properties().getOutline().getPath(),
- SkRegion::kIntersect_Op);
+
+ if (CC_UNLIKELY(properties().hasClippingPath())) {
+ // TODO: optimize for round rect/circle clipping
+ const SkPath* path = properties().getClippingPath();
+ ClipPathOp* op = new (handler.allocator()) ClipPathOp(path, SkRegion::kIntersect_Op);
handler(op, PROPERTY_SAVECOUNT, properties().getClipToBounds());
}
}
@@ -408,10 +411,15 @@ void RenderNode::iterate3dChildren(const Vector<ZDrawDisplayListOpPair>& zTransl
mat4 shadowMatrixZ(casterOp->mTransformFromParent);
caster->applyViewPropertyTransforms(shadowMatrixZ, true);
+ const SkPath* outlinePath = caster->properties().getOutline().getPath();
+ const RevealClip& revealClip = caster->properties().getRevealClip();
+ const SkPath* revealClipPath = revealClip.hasConvexClip()
+ ? revealClip.getPath() : NULL; // only pass the reveal clip's path if it's convex
+
DisplayListOp* shadowOp = new (alloc) DrawShadowOp(
- shadowMatrixXY, shadowMatrixZ,
- caster->properties().getAlpha(), caster->properties().getOutline().getPath(),
- caster->properties().getWidth(), caster->properties().getHeight());
+ shadowMatrixXY, shadowMatrixZ, caster->properties().getAlpha(),
+ caster->properties().getWidth(), caster->properties().getHeight(),
+ outlinePath, revealClipPath);
handler(shadowOp, PROPERTY_SAVECOUNT, properties().getClipToBounds());
}
@@ -498,7 +506,8 @@ void RenderNode::iterate(OpenGLRenderer& renderer, T& handler, const int level)
setViewProperties<T>(renderer, handler, level + 1);
- bool quickRejected = properties().getClipToBounds() && renderer.quickRejectConservative(0, 0, properties().getWidth(), properties().getHeight());
+ bool quickRejected = properties().getClipToBounds()
+ && renderer.quickRejectConservative(0, 0, properties().getWidth(), properties().getHeight());
if (!quickRejected) {
Vector<ZDrawDisplayListOpPair> zTranslatedNodes;
buildZSortedChildList(zTranslatedNodes);
diff --git a/libs/hwui/RenderProperties.cpp b/libs/hwui/RenderProperties.cpp
index ca291a6..3975a76 100644
--- a/libs/hwui/RenderProperties.cpp
+++ b/libs/hwui/RenderProperties.cpp
@@ -22,6 +22,8 @@
#include <SkCanvas.h>
#include <SkMatrix.h>
+#include <SkPath.h>
+#include <SkPathOps.h>
#include "Matrix.h"
@@ -51,13 +53,15 @@ RenderProperties::PrimitiveFields::PrimitiveFields()
RenderProperties::ComputedFields::ComputedFields()
: mTransformMatrix(NULL)
, mTransformCamera(NULL)
- , mTransformMatrix3D(NULL) {
+ , mTransformMatrix3D(NULL)
+ , mClipPath(NULL) {
}
RenderProperties::ComputedFields::~ComputedFields() {
delete mTransformMatrix;
delete mTransformCamera;
delete mTransformMatrix3D;
+ delete mClipPath;
}
RenderProperties::RenderProperties()
@@ -80,6 +84,7 @@ RenderProperties& RenderProperties::operator=(const RenderProperties& other) {
// Update the computed fields
updateMatrix();
+ updateClipPath();
}
return *this;
}
@@ -181,5 +186,39 @@ void RenderProperties::updateMatrix() {
}
}
+void RenderProperties::updateClipPath() {
+ const SkPath* outlineClipPath = mPrimitiveFields.mOutline.willClip()
+ ? mPrimitiveFields.mOutline.getPath() : NULL;
+ const SkPath* revealClipPath = mPrimitiveFields.mRevealClip.getPath();
+
+ if (!outlineClipPath && !revealClipPath) {
+ // mComputedFields.mClipPath doesn't need to be updated, since it won't be used
+ return;
+ }
+
+ if (mComputedFields.mClipPath == NULL) {
+ mComputedFields.mClipPath = new SkPath();
+ }
+ SkPath* clipPath = mComputedFields.mClipPath;
+ mComputedFields.mClipPathOp = SkRegion::kIntersect_Op;
+
+ if (outlineClipPath && revealClipPath) {
+ SkPathOp op = kIntersect_PathOp;
+ if (mPrimitiveFields.mRevealClip.isInverseClip()) {
+ op = kDifference_PathOp; // apply difference step in the Op below, instead of draw time
+ }
+
+ Op(*outlineClipPath, *revealClipPath, op, clipPath);
+ } else if (outlineClipPath) {
+ *clipPath = *outlineClipPath;
+ } else {
+ *clipPath = *revealClipPath;
+ if (mPrimitiveFields.mRevealClip.isInverseClip()) {
+ // apply difference step at draw time
+ mComputedFields.mClipPathOp = SkRegion::kDifference_Op;
+ }
+ }
+}
+
} /* namespace uirenderer */
} /* namespace android */
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 504196d..061e469 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -22,8 +22,10 @@
#include <SkCamera.h>
#include <SkMatrix.h>
+#include <SkRegion.h>
#include "Rect.h"
+#include "RevealClip.h"
#include "Outline.h"
#define TRANSLATION 0x0001
@@ -34,7 +36,6 @@
class SkBitmap;
class SkPaint;
-class SkRegion;
namespace android {
namespace uirenderer {
@@ -415,6 +416,10 @@ public:
return mPrimitiveFields.mOutline;
}
+ const RevealClip& getRevealClip() const {
+ return mPrimitiveFields.mRevealClip;
+ }
+
bool getProjectBackwards() const {
return mPrimitiveFields.mProjectBackwards;
}
@@ -423,10 +428,29 @@ public:
ANDROID_API void updateMatrix();
+ ANDROID_API void updateClipPath();
+
+ // signals that mComputedFields.mClipPath is up to date, and should be used for clipping
+ bool hasClippingPath() const {
+ return mPrimitiveFields.mOutline.willClip() || mPrimitiveFields.mRevealClip.willClip();
+ }
+
+ const SkPath* getClippingPath() const {
+ return hasClippingPath() ? mComputedFields.mClipPath : NULL;
+ }
+
+ SkRegion::Op getClippingPathOp() const {
+ return mComputedFields.mClipPathOp;
+ }
+
Outline& mutableOutline() {
return mPrimitiveFields.mOutline;
}
+ RevealClip& mutableRevealClip() {
+ return mPrimitiveFields.mRevealClip;
+ }
+
private:
void onTranslationUpdate() {
mPrimitiveFields.mMatrixDirty = true;
@@ -442,6 +466,7 @@ private:
PrimitiveFields();
Outline mOutline;
+ RevealClip mRevealClip;
bool mClipToBounds;
bool mProjectBackwards;
bool mProjectionReceiver;
@@ -483,6 +508,8 @@ private:
Matrix4* mTransformMatrix;
Sk3DView* mTransformCamera;
SkMatrix* mTransformMatrix3D;
+ SkPath* mClipPath; // TODO: remove this, create new ops for efficient/special case clipping
+ SkRegion::Op mClipPathOp;
} mComputedFields;
};
diff --git a/libs/hwui/RevealClip.h b/libs/hwui/RevealClip.h
new file mode 100644
index 0000000..ece8498
--- /dev/null
+++ b/libs/hwui/RevealClip.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef REVEALCLIP_H
+#define REVEALCLIP_H
+
+#include <SkPath.h>
+
+#include "Rect.h"
+
+namespace android {
+namespace uirenderer {
+
+class RevealClip {
+public:
+ RevealClip()
+ : mShouldClip(false)
+ , mInverseClip(false)
+ , mX(0)
+ , mY(0)
+ , mRadius(0) {}
+
+ void set(bool shouldClip, bool inverseClip, float x, float y, float radius) {
+ mShouldClip = shouldClip;
+ mInverseClip = inverseClip;
+ mX = x;
+ mY = y;
+ mRadius = radius;
+
+ mPath.rewind();
+ if (mShouldClip) {
+ mPath.addCircle(x, y, radius);
+ }
+ }
+
+ bool hasConvexClip() const {
+ return mShouldClip && !mInverseClip;
+ }
+
+ bool isInverseClip() const {
+ return mInverseClip;
+ }
+
+ bool willClip() const {
+ return mShouldClip;
+ }
+
+ const SkPath* getPath() const {
+ if (!mShouldClip) return NULL;
+
+ return &mPath;
+ }
+
+private:
+ bool mShouldClip;
+ bool mInverseClip;
+ float mX;
+ float mY;
+ float mRadius;
+ SkPath mPath;
+};
+
+} /* namespace uirenderer */
+} /* namespace android */
+
+#endif /* REVEALCLIP_H */
diff --git a/media/java/android/media/MediaFocusControl.java b/media/java/android/media/MediaFocusControl.java
index 1016dd4..f688d81 100644
--- a/media/java/android/media/MediaFocusControl.java
+++ b/media/java/android/media/MediaFocusControl.java
@@ -32,6 +32,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.database.ContentObserver;
+import android.media.PlayerRecord.RemotePlaybackState;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
@@ -73,8 +74,7 @@ public class MediaFocusControl implements OnFinished {
private boolean mIsRinging = false;
private final PowerManager.WakeLock mMediaEventWakeLock;
- //FIXME should be private
- protected final MediaEventHandler mEventHandler;
+ private final MediaEventHandler mEventHandler;
private final Context mContext;
private final ContentResolver mContentResolver;
private final VolumeController mVolumeController;
@@ -120,6 +120,9 @@ public class MediaFocusControl implements OnFinished {
mHasRemotePlayback = false;
mMainRemoteIsActive = false;
+
+ PlayerRecord.setMediaFocusControl(this);
+
postReevaluateRemote();
}
@@ -251,7 +254,7 @@ public class MediaFocusControl implements OnFinished {
currentUser);
if (DEBUG_RC) { Log.d(TAG, " > enabled list: " + enabledNotifListeners); }
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// check whether the "enable" status of each RCD with a notification listener
// has changed
final String[] enabledComponents;
@@ -330,6 +333,7 @@ public class MediaFocusControl implements OnFinished {
private static final int MSG_RCC_UPDATE_METADATA = 9;
private static final int MSG_RCDISPLAY_INIT_INFO = 10;
private static final int MSG_REEVALUATE_RCD = 11;
+ private static final int MSG_UNREGISTER_MEDIABUTTONINTENT = 12;
// sendMsg() flags
/** If the msg is already queued, replace it with this one. */
@@ -351,8 +355,7 @@ public class MediaFocusControl implements OnFinished {
handler.sendMessageDelayed(handler.obtainMessage(msg, arg1, arg2, obj), delay);
}
- //FIXME should be private
- protected class MediaEventHandler extends Handler {
+ private class MediaEventHandler extends Handler {
MediaEventHandler(Looper looper) {
super(looper);
}
@@ -370,7 +373,7 @@ public class MediaFocusControl implements OnFinished {
case MSG_RCDISPLAY_UPDATE:
// msg.obj is guaranteed to be non null
- onRcDisplayUpdate( (MediaController) msg.obj, msg.arg1);
+ onRcDisplayUpdate( (PlayerRecord) msg.obj, msg.arg1);
break;
case MSG_REEVALUATE_REMOTE:
@@ -390,7 +393,7 @@ public class MediaFocusControl implements OnFinished {
case MSG_RCC_NEW_PLAYBACK_STATE:
onNewPlaybackStateForRcc(msg.arg1 /* rccId */,
msg.arg2 /* state */,
- (MediaController.RccPlaybackState)msg.obj /* newState */);
+ (PlayerRecord.RccPlaybackState)msg.obj /* newState */);
break;
case MSG_RCC_SEEK_REQUEST:
@@ -416,6 +419,10 @@ public class MediaFocusControl implements OnFinished {
case MSG_REEVALUATE_RCD:
onReevaluateRemoteControlDisplays();
break;
+
+ case MSG_UNREGISTER_MEDIABUTTONINTENT:
+ unregisterMediaButtonIntent( (PendingIntent) msg.obj );
+ break;
}
}
}
@@ -465,7 +472,7 @@ public class MediaFocusControl implements OnFinished {
exFocusOwner.handleFocusLoss(AudioManager.AUDIOFOCUS_LOSS);
exFocusOwner.release();
// clear RCD
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
clearRemoteControlDisplay_syncAfRcs();
}
}
@@ -529,7 +536,7 @@ public class MediaFocusControl implements OnFinished {
// notify the new top of the stack it gained focus
notifyTopOfAudioFocusStack();
// there's a new top of the stack, let the remote control know
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
}
}
@@ -576,7 +583,7 @@ public class MediaFocusControl implements OnFinished {
// notify the new top of the stack it gained focus.
notifyTopOfAudioFocusStack();
// there's a new top of the stack, let the remote control know
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
}
}
@@ -688,7 +695,7 @@ public class MediaFocusControl implements OnFinished {
clientId, afdh, callingPackageName, Binder.getCallingUid()));
// there's a new top of the stack, let the remote control know
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
}
}//synchronized(mAudioFocusLock)
@@ -752,7 +759,7 @@ public class MediaFocusControl implements OnFinished {
}
// event filtering for telephony
synchronized(mRingingLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
if ((mMediaReceiverForCalls != null) &&
(mIsRinging || (mAudioService.getMode() == AudioSystem.MODE_IN_CALL))) {
dispatchMediaKeyEventForCalls(keyEvent, needWakeLock);
@@ -805,15 +812,15 @@ public class MediaFocusControl implements OnFinished {
}
Intent keyIntent = new Intent(Intent.ACTION_MEDIA_BUTTON, null);
keyIntent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
- synchronized(mMCStack) {
- if (!mMCStack.empty()) {
+ synchronized(mPRStack) {
+ if (!mPRStack.empty()) {
// send the intent that was registered by the client
try {
- mMCStack.peek().mMediaIntent.send(mContext,
+ mPRStack.peek().getMediaButtonIntent().send(mContext,
needWakeLock ? WAKELOCK_RELEASE_ON_FINISHED : 0 /*code*/,
keyIntent, this, mEventHandler);
} catch (CanceledException e) {
- Log.e(TAG, "Error sending pending intent " + mMCStack.peek());
+ Log.e(TAG, "Error sending pending intent " + mPRStack.peek());
e.printStackTrace();
}
} else {
@@ -1023,7 +1030,7 @@ public class MediaFocusControl implements OnFinished {
};
/**
- * Synchronization on mCurrentRcLock always inside a block synchronized on mMCStack
+ * Synchronization on mCurrentRcLock always inside a block synchronized on mPRStack
*/
private final Object mCurrentRcLock = new Object();
/**
@@ -1052,47 +1059,6 @@ public class MediaFocusControl implements OnFinished {
*/
private int mCurrentRcClientGen = 0;
- /**
- * Inner class to monitor remote control client deaths, and remove the client for the
- * remote control stack if necessary.
- */
- protected class RcClientDeathHandler implements IBinder.DeathRecipient {
- //FIXME should be private
- final protected IBinder mCb; // To be notified of client's death
- final private PendingIntent mMediaIntent;
-
- RcClientDeathHandler(IBinder cb, PendingIntent pi) {
- mCb = cb;
- mMediaIntent = pi;
- }
-
- public void binderDied() {
- Log.w(TAG, " RemoteControlClient died");
- // remote control client died, make sure the displays don't use it anymore
- // by setting its remote control client to null
- registerRemoteControlClient(mMediaIntent, null/*rcClient*/, null/*ignored*/);
- // the dead client was maybe handling remote playback, reevaluate
- postReevaluateRemote();
- }
-
- public IBinder getBinder() {
- return mCb;
- }
- }
-
- protected class RemotePlaybackState {
- int mRccId;
- int mVolume;
- int mVolumeMax;
- int mVolumeHandling;
-
- private RemotePlaybackState(int id, int vol, int volMax) {
- mRccId = id;
- mVolume = vol;
- mVolumeMax = volMax;
- mVolumeHandling = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME_HANDLING;
- }
- }
/**
* Internal cache for the playback information of the RemoteControlClient whose volume gets to
@@ -1116,10 +1082,10 @@ public class MediaFocusControl implements OnFinished {
/**
* The stack of remote control event receivers.
* Code sections and methods that modify the remote control event receiver stack are
- * synchronized on mMCStack, but also BEFORE on mFocusLock as any change in either
+ * synchronized on mPRStack, but also BEFORE on mFocusLock as any change in either
* stack, audio focus or RC, can lead to a change in the remote control display
*/
- private final Stack<MediaController> mMCStack = new Stack<MediaController>();
+ private final Stack<PlayerRecord> mPRStack = new Stack<PlayerRecord>();
/**
* The component the telephony package can register so telephony calls have priority to
@@ -1133,17 +1099,10 @@ public class MediaFocusControl implements OnFinished {
*/
private void dumpRCStack(PrintWriter pw) {
pw.println("\nRemote Control stack entries (last is top of stack):");
- synchronized(mMCStack) {
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ synchronized(mPRStack) {
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- pw.println(" pi: " + mcse.mMediaIntent +
- " -- pack: " + mcse.mCallingPackageName +
- " -- ercvr: " + mcse.mReceiverComponent +
- " -- client: " + mcse.mRcClient +
- " -- uid: " + mcse.mCallingUid +
- " -- type: " + mcse.mPlaybackType +
- " state: " + mcse.mPlaybackState);
+ stackIterator.next().dump(pw, true);
}
}
}
@@ -1155,18 +1114,10 @@ public class MediaFocusControl implements OnFinished {
*/
private void dumpRCCStack(PrintWriter pw) {
pw.println("\nRemote Control Client stack entries (last is top of stack):");
- synchronized(mMCStack) {
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ synchronized(mPRStack) {
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- pw.println(" uid: " + mcse.mCallingUid +
- " -- id: " + mcse.mRccId +
- " -- type: " + mcse.mPlaybackType +
- " -- state: " + mcse.mPlaybackState +
- " -- vol handling: " + mcse.mPlaybackVolumeHandling +
- " -- vol: " + mcse.mPlaybackVolume +
- " -- volMax: " + mcse.mPlaybackVolumeMax +
- " -- volObs: " + mcse.mRemoteVolumeObs);
+ stackIterator.next().dump(pw, false);
}
synchronized(mCurrentRcLock) {
pw.println("\nCurrent remote control generation ID = " + mCurrentRcClientGen);
@@ -1191,7 +1142,7 @@ public class MediaFocusControl implements OnFinished {
*/
private void dumpRCDList(PrintWriter pw) {
pw.println("\nRemote Control Display list entries:");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator();
while (displayIterator.hasNext()) {
final DisplayInfoForServer di = displayIterator.next();
@@ -1210,47 +1161,49 @@ public class MediaFocusControl implements OnFinished {
* Pre-condition: packageName != null
*/
private void cleanupMediaButtonReceiverForPackage(String packageName, boolean removeAll) {
- synchronized(mMCStack) {
- if (mMCStack.empty()) {
+ synchronized(mPRStack) {
+ if (mPRStack.empty()) {
return;
} else {
final PackageManager pm = mContext.getPackageManager();
- MediaController oldTop = mMCStack.peek();
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ PlayerRecord oldTop = mPRStack.peek();
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
// iterate over the stack entries
// (using an iterator on the stack so we can safely remove an entry after having
// evaluated it, traversal order doesn't matter here)
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- if (removeAll && packageName.equals(mcse.mMediaIntent.getCreatorPackage())) {
+ PlayerRecord prse = stackIterator.next();
+ if (removeAll
+ && packageName.equals(prse.getMediaButtonIntent().getCreatorPackage()))
+ {
// a stack entry is from the package being removed, remove it from the stack
stackIterator.remove();
- mcse.destroy();
- } else if (mcse.mReceiverComponent != null) {
+ prse.destroy();
+ } else if (prse.getMediaButtonReceiver() != null) {
try {
// Check to see if this receiver still exists.
- pm.getReceiverInfo(mcse.mReceiverComponent, 0);
+ pm.getReceiverInfo(prse.getMediaButtonReceiver(), 0);
} catch (PackageManager.NameNotFoundException e) {
// Not found -- remove it!
stackIterator.remove();
- mcse.destroy();
+ prse.destroy();
}
}
}
- if (mMCStack.empty()) {
+ if (mPRStack.empty()) {
// no saved media button receiver
mEventHandler.sendMessage(
mEventHandler.obtainMessage(MSG_PERSIST_MEDIABUTTONRECEIVER, 0, 0,
null));
- } else if (oldTop != mMCStack.peek()) {
+ } else if (oldTop != mPRStack.peek()) {
// the top of the stack has changed, save it in the system settings
// by posting a message to persist it; only do this however if it has
// a concrete component name (is not a transient registration)
- MediaController mcse = mMCStack.peek();
- if (mcse.mReceiverComponent != null) {
+ PlayerRecord prse = mPRStack.peek();
+ if (prse.getMediaButtonReceiver() != null) {
mEventHandler.sendMessage(
mEventHandler.obtainMessage(MSG_PERSIST_MEDIABUTTONRECEIVER, 0, 0,
- mcse.mReceiverComponent));
+ prse.getMediaButtonReceiver()));
}
}
}
@@ -1284,28 +1237,28 @@ public class MediaFocusControl implements OnFinished {
/**
* Helper function:
* Set the new remote control receiver at the top of the RC focus stack.
- * Called synchronized on mAudioFocusLock, then mMCStack
+ * Called synchronized on mAudioFocusLock, then mPRStack
* precondition: mediaIntent != null
- * @return true if mMCStack was changed, false otherwise
+ * @return true if mPRStack was changed, false otherwise
*/
private boolean pushMediaButtonReceiver_syncAfRcs(PendingIntent mediaIntent,
ComponentName target, IBinder token) {
// already at top of stack?
- if (!mMCStack.empty() && mMCStack.peek().mMediaIntent.equals(mediaIntent)) {
+ if (!mPRStack.empty() && mPRStack.peek().hasMatchingMediaButtonIntent(mediaIntent)) {
return false;
}
if (mAppOps.noteOp(AppOpsManager.OP_TAKE_MEDIA_BUTTONS, Binder.getCallingUid(),
mediaIntent.getCreatorPackage()) != AppOpsManager.MODE_ALLOWED) {
return false;
}
- MediaController mcse = null;
+ PlayerRecord prse = null;
boolean wasInsideStack = false;
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- mcse = mMCStack.elementAt(index);
- if(mcse.mMediaIntent.equals(mediaIntent)) {
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ prse = mPRStack.elementAt(index);
+ if(prse.hasMatchingMediaButtonIntent(mediaIntent)) {
// ok to remove element while traversing the stack since we're leaving the loop
- mMCStack.removeElementAt(index);
+ mPRStack.removeElementAt(index);
wasInsideStack = true;
break;
}
@@ -1315,9 +1268,9 @@ public class MediaFocusControl implements OnFinished {
Log.e(TAG, "Wrong index accessing media button stack, lock error? ", e);
}
if (!wasInsideStack) {
- mcse = new MediaController(this, mediaIntent, target, token);
+ prse = new PlayerRecord(mediaIntent, target, token);
}
- mMCStack.push(mcse); // mcse is never null
+ mPRStack.push(prse); // prse is never null
// post message to persist the default media button receiver
if (target != null) {
@@ -1332,17 +1285,17 @@ public class MediaFocusControl implements OnFinished {
/**
* Helper function:
* Remove the remote control receiver from the RC focus stack.
- * Called synchronized on mAudioFocusLock, then mMCStack
+ * Called synchronized on mAudioFocusLock, then mPRStack
* precondition: pi != null
*/
private void removeMediaButtonReceiver_syncAfRcs(PendingIntent pi) {
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if (mcse.mMediaIntent.equals(pi)) {
- mcse.destroy();
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if (prse.hasMatchingMediaButtonIntent(pi)) {
+ prse.destroy();
// ok to remove element while traversing the stack since we're leaving the loop
- mMCStack.removeElementAt(index);
+ mPRStack.removeElementAt(index);
break;
}
}
@@ -1354,10 +1307,10 @@ public class MediaFocusControl implements OnFinished {
/**
* Helper function:
- * Called synchronized on mMCStack
+ * Called synchronized on mPRStack
*/
private boolean isCurrentRcController(PendingIntent pi) {
- if (!mMCStack.empty() && mMCStack.peek().mMediaIntent.equals(pi)) {
+ if (!mPRStack.empty() && mPRStack.peek().hasMatchingMediaButtonIntent(pi)) {
return true;
}
return false;
@@ -1378,7 +1331,7 @@ public class MediaFocusControl implements OnFinished {
*/
private void setNewRcClientOnDisplays_syncRcsCurrc(int newClientGeneration,
PendingIntent newMediaIntent, boolean clearing) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
if (mRcDisplays.size() > 0) {
final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator();
while (displayIterator.hasNext()) {
@@ -1402,12 +1355,12 @@ public class MediaFocusControl implements OnFinished {
private void setNewRcClientGenerationOnClients_syncRcsCurrc(int newClientGeneration) {
// (using an iterator on the stack so we can safely remove an entry if needed,
// traversal order doesn't matter here as we update all entries)
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController se = stackIterator.next();
- if ((se != null) && (se.mRcClient != null)) {
+ PlayerRecord se = stackIterator.next();
+ if ((se != null) && (se.getRcc() != null)) {
try {
- se.mRcClient.setCurrentClientGenerationId(newClientGeneration);
+ se.getRcc().setCurrentClientGenerationId(newClientGeneration);
} catch (RemoteException e) {
Log.w(TAG, "Dead client in setNewRcClientGenerationOnClients_syncRcsCurrc()",e);
stackIterator.remove();
@@ -1439,7 +1392,7 @@ public class MediaFocusControl implements OnFinished {
private void onRcDisplayClear() {
if (DEBUG_RC) Log.i(TAG, "Clear remote control display");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
mCurrentRcClientGen++;
// synchronously update the displays and clients with the new client generation
@@ -1452,17 +1405,17 @@ public class MediaFocusControl implements OnFinished {
/**
* Called when processing MSG_RCDISPLAY_UPDATE event
*/
- private void onRcDisplayUpdate(MediaController mcse, int flags /* USED ?*/) {
- synchronized(mMCStack) {
+ private void onRcDisplayUpdate(PlayerRecord prse, int flags /* USED ?*/) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
- if ((mCurrentRcClient != null) && (mCurrentRcClient.equals(mcse.mRcClient))) {
+ if ((mCurrentRcClient != null) && (mCurrentRcClient.equals(prse.getRcc()))) {
if (DEBUG_RC) Log.i(TAG, "Display/update remote control ");
mCurrentRcClientGen++;
// synchronously update the displays and clients with
// the new client generation
setNewRcClient_syncRcsCurrc(mCurrentRcClientGen,
- mcse.mMediaIntent /*newMediaIntent*/,
+ prse.getMediaButtonIntent() /*newMediaIntent*/,
false /*clearing*/);
// tell the current client that it needs to send info
@@ -1488,7 +1441,7 @@ public class MediaFocusControl implements OnFinished {
* a single RemoteControlDisplay, NOT all of them, as with MSG_RCDISPLAY_UPDATE.
*/
private void onRcDisplayInitInfo(IRemoteControlDisplay newRcd, int w, int h) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
if (mCurrentRcClient != null) {
if (DEBUG_RC) { Log.i(TAG, "Init RCD with current info"); }
@@ -1515,7 +1468,7 @@ public class MediaFocusControl implements OnFinished {
/**
* Helper function:
- * Called synchronized on mMCStack
+ * Called synchronized on mPRStack
*/
private void clearRemoteControlDisplay_syncAfRcs() {
synchronized(mCurrentRcLock) {
@@ -1530,35 +1483,35 @@ public class MediaFocusControl implements OnFinished {
* checkUpdateRemoteControlDisplay_syncAfRcs() which checks the preconditions for
* this method.
* Preconditions:
- * - called synchronized mAudioFocusLock then on mMCStack
- * - mMCStack.isEmpty() is false
+ * - called synchronized mAudioFocusLock then on mPRStack
+ * - mPRStack.isEmpty() is false
*/
private void updateRemoteControlDisplay_syncAfRcs(int infoChangedFlags) {
- MediaController mcse = mMCStack.peek();
+ PlayerRecord prse = mPRStack.peek();
int infoFlagsAboutToBeUsed = infoChangedFlags;
// this is where we enforce opt-in for information display on the remote controls
// with the new AudioManager.registerRemoteControlClient() API
- if (mcse.mRcClient == null) {
+ if (prse.getRcc() == null) {
//Log.w(TAG, "Can't update remote control display with null remote control client");
clearRemoteControlDisplay_syncAfRcs();
return;
}
synchronized(mCurrentRcLock) {
- if (!mcse.mRcClient.equals(mCurrentRcClient)) {
+ if (!prse.getRcc().equals(mCurrentRcClient)) {
// new RC client, assume every type of information shall be queried
infoFlagsAboutToBeUsed = RC_INFO_ALL;
}
- mCurrentRcClient = mcse.mRcClient;
- mCurrentRcClientIntent = mcse.mMediaIntent;
+ mCurrentRcClient = prse.getRcc();
+ mCurrentRcClientIntent = prse.getMediaButtonIntent();
}
// will cause onRcDisplayUpdate() to be called in AudioService's handler thread
mEventHandler.sendMessage( mEventHandler.obtainMessage(MSG_RCDISPLAY_UPDATE,
- infoFlagsAboutToBeUsed /* arg1 */, 0, mcse /* obj, != null */) );
+ infoFlagsAboutToBeUsed /* arg1 */, 0, prse /* obj, != null */) );
}
/**
* Helper function:
- * Called synchronized on mAudioFocusLock, then mMCStack
+ * Called synchronized on mAudioFocusLock, then mPRStack
* Check whether the remote control display should be updated, triggers the update if required
* @param infoChangedFlags the flags corresponding to the remote control client information
* that has changed, if applicable (checking for the update conditions might trigger a
@@ -1567,7 +1520,7 @@ public class MediaFocusControl implements OnFinished {
private void checkUpdateRemoteControlDisplay_syncAfRcs(int infoChangedFlags) {
// determine whether the remote control display should be refreshed
// if either stack is empty, there is a mismatch, so clear the RC display
- if (mMCStack.isEmpty() || mFocusStack.isEmpty()) {
+ if (mPRStack.isEmpty() || mFocusStack.isEmpty()) {
clearRemoteControlDisplay_syncAfRcs();
return;
}
@@ -1600,19 +1553,19 @@ public class MediaFocusControl implements OnFinished {
}
// if the audio focus and RC owners belong to different packages, there is a mismatch, clear
- if (!af.hasSamePackage(mMCStack.peek().mCallingPackageName)) {
+ if (!af.hasSamePackage(mPRStack.peek().getCallingPackageName())) {
clearRemoteControlDisplay_syncAfRcs();
return;
}
// if the audio focus didn't originate from the same Uid as the one in which the remote
// control information will be retrieved, clear
- if (!af.hasSameUid(mMCStack.peek().mCallingUid)) {
+ if (!af.hasSameUid(mPRStack.peek().getCallingUid())) {
clearRemoteControlDisplay_syncAfRcs();
return;
}
// refresh conditions were verified: update the remote controls
- // ok to call: synchronized mAudioFocusLock then on mMCStack, mMCStack is not empty
+ // ok to call: synchronized mAudioFocusLock then on mPRStack, mPRStack is not empty
updateRemoteControlDisplay_syncAfRcs(infoChangedFlags);
}
@@ -1630,25 +1583,25 @@ public class MediaFocusControl implements OnFinished {
private void onPromoteRcc(int rccId) {
if (DEBUG_RC) { Log.d(TAG, "Promoting RCC " + rccId); }
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// ignore if given RCC ID is already at top of remote control stack
- if (!mMCStack.isEmpty() && (mMCStack.peek().mRccId == rccId)) {
+ if (!mPRStack.isEmpty() && (mPRStack.peek().getRccId() == rccId)) {
return;
}
int indexToPromote = -1;
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if (mcse.mRccId == rccId) {
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if (prse.getRccId() == rccId) {
indexToPromote = index;
break;
}
}
if (indexToPromote >= 0) {
if (DEBUG_RC) { Log.d(TAG, " moving RCC from index " + indexToPromote
- + " to " + (mMCStack.size()-1)); }
- final MediaController mcse = mMCStack.remove(indexToPromote);
- mMCStack.push(mcse);
+ + " to " + (mPRStack.size()-1)); }
+ final PlayerRecord prse = mPRStack.remove(indexToPromote);
+ mPRStack.push(prse);
// the RC stack changed, reevaluate the display
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
}
@@ -1656,7 +1609,7 @@ public class MediaFocusControl implements OnFinished {
// not expected to happen, indicates improper concurrent modification
Log.e(TAG, "Wrong index accessing RC stack, lock error? ", e);
}
- }//synchronized(mMCStack)
+ }//synchronized(mPRStack)
}//synchronized(mAudioFocusLock)
}
@@ -1669,7 +1622,7 @@ public class MediaFocusControl implements OnFinished {
Log.i(TAG, " Remote Control registerMediaButtonIntent() for " + mediaIntent);
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
if (pushMediaButtonReceiver_syncAfRcs(mediaIntent, eventReceiver, token)) {
// new RC client, assume every type of information shall be queried
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
@@ -1687,7 +1640,7 @@ public class MediaFocusControl implements OnFinished {
Log.i(TAG, " Remote Control unregisterMediaButtonIntent() for " + mediaIntent);
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
boolean topOfStackWillChange = isCurrentRcController(mediaIntent);
removeMediaButtonReceiver_syncAfRcs(mediaIntent);
if (topOfStackWillChange) {
@@ -1698,6 +1651,12 @@ public class MediaFocusControl implements OnFinished {
}
}
+ protected void unregisterMediaButtonIntentAsync(final PendingIntent mediaIntent) {
+ mEventHandler.sendMessage(
+ mEventHandler.obtainMessage(MSG_UNREGISTER_MEDIABUTTONINTENT, 0, 0,
+ mediaIntent));
+ }
+
/**
* see AudioManager.registerMediaButtonEventReceiverForCalls(ComponentName c)
* precondition: c != null
@@ -1708,7 +1667,7 @@ public class MediaFocusControl implements OnFinished {
Log.e(TAG, "Invalid permissions to register media button receiver for calls");
return;
}
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
mMediaReceiverForCalls = c;
}
}
@@ -1722,14 +1681,14 @@ public class MediaFocusControl implements OnFinished {
Log.e(TAG, "Invalid permissions to unregister media button receiver for calls");
return;
}
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
mMediaReceiverForCalls = null;
}
}
/**
* see AudioManager.registerRemoteControlClient(ComponentName eventReceiver, ...)
- * @return the unique ID of the MediaController associated with the RemoteControlClient
+ * @return the unique ID of the PlayerRecord associated with the RemoteControlClient
* Note: using this method with rcClient == null is a way to "disable" the IRemoteControlClient
* without modifying the RC stack, but while still causing the display to refresh (will
* become blank as a result of this)
@@ -1739,45 +1698,26 @@ public class MediaFocusControl implements OnFinished {
if (DEBUG_RC) Log.i(TAG, "Register remote control client rcClient="+rcClient);
int rccId = RemoteControlClient.RCSE_ID_UNREGISTERED;
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// store the new display information
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if(mcse.mMediaIntent.equals(mediaIntent)) {
- // already had a remote control client?
- if (mcse.mRcClientDeathHandler != null) {
- // stop monitoring the old client's death
- mcse.unlinkToRcClientDeath();
- }
- // save the new remote control client
- mcse.mRcClient = rcClient;
- mcse.mCallingPackageName = callingPackageName;
- mcse.mCallingUid = Binder.getCallingUid();
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if(prse.hasMatchingMediaButtonIntent(mediaIntent)) {
+ prse.resetControllerInfoForRcc(rcClient, callingPackageName,
+ Binder.getCallingUid());
+
if (rcClient == null) {
- // here mcse.mRcClientDeathHandler is null;
- mcse.resetPlaybackInfo();
break;
}
- rccId = mcse.mRccId;
+
+ rccId = prse.getRccId();
// there is a new (non-null) client:
- // 1/ give the new client the displays (if any)
+ // give the new client the displays (if any)
if (mRcDisplays.size() > 0) {
- plugRemoteControlDisplaysIntoClient_syncRcStack(mcse.mRcClient);
- }
- // 2/ monitor the new client's death
- IBinder b = mcse.mRcClient.asBinder();
- RcClientDeathHandler rcdh =
- new RcClientDeathHandler(b, mcse.mMediaIntent);
- try {
- b.linkToDeath(rcdh, 0);
- } catch (RemoteException e) {
- // remote control client is DOA, disqualify it
- Log.w(TAG, "registerRemoteControlClient() has a dead client " + b);
- mcse.mRcClient = null;
+ plugRemoteControlDisplaysIntoClient_syncRcStack(prse.getRcc());
}
- mcse.mRcClientDeathHandler = rcdh;
break;
}
}//for
@@ -1791,7 +1731,7 @@ public class MediaFocusControl implements OnFinished {
if (isCurrentRcController(mediaIntent)) {
checkUpdateRemoteControlDisplay_syncAfRcs(RC_INFO_ALL);
}
- }//synchronized(mMCStack)
+ }//synchronized(mPRStack)
}//synchronized(mAudioFocusLock)
return rccId;
}
@@ -1804,20 +1744,16 @@ public class MediaFocusControl implements OnFinished {
IRemoteControlClient rcClient) {
if (DEBUG_RC) Log.i(TAG, "Unregister remote control client rcClient="+rcClient);
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
boolean topRccChange = false;
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if ((mcse.mMediaIntent.equals(mediaIntent))
- && rcClient.equals(mcse.mRcClient)) {
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if ((prse.hasMatchingMediaButtonIntent(mediaIntent))
+ && rcClient.equals(prse.getRcc())) {
// we found the IRemoteControlClient to unregister
- // stop monitoring its death
- mcse.unlinkToRcClientDeath();
- // reset the client-related fields
- mcse.mRcClient = null;
- mcse.mCallingPackageName = null;
- topRccChange = (index == mMCStack.size()-1);
+ prse.resetControllerInfoForNoRcc();
+ topRccChange = (index == mPRStack.size()-1);
// there can only be one matching RCC in the RC stack, we're done
break;
}
@@ -1881,7 +1817,7 @@ public class MediaFocusControl implements OnFinished {
}
public void binderDied() {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
Log.w(TAG, "RemoteControl: display " + mRcDisplay + " died");
// remove the display from the list
final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator();
@@ -1899,7 +1835,7 @@ public class MediaFocusControl implements OnFinished {
/**
* The remote control displays.
- * Access synchronized on mMCStack
+ * Access synchronized on mPRStack
*/
private ArrayList<DisplayInfoForServer> mRcDisplays = new ArrayList<DisplayInfoForServer>(1);
@@ -1927,12 +1863,12 @@ public class MediaFocusControl implements OnFinished {
boolean enabled) {
// let all the remote control clients know whether the given display is enabled
// (so the remote control stack traversal order doesn't matter).
- final Iterator<MediaController> stackIterator = mMCStack.iterator();
+ final Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- if(mcse.mRcClient != null) {
+ PlayerRecord prse = stackIterator.next();
+ if(prse.getRcc() != null) {
try {
- mcse.mRcClient.enableRemoteControlDisplay(rcd, enabled);
+ prse.getRcc().enableRemoteControlDisplay(rcd, enabled);
} catch (RemoteException e) {
Log.e(TAG, "Error connecting RCD to client: ", e);
}
@@ -1973,7 +1909,7 @@ public class MediaFocusControl implements OnFinished {
ComponentName listenerComp) {
if (DEBUG_RC) Log.d(TAG, ">>> registerRemoteControlDisplay("+rcd+")");
synchronized(mAudioFocusLock) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
if ((rcd == null) || rcDisplayIsPluggedIn_syncRcStack(rcd)) {
return;
}
@@ -1989,12 +1925,12 @@ public class MediaFocusControl implements OnFinished {
// let all the remote control clients know there is a new display (so the remote
// control stack traversal order doesn't matter).
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- if(mcse.mRcClient != null) {
+ PlayerRecord prse = stackIterator.next();
+ if(prse.getRcc() != null) {
try {
- mcse.mRcClient.plugRemoteControlDisplay(rcd, w, h);
+ prse.getRcc().plugRemoteControlDisplay(rcd, w, h);
} catch (RemoteException e) {
Log.e(TAG, "Error connecting RCD to client: ", e);
}
@@ -2019,7 +1955,7 @@ public class MediaFocusControl implements OnFinished {
*/
protected void unregisterRemoteControlDisplay(IRemoteControlDisplay rcd) {
if (DEBUG_RC) Log.d(TAG, "<<< unregisterRemoteControlDisplay("+rcd+")");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
if (rcd == null) {
return;
}
@@ -2038,12 +1974,12 @@ public class MediaFocusControl implements OnFinished {
if (displayWasPluggedIn) {
// disconnect this remote control display from all the clients, so the remote
// control stack traversal order doesn't matter
- final Iterator<MediaController> stackIterator = mMCStack.iterator();
+ final Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- final MediaController mcse = stackIterator.next();
- if(mcse.mRcClient != null) {
+ final PlayerRecord prse = stackIterator.next();
+ if(prse.getRcc() != null) {
try {
- mcse.mRcClient.unplugRemoteControlDisplay(rcd);
+ prse.getRcc().unplugRemoteControlDisplay(rcd);
} catch (RemoteException e) {
Log.e(TAG, "Error disconnecting remote control display to client: ", e);
}
@@ -2065,7 +2001,7 @@ public class MediaFocusControl implements OnFinished {
* display doesn't need to receive artwork.
*/
protected void remoteControlDisplayUsesBitmapSize(IRemoteControlDisplay rcd, int w, int h) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
final Iterator<DisplayInfoForServer> displayIterator = mRcDisplays.iterator();
boolean artworkSizeUpdate = false;
while (displayIterator.hasNext() && !artworkSizeUpdate) {
@@ -2081,12 +2017,12 @@ public class MediaFocusControl implements OnFinished {
if (artworkSizeUpdate) {
// RCD is currently plugged in and its artwork size has changed, notify all RCCs,
// stack traversal order doesn't matter
- final Iterator<MediaController> stackIterator = mMCStack.iterator();
+ final Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- final MediaController mcse = stackIterator.next();
- if(mcse.mRcClient != null) {
+ final PlayerRecord prse = stackIterator.next();
+ if(prse.getRcc() != null) {
try {
- mcse.mRcClient.setBitmapSizeForDisplay(rcd, w, h);
+ prse.getRcc().setBitmapSizeForDisplay(rcd, w, h);
} catch (RemoteException e) {
Log.e(TAG, "Error setting bitmap size for RCD on RCC: ", e);
}
@@ -2110,7 +2046,7 @@ public class MediaFocusControl implements OnFinished {
*/
protected void remoteControlDisplayWantsPlaybackPositionSync(IRemoteControlDisplay rcd,
boolean wantsSync) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
boolean rcdRegistered = false;
// store the information about this display
// (display stack traversal order doesn't matter).
@@ -2128,12 +2064,12 @@ public class MediaFocusControl implements OnFinished {
}
// notify all current RemoteControlClients
// (stack traversal order doesn't matter as we notify all RCCs)
- final Iterator<MediaController> stackIterator = mMCStack.iterator();
+ final Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while (stackIterator.hasNext()) {
- final MediaController mcse = stackIterator.next();
- if (mcse.mRcClient != null) {
+ final PlayerRecord prse = stackIterator.next();
+ if (prse.getRcc() != null) {
try {
- mcse.mRcClient.setWantsSyncForDisplay(rcd, wantsSync);
+ prse.getRcc().setWantsSyncForDisplay(rcd, wantsSync);
} catch (RemoteException e) {
Log.e(TAG, "Error setting position sync flag for RCD on RCC: ", e);
}
@@ -2144,7 +2080,7 @@ public class MediaFocusControl implements OnFinished {
protected void setRemoteControlClientPlaybackPosition(int generationId, long timeMs) {
// ignore position change requests if invalid generation ID
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
if (mCurrentRcClientGen != generationId) {
return;
@@ -2159,7 +2095,7 @@ public class MediaFocusControl implements OnFinished {
private void onSetRemoteControlClientPlaybackPosition(int generationId, long timeMs) {
if(DEBUG_RC) Log.d(TAG, "onSetRemoteControlClientPlaybackPosition(genId=" + generationId +
", timeMs=" + timeMs + ")");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
if ((mCurrentRcClient != null) && (mCurrentRcClientGen == generationId)) {
// tell the current client to seek to the requested location
@@ -2182,7 +2118,7 @@ public class MediaFocusControl implements OnFinished {
private void onUpdateRemoteControlClientMetadata(int genId, int key, Rating value) {
if(DEBUG_RC) Log.d(TAG, "onUpdateRemoteControlClientMetadata(genId=" + genId +
", what=" + key + ",rating=" + value + ")");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
synchronized(mCurrentRcLock) {
if ((mCurrentRcClient != null) && (mCurrentRcClientGen == genId)) {
try {
@@ -2213,20 +2149,20 @@ public class MediaFocusControl implements OnFinished {
private void onNewPlaybackInfoForRcc(int rccId, int key, int value) {
if(DEBUG_RC) Log.d(TAG, "onNewPlaybackInfoForRcc(id=" + rccId +
", what=" + key + ",val=" + value + ")");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// iterating from top of stack as playback information changes are more likely
// on entries at the top of the remote control stack
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if (mcse.mRccId == rccId) {
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if (prse.getRccId() == rccId) {
switch (key) {
case RemoteControlClient.PLAYBACKINFO_PLAYBACK_TYPE:
- mcse.mPlaybackType = value;
+ prse.mPlaybackType = value;
postReevaluateRemote();
break;
case RemoteControlClient.PLAYBACKINFO_VOLUME:
- mcse.mPlaybackVolume = value;
+ prse.mPlaybackVolume = value;
synchronized (mMainRemote) {
if (rccId == mMainRemote.mRccId) {
mMainRemote.mVolume = value;
@@ -2235,7 +2171,7 @@ public class MediaFocusControl implements OnFinished {
}
break;
case RemoteControlClient.PLAYBACKINFO_VOLUME_MAX:
- mcse.mPlaybackVolumeMax = value;
+ prse.mPlaybackVolumeMax = value;
synchronized (mMainRemote) {
if (rccId == mMainRemote.mRccId) {
mMainRemote.mVolumeMax = value;
@@ -2244,7 +2180,7 @@ public class MediaFocusControl implements OnFinished {
}
break;
case RemoteControlClient.PLAYBACKINFO_VOLUME_HANDLING:
- mcse.mPlaybackVolumeHandling = value;
+ prse.mPlaybackVolumeHandling = value;
synchronized (mMainRemote) {
if (rccId == mMainRemote.mRccId) {
mMainRemote.mVolumeHandling = value;
@@ -2253,7 +2189,7 @@ public class MediaFocusControl implements OnFinished {
}
break;
case RemoteControlClient.PLAYBACKINFO_USES_STREAM:
- mcse.mPlaybackStream = value;
+ prse.mPlaybackStream = value;
break;
default:
Log.e(TAG, "unhandled key " + key + " for RCC " + rccId);
@@ -2264,7 +2200,7 @@ public class MediaFocusControl implements OnFinished {
}//for
} catch (ArrayIndexOutOfBoundsException e) {
// not expected to happen, indicates improper concurrent modification
- Log.e(TAG, "Wrong index mMCStack on onNewPlaybackInfoForRcc, lock error? ", e);
+ Log.e(TAG, "Wrong index mPRStack on onNewPlaybackInfoForRcc, lock error? ", e);
}
}
}
@@ -2272,21 +2208,21 @@ public class MediaFocusControl implements OnFinished {
protected void setPlaybackStateForRcc(int rccId, int state, long timeMs, float speed) {
sendMsg(mEventHandler, MSG_RCC_NEW_PLAYBACK_STATE, SENDMSG_QUEUE,
rccId /* arg1 */, state /* arg2 */,
- new MediaController.RccPlaybackState(state, timeMs, speed) /* obj */, 0 /* delay */);
+ new PlayerRecord.RccPlaybackState(state, timeMs, speed) /* obj */, 0 /* delay */);
}
private void onNewPlaybackStateForRcc(int rccId, int state,
- MediaController.RccPlaybackState newState) {
+ PlayerRecord.RccPlaybackState newState) {
if(DEBUG_RC) Log.d(TAG, "onNewPlaybackStateForRcc(id=" + rccId + ", state=" + state
+ ", time=" + newState.mPositionMs + ", speed=" + newState.mSpeed + ")");
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// iterating from top of stack as playback information changes are more likely
// on entries at the top of the remote control stack
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if (mcse.mRccId == rccId) {
- mcse.mPlaybackState = newState;
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if (prse.getRccId() == rccId) {
+ prse.mPlaybackState = newState;
synchronized (mMainRemote) {
if (rccId == mMainRemote.mRccId) {
mMainRemoteIsActive = isPlaystateActive(state);
@@ -2303,7 +2239,7 @@ public class MediaFocusControl implements OnFinished {
}//for
} catch (ArrayIndexOutOfBoundsException e) {
// not expected to happen, indicates improper concurrent modification
- Log.e(TAG, "Wrong index on mMCStack in onNewPlaybackStateForRcc, lock error? ", e);
+ Log.e(TAG, "Wrong index on mPRStack in onNewPlaybackStateForRcc, lock error? ", e);
}
}
}
@@ -2315,15 +2251,15 @@ public class MediaFocusControl implements OnFinished {
// handler for MSG_RCC_NEW_VOLUME_OBS
private void onRegisterVolumeObserverForRcc(int rccId, IRemoteVolumeObserver rvo) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// The stack traversal order doesn't matter because there is only one stack entry
// with this RCC ID, but the matching ID is more likely at the top of the stack, so
// start iterating from the top.
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if (mcse.mRccId == rccId) {
- mcse.mRemoteVolumeObs = rvo;
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if (prse.getRccId() == rccId) {
+ prse.mRemoteVolumeObs = rvo;
break;
}
}
@@ -2341,21 +2277,21 @@ public class MediaFocusControl implements OnFinished {
* @return false if no remote playing is currently playing
*/
protected boolean checkUpdateRemoteStateIfActive(int streamType) {
- synchronized(mMCStack) {
+ synchronized(mPRStack) {
// iterating from top of stack as active playback is more likely on entries at the top
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
- if ((mcse.mPlaybackType == RemoteControlClient.PLAYBACK_TYPE_REMOTE)
- && isPlaystateActive(mcse.mPlaybackState.mState)
- && (mcse.mPlaybackStream == streamType)) {
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
+ if ((prse.mPlaybackType == RemoteControlClient.PLAYBACK_TYPE_REMOTE)
+ && isPlaystateActive(prse.mPlaybackState.mState)
+ && (prse.mPlaybackStream == streamType)) {
if (DEBUG_RC) Log.d(TAG, "remote playback active on stream " + streamType
- + ", vol =" + mcse.mPlaybackVolume);
+ + ", vol =" + prse.mPlaybackVolume);
synchronized (mMainRemote) {
- mMainRemote.mRccId = mcse.mRccId;
- mMainRemote.mVolume = mcse.mPlaybackVolume;
- mMainRemote.mVolumeMax = mcse.mPlaybackVolumeMax;
- mMainRemote.mVolumeHandling = mcse.mPlaybackVolumeHandling;
+ mMainRemote.mRccId = prse.getRccId();
+ mMainRemote.mVolume = prse.mPlaybackVolume;
+ mMainRemote.mVolumeMax = prse.mPlaybackVolumeMax;
+ mMainRemote.mVolumeHandling = prse.mPlaybackVolumeHandling;
mMainRemoteIsActive = true;
}
return true;
@@ -2422,16 +2358,16 @@ public class MediaFocusControl implements OnFinished {
return;
}
IRemoteVolumeObserver rvo = null;
- synchronized (mMCStack) {
+ synchronized (mPRStack) {
// The stack traversal order doesn't matter because there is only one stack entry
// with this RCC ID, but the matching ID is more likely at the top of the stack, so
// start iterating from the top.
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
//FIXME OPTIMIZE store this info in mMainRemote so we don't have to iterate?
- if (mcse.mRccId == rccId) {
- rvo = mcse.mRemoteVolumeObs;
+ if (prse.getRccId() == rccId) {
+ rvo = prse.mRemoteVolumeObs;
break;
}
}
@@ -2477,16 +2413,16 @@ public class MediaFocusControl implements OnFinished {
rccId = mMainRemote.mRccId;
}
IRemoteVolumeObserver rvo = null;
- synchronized (mMCStack) {
+ synchronized (mPRStack) {
// The stack traversal order doesn't matter because there is only one stack entry
// with this RCC ID, but the matching ID is more likely at the top of the stack, so
// start iterating from the top.
try {
- for (int index = mMCStack.size()-1; index >= 0; index--) {
- final MediaController mcse = mMCStack.elementAt(index);
+ for (int index = mPRStack.size()-1; index >= 0; index--) {
+ final PlayerRecord prse = mPRStack.elementAt(index);
//FIXME OPTIMIZE store this info in mMainRemote so we don't have to iterate?
- if (mcse.mRccId == rccId) {
- rvo = mcse.mRemoteVolumeObs;
+ if (prse.getRccId() == rccId) {
+ rvo = prse.mRemoteVolumeObs;
break;
}
}
@@ -2509,7 +2445,7 @@ public class MediaFocusControl implements OnFinished {
* have their volume controlled. In this implementation this is only to reset whether
* VolumePanel should display remote volumes
*/
- private void postReevaluateRemote() {
+ protected void postReevaluateRemote() {
sendMsg(mEventHandler, MSG_REEVALUATE_REMOTE, SENDMSG_QUEUE, 0, 0, null, 0);
}
@@ -2517,13 +2453,13 @@ public class MediaFocusControl implements OnFinished {
if (DEBUG_VOL) { Log.w(TAG, "onReevaluateRemote()"); }
// is there a registered RemoteControlClient that is handling remote playback
boolean hasRemotePlayback = false;
- synchronized (mMCStack) {
+ synchronized (mPRStack) {
// iteration stops when PLAYBACK_TYPE_REMOTE is found, so remote control stack
// traversal order doesn't matter
- Iterator<MediaController> stackIterator = mMCStack.iterator();
+ Iterator<PlayerRecord> stackIterator = mPRStack.iterator();
while(stackIterator.hasNext()) {
- MediaController mcse = stackIterator.next();
- if (mcse.mPlaybackType == RemoteControlClient.PLAYBACK_TYPE_REMOTE) {
+ PlayerRecord prse = stackIterator.next();
+ if (prse.mPlaybackType == RemoteControlClient.PLAYBACK_TYPE_REMOTE) {
hasRemotePlayback = true;
break;
}
diff --git a/media/java/android/media/MediaController.java b/media/java/android/media/PlayerRecord.java
index 6e3a9b3..a79b0ed 100644
--- a/media/java/android/media/MediaController.java
+++ b/media/java/android/media/PlayerRecord.java
@@ -18,7 +18,7 @@ package android.media;
import android.app.PendingIntent;
import android.content.ComponentName;
-import android.media.MediaFocusControl.RcClientDeathHandler;
+import android.os.Binder;
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
import android.os.RemoteException;
@@ -33,7 +33,7 @@ import java.io.PrintWriter;
* instance is managed by android.media.MediaFocusControl, from its addition to the player stack
* stack to its release.
*/
-class MediaController implements DeathRecipient {
+class PlayerRecord implements DeathRecipient {
// on purpose not using this classe's name, as it will only be used from MediaFocusControl
private static final String TAG = "MediaFocusControl";
@@ -44,34 +44,33 @@ class MediaController implements DeathRecipient {
*/
private static int sLastRccId = 0;
- //FIXME should be final static
- public MediaFocusControl mController;
+ public static MediaFocusControl sController;
/**
* The target for the ACTION_MEDIA_BUTTON events.
- * Always non null.
+ * Always non null. //FIXME verify
*/
- final public PendingIntent mMediaIntent;
+ final private PendingIntent mMediaIntent;
/**
* The registered media button event receiver.
- * Always non null.
*/
- final public ComponentName mReceiverComponent;
+ final private ComponentName mReceiverComponent;
- public int mRccId = RemoteControlClient.RCSE_ID_UNREGISTERED;
+ private int mRccId = RemoteControlClient.RCSE_ID_UNREGISTERED;
- public IBinder mToken;
- public String mCallingPackageName;
- public int mCallingUid;
+ private IBinder mToken;
+ private String mCallingPackageName;
+ private int mCallingUid;
/**
* Provides access to the information to display on the remote control.
* May be null (when a media button event receiver is registered,
* but no remote control client has been registered) */
- public IRemoteControlClient mRcClient;
- public RcClientDeathHandler mRcClientDeathHandler;
+ private IRemoteControlClient mRcClient;
+ private RcClientDeathHandler mRcClientDeathHandler;
/**
* Information only used for non-local playback
*/
+ //FIXME private?
public int mPlaybackType;
public int mPlaybackVolume;
public int mPlaybackVolumeMax;
@@ -142,24 +141,80 @@ class MediaController implements DeathRecipient {
}
- void dump(PrintWriter pw) {
- // FIXME to implement, remove dump from MediaFocusControl that accesses private members
+ /**
+ * Inner class to monitor remote control client deaths, and remove the client for the
+ * remote control stack if necessary.
+ */
+ private class RcClientDeathHandler implements IBinder.DeathRecipient {
+ final private IBinder mCb; // To be notified of client's death
+ //FIXME needed?
+ final private PendingIntent mMediaIntent;
+
+ RcClientDeathHandler(IBinder cb, PendingIntent pi) {
+ mCb = cb;
+ mMediaIntent = pi;
+ }
+
+ public void binderDied() {
+ Log.w(TAG, " RemoteControlClient died");
+ // remote control client died, make sure the displays don't use it anymore
+ // by setting its remote control client to null
+ sController.registerRemoteControlClient(mMediaIntent, null/*rcClient*/, null/*ignored*/);
+ // the dead client was maybe handling remote playback, the controller should reevaluate
+ sController.postReevaluateRemote();
+ }
+
+ public IBinder getBinder() {
+ return mCb;
+ }
}
- public void resetPlaybackInfo() {
- mPlaybackType = RemoteControlClient.PLAYBACK_TYPE_LOCAL;
- mPlaybackVolume = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME;
- mPlaybackVolumeMax = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME;
- mPlaybackVolumeHandling = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME_HANDLING;
- mPlaybackStream = AudioManager.STREAM_MUSIC;
- mPlaybackState.reset();
- mRemoteVolumeObs = null;
+
+ protected static class RemotePlaybackState {
+ int mRccId;
+ int mVolume;
+ int mVolumeMax;
+ int mVolumeHandling;
+
+ protected RemotePlaybackState(int id, int vol, int volMax) {
+ mRccId = id;
+ mVolume = vol;
+ mVolumeMax = volMax;
+ mVolumeHandling = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME_HANDLING;
+ }
+ }
+
+
+ void dump(PrintWriter pw, boolean registrationInfo) {
+ if (registrationInfo) {
+ pw.println(" pi: " + mMediaIntent +
+ " -- pack: " + mCallingPackageName +
+ " -- ercvr: " + mReceiverComponent +
+ " -- client: " + mRcClient +
+ " -- uid: " + mCallingUid +
+ " -- type: " + mPlaybackType +
+ " state: " + mPlaybackState);
+ } else {
+ // emphasis on state
+ pw.println(" uid: " + mCallingUid +
+ " -- id: " + mRccId +
+ " -- type: " + mPlaybackType +
+ " -- state: " + mPlaybackState +
+ " -- vol handling: " + mPlaybackVolumeHandling +
+ " -- vol: " + mPlaybackVolume +
+ " -- volMax: " + mPlaybackVolumeMax +
+ " -- volObs: " + mRemoteVolumeObs);
+ }
+ }
+
+
+ static protected void setMediaFocusControl(MediaFocusControl mfc) {
+ sController = mfc;
}
/** precondition: mediaIntent != null */
- public MediaController(MediaFocusControl controller, PendingIntent mediaIntent,
- ComponentName eventReceiver, IBinder token) {
- mController = controller;
+ protected PlayerRecord(PendingIntent mediaIntent, ComponentName eventReceiver, IBinder token)
+ {
mMediaIntent = mediaIntent;
mReceiverComponent = eventReceiver;
mToken = token;
@@ -176,16 +231,95 @@ class MediaController implements DeathRecipient {
try {
mToken.linkToDeath(this, 0);
} catch (RemoteException e) {
- //FIXME do not access the event handler directly
- mController.mEventHandler.post(new Runnable() {
- @Override public void run() {
- mController.unregisterMediaButtonIntent(mMediaIntent);
- }
- });
+ sController.unregisterMediaButtonIntentAsync(mMediaIntent);
}
}
}
+ //---------------------------------------------
+ // Accessors
+ protected int getRccId() {
+ return mRccId;
+ }
+
+ protected IRemoteControlClient getRcc() {
+ return mRcClient;
+ }
+
+ protected ComponentName getMediaButtonReceiver() {
+ return mReceiverComponent;
+ }
+
+ protected PendingIntent getMediaButtonIntent() {
+ return mMediaIntent;
+ }
+
+ // FIXME this is only used when comparing with the audio focus owner calling package name,
+ // accessor to be removed once audio focus and media button owner are dissociated
+ protected String getCallingPackageName() {
+ return mCallingPackageName;
+ }
+
+ // FIXME this is only used when comparing with the audio focus owner calling package name,
+ // accessor to be removed once audio focus and media button owner are dissociated
+ protected int getCallingUid() {
+ return mCallingUid;
+ }
+
+ protected boolean hasMatchingMediaButtonIntent(PendingIntent pi) {
+ return mMediaIntent.equals(pi);
+ }
+
+ //---------------------------------------------
+ // Modify the records stored in the instance
+ protected void resetControllerInfoForRcc(IRemoteControlClient rcClient,
+ String callingPackageName, int uid) {
+ // already had a remote control client?
+ if (mRcClientDeathHandler != null) {
+ // stop monitoring the old client's death
+ unlinkToRcClientDeath();
+ }
+ // save the new remote control client
+ mRcClient = rcClient;
+ mCallingPackageName = callingPackageName;
+ mCallingUid = uid;
+ if (rcClient == null) {
+ // here mcse.mRcClientDeathHandler is null;
+ resetPlaybackInfo();
+ } else {
+ IBinder b = mRcClient.asBinder();
+ RcClientDeathHandler rcdh =
+ new RcClientDeathHandler(b, mMediaIntent);
+ try {
+ b.linkToDeath(rcdh, 0);
+ } catch (RemoteException e) {
+ // remote control client is DOA, disqualify it
+ Log.w(TAG, "registerRemoteControlClient() has a dead client " + b);
+ mRcClient = null;
+ }
+ mRcClientDeathHandler = rcdh;
+ }
+ }
+
+ protected void resetControllerInfoForNoRcc() {
+ // stop monitoring the RCC death
+ unlinkToRcClientDeath();
+ // reset the RCC-related fields
+ mRcClient = null;
+ mCallingPackageName = null;
+ }
+
+ public void resetPlaybackInfo() {
+ mPlaybackType = RemoteControlClient.PLAYBACK_TYPE_LOCAL;
+ mPlaybackVolume = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME;
+ mPlaybackVolumeMax = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME;
+ mPlaybackVolumeHandling = RemoteControlClient.DEFAULT_PLAYBACK_VOLUME_HANDLING;
+ mPlaybackStream = AudioManager.STREAM_MUSIC;
+ mPlaybackState.reset();
+ mRemoteVolumeObs = null;
+ }
+
+ //---------------------------------------------
public void unlinkToRcClientDeath() {
if ((mRcClientDeathHandler != null) && (mRcClientDeathHandler.mCb != null)) {
try {
@@ -209,7 +343,7 @@ class MediaController implements DeathRecipient {
@Override
public void binderDied() {
- mController.unregisterMediaButtonIntent(mMediaIntent);
+ sController.unregisterMediaButtonIntentAsync(mMediaIntent);
}
@Override
diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp
index 82c6a80..0e55228 100644
--- a/media/jni/android_mtp_MtpDatabase.cpp
+++ b/media/jni/android_mtp_MtpDatabase.cpp
@@ -17,11 +17,12 @@
#define LOG_TAG "MtpDatabaseJNI"
#include "utils/Log.h"
-#include <stdio.h>
#include <assert.h>
+#include <fcntl.h>
+#include <inttypes.h>
#include <limits.h>
+#include <stdio.h>
#include <unistd.h>
-#include <fcntl.h>
#include "jni.h"
#include "JNIHelp.h"
@@ -393,7 +394,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
// release date is stored internally as just the year
if (property == MTP_PROPERTY_ORIGINAL_RELEASE_DATE) {
char date[20];
- snprintf(date, sizeof(date), "%04lld0101T000000", longValue);
+ snprintf(date, sizeof(date), "%04" PRId64 "0101T000000", longValue);
packet.putString(date);
goto out;
}
@@ -657,7 +658,7 @@ MtpResponseCode MyMtpDatabase::setDevicePropertyValue(MtpDeviceProperty property
return result;
}
-MtpResponseCode MyMtpDatabase::resetDeviceProperty(MtpDeviceProperty property) {
+MtpResponseCode MyMtpDatabase::resetDeviceProperty(MtpDeviceProperty /*property*/) {
return -1;
}
@@ -1151,7 +1152,7 @@ android_mtp_MtpDatabase_finalize(JNIEnv *env, jobject thiz)
}
static jstring
-android_mtp_MtpPropertyGroup_format_date_time(JNIEnv *env, jobject thiz, jlong seconds)
+android_mtp_MtpPropertyGroup_format_date_time(JNIEnv *env, jobject /*thiz*/, jlong seconds)
{
char date[20];
formatDateTime(seconds, date, sizeof(date));
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
index 3fc562c..31e806c 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
@@ -979,13 +979,6 @@ public class KeyguardViewMediator {
return;
}
- if (mLockPatternUtils.checkVoldPassword()) {
- if (DEBUG) Log.d(TAG, "Not showing lock screen since just decrypted");
- // Without this, settings is not enabled until the lock screen first appears
- hideLocked();
- return;
- }
-
if (DEBUG) Log.d(TAG, "doKeyguard: showing the lock screen");
showLocked(options);
}
diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml
index ab71371..76e7784 100644
--- a/packages/SystemUI/res/values-land/dimens.xml
+++ b/packages/SystemUI/res/values-land/dimens.xml
@@ -40,4 +40,7 @@
<!-- The fixed height of each tile -->
<dimen name="quick_settings_cell_height">100dp</dimen>
+
+ <!-- Width of the zen mode interstitial dialog. -->
+ <dimen name="zen_mode_dialog_width">384dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index ad4dcf9..45f6af3 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -51,4 +51,7 @@
<!-- How far to slide the panel out when you touch it -->
<!-- On tablets this is just the close_handle_height -->
<dimen name="peek_height">@dimen/close_handle_height</dimen>
+
+ <!-- Width of the zen mode interstitial dialog. -->
+ <dimen name="zen_mode_dialog_width">384dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index f4bfd10..e67e8cf 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -232,4 +232,7 @@
<!-- The size of the icon in the recents task view. -->
<dimen name="recents_task_view_icon_size">60dp</dimen>
+
+ <!-- Width of the zen mode interstitial dialog. Defaults to MATCH_PARENT. -->
+ <dimen name="zen_mode_dialog_width">-1px</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index e516bb8..5771299 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -172,6 +172,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
.setContentTitle(r.getString(R.string.screenshot_saving_title))
.setContentText(r.getString(R.string.screenshot_saving_text))
.setSmallIcon(R.drawable.stat_notify_image)
+ .setCategory(Notification.CATEGORY_PROGRESS)
.setWhen(now);
mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
@@ -694,6 +695,7 @@ class GlobalScreenshot {
.setSmallIcon(R.drawable.stat_notify_image_error)
.setWhen(System.currentTimeMillis())
.setVisibility(Notification.VISIBILITY_PUBLIC) // ok to show outside lockscreen
+ .setCategory(Notification.CATEGORY_ERROR)
.setAutoCancel(true);
Notification n =
new Notification.BigTextStyle(b)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 68c8364..117ae81 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1260,8 +1260,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
private boolean shouldIntercept() {
- return mZenMode == Settings.Global.ZEN_MODE_LIMITED
- || mZenMode == Settings.Global.ZEN_MODE_FULL;
+ return mZenMode != Settings.Global.ZEN_MODE_OFF;
}
protected boolean shouldIntercept(Notification n) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 60ec787..650c557 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -352,13 +352,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
super.setZenMode(mode);
if (mModeIcon == null) return;
if (!isDeviceProvisioned()) return;
- final boolean limited = mode == Settings.Global.ZEN_MODE_LIMITED;
- final boolean full = mode == Settings.Global.ZEN_MODE_FULL;
- mModeIcon.setVisibility(full || limited ? View.VISIBLE : View.GONE);
- final int icon = limited ? R.drawable.stat_sys_zen_limited : R.drawable.stat_sys_zen_full;
- if (full || limited) {
- mModeIcon.setImageResource(icon);
- }
+ mModeIcon.setVisibility(mode != Settings.Global.ZEN_MODE_OFF ? View.VISIBLE : View.GONE);
}
@Override
@@ -481,6 +475,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
mMoreIcon = mStatusBarView.findViewById(R.id.moreIcon);
mNotificationIcons.setOverflowIndicator(mMoreIcon);
mModeIcon = (ImageView)mStatusBarView.findViewById(R.id.modeIcon);
+ mModeIcon.setImageResource(R.drawable.stat_sys_zen_limited);
mStatusBarContents = (LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents);
mTickerView = mStatusBarView.findViewById(R.id.ticker);
@@ -981,9 +976,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
@Override
public void resetHeadsUpDecayTimer() {
+ mHandler.removeMessages(MSG_HIDE_HEADS_UP);
if (mUseHeadsUp && mHeadsUpNotificationDecay > 0
&& mHeadsUpNotificationView.isClearable()) {
- mHandler.removeMessages(MSG_HIDE_HEADS_UP);
mHandler.sendEmptyMessageDelayed(MSG_HIDE_HEADS_UP, mHeadsUpNotificationDecay);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index 8170b5a..aed9a71 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -33,6 +33,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.UserInfo;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
@@ -42,6 +43,7 @@ import android.hardware.display.DisplayManager;
import android.media.MediaRouter;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
+import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -56,11 +58,13 @@ import android.text.TextUtils.TruncateAt;
import android.util.Log;
import android.util.Pair;
import android.view.LayoutInflater;
+import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
+import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
@@ -897,7 +901,16 @@ class QuickSettings {
d.requestWindowFeature(Window.FEATURE_NO_TITLE);
d.setCancelable(true);
d.setCanceledOnTouchOutside(true);
- final ZenModeView v = new ZenModeView(mContext);
+ final ZenModeView v = new ZenModeView(mContext) {
+ @Override
+ protected void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ WindowManager.LayoutParams lp = d.getWindow().getAttributes();
+ lp.width = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.zen_mode_dialog_width);
+ d.getWindow().setAttributes(lp);
+ }
+ };
v.setAdapter(new ZenModeViewAdapter(mContext) {
@Override
public void configure() {
@@ -914,6 +927,10 @@ class QuickSettings {
d.setContentView(v);
d.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
+ WindowManager.LayoutParams lp = d.getWindow().getAttributes();
+ lp.horizontalMargin = 0;
+ lp.width = mContext.getResources().getDimensionPixelSize(R.dimen.zen_mode_dialog_width);
+ d.getWindow().setAttributes(lp);
d.show();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
index c3c281c..9b25046 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
@@ -608,16 +608,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
mZenModeState.enabled = mode != Settings.Global.ZEN_MODE_OFF;
mZenModeState.zenMode = mode;
- if (mode == Settings.Global.ZEN_MODE_FULL) {
- mZenModeState.iconId = R.drawable.stat_sys_zen_full;
- mZenModeState.label = ZenModeView.modeToLabel(ZenModeView.Adapter.MODE_FULL);
- } else if (mode == Settings.Global.ZEN_MODE_LIMITED) {
- mZenModeState.iconId = R.drawable.stat_sys_zen_limited;
- mZenModeState.label = ZenModeView.modeToLabel(ZenModeView.Adapter.MODE_LIMITED);
- } else {
- mZenModeState.iconId = R.drawable.stat_sys_zen_limited;
- mZenModeState.label = ZenModeView.modeToLabel(ZenModeView.Adapter.MODE_LIMITED);
- }
+ mZenModeState.label = ZenModeView.MODE_LABEL;
+ mZenModeState.iconId = R.drawable.stat_sys_zen_limited;
mZenModeCallback.refreshView(mZenModeTile, mZenModeState);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
index d1c7a41..d1a9d57 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java
@@ -21,10 +21,10 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Paint;
-import android.graphics.Path;
+import android.graphics.PorterDuff.Mode;
import android.graphics.Typeface;
import android.graphics.drawable.ShapeDrawable;
-import android.graphics.drawable.shapes.PathShape;
+import android.graphics.drawable.shapes.OvalShape;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
@@ -36,13 +36,13 @@ import android.util.TypedValue;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
-import android.widget.ListView;
import android.widget.RelativeLayout;
-import android.widget.Spinner;
+import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
@@ -53,28 +53,30 @@ public class ZenModeView extends RelativeLayout {
private static final String TAG = ZenModeView.class.getSimpleName();
private static final boolean DEBUG = false;
+ public static final String MODE_LABEL = "Limited interruptions";
+ public static final int BACKGROUND = 0xff282828;
+
private static final Typeface CONDENSED =
Typeface.create("sans-serif-condensed", Typeface.NORMAL);
private static final int GRAY = 0xff999999; //TextAppearance.StatusBar.Expanded.Network
- private static final int BACKGROUND = 0xff282828;
+ private static final int DARK_GRAY = 0xff333333;
+
private static final long DURATION = new ValueAnimator().getDuration();
- private static final long BOUNCE_DURATION = DURATION / 3;
+ private static final long PAGER_DURATION = DURATION / 2;
private static final float BOUNCE_SCALE = 0.8f;
- private static final float SETTINGS_ALPHA = 0.6f;
-
- private static final String FULL_TEXT =
- "You won't hear any calls, alarms or timers.";
+ private static final long CLOSE_DELAY = 600;
private final Context mContext;
private final Paint mPathPaint;
private final ImageView mSettingsButton;
- private final ModeSpinner mModeSpinner;
- private final TextView mActionButton;
+ private final TextView mModeText;
+ private final Switch mModeSwitch;
private final View mDivider;
private final UntilPager mUntilPager;
- private final AlarmWarning mAlarmWarning;
+ private final ProgressDots mProgressDots;
private Adapter mAdapter;
+ private boolean mInit;
public ZenModeView(Context context) {
this(context, null);
@@ -105,37 +107,45 @@ public class ZenModeView extends RelativeLayout {
mSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (mAdapter != null && mAdapter.getMode() == Adapter.MODE_LIMITED) {
+ if (mAdapter != null) {
mAdapter.configure();
}
bounce(mSettingsButton, null);
}
});
- mModeSpinner = new ModeSpinner(mContext);
- mModeSpinner.setId(android.R.id.title);
+ mModeText = new TextView(mContext);
+ mModeText.setText(MODE_LABEL);
+ mModeText.setId(android.R.id.title);
+ mModeText.setTextColor(GRAY);
+ mModeText.setTypeface(CONDENSED);
+ mModeText.setAllCaps(true);
+ mModeText.setGravity(Gravity.CENTER);
+ mModeText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mModeText.getTextSize() * 1.1f);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize);
lp.topMargin = p;
lp.addRule(CENTER_HORIZONTAL);
- addView(mModeSpinner, lp);
-
- mActionButton = new TextView(mContext);
- mActionButton.setTextColor(GRAY);
- mActionButton.setTypeface(CONDENSED);
- mActionButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mActionButton.getTextSize() * 1.2f);
- mActionButton.setAllCaps(true);
- mActionButton.setGravity(Gravity.CENTER);
- mActionButton.setPadding(p, 0, p * 2, 0);
+ addView(mModeText, lp);
+
+ mModeSwitch = new Switch(mContext);
+ mModeSwitch.setSwitchPadding(0);
+ mModeSwitch.setSwitchTypeface(CONDENSED);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize);
lp.topMargin = p;
lp.addRule(ALIGN_PARENT_RIGHT);
- lp.addRule(ALIGN_BASELINE, mModeSpinner.getId());
- addView(mActionButton, lp);
- mActionButton.setOnClickListener(new View.OnClickListener() {
+ lp.addRule(ALIGN_BASELINE, mModeText.getId());
+ addView(mModeSwitch, lp);
+ mModeSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
- public void onClick(View v) {
- bounce(v, null);
- beginOrEnd();
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mAdapter.setMode(isChecked);
+ if (!mInit) return;
+ postDelayed(new Runnable(){
+ @Override
+ public void run() {
+ mAdapter.close();
+ }
+ }, CLOSE_DELAY);
}
});
@@ -143,35 +153,24 @@ public class ZenModeView extends RelativeLayout {
mDivider.setId(android.R.id.empty);
mDivider.setBackgroundColor(GRAY);
lp = new LayoutParams(LayoutParams.MATCH_PARENT, 2);
- lp.addRule(BELOW, mModeSpinner.getId());
+ lp.addRule(BELOW, mModeText.getId());
lp.topMargin = p;
- lp.bottomMargin = p;
+ lp.bottomMargin = p * 2;
addView(mDivider, lp);
mUntilPager = new UntilPager(mContext, mPathPaint, iconSize * 3 / 4);
mUntilPager.setId(android.R.id.tabhost);
- lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+ lp.leftMargin = lp.rightMargin = iconSize / 2;
+ lp.addRule(CENTER_HORIZONTAL);
lp.addRule(BELOW, mDivider.getId());
addView(mUntilPager, lp);
- mAlarmWarning = new AlarmWarning(mContext);
+ mProgressDots = new ProgressDots(mContext, iconSize / 5);
lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.addRule(CENTER_HORIZONTAL);
lp.addRule(BELOW, mUntilPager.getId());
- lp.bottomMargin = p;
- addView(mAlarmWarning, lp);
- }
-
- private void beginOrEnd() {
- if (mAdapter == null) return;
- if (mAdapter.getMode() == mAdapter.getCommittedMode()) {
- // end
- mAdapter.setCommittedMode(Adapter.MODE_OFF);
- } else {
- // begin
- mAdapter.setCommittedMode(mAdapter.getMode());
- }
- mAdapter.close();
+ addView(mProgressDots, lp);
}
public void setAdapter(Adapter adapter) {
@@ -191,55 +190,15 @@ public class ZenModeView extends RelativeLayout {
}
private void updateState(boolean animate) {
- mModeSpinner.updateState();
mUntilPager.updateState();
- mAlarmWarning.updateState(animate);
- final float settingsAlpha = isFull() ? 0 : SETTINGS_ALPHA;
- if (settingsAlpha != mSettingsButton.getAlpha()) {
- if (animate) {
- mSettingsButton.animate().alpha(settingsAlpha).start();
- } else {
- mSettingsButton.setAlpha(settingsAlpha);
- }
- }
- final boolean committed = mAdapter != null
- && mAdapter.getMode() == mAdapter.getCommittedMode();
- mActionButton.setText(committed ? "End" : "Begin");
- }
-
- private boolean isFull() {
- return mAdapter != null && mAdapter.getMode() == Adapter.MODE_FULL;
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- if (DEBUG) log("onMeasure %s %s",
- MeasureSpec.toString(widthMeasureSpec), MeasureSpec.toString(heightMeasureSpec));
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- if (!isFull()) {
- final LayoutParams lp = (LayoutParams) mModeSpinner.getLayoutParams();
- final int mh = vh(mModeSpinner) + vh(mDivider) + vh(mUntilPager) + lp.topMargin;
- setMeasuredDimension(getMeasuredWidth(), mh);
- }
- }
-
- private int vh(View v) {
- LayoutParams lp = (LayoutParams) v.getLayoutParams();
- return v.getMeasuredHeight() + lp.topMargin + lp.bottomMargin;
+ mModeSwitch.setChecked(mAdapter.getMode());
+ mInit = true;
}
private static void log(String msg, Object... args) {
Log.d(TAG, args == null || args.length == 0 ? msg : String.format(msg, args));
}
- private static ShapeDrawable sd(Path p, int size, Paint pt) {
- final ShapeDrawable sd = new ShapeDrawable(new PathShape(p, size, size));
- sd.getPaint().set(pt);
- sd.setIntrinsicHeight(size);
- sd.setIntrinsicWidth(size);
- return sd;
- }
-
private static void bounce(final View v, final Runnable midBounce) {
v.animate().scaleX(BOUNCE_SCALE).scaleY(BOUNCE_SCALE).setDuration(DURATION / 3)
.setListener(new AnimatorListenerAdapter() {
@@ -257,118 +216,23 @@ public class ZenModeView extends RelativeLayout {
}).start();
}
- public static String modeToString(int mode) {
- if (mode == Adapter.MODE_OFF) return "MODE_OFF";
- if (mode == Adapter.MODE_LIMITED) return "MODE_LIMITED";
- if (mode == Adapter.MODE_FULL) return "MODE_FULL";
- throw new IllegalArgumentException("Invalid mode: " + mode);
- }
-
- public static String modeToLabel(int mode) {
- if (mode == Adapter.MODE_LIMITED) return "Limited interruptions";
- if (mode == Adapter.MODE_FULL) return "Zero interruptions";
- throw new UnsupportedOperationException("Unsupported mode: " + mode);
- }
-
- private final class UntilPager extends RelativeLayout {
- private final ImageView mPrev;
- private final ImageView mNext;
- private final TextView mText1;
- private final TextView mText2;
-
- private TextView mText;
+ private final class UntilView extends FrameLayout {
+ private static final boolean SUPPORT_LINKS = false;
- public UntilPager(Context context, Paint pathPaint, int iconSize) {
+ private final TextView mText;
+ public UntilView(Context context) {
super(context);
- mText1 = new TextView(mContext);
- mText1.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText1.getTextSize() * 1.2f);
- mText1.setTypeface(CONDENSED);
- mText1.setTextColor(GRAY);
- mText1.setGravity(Gravity.CENTER);
- LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, iconSize);
- addView(mText1, lp);
- mText = mText1;
-
- mText2 = new TextView(mContext);
- mText2.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText1.getTextSize());
- mText2.setTypeface(CONDENSED);
- mText2.setTextColor(GRAY);
- mText2.setAlpha(0);
- mText2.setGravity(Gravity.CENTER);
- addView(mText2, lp);
-
- lp = new LayoutParams(iconSize, iconSize);
- final View v = new View(mContext);
- v.setBackgroundColor(BACKGROUND);
- addView(v, lp);
- mPrev = new ImageView(mContext);
- mPrev.setId(android.R.id.button1);
- mPrev.setImageDrawable(sd(prevPath(iconSize), iconSize, pathPaint));
- addView(mPrev, lp);
- mPrev.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- onNav(v, -1);
- }
- });
-
- lp = new LayoutParams(iconSize, iconSize);
- lp.addRule(ALIGN_PARENT_RIGHT);
- final View v2 = new View(mContext);
- v2.setBackgroundColor(BACKGROUND);
- addView(v2, lp);
- mNext = new ImageView(mContext);
- mNext.setId(android.R.id.button2);
- mNext.setImageDrawable(sd(nextPath(iconSize), iconSize, pathPaint));
- addView(mNext, lp);
- mNext.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- onNav(v, 1);
- }
- });
-
- updateState();
+ mText = new TextView(mContext);
+ mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText.getTextSize() * 1.2f);
+ mText.setTypeface(CONDENSED);
+ mText.setTextColor(GRAY);
+ mText.setGravity(Gravity.CENTER);
+ addView(mText);
}
- private void onNav(View v, int d) {
- bounce(v, null);
- if (mAdapter == null) {
- return;
- }
- if (mAdapter.getExitConditionCount() == 1) {
- horBounce(d);
- return;
- }
- final int w = getWidth();
- final float s = Math.signum(d);
- final TextView current = mText;
- final TextView other = mText == mText1 ? mText2 : mText1;
- final ExitCondition ec = mAdapter.getExitCondition(d);
- setText(other, ec);
- other.setTranslationX(-s * w);
- other.animate().translationX(0).alpha(1).setDuration(DURATION).start();
- current.animate().translationX(s * w).alpha(0).setDuration(DURATION).start();
- mText = other;
- mAdapter.select(ec);
- }
-
- private void horBounce(int d) {
- final int w = getWidth();
- mText.animate()
- .setDuration(BOUNCE_DURATION)
- .translationX(Math.signum(d) * w / 20)
- .setListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mText.animate().translationX(0).setListener(null).start();
- }
- }).start();
- }
-
- private void setText(final TextView textView, final ExitCondition ec) {
+ public void setExitCondition(final ExitCondition ec) {
SpannableStringBuilder ss = new SpannableStringBuilder(ec.summary);
- if (ec.action != null) {
+ if (SUPPORT_LINKS && ec.action != null) {
ss.setSpan(new CustomLinkSpan() {
@Override
public void onClick() {
@@ -376,38 +240,122 @@ public class ZenModeView extends RelativeLayout {
Toast.makeText(mContext, ec.action, Toast.LENGTH_SHORT).show();
}
}, 0, ss.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
- textView.setMovementMethod(LinkMovementMethod.getInstance());
+ mText.setMovementMethod(LinkMovementMethod.getInstance());
} else {
- textView.setMovementMethod(null);
+ mText.setMovementMethod(null);
+ }
+ mText.setText(ss);
+ }
+ }
+
+ private final class ProgressDots extends LinearLayout {
+ private final int mDotSize;
+ public ProgressDots(Context context, int dotSize) {
+ super(context);
+ setOrientation(HORIZONTAL);
+ mDotSize = dotSize;
+ }
+
+ private void updateState(int current, int count) {
+ while (getChildCount() < count) {
+ View dot = new View(mContext);
+ OvalShape s = new OvalShape();
+ ShapeDrawable sd = new ShapeDrawable(s);
+
+ dot.setBackground(sd);
+ LayoutParams lp = new LayoutParams(mDotSize, mDotSize);
+ lp.leftMargin = lp.rightMargin = mDotSize / 2;
+ lp.topMargin = lp.bottomMargin = mDotSize * 2 / 3;
+ addView(dot, lp);
+ }
+ while (getChildCount() > count) {
+ removeViewAt(getChildCount() - 1);
+ }
+ final int N = getChildCount();
+ for (int i = 0; i < N; i++) {
+ final int color = current == i ? GRAY : DARK_GRAY;
+ ((ShapeDrawable)getChildAt(i).getBackground()).setColorFilter(color, Mode.ADD);
+ }
+ }
+ }
+
+ private final class UntilPager extends RelativeLayout {
+ private final UntilView[] mViews;
+ private int mCurrent;
+ private float mDownX;
+
+ public UntilPager(Context context, Paint pathPaint, int iconSize) {
+ super(context);
+ mViews = new UntilView[3];
+ for (int i = 0; i < mViews.length; i++) {
+ UntilView v = new UntilView(mContext);
+ LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, iconSize);
+ addView(v, lp);
+ mViews[i] = v;
}
- textView.setText(ss);
+ updateState();
+ addOnLayoutChangeListener(new OnLayoutChangeListener() {
+ @Override
+ public void onLayoutChange(View v, int left, int top, int right,
+ int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
+ if (left != oldLeft || right != oldRight) {
+ updateState();
+ }
+ }
+ });
+ setBackgroundColor(DARK_GRAY);
}
private void updateState() {
if (mAdapter == null) {
return;
}
- setText(mText, mAdapter.getExitCondition(0));
+ UntilView current = mViews[mCurrent];
+ current.setExitCondition(mAdapter.getExitCondition(0));
+ UntilView next = mViews[mCurrent + 1 % 3];
+ next.setExitCondition(mAdapter.getExitCondition(1));
+ UntilView prev = mViews[mCurrent + 2 % 3];
+ prev.setExitCondition(mAdapter.getExitCondition(-1));
+ position(0, false);
+ mProgressDots.updateState(mAdapter.getExitConditionIndex(),
+ mAdapter.getExitConditionCount());
}
- private Path prevPath(int size) {
- final int hp = size * 3 / 8;
- final int vp = size / 4;
- final Path p = new Path();
- p.moveTo(size - hp, vp);
- p.lineTo(hp, size / 2);
- p.lineTo(size - hp, size - vp);
- return p;
+ private void position(float dx, boolean animate) {
+ int w = getWidth();
+ UntilView current = mViews[mCurrent];
+ UntilView next = mViews[mCurrent + 1 % 3];
+ UntilView prev = mViews[mCurrent + 2 % 3];
+ if (animate) {
+ current.animate().setDuration(PAGER_DURATION).translationX(dx).start();
+ next.animate().setDuration(PAGER_DURATION).translationX(w + dx).start();
+ prev.animate().setDuration(PAGER_DURATION).translationX(-w + dx).start();
+ } else {
+ current.setTranslationX(dx);
+ next.setTranslationX(w + dx);
+ prev.setTranslationX(-w + dx);
+ }
}
- private Path nextPath(int size) {
- final int hp = size * 3 / 8;
- final int vp = size / 4;
- Path p = new Path();
- p.moveTo(hp, vp);
- p.lineTo(size - hp, size / 2);
- p.lineTo(hp, size - vp);
- return p;
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ log("onTouchEvent " + MotionEvent.actionToString(event.getAction()));
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ mDownX = event.getX();
+ } else if (event.getAction() == MotionEvent.ACTION_MOVE) {
+ float dx = event.getX() - mDownX;
+ position(dx, false);
+ } else if (event.getAction() == MotionEvent.ACTION_UP
+ || event.getAction() == MotionEvent.ACTION_CANCEL) {
+ float dx = event.getX() - mDownX;
+ int d = Math.abs(dx) < getWidth() / 3 ? 0 : Math.signum(dx) > 0 ? -1 : 1;
+ if (d != 0 && mAdapter.getExitConditionCount() > 1) {
+ mAdapter.select(mAdapter.getExitCondition(d));
+ } else {
+ position(0, true);
+ }
+ }
+ return true;
}
}
@@ -432,21 +380,16 @@ public class ZenModeView extends RelativeLayout {
}
public interface Adapter {
- public static final int MODE_OFF = 0;
- public static final int MODE_LIMITED = 1;
- public static final int MODE_FULL = 2;
-
void configure();
void close();
- int getMode();
- void setMode(int mode);
- int getCommittedMode();
- void setCommittedMode(int mode);
+ boolean getMode();
+ void setMode(boolean mode);
void select(ExitCondition ec);
void init();
void setCallbacks(Callbacks callbacks);
ExitCondition getExitCondition(int d);
int getExitConditionCount();
+ int getExitConditionIndex();
public static class ExitCondition {
public String summary;
@@ -459,110 +402,4 @@ public class ZenModeView extends RelativeLayout {
void onChanged();
}
}
-
- private final class ModeSpinner extends Spinner {
- public ModeSpinner(final Context context) {
- super(context);
- setBackgroundResource(R.drawable.spinner_default_holo_dark_am_no_underline);
- final ArrayAdapter<Integer> adapter = new ArrayAdapter<Integer>(mContext, 0) {
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- if (DEBUG) log("getView %s parent=%s", position, parent);
- return getDropDownView(position, convertView, parent);
- }
-
- @Override
- public View getDropDownView(final int position, View convertView, ViewGroup parent) {
- if (DEBUG) log("getDropDownView %s cv=%s parent=%s",
- position, convertView, parent);
- final TextView tv = convertView != null ? (TextView) convertView
- : new TextView(context);
- final int mode = getItem(position);
- tv.setText(modeToLabel(mode));
- final boolean inDropdown = parent instanceof ListView;
- if (convertView == null) {
- if (DEBUG) log(" setting up view");
- tv.setTextColor(GRAY);
- tv.setTypeface(CONDENSED);
- tv.setAllCaps(true);
- tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, tv.getTextSize() * 1.2f);
- final int p = (int) tv.getTextSize() / 2;
- if (inDropdown) {
- tv.setPadding(p, p, 0, p);
- } else {
- tv.setGravity(Gravity.CENTER_HORIZONTAL);
- tv.setPadding(p, 0, 0, 0);
- }
- }
- tv.setOnTouchListener(new OnTouchListener(){
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if (DEBUG) log("onTouch %s %s inDropdown=%s", tv.getText(),
- MotionEvent.actionToString(event.getAction()), inDropdown);
- if (inDropdown && mAdapter != null) {
- mAdapter.setMode(mode);
- }
- return false;
- }
- });
- return tv;
- }
- };
- adapter.add(Adapter.MODE_LIMITED);
- adapter.add(Adapter.MODE_FULL);
- setAdapter(adapter);
- }
-
- public void updateState() {
- int mode = mAdapter != null ? mAdapter.getMode() : Adapter.MODE_LIMITED;
- if (mode == Adapter.MODE_OFF) {
- mode = Adapter.MODE_LIMITED;
- }
- if (DEBUG) log("setSelectedMode " + mode);
- for (int i = 0; i < getAdapter().getCount(); i++) {
- if (getAdapter().getItem(i).equals(mode)) {
- if (DEBUG) log(" setting selection = " + i);
- setSelection(i, true);
- onDetachedFromWindow();
- }
- }
- }
- }
-
- private final class AlarmWarning extends LinearLayout {
- public AlarmWarning(Context context) {
- super(context);
- setOrientation(HORIZONTAL);
-
- final TextView tv = new TextView(mContext);
- tv.setTextColor(GRAY);
- tv.setGravity(Gravity.TOP);
- tv.setTypeface(CONDENSED);
- tv.setText(FULL_TEXT);
- addView(tv);
-
- final ImageView icon = new ImageView(mContext);
- icon.setAlpha(.75f);
- int size = (int)tv.getTextSize();
- icon.setImageResource(android.R.drawable.ic_dialog_alert);
- LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(size, size);
- final int p = size / 4;
- lp.bottomMargin = lp.topMargin = lp.rightMargin = lp.leftMargin = p;
- addView(icon, 0, lp);
- setPadding(p, 0, p, p);
- }
-
- public void updateState(boolean animate) {
- final float alpha = isFull() ? 1 : 0;
- if (alpha == getAlpha()) {
- return;
- }
- if (animate) {
- animate().alpha(alpha).start();
- } else {
- setAlpha(alpha);
- requestLayout();
- }
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java
index d2067a4..c97ba8d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java
@@ -39,8 +39,7 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
private Callbacks mCallbacks;
private int mExitIndex;
- private int mMode;
- private int mCommittedMode;
+ private boolean mMode;
public ZenModeViewAdapter(Context context) {
mContext = context;
@@ -51,27 +50,15 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
}
@Override
- public int getMode() {
+ public boolean getMode() {
return mMode;
}
@Override
- public void setMode(int mode) {
+ public void setMode(boolean mode) {
if (mode == mMode) return;
mMode = mode;
- dispatchChanged();
- }
-
- @Override
- public int getCommittedMode() {
- return mCommittedMode;
- }
-
- @Override
- public void setCommittedMode(int mode) {
- final int v = mode == MODE_LIMITED ? Settings.Global.ZEN_MODE_LIMITED
- : mode == MODE_FULL ? Settings.Global.ZEN_MODE_FULL
- : Settings.Global.ZEN_MODE_OFF;
+ final int v = mMode ? Settings.Global.ZEN_MODE_ON : Settings.Global.ZEN_MODE_OFF;
AsyncTask.execute(new Runnable() {
@Override
public void run() {
@@ -79,6 +66,7 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
Settings.Global.ZEN_MODE, v);
}
});
+ dispatchChanged();
}
@Override
@@ -87,11 +75,6 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
mExitIndex = 0;
dispatchChanged();
}
- final int mode = mCommittedMode == MODE_FULL ? MODE_FULL : MODE_LIMITED;
- if (mode != mMode) {
- mMode = mode;
- dispatchChanged();
- }
}
private void dispatchChanged() {
@@ -122,6 +105,11 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
}
@Override
+ public int getExitConditionIndex() {
+ return mExitIndex;
+ }
+
+ @Override
public void select(ExitCondition ec) {
final int i = mExits.indexOf(ec);
if (i == -1 || i == mExitIndex) {
@@ -171,15 +159,13 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter {
}
private void loadSettings() {
- mCommittedMode = getModeFromSetting();
+ mMode = getModeFromSetting();
}
- private int getModeFromSetting() {
+ private boolean getModeFromSetting() {
final int v = Settings.Global.getInt(mResolver,
Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
- if (v == Settings.Global.ZEN_MODE_LIMITED) return MODE_LIMITED;
- if (v == Settings.Global.ZEN_MODE_FULL) return MODE_FULL;
- return MODE_OFF;
+ return v != Settings.Global.ZEN_MODE_OFF;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 0adb32f..481266b 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -312,6 +312,7 @@ public class StorageNotification extends SystemUI {
mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
mUsbStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
+ mUsbStorageNotification.category = Notification.CATEGORY_SYSTEM;
final boolean adbOn = 1 == Settings.Global.getInt(
mContext.getContentResolver(),
@@ -404,6 +405,7 @@ public class StorageNotification extends SystemUI {
mMediaStorageNotification.icon = icon;
mMediaStorageNotification.setLatestEventInfo(mContext, title, message, pi);
mMediaStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
+ mMediaStorageNotification.category = Notification.CATEGORY_SYSTEM;
}
final int notificationId = mMediaStorageNotification.icon;
diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
index d6c0c99..fb002d2 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -363,16 +363,17 @@ public class WallpaperCropActivity extends Activity {
// Get the crop
RectF cropRect = mCropView.getCrop();
+ Point inSize = mCropView.getSourceDimensions();
+
// Due to rounding errors in the cropview renderer the edges can be slightly offset
// therefore we ensure that the boundaries are sanely defined
cropRect.left = Math.max(0, cropRect.left);
- cropRect.right = Math.min(mCropView.getWidth(), cropRect.right);
+ cropRect.right = Math.min(inSize.x, cropRect.right);
cropRect.top = Math.max(0, cropRect.top);
- cropRect.bottom = Math.min(mCropView.getHeight(), cropRect.bottom);
+ cropRect.bottom = Math.min(inSize.y, cropRect.bottom);
int cropRotation = mCropView.getImageRotation();
float cropScale = mCropView.getWidth() / (float) cropRect.width();
- Point inSize = mCropView.getSourceDimensions();
Matrix rotateMatrix = new Matrix();
rotateMatrix.setRotate(cropRotation);
float[] rotatedInSize = new float[] { inSize.x, inSize.y };
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 0edce11..35f873e 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -397,9 +397,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
return true; // yes, recycle the event
}
if (mSecurityPolicy.canDispatchAccessibilityEventLocked(event)) {
+ mSecurityPolicy.updateActiveWindowLocked(event.getWindowId(), event.getEventType());
mSecurityPolicy.updateEventSourceLocked(event);
- mMainHandler.obtainMessage(MainHandler.MSG_UPDATE_ACTIVE_WINDOW,
- event.getWindowId(), event.getEventType()).sendToTarget();
notifyAccessibilityServicesDelayedLocked(event, false);
notifyAccessibilityServicesDelayedLocked(event, true);
}
@@ -503,7 +502,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
mGlobalWindowTokens.put(windowId, windowToken.asBinder());
if (DEBUG) {
Slog.i(LOG_TAG, "Added global connection for pid:" + Binder.getCallingPid()
- + " with windowId: " + windowId);
+ + " with windowId: " + windowId + " and token: " + windowToken.asBinder());
}
} else {
AccessibilityConnectionWrapper wrapper = new AccessibilityConnectionWrapper(
@@ -514,12 +513,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
userState.mWindowTokens.put(windowId, windowToken.asBinder());
if (DEBUG) {
Slog.i(LOG_TAG, "Added user connection for pid:" + Binder.getCallingPid()
- + " with windowId: " + windowId + " and userId:" + mCurrentUserId);
+ + " with windowId: " + windowId + " and userId:" + mCurrentUserId
+ + " and token: " + windowToken.asBinder());
}
}
- if (DEBUG) {
- Slog.i(LOG_TAG, "Adding interaction connection to windowId: " + windowId);
- }
return windowId;
}
}
@@ -534,7 +531,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
if (removedWindowId >= 0) {
if (DEBUG) {
Slog.i(LOG_TAG, "Removed global connection for pid:" + Binder.getCallingPid()
- + " with windowId: " + removedWindowId);
+ + " with windowId: " + removedWindowId + " and token: " + window.asBinder());
}
return;
}
@@ -548,7 +545,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
if (DEBUG) {
Slog.i(LOG_TAG, "Removed user connection for pid:" + Binder.getCallingPid()
+ " with windowId: " + removedWindowIdForUser + " and userId:"
- + mUserStates.keyAt(i));
+ + mUserStates.keyAt(i) + " and token: " + window.asBinder());
}
return;
}
@@ -1622,7 +1619,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
public static final int MSG_SEND_ACCESSIBILITY_EVENT_TO_INPUT_FILTER = 1;
public static final int MSG_SEND_STATE_TO_CLIENTS = 2;
public static final int MSG_SEND_CLEARED_STATE_TO_CLIENTS_FOR_USER = 3;
- public static final int MSG_UPDATE_ACTIVE_WINDOW = 4;
public static final int MSG_ANNOUNCE_NEW_USER_IF_NEEDED = 5;
public static final int MSG_UPDATE_INPUT_FILTER = 6;
public static final int MSG_SHOW_ENABLED_TOUCH_EXPLORATION_DIALOG = 7;
@@ -1669,12 +1665,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
sendStateToClientsForUser(0, userId);
} break;
- case MSG_UPDATE_ACTIVE_WINDOW: {
- final int windowId = msg.arg1;
- final int eventType = msg.arg2;
- mSecurityPolicy.updateActiveWindow(windowId, eventType);
- } break;
-
case MSG_ANNOUNCE_NEW_USER_IF_NEEDED: {
announceNewUserIfNeeded();
} break;
@@ -3168,7 +3158,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
}
}
- public void updateActiveWindow(int windowId, int eventType) {
+ public void updateActiveWindowLocked(int windowId, int eventType) {
// The active window is either the window that has input focus or
// the window that the user is currently touching. If the user is
// touching a window that does not have input focus as soon as the
@@ -3185,17 +3175,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// what the focused window is to update the active one.
// The active window also determined events from which
// windows are delivered.
- boolean focusedWindowActive = false;
synchronized (mLock) {
- if (mWindowsForAccessibilityCallback == null) {
- focusedWindowActive = true;
- }
- }
- if (focusedWindowActive) {
- if (windowId == getFocusedWindowId()) {
- synchronized (mLock) {
- mActiveWindowId = windowId;
- }
+ if (mWindowsForAccessibilityCallback == null
+ && windowId == getFocusedWindowId()) {
+ mActiveWindowId = windowId;
}
}
} break;
@@ -3337,7 +3320,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
private int getFocusedWindowId() {
IBinder token = mWindowManagerService.getFocusedWindowToken();
- return findWindowIdLocked(token);
+ synchronized (mLock) {
+ return findWindowIdLocked(token);
+ }
}
}
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index b84df79..b7c1704 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -158,7 +158,7 @@ class AppWidgetServiceImpl {
final int N = instances.size();
for (int i = 0; i < N; i++) {
Provider p = instances.get(i).provider;
- if (p.info != null && pkg.equals(p.info.provider.getPackageName())) {
+ if (p != null && p.info != null && pkg.equals(p.info.provider.getPackageName())) {
return true;
}
}
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 19e8083..fe814fc 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -30,11 +30,7 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import android.os.Binder;
import android.os.Environment;
-import android.os.IBinder;
import android.os.RemoteException;
-import android.os.storage.IMountService;
-import android.os.ServiceManager;
-import android.os.storage.StorageManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
@@ -83,7 +79,6 @@ public class LockSettingsService extends ILockSettings.Stub {
private final Context mContext;
private LockPatternUtils mLockPatternUtils;
- private boolean mFirstCallToVold;
public LockSettingsService(Context context) {
mContext = context;
@@ -91,7 +86,6 @@ public class LockSettingsService extends ILockSettings.Stub {
mOpenHelper = new DatabaseHelper(mContext);
mLockPatternUtils = new LockPatternUtils(context);
- mFirstCallToVold = true;
}
public void systemReady() {
@@ -353,33 +347,6 @@ public class LockSettingsService extends ILockSettings.Stub {
}
@Override
- public boolean checkVoldPassword(int userId) throws RemoteException {
- if (!mFirstCallToVold) {
- return false;
- }
- mFirstCallToVold = false;
-
- checkPasswordReadPermission(userId);
-
- // There's no guarantee that this will safely connect, but if it fails
- // we will simply show the lock screen when we shouldn't, so relatively
- // benign. There is an outside chance something nasty would happen if
- // this service restarted before vold stales out the password in this
- // case. The nastiness is limited to not showing the lock screen when
- // we should, within the first minute of decrypting the phone if this
- // service can't connect to vold, it restarts, and then the new instance
- // does successfully connect.
- final IMountService service = getMountService();
- String password = service.getPassword();
- service.clearPassword();
- if (service.getPasswordType() == StorageManager.CRYPT_TYPE_PATTERN) {
- return checkPattern(password, userId);
- } else {
- return checkPassword(password, userId);
- }
- }
-
- @Override
public void removeUser(int userId) {
checkWritePermission(userId);
@@ -557,12 +524,4 @@ public class LockSettingsService extends ILockSettings.Stub {
Secure.LOCK_SCREEN_OWNER_INFO_ENABLED,
Secure.LOCK_SCREEN_OWNER_INFO
};
-
- private IMountService getMountService() {
- final IBinder service = ServiceManager.getService("mount");
- if (service != null) {
- return IMountService.Stub.asInterface(service);
- }
- return null;
- }
}
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index b6e0d5f..cd74fed 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -74,7 +74,6 @@ import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
import org.apache.commons.codec.binary.Hex;
-import org.apache.commons.codec.DecoderException;
import org.xmlpull.v1.XmlPullParserException;
import java.io.File;
@@ -574,14 +573,6 @@ class MountService extends IMountService.Stub
}
}
- private boolean isReady() {
- try {
- return mConnectedSignal.await(0, TimeUnit.MILLISECONDS);
- } catch (InterruptedException e) {
- return false;
- }
- }
-
private void handleSystemReady() {
// Snapshot current volume states since it's not safe to call into vold
// while holding locks.
@@ -2090,19 +2081,6 @@ class MountService extends IMountService.Stub
return new String(Hex.encodeHex(bytes));
}
- private String fromHex(String hexPassword) {
- if (hexPassword == null) {
- return null;
- }
-
- try {
- byte[] bytes = Hex.decodeHex(hexPassword.toCharArray());
- return new String(bytes, StandardCharsets.UTF_8);
- } catch (DecoderException e) {
- return null;
- }
- }
-
@Override
public int decryptStorage(String password) {
if (TextUtils.isEmpty(password)) {
@@ -2252,35 +2230,6 @@ class MountService extends IMountService.Stub
}
@Override
- public String getPassword() throws RemoteException {
- if (!isReady()) {
- return new String();
- }
-
- final NativeDaemonEvent event;
- try {
- event = mConnector.execute("cryptfs", "getpw");
- return fromHex(event.getMessage());
- } catch (NativeDaemonConnectorException e) {
- throw e.rethrowAsParcelableException();
- }
- }
-
- @Override
- public void clearPassword() throws RemoteException {
- if (!isReady()) {
- return;
- }
-
- final NativeDaemonEvent event;
- try {
- event = mConnector.execute("cryptfs", "clearpw");
- } catch (NativeDaemonConnectorException e) {
- throw e.rethrowAsParcelableException();
- }
- }
-
- @Override
public int mkdirs(String callingPkg, String appPath) {
final int userId = UserHandle.getUserId(Binder.getCallingUid());
final UserEnvironment userEnv = new UserEnvironment(userId);
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index b233943..abe362a 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -472,6 +472,7 @@ public class Tethering extends BaseNetworkObserver {
mTetheredNotification.tickerText = title;
mTetheredNotification.visibility = Notification.VISIBILITY_PUBLIC;
mTetheredNotification.setLatestEventInfo(mContext, title, message, pi);
+ mTetheredNotification.category = Notification.CATEGORY_STATUS;
notificationManager.notifyAsUser(null, mTetheredNotification.icon,
mTetheredNotification, UserHandle.ALL);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 7c2de8b..3bc7f4f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1242,7 +1242,6 @@ public class NotificationManagerService extends SystemService {
getContext().registerReceiver(mIntentReceiver, sdFilter);
mSettingsObserver = new SettingsObserver(mHandler);
- mSettingsObserver.observe();
// spin up NotificationScorers
String[] notificationScorerNames = resources.getStringArray(
@@ -1297,8 +1296,10 @@ public class NotificationManagerService extends SystemService {
// Grab our optional AudioService
mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
- // make sure our listener services are properly bound
- rebindListenerServices();
+ } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
+ // This observer will force an update when observe is called, causing us to
+ // bind to listener services.
+ mSettingsObserver.observe();
}
}
@@ -2557,7 +2558,7 @@ public class NotificationManagerService extends SystemService {
exceptionPackages);
// alarm restrictions
- final boolean muteAlarms = mZenMode == Settings.Global.ZEN_MODE_FULL;
+ final boolean muteAlarms = false; // TODO until we save user config
mAppOps.setRestriction(AppOpsManager.OP_VIBRATE, AudioManager.STREAM_ALARM,
muteAlarms ? AppOpsManager.MODE_IGNORED : AppOpsManager.MODE_ALLOWED,
exceptionPackages);
@@ -2594,10 +2595,8 @@ public class NotificationManagerService extends SystemService {
}
private boolean shouldIntercept(String pkg, Notification n) {
- if (mZenMode == Settings.Global.ZEN_MODE_LIMITED) {
+ if (mZenMode != Settings.Global.ZEN_MODE_OFF) {
return !isAlarm(pkg, n);
- } else if (mZenMode == Settings.Global.ZEN_MODE_FULL) {
- return true;
}
return false;
}
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 9236bde..37547f2 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -1477,6 +1477,7 @@ final class Settings {
// FROM NATIVE CODE. AT THE MOMENT, LOOK AT THE FOLLOWING SOURCES:
// system/core/run-as/run-as.c
// system/core/sdcard/sdcard.c
+ // external/libselinux/src/android.c:package_info_init()
//
sb.setLength(0);
sb.append(ai.packageName);
diff --git a/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java b/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
index 260e97a..eb38f4a 100644
--- a/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
+++ b/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
@@ -455,6 +455,7 @@ public class DeviceStorageMonitorService extends SystemService {
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.setLatestEventInfo(context, title, details, intent);
notification.visibility = Notification.VISIBILITY_PUBLIC;
+ notification.category = Notification.CATEGORY_SYSTEM;
mNotificationMgr.notifyAsUser(null, LOW_MEMORY_NOTIFICATION_ID, notification,
UserHandle.ALL);
context.sendStickyBroadcastAsUser(mStorageLowIntent, UserHandle.ALL);
diff --git a/telephony/java/com/android/internal/telephony/ITelephonyListener.aidl b/telephony/java/com/android/internal/telephony/ITelephonyListener.aidl
index 8f5441c..c226217 100644
--- a/telephony/java/com/android/internal/telephony/ITelephonyListener.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephonyListener.aidl
@@ -23,16 +23,5 @@ package com.android.internal.telephony;
* {@hide}
*/
oneway interface ITelephonyListener {
- /**
- * Notify of a new or updated call.
- * Any time the state of a call is updated, it will alert any listeners. This includes changes
- * of state such as when a call is put on hold or conferenced.
- *
- * @param callId a unique identifier for a given call that can be used to track state changes
- * @param state the new state of the call.
- * {@see com.android.services.telephony.common.Call$State}
- * @param number the phone number of the call. For some states, this may be blank. However, it
- * will be populated for any initial state.
- */
void onUpdate(int callId, int state, String number);
}
diff --git a/tests/SharedLibrary/client/Android.mk b/tests/SharedLibrary/client/Android.mk
index 60ef92a..1d66bb9 100644
--- a/tests/SharedLibrary/client/Android.mk
+++ b/tests/SharedLibrary/client/Android.mk
@@ -3,7 +3,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_APK_LIBRARIES := SharedLibrary
+LOCAL_RES_LIBRARIES := SharedLibrary
LOCAL_PACKAGE_NAME := SharedLibraryClient
diff --git a/tests/SharedLibrary/client/AndroidManifest.xml b/tests/SharedLibrary/client/AndroidManifest.xml
index c6a43c0..a39c754 100644
--- a/tests/SharedLibrary/client/AndroidManifest.xml
+++ b/tests/SharedLibrary/client/AndroidManifest.xml
@@ -16,7 +16,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.test.lib_client">
- <application android:label="@string/app_title">
+ <application android:label="@string/app_title" android:theme="@style/Theme">
<uses-library android:name="android.test.runner" />
<uses-library android:name="com.google.android.test.shared_library" />
<activity android:name="ActivityMain">
diff --git a/tests/SharedLibrary/client/res/layout/main.xml b/tests/SharedLibrary/client/res/layout/main.xml
new file mode 100644
index 0000000..067ef9f
--- /dev/null
+++ b/tests/SharedLibrary/client/res/layout/main.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@com.google.android.test.shared_library:string/shared_string"
+ style="@com.google.android.test.shared_library:style/CodeFont"/>
+
+ <com.google.android.test.shared_library.AddressView
+ xmlns:custom="http://schemas.android.com/apk/res/com.google.android.test.shared_library"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ custom:name="Professor Android"
+ custom:streetNumber="44"
+ custom:streetName="KitKat Lane"
+ custom:city="AndroidVille"
+ custom:state="OS"
+ custom:country="Mobile"
+ custom:zip="12345"/>
+</LinearLayout>
diff --git a/tests/SharedLibrary/client/res/values/strings.xml b/tests/SharedLibrary/client/res/values/strings.xml
index 3757a25..d9efdc7 100644
--- a/tests/SharedLibrary/client/res/values/strings.xml
+++ b/tests/SharedLibrary/client/res/values/strings.xml
@@ -16,4 +16,5 @@
<resources>
<string name="app_title">SharedLibrary client</string>
+ <string name="changes">@com.google.android.test.shared_library:string/shared_string</string>
</resources>
diff --git a/tests/SharedLibrary/client/res/values/themes.xml b/tests/SharedLibrary/client/res/values/themes.xml
new file mode 100644
index 0000000..a14f98a
--- /dev/null
+++ b/tests/SharedLibrary/client/res/values/themes.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <style name="Theme" parent="com.google.android.test.shared_library:Theme">
+ </style>
+</resources>
diff --git a/tests/SharedLibrary/client/src/com/google/android/test/lib_client/ActivityMain.java b/tests/SharedLibrary/client/src/com/google/android/test/lib_client/ActivityMain.java
index d6121a5..7276b3c 100644
--- a/tests/SharedLibrary/client/src/com/google/android/test/lib_client/ActivityMain.java
+++ b/tests/SharedLibrary/client/src/com/google/android/test/lib_client/ActivityMain.java
@@ -18,18 +18,33 @@ package com.google.android.test.lib_client;
import android.app.Activity;
import android.os.Bundle;
-import android.widget.TextView;
import com.google.android.test.shared_library.SharedLibraryMain;
public class ActivityMain extends Activity {
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ String[] expectedAnimals = new String[] {
+ "Racoon",
+ "Rhino",
+ "Elephant"
+ };
+
+ String[] animals = getResources().getStringArray(com.google.android.test.shared_library.R.array.animals);
+ if (animals == null || animals.length != expectedAnimals.length) {
+ throw new AssertionError("Animal list from shared library is null or wrong length.");
+ }
- TextView content = new TextView(this);
- content.setText("Library version: " + SharedLibraryMain.getVersion(this) + "!");
+ for (int i = 0; i < expectedAnimals.length; i++) {
+ if (!expectedAnimals[i].equals(animals[i])) {
+ throw new AssertionError("Expected '" + expectedAnimals[i]
+ + "' at index " + i + " but got '" + animals[i]);
+ }
+ }
SharedLibraryMain.ensureVersion(this, SharedLibraryMain.VERSION_BASE);
- setContentView(content);
}
}
diff --git a/tests/SharedLibrary/lib/Android.mk b/tests/SharedLibrary/lib/Android.mk
index c19e23a..b2fc369 100644
--- a/tests/SharedLibrary/lib/Android.mk
+++ b/tests/SharedLibrary/lib/Android.mk
@@ -3,8 +3,13 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_AAPT_FLAGS := --shared-lib
LOCAL_PACKAGE_NAME := SharedLibrary
-LOCAL_MODULE_TAGS := tests
+LOCAL_EXPORT_PACKAGE_RESOURCES := true
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.proguard
include $(BUILD_PACKAGE)
diff --git a/tests/SharedLibrary/lib/proguard.proguard b/tests/SharedLibrary/lib/proguard.proguard
new file mode 100644
index 0000000..e5dfbe1
--- /dev/null
+++ b/tests/SharedLibrary/lib/proguard.proguard
@@ -0,0 +1,7 @@
+-keepparameternames
+-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
+ SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
+
+-keep public class * {
+ public protected *;
+}
diff --git a/tests/SharedLibrary/lib/res/layout/address.xml b/tests/SharedLibrary/lib/res/layout/address.xml
new file mode 100644
index 0000000..835f43e
--- /dev/null
+++ b/tests/SharedLibrary/lib/res/layout/address.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <TextView android:id="@+id/name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ <TextView android:id="@+id/street"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ <TextView android:id="@+id/cityStateZip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ <TextView android:id="@+id/country"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+</merge>
diff --git a/tests/SharedLibrary/lib/res/values/attrs.xml b/tests/SharedLibrary/lib/res/values/attrs.xml
new file mode 100644
index 0000000..8cefe92
--- /dev/null
+++ b/tests/SharedLibrary/lib/res/values/attrs.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <declare-styleable name="AddressView">
+ <attr name="name" format="string" />
+ <attr name="streetNumber" format="integer" />
+ <attr name="streetName" format="string" />
+ <attr name="city" format="string" />
+ <attr name="state" format="string" />
+ <attr name="zip" format="string" />
+ <attr name="country" format="string" />
+ </declare-styleable>
+</resources>
diff --git a/tests/SharedLibrary/lib/res/values/public.xml b/tests/SharedLibrary/lib/res/values/public.xml
new file mode 100644
index 0000000..37b1ec9
--- /dev/null
+++ b/tests/SharedLibrary/lib/res/values/public.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <public type="string" name="shared_string" id="0x00020003" />
+ <public type="style" name="CodeFont" id="0x00040000" />
+ <public type="style" name="Theme" id="0x00040001" />
+
+ <public type="attr" name="name" id="0x00010000" />
+ <public type="attr" name="streetNumber" id="0x00010001" />
+ <public type="attr" name="streetName" id="0x00010002" />
+ <public type="attr" name="city" id="0x00010003" />
+ <public type="attr" name="state" id="0x00010004" />
+ <public type="attr" name="zip" id="0x00010005" />
+ <public type="attr" name="country" id="0x00010006" />
+
+ <public type="array" name="animals" id="0x02050000" />
+</resources>
diff --git a/tests/SharedLibrary/lib/res/values/strings.xml b/tests/SharedLibrary/lib/res/values/strings.xml
index bbfb0b4..6827f93 100644
--- a/tests/SharedLibrary/lib/res/values/strings.xml
+++ b/tests/SharedLibrary/lib/res/values/strings.xml
@@ -19,4 +19,13 @@
<string name="upgrade_body"><xliff:g id="app">%1$s</xliff:g> requires a newer version
of <xliff:g id="lib">%2$s</xliff:g> to run.</string>
<string name="upgrade_button">Upgrade</string>
+ <string name="shared_string">Shared string!</string>
+
+ <string-array name="animals">
+ <item>@string/racoon</item>
+ <item>Rhino</item>
+ <item>Elephant</item>
+ </string-array>
+
+ <string name="racoon">Racoon</string>
</resources>
diff --git a/tests/SharedLibrary/lib/res/values/themes.xml b/tests/SharedLibrary/lib/res/values/themes.xml
new file mode 100644
index 0000000..f1081ac
--- /dev/null
+++ b/tests/SharedLibrary/lib/res/values/themes.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+ <style name="CodeFont" parent="@android:style/TextAppearance.Medium">
+ <item name="android:textColor">#00FF00</item>
+ <item name="android:typeface">monospace</item>
+ </style>
+
+ <style name="Theme" parent="android:Theme.Holo.Light">
+ <item name="android:actionBarStyle">@style/ActionBar</item>
+ </style>
+
+ <style name="ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
+ <item name="android:background">@color/orange</item>
+ </style>
+
+ <color name="orange">#f0ad4e</color>
+</resources>
diff --git a/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/AddressView.java b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/AddressView.java
new file mode 100644
index 0000000..dcaf68c
--- /dev/null
+++ b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/AddressView.java
@@ -0,0 +1,44 @@
+package com.google.android.test.shared_library;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+public class AddressView extends LinearLayout {
+ private TextView mNameView;
+ private TextView mStreetView;
+ private TextView mCityStateZipView;
+ private TextView mCountryView;
+
+ public AddressView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ setOrientation(VERTICAL);
+
+ View view = LayoutInflater.from(context).inflate(R.layout.address, this);
+ mNameView = (TextView) view.findViewById(R.id.name);
+ mStreetView = (TextView) view.findViewById(R.id.street);
+ mCityStateZipView = (TextView) view.findViewById(R.id.cityStateZip);
+ mCountryView = (TextView) view.findViewById(R.id.country);
+
+ TypedArray a = context.getTheme().obtainStyledAttributes(
+ attrs,
+ R.styleable.AddressView,
+ 0, 0);
+ try {
+ mNameView.setText(a.getString(R.styleable.AddressView_name));
+ int streetNumber = a.getInteger(R.styleable.AddressView_streetNumber, -1);
+ mStreetView.setText((streetNumber <= 0 ? "" : Integer.toString(streetNumber)) +
+ " " + a.getString(R.styleable.AddressView_streetName));
+ mCityStateZipView.setText(a.getString(R.styleable.AddressView_city) + ", " +
+ a.getString(R.styleable.AddressView_state) + " " +
+ a.getString(R.styleable.AddressView_zip));
+ mCountryView.setText(a.getString(R.styleable.AddressView_country));
+ } finally {
+ a.recycle();
+ }
+ }
+}
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index f9a2d19..38bfa00 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1798,6 +1798,11 @@ void* AaptFile::editData(size_t size)
return buf;
}
+void* AaptFile::editDataInRange(size_t offset, size_t size)
+{
+ return (void*)(((uint8_t*) editData(offset + size)) + offset);
+}
+
void* AaptFile::editData(size_t* outSize)
{
if (outSize) {
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h
index 336d08b..82dda5f 100644
--- a/tools/aapt/AaptAssets.h
+++ b/tools/aapt/AaptAssets.h
@@ -251,6 +251,7 @@ public:
size_t getSize() const { return mDataSize; }
void* editData(size_t size);
void* editData(size_t* outSize = NULL);
+ void* editDataInRange(size_t offset, size_t size);
void* padData(size_t wordSize);
status_t writeData(const void* data, size_t size);
void clearData();
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index 49b8b55..d2eccbe 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -64,6 +64,7 @@ public:
mProduct(NULL), mUseCrunchCache(false), mErrorOnFailedInsert(false),
mErrorOnMissingConfigEntry(false), mOutputTextSymbols(NULL),
mSingleCrunchInputFile(NULL), mSingleCrunchOutputFile(NULL),
+ mBuildSharedLibrary(false),
mArgc(0), mArgv(NULL)
{}
~Bundle(void) {}
@@ -188,6 +189,8 @@ public:
void setSingleCrunchInputFile(const char* val) { mSingleCrunchInputFile = val; }
const char* getSingleCrunchOutputFile() const { return mSingleCrunchOutputFile; }
void setSingleCrunchOutputFile(const char* val) { mSingleCrunchOutputFile = val; }
+ bool getBuildSharedLibrary() const { return mBuildSharedLibrary; }
+ void setBuildSharedLibrary(bool val) { mBuildSharedLibrary = val; }
/*
* Set and get the file specification.
@@ -300,6 +303,7 @@ private:
const char* mOutputTextSymbols;
const char* mSingleCrunchInputFile;
const char* mSingleCrunchOutputFile;
+ bool mBuildSharedLibrary;
/* file specification */
int mArgc;
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index 33711fa..1cf4783 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -190,6 +190,9 @@ void usage(void)
" Make the resources ID non constant. This is required to make an R java class\n"
" that does not contain the final value but is used to make reusable compiled\n"
" libraries that need to access resources.\n"
+ " --shared-lib\n"
+ " Make a shared library resource package that can be loaded by an application\n"
+ " at runtime to access the libraries resources. Implies --non-constant-id.\n"
" --error-on-failed-insert\n"
" Forces aapt to return an error if it fails to insert values into the manifest\n"
" with --debug-mode, --min-sdk-version, --target-sdk-version --version-code\n"
@@ -618,6 +621,9 @@ int main(int argc, char* const argv[])
bundle.setProduct(argv[0]);
} else if (strcmp(cp, "-non-constant-id") == 0) {
bundle.setNonConstantId(true);
+ } else if (strcmp(cp, "-shared-lib") == 0) {
+ bundle.setNonConstantId(true);
+ bundle.setBuildSharedLibrary(true);
} else if (strcmp(cp, "-no-crunch") == 0) {
bundle.setUseCrunchCache(true);
} else if (strcmp(cp, "-ignore-assets") == 0) {
diff --git a/tools/aapt/ResourceIdCache.cpp b/tools/aapt/ResourceIdCache.cpp
index e03f4f6..d60a07f 100644
--- a/tools/aapt/ResourceIdCache.cpp
+++ b/tools/aapt/ResourceIdCache.cpp
@@ -98,10 +98,10 @@ uint32_t ResourceIdCache::store(const android::String16& package,
void ResourceIdCache::dump() {
printf("ResourceIdCache dump:\n");
- printf("Size: %ld\n", mIdMap.size());
- printf("Hits: %ld\n", mHits);
- printf("Misses: %ld\n", mMisses);
- printf("(Collisions: %ld)\n", mCollisions);
+ printf("Size: %zd\n", mIdMap.size());
+ printf("Hits: %zd\n", mHits);
+ printf("Misses: %zd\n", mMisses);
+ printf("(Collisions: %zd)\n", mCollisions);
}
}
diff --git a/tools/aapt/ResourceIdCache.h b/tools/aapt/ResourceIdCache.h
index e6bcda2..3acdee1 100644
--- a/tools/aapt/ResourceIdCache.h
+++ b/tools/aapt/ResourceIdCache.h
@@ -6,18 +6,20 @@
#ifndef RESOURCE_ID_CACHE_H
#define RESOURCE_ID_CACHE_H
+#include <utils/String16.h>
+
namespace android {
class ResourceIdCache {
public:
- static uint32_t lookup(const android::String16& package,
- const android::String16& type,
- const android::String16& name,
+ static uint32_t lookup(const String16& package,
+ const String16& type,
+ const String16& name,
bool onlyPublic);
- static uint32_t store(const android::String16& package,
- const android::String16& type,
- const android::String16& name,
+ static uint32_t store(const String16& package,
+ const String16& type,
+ const String16& name,
bool onlyPublic,
uint32_t resId);
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 652998e..0fb2606 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -1673,7 +1673,7 @@ status_t compileResourceFile(Bundle* bundle,
ResourceTable::ResourceTable(Bundle* bundle, const String16& assetsPackage)
: mAssetsPackage(assetsPackage), mNextPackageId(1), mHaveAppPackage(false),
- mIsAppPackage(!bundle->getExtending()),
+ mIsAppPackage(!bundle->getExtending()), mIsSharedLibrary(bundle->getBuildSharedLibrary()),
mNumLocal(0),
mBundle(bundle)
{
@@ -1695,8 +1695,9 @@ status_t ResourceTable::addIncludedResources(Bundle* bundle, const sp<AaptAssets
const size_t N = incl.getBasePackageCount();
for (size_t phase=0; phase<2; phase++) {
for (size_t i=0; i<N; i++) {
- String16 name(incl.getBasePackageName(i));
+ const String16 name = incl.getBasePackageName(i);
uint32_t id = incl.getBasePackageId(i);
+
// First time through: only add base packages (id
// is not 0); second time through add the other
// packages.
@@ -1722,7 +1723,7 @@ status_t ResourceTable::addIncludedResources(Bundle* bundle, const sp<AaptAssets
}
}
if (id != 0) {
- NOISY(printf("Including package %s with ID=%d\n",
+ NOISY(fprintf(stderr, "Including package %s with ID=%d\n",
String8(name).string(), id));
sp<Package> p = new Package(name, id);
mPackages.add(name, p);
@@ -2687,6 +2688,9 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
bool useUTF8 = !bundle->getUTF16StringsOption();
+ // The libraries this table references.
+ Vector<sp<Package> > libraryPackages;
+
// Iterate through all data, collecting all values (strings,
// references, etc).
StringPool valueStrings(useUTF8);
@@ -2694,8 +2698,22 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
for (pi=0; pi<N; pi++) {
sp<Package> p = mOrderedPackages.itemAt(pi);
if (p->getTypes().size() == 0) {
- // Empty, skip!
+ // Empty, this is an imported package being used as
+ // a shared library. We do not flatten this package.
+ if (p->getAssignedId() != 0x01 && p->getName() != String16("android")) {
+ // This is not the base Android package, and it is a library
+ // so we must add a reference to the library when flattening.
+ libraryPackages.add(p);
+ }
continue;
+ } else if (p->getAssignedId() == 0x00) {
+ if (!bundle->getBuildSharedLibrary()) {
+ fprintf(stderr, "ERROR: Package %s can not have ID=0x00 unless building a shared library.",
+ String8(p->getName()).string());
+ return UNKNOWN_ERROR;
+ }
+ // If this is a shared library, we also include ourselves as an entry.
+ libraryPackages.add(p);
}
StringPool typeStrings(useUTF8);
@@ -2778,7 +2796,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
}
ssize_t strAmt = 0;
-
+
// Now build the array of package chunks.
Vector<sp<AaptFile> > flatPackages;
for (pi=0; pi<N; pi++) {
@@ -2827,6 +2845,12 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
return amt;
}
+ err = flattenLibraryTable(data, libraryPackages);
+ if (err != NO_ERROR) {
+ fprintf(stderr, "ERROR: failed to write library table\n");
+ return err;
+ }
+
// Build the type chunks inside of this package.
for (size_t ti=0; ti<N; ti++) {
// Retrieve them in the same order as the type string block.
@@ -3053,7 +3077,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
fprintf(stderr, "**** value strings: %d\n", amt);
fprintf(stderr, "**** total strings: %d\n", strAmt);
#endif
-
+
for (pi=0; pi<flatPackages.size(); pi++) {
err = dest->writeData(flatPackages[pi]->getData(),
flatPackages[pi]->getSize());
@@ -3078,6 +3102,38 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
return NO_ERROR;
}
+status_t ResourceTable::flattenLibraryTable(const sp<AaptFile>& dest, const Vector<sp<Package> >& libs) {
+ // Write out the library table if necessary
+ if (libs.size() > 0) {
+ NOISY(fprintf(stderr, "Writing library reference table\n"));
+
+ const size_t libStart = dest->getSize();
+ const size_t count = libs.size();
+ ResTable_lib_header* libHeader = (ResTable_lib_header*) dest->editDataInRange(libStart, sizeof(ResTable_lib_header));
+
+ memset(libHeader, 0, sizeof(*libHeader));
+ libHeader->header.type = htods(RES_TABLE_LIBRARY_TYPE);
+ libHeader->header.headerSize = htods(sizeof(*libHeader));
+ libHeader->header.size = htodl(sizeof(*libHeader) + (sizeof(ResTable_lib_entry) * count));
+ libHeader->count = htodl(count);
+
+ // Write the library entries
+ for (size_t i = 0; i < count; i++) {
+ const size_t entryStart = dest->getSize();
+ sp<Package> libPackage = libs[i];
+ NOISY(fprintf(stderr, " Entry %s -> 0x%02x\n",
+ String8(libPackage->getName()).string(),
+ (uint8_t)libPackage->getAssignedId()));
+
+ ResTable_lib_entry* entry = (ResTable_lib_entry*) dest->editDataInRange(entryStart, sizeof(ResTable_lib_entry));
+ memset(entry, 0, sizeof(*entry));
+ entry->packageId = htodl(libPackage->getAssignedId());
+ strcpy16_htod(entry->packageName, libPackage->getName().string());
+ }
+ }
+ return NO_ERROR;
+}
+
void ResourceTable::writePublicDefinitions(const String16& package, FILE* fp)
{
fprintf(fp,
@@ -3847,7 +3903,7 @@ sp<ResourceTable::Package> ResourceTable::getPackage(const String16& package)
return NULL;
}
mHaveAppPackage = true;
- p = new Package(package, 127);
+ p = new Package(package, mIsSharedLibrary ? 0 : 127);
} else {
p = new Package(package, mNextPackageId);
}
diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h
index 75005cd..ec8fd17 100644
--- a/tools/aapt/ResourceTable.h
+++ b/tools/aapt/ResourceTable.h
@@ -224,6 +224,7 @@ public:
status_t validateLocalizations(void);
status_t flatten(Bundle*, const sp<AaptFile>& dest);
+ status_t flattenLibraryTable(const sp<AaptFile>& dest, const Vector<sp<Package> >& libs);
void writePublicDefinitions(const String16& package, FILE* fp);
@@ -546,6 +547,7 @@ private:
uint32_t mNextPackageId;
bool mHaveAppPackage;
bool mIsAppPackage;
+ bool mIsSharedLibrary;
size_t mNumLocal;
SourcePos mCurrentXmlPos;
Bundle* mBundle;
diff --git a/tools/aapt/printapk.cpp b/tools/aapt/printapk.cpp
index 4cf73d8..def6e2e 100644
--- a/tools/aapt/printapk.cpp
+++ b/tools/aapt/printapk.cpp
@@ -115,8 +115,8 @@ main(int argc, char** argv)
size_t basePackageCount = res.getBasePackageCount();
printf("Base Packages: %d\n", (int)basePackageCount);
for (size_t bpIndex=0; bpIndex<basePackageCount; bpIndex++) {
- const char16_t* ch = res.getBasePackageName(bpIndex);
- String8 s = String8(String16(ch));
+ const String16 ch = res.getBasePackageName(bpIndex);
+ String8 s = String8(ch);
printf(" [%3d] %s\n", (int)bpIndex, s.string());
}
#endif