From 207637327511c960805713971e2e7dd11cb9c290 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Mon, 26 Jan 2009 11:51:12 -0800 Subject: Add missing include This should fix the build for gcc 4.3.2 --- libs/surfaceflinger/SurfaceFlinger.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/surfaceflinger/SurfaceFlinger.cpp') diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index 4c719e8d9b9a..554e8e79b4ae 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3-59-g8ed1b From c2ad241504fcaa12d4579d3b0b4038d1ca8d08c9 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 19 Mar 2009 23:08:54 -0700 Subject: auto import from //branches/cupcake_rel/...@141571 --- api/3.xml | 6 +- api/current.xml | 305 +++++++- camera/libcameraservice/Android.mk | 3 +- camera/libcameraservice/CameraService.cpp | 30 + camera/libcameraservice/CameraService.h | 5 + core/java/android/app/ActivityThread.java | 7 +- core/java/android/app/ApplicationContext.java | 6 +- core/java/android/app/DatePickerDialog.java | 8 +- core/java/android/content/ContentProvider.java | 3 +- core/java/android/content/Intent.java | 23 +- .../net/http/CertificateChainValidator.java | 23 +- core/java/android/net/http/HttpsConnection.java | 159 +++-- core/java/android/os/BatteryStats.java | 21 +- core/java/android/os/LocalPowerManager.java | 8 +- core/java/android/provider/Checkin.java | 37 + .../android/server/BluetoothDeviceService.java | 3 +- core/java/android/server/BluetoothEventLoop.java | 2 +- core/java/android/text/Html.java | 14 +- .../text/method/ArrowKeyMovementMethod.java | 32 + core/java/android/text/method/Touch.java | 22 +- .../view/inputmethod/BaseInputConnection.java | 13 +- .../view/inputmethod/InputConnectionWrapper.java | 16 +- .../view/inputmethod/InputMethodManager.java | 2 +- core/java/android/webkit/ContentLoader.java | 3 + core/java/android/widget/AbsListView.java | 59 +- core/java/android/widget/CursorAdapter.java | 6 +- core/java/android/widget/FrameLayout.java | 4 +- core/java/android/widget/ListView.java | 30 +- core/java/android/widget/TextView.java | 58 +- .../com/android/internal/app/IBatteryStats.aidl | 2 + .../com/android/internal/database/SortCursor.java | 10 +- .../android/internal/logging/AndroidHandler.java | 16 +- .../com/android/internal/os/BatteryStatsImpl.java | 34 +- .../android/internal/widget/EditStyledText.java | 792 ++++++++++++++++----- .../internal/widget/EditableInputConnection.java | 2 +- .../android/gdata/client/AndroidGDataClient.java | 20 +- core/jni/android_media_JetPlayer.cpp | 3 +- core/res/AndroidManifest.xml | 6 +- core/res/assets/images/android-logo-mask.png | Bin 0 -> 5306 bytes core/res/assets/images/android-logo-shine.png | Bin 0 -> 641 bytes core/res/assets/images/android_320x480.png | Bin 3098 -> 0 bytes core/res/assets/images/boot_robot.png | Bin 1001 -> 0 bytes core/res/assets/images/boot_robot_glow.png | Bin 2083 -> 0 bytes core/res/assets/images/cylon_dot.png | Bin 748 -> 0 bytes core/res/assets/images/cylon_left.png | Bin 1283 -> 0 bytes core/res/assets/images/cylon_right.png | Bin 1259 -> 0 bytes ...c_btn_square_browser_zoom_fit_page_disabled.png | Bin 291 -> 456 bytes .../ic_btn_square_browser_zoom_fit_page_normal.png | Bin 439 -> 820 bytes core/res/res/drawable/ic_emergency.png | Bin 653 -> 605 bytes .../res/drawable/timepicker_down_disabled.9.png | Bin 444 -> 422 bytes .../timepicker_down_disabled_focused.9.png | Bin 611 -> 580 bytes core/res/res/drawable/timepicker_down_normal.9.png | Bin 806 -> 795 bytes .../res/res/drawable/timepicker_down_pressed.9.png | Bin 1257 -> 1161 bytes .../res/drawable/timepicker_down_selected.9.png | Bin 1292 -> 1170 bytes core/res/res/drawable/timepicker_up_disabled.9.png | Bin 512 -> 491 bytes .../drawable/timepicker_up_disabled_focused.9.png | Bin 724 -> 728 bytes core/res/res/drawable/timepicker_up_normal.9.png | Bin 1058 -> 989 bytes core/res/res/drawable/timepicker_up_pressed.9.png | Bin 1500 -> 1433 bytes core/res/res/drawable/timepicker_up_selected.9.png | Bin 1519 -> 1428 bytes core/res/res/layout/always_use_checkbox.xml | 3 +- .../res/layout/keyguard_screen_glogin_unlock.xml | 2 +- core/res/res/layout/keyguard_screen_lock.xml | 2 +- .../layout/keyguard_screen_sim_pin_landscape.xml | 11 +- .../layout/keyguard_screen_sim_pin_portrait.xml | 3 +- .../layout/keyguard_screen_unlock_landscape.xml | 4 +- .../res/layout/keyguard_screen_unlock_portrait.xml | 4 +- core/res/res/layout/time_picker.xml | 4 +- core/res/res/values-ar-rEG/arrays.xml | 32 + core/res/res/values-ar-rIL/arrays.xml | 32 + core/res/res/values-bg-rBG/arrays.xml | 32 + core/res/res/values-ca-rES/arrays.xml | 32 + core/res/res/values-cs-rCZ/arrays.xml | 32 + core/res/res/values-da-rDK/arrays.xml | 32 + core/res/res/values-de-rAT/arrays.xml | 32 + core/res/res/values-de-rCH/arrays.xml | 32 + core/res/res/values-de-rDE/arrays.xml | 32 + core/res/res/values-de-rLI/arrays.xml | 32 + core/res/res/values-el-rGR/arrays.xml | 32 + core/res/res/values-en-rCA/arrays.xml | 32 + core/res/res/values-en-rIN/arrays.xml | 32 + core/res/res/values-en-rNZ/arrays.xml | 32 + core/res/res/values-es/strings.xml | 1 + core/res/res/values-fi-rFI/arrays.xml | 32 + core/res/res/values-fr-rBE/arrays.xml | 32 + core/res/res/values-fr-rCA/arrays.xml | 32 + core/res/res/values-fr-rCH/arrays.xml | 32 + core/res/res/values-he-rIL/arrays.xml | 32 + core/res/res/values-hi-rIN/arrays.xml | 32 + core/res/res/values-hu-rHU/arrays.xml | 32 + core/res/res/values-id-rID/arrays.xml | 32 + core/res/res/values-it-rCH/arrays.xml | 32 + core/res/res/values-ja/strings.xml | 23 +- core/res/res/values-ko-rKR/arrays.xml | 32 + core/res/res/values-lt-rLT/arrays.xml | 32 + core/res/res/values-lv-rLV/arrays.xml | 32 + core/res/res/values-nl-rBE/arrays.xml | 32 + core/res/res/values-nl-rNL/arrays.xml | 32 + core/res/res/values-no-rNO/arrays.xml | 32 + core/res/res/values-pl-rPL/arrays.xml | 32 + core/res/res/values-pt-rBR/arrays.xml | 32 + core/res/res/values-pt-rPT/arrays.xml | 32 + core/res/res/values-ro-rRO/arrays.xml | 32 + core/res/res/values-ru-rRU/arrays.xml | 32 + core/res/res/values-sk-rSK/arrays.xml | 32 + core/res/res/values-sl-rSI/arrays.xml | 32 + core/res/res/values-sr-rRS/arrays.xml | 32 + core/res/res/values-sv-rSE/arrays.xml | 32 + core/res/res/values-th-rTH/arrays.xml | 32 + core/res/res/values-tl-rPH/arrays.xml | 32 + core/res/res/values-tr-rTR/arrays.xml | 32 + core/res/res/values-uk-rUA/arrays.xml | 32 + core/res/res/values-vi-rVN/arrays.xml | 32 + core/res/res/values-zh-rCN/arrays.xml | 32 + core/res/res/values-zh-rTW/arrays.xml | 32 + core/res/res/values/public.xml | 2 + core/res/res/values/strings.xml | 10 + core/res/res/values/themes.xml | 44 +- data/fonts/DroidSansJapanese.ttf | Bin 0 -> 1174432 bytes data/sounds/AudioPackage2.mk | 92 +++ data/sounds/OriginalAudio.mk | 2 + data/sounds/effects/VideoRecord.ogg | Bin 0 -> 14969 bytes data/sounds/effects/VideoRecord.wav | Bin 0 -> 152342 bytes data/sounds/effects/camera_click.ogg | Bin 0 -> 5593 bytes data/sounds/newwavelabs/Big_Easy.ogg | Bin 0 -> 46673 bytes data/sounds/newwavelabs/Big_Easy.wav | Bin 0 -> 846768 bytes data/sounds/newwavelabs/Bollywood.ogg | Bin 0 -> 39174 bytes data/sounds/newwavelabs/Bollywood.wav | Bin 0 -> 742784 bytes data/sounds/newwavelabs/Cairo.ogg | Bin 0 -> 37672 bytes data/sounds/newwavelabs/Cairo.wav | Bin 0 -> 736324 bytes data/sounds/newwavelabs/Calypso_Steel.ogg | Bin 0 -> 38875 bytes data/sounds/newwavelabs/Calypso_Steel.wav | Bin 0 -> 705644 bytes data/sounds/newwavelabs/Champagne_Edition.ogg | Bin 0 -> 39921 bytes data/sounds/newwavelabs/Champagne_Edition.wav | Bin 0 -> 769792 bytes data/sounds/newwavelabs/Club_Cubano.ogg | Bin 0 -> 37179 bytes data/sounds/newwavelabs/Club_Cubano.wav | Bin 0 -> 705620 bytes data/sounds/newwavelabs/Eastern_Sky.ogg | Bin 0 -> 50578 bytes data/sounds/newwavelabs/Eastern_Sky.wav | Bin 0 -> 940844 bytes data/sounds/newwavelabs/Funk_Yall.ogg | Bin 0 -> 39738 bytes data/sounds/newwavelabs/Funk_Yall.wav | Bin 0 -> 723740 bytes data/sounds/newwavelabs/Gimme_Mo_Town.ogg | Bin 0 -> 38688 bytes data/sounds/newwavelabs/Gimme_Mo_Town.wav | Bin 0 -> 705644 bytes data/sounds/newwavelabs/Glacial_Groove.ogg | Bin 0 -> 54923 bytes data/sounds/newwavelabs/Glacial_Groove.wav | Bin 0 -> 898884 bytes data/sounds/newwavelabs/No_Limits.ogg | Bin 0 -> 32933 bytes data/sounds/newwavelabs/No_Limits.wav | Bin 0 -> 631928 bytes data/sounds/newwavelabs/Paradise_Island.ogg | Bin 0 -> 39199 bytes data/sounds/newwavelabs/Paradise_Island.wav | Bin 0 -> 729976 bytes data/sounds/newwavelabs/Revelation.ogg | Bin 0 -> 52536 bytes data/sounds/newwavelabs/Revelation.wav | Bin 0 -> 1048480 bytes data/sounds/newwavelabs/Road_Trip.ogg | Bin 0 -> 49108 bytes data/sounds/newwavelabs/Road_Trip.wav | Bin 0 -> 967732 bytes data/sounds/newwavelabs/Savannah.ogg | Bin 0 -> 39138 bytes data/sounds/newwavelabs/Savannah.wav | Bin 0 -> 705644 bytes data/sounds/newwavelabs/Seville.ogg | Bin 0 -> 44422 bytes data/sounds/newwavelabs/Seville.wav | Bin 0 -> 846768 bytes data/sounds/newwavelabs/Shes_All_That.ogg | Bin 0 -> 39413 bytes data/sounds/newwavelabs/Shes_All_That.wav | Bin 0 -> 736324 bytes data/sounds/newwavelabs/Steppin_Out.ogg | Bin 0 -> 37847 bytes data/sounds/newwavelabs/Steppin_Out.wav | Bin 0 -> 705620 bytes data/sounds/newwavelabs/Third_Eye.ogg | Bin 0 -> 36539 bytes data/sounds/newwavelabs/Third_Eye.wav | Bin 0 -> 705644 bytes data/sounds/newwavelabs/Thunderfoot.ogg | Bin 0 -> 46049 bytes data/sounds/newwavelabs/Thunderfoot.wav | Bin 0 -> 846768 bytes docs/html/guide/topics/graphics/2d-graphics.jd | 5 +- docs/html/sdk/1.5_r1/index.jd | 62 ++ docs/html/sdk/1.5_r1/installing.jd | 312 ++++++++ docs/html/sdk/1.5_r1/requirements.jd | 42 ++ docs/html/sdk/1.5_r1/upgrading.jd | 150 ++++ docs/html/sdk/android-1.5.jd | 248 +++++++ docs/html/sdk/sdk_toc.cs | 3 +- include/media/AudioRecord.h | 1 + include/media/AudioTrack.h | 1 + include/media/mediaplayer.h | 1 + libs/surfaceflinger/BootAnimation.cpp | 199 +----- libs/surfaceflinger/BootAnimation.h | 10 +- libs/surfaceflinger/LayerOrientationAnim.cpp | 187 +++-- libs/surfaceflinger/LayerOrientationAnim.h | 3 +- libs/surfaceflinger/SurfaceFlinger.cpp | 3 +- libs/surfaceflinger/SurfaceFlinger.h | 2 + libs/surfaceflinger/Transform.cpp | 19 + libs/surfaceflinger/Transform.h | 4 +- media/java/android/media/AudioRecord.java | 161 ++--- media/java/android/media/AudioService.java | 85 ++- media/java/android/media/AudioTrack.java | 2 - media/java/android/media/MediaPlayer.java | 12 +- media/jni/soundpool/NOTICE | 190 +++++ media/libmedia/AudioRecord.cpp | 9 +- media/libmedia/AudioTrack.cpp | 15 +- media/libmedia/JetPlayer.cpp | 2 +- media/libmedia/mediaplayer.cpp | 28 +- preloaded-classes | 389 ++++++++-- .../java/com/android/server/HardwareService.java | 47 +- .../android/server/NotificationManagerService.java | 1 + .../com/android/server/PackageManagerService.java | 28 +- .../com/android/server/PowerManagerService.java | 253 ++++--- services/java/com/android/server/WifiService.java | 30 +- .../com/android/server/WindowManagerService.java | 8 +- .../android/server/am/ActivityManagerService.java | 13 +- .../com/android/server/am/BatteryStatsService.java | 16 +- .../java/com/android/server/status/DateView.java | 4 +- .../android/internal/telephony/gsm/ApnSetting.java | 8 +- .../telephony/gsm/DataConnectionTracker.java | 87 +++ .../com/android/internal/telephony/gsm/RIL.java | 4 +- .../src/com/android/statusbartest/PowerTest.java | 24 +- wifi/java/android/net/wifi/WifiStateTracker.java | 26 +- 205 files changed, 5076 insertions(+), 1058 deletions(-) create mode 100644 core/res/assets/images/android-logo-mask.png create mode 100644 core/res/assets/images/android-logo-shine.png delete mode 100644 core/res/assets/images/android_320x480.png delete mode 100644 core/res/assets/images/boot_robot.png delete mode 100644 core/res/assets/images/boot_robot_glow.png delete mode 100644 core/res/assets/images/cylon_dot.png delete mode 100644 core/res/assets/images/cylon_left.png delete mode 100644 core/res/assets/images/cylon_right.png create mode 100644 core/res/res/values-ar-rEG/arrays.xml create mode 100644 core/res/res/values-ar-rIL/arrays.xml create mode 100644 core/res/res/values-bg-rBG/arrays.xml create mode 100644 core/res/res/values-ca-rES/arrays.xml create mode 100644 core/res/res/values-cs-rCZ/arrays.xml create mode 100644 core/res/res/values-da-rDK/arrays.xml create mode 100644 core/res/res/values-de-rAT/arrays.xml create mode 100644 core/res/res/values-de-rCH/arrays.xml create mode 100644 core/res/res/values-de-rDE/arrays.xml create mode 100644 core/res/res/values-de-rLI/arrays.xml create mode 100644 core/res/res/values-el-rGR/arrays.xml create mode 100644 core/res/res/values-en-rCA/arrays.xml create mode 100644 core/res/res/values-en-rIN/arrays.xml create mode 100644 core/res/res/values-en-rNZ/arrays.xml create mode 100644 core/res/res/values-fi-rFI/arrays.xml create mode 100644 core/res/res/values-fr-rBE/arrays.xml create mode 100644 core/res/res/values-fr-rCA/arrays.xml create mode 100644 core/res/res/values-fr-rCH/arrays.xml create mode 100644 core/res/res/values-he-rIL/arrays.xml create mode 100644 core/res/res/values-hi-rIN/arrays.xml create mode 100644 core/res/res/values-hu-rHU/arrays.xml create mode 100644 core/res/res/values-id-rID/arrays.xml create mode 100644 core/res/res/values-it-rCH/arrays.xml create mode 100644 core/res/res/values-ko-rKR/arrays.xml create mode 100644 core/res/res/values-lt-rLT/arrays.xml create mode 100644 core/res/res/values-lv-rLV/arrays.xml create mode 100644 core/res/res/values-nl-rBE/arrays.xml create mode 100644 core/res/res/values-nl-rNL/arrays.xml create mode 100644 core/res/res/values-no-rNO/arrays.xml create mode 100644 core/res/res/values-pl-rPL/arrays.xml create mode 100644 core/res/res/values-pt-rBR/arrays.xml create mode 100644 core/res/res/values-pt-rPT/arrays.xml create mode 100644 core/res/res/values-ro-rRO/arrays.xml create mode 100644 core/res/res/values-ru-rRU/arrays.xml create mode 100644 core/res/res/values-sk-rSK/arrays.xml create mode 100644 core/res/res/values-sl-rSI/arrays.xml create mode 100644 core/res/res/values-sr-rRS/arrays.xml create mode 100644 core/res/res/values-sv-rSE/arrays.xml create mode 100644 core/res/res/values-th-rTH/arrays.xml create mode 100644 core/res/res/values-tl-rPH/arrays.xml create mode 100644 core/res/res/values-tr-rTR/arrays.xml create mode 100644 core/res/res/values-uk-rUA/arrays.xml create mode 100644 core/res/res/values-vi-rVN/arrays.xml create mode 100644 core/res/res/values-zh-rCN/arrays.xml create mode 100644 core/res/res/values-zh-rTW/arrays.xml create mode 100755 data/fonts/DroidSansJapanese.ttf create mode 100644 data/sounds/AudioPackage2.mk create mode 100644 data/sounds/effects/VideoRecord.ogg create mode 100644 data/sounds/effects/VideoRecord.wav create mode 100644 data/sounds/effects/camera_click.ogg create mode 100644 data/sounds/newwavelabs/Big_Easy.ogg create mode 100644 data/sounds/newwavelabs/Big_Easy.wav create mode 100644 data/sounds/newwavelabs/Bollywood.ogg create mode 100644 data/sounds/newwavelabs/Bollywood.wav create mode 100644 data/sounds/newwavelabs/Cairo.ogg create mode 100644 data/sounds/newwavelabs/Cairo.wav create mode 100644 data/sounds/newwavelabs/Calypso_Steel.ogg create mode 100644 data/sounds/newwavelabs/Calypso_Steel.wav create mode 100644 data/sounds/newwavelabs/Champagne_Edition.ogg create mode 100644 data/sounds/newwavelabs/Champagne_Edition.wav create mode 100644 data/sounds/newwavelabs/Club_Cubano.ogg create mode 100644 data/sounds/newwavelabs/Club_Cubano.wav create mode 100644 data/sounds/newwavelabs/Eastern_Sky.ogg create mode 100644 data/sounds/newwavelabs/Eastern_Sky.wav create mode 100644 data/sounds/newwavelabs/Funk_Yall.ogg create mode 100644 data/sounds/newwavelabs/Funk_Yall.wav create mode 100644 data/sounds/newwavelabs/Gimme_Mo_Town.ogg create mode 100644 data/sounds/newwavelabs/Gimme_Mo_Town.wav create mode 100644 data/sounds/newwavelabs/Glacial_Groove.ogg create mode 100644 data/sounds/newwavelabs/Glacial_Groove.wav create mode 100644 data/sounds/newwavelabs/No_Limits.ogg create mode 100644 data/sounds/newwavelabs/No_Limits.wav create mode 100644 data/sounds/newwavelabs/Paradise_Island.ogg create mode 100644 data/sounds/newwavelabs/Paradise_Island.wav create mode 100644 data/sounds/newwavelabs/Revelation.ogg create mode 100644 data/sounds/newwavelabs/Revelation.wav create mode 100644 data/sounds/newwavelabs/Road_Trip.ogg create mode 100644 data/sounds/newwavelabs/Road_Trip.wav create mode 100644 data/sounds/newwavelabs/Savannah.ogg create mode 100644 data/sounds/newwavelabs/Savannah.wav create mode 100644 data/sounds/newwavelabs/Seville.ogg create mode 100644 data/sounds/newwavelabs/Seville.wav create mode 100644 data/sounds/newwavelabs/Shes_All_That.ogg create mode 100644 data/sounds/newwavelabs/Shes_All_That.wav create mode 100644 data/sounds/newwavelabs/Steppin_Out.ogg create mode 100644 data/sounds/newwavelabs/Steppin_Out.wav create mode 100644 data/sounds/newwavelabs/Third_Eye.ogg create mode 100644 data/sounds/newwavelabs/Third_Eye.wav create mode 100644 data/sounds/newwavelabs/Thunderfoot.ogg create mode 100644 data/sounds/newwavelabs/Thunderfoot.wav create mode 100644 docs/html/sdk/1.5_r1/index.jd create mode 100644 docs/html/sdk/1.5_r1/installing.jd create mode 100644 docs/html/sdk/1.5_r1/requirements.jd create mode 100644 docs/html/sdk/1.5_r1/upgrading.jd create mode 100644 docs/html/sdk/android-1.5.jd create mode 100644 media/jni/soundpool/NOTICE (limited to 'libs/surfaceflinger/SurfaceFlinger.cpp') diff --git a/api/3.xml b/api/3.xml index 512fef8b184f..c75281319230 100644 --- a/api/3.xml +++ b/api/3.xml @@ -125608,7 +125608,7 @@ native="false" synchronized="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > @@ -125652,7 +125652,7 @@ native="false" synchronized="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > @@ -125665,7 +125665,7 @@ native="false" synchronized="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > diff --git a/api/current.xml b/api/current.xml index c9ed3c42ddeb..2260abb5abab 100644 --- a/api/current.xml +++ b/api/current.xml @@ -12120,6 +12120,17 @@ visibility="public" > + + + + + + + + + + + + + + - - + - - + - - + - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + @@ -146440,7 +146688,7 @@ native="false" synchronized="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > @@ -146453,7 +146701,7 @@ native="false" synchronized="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > @@ -157332,6 +157580,17 @@ visibility="public" > + + #include +#include +#include #include "CameraService.h" namespace android { @@ -151,6 +153,19 @@ void CameraService::removeClient(const sp& cameraClient) } } +static sp newMediaPlayer(const char *file) +{ + sp mp = new MediaPlayer(); + if (mp->setDataSource(file) == NO_ERROR) { + mp->setAudioStreamType(AudioSystem::ALARM); + mp->prepare(); + } else { + mp.clear(); + LOGE("Failed to load CameraService sounds."); + } + return mp; +} + CameraService::Client::Client(const sp& cameraService, const sp& cameraClient, pid_t clientPid) { @@ -161,6 +176,9 @@ CameraService::Client::Client(const sp& cameraService, mHardware = openCameraHardware(); mUseOverlay = mHardware->useOverlay(); + mMediaPlayerClick = newMediaPlayer("/system/media/audio/ui/camera_click.ogg"); + mMediaPlayerBeep = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg"); + // Callback is disabled by default mPreviewCallbackFlag = FRAME_CALLBACK_FLAG_NOOP; LOGD("Client X constructor"); @@ -265,6 +283,9 @@ CameraService::Client::~Client() #endif } + mMediaPlayerBeep.clear(); + mMediaPlayerClick.clear(); + // make sure we tear down the hardware mClientPid = IPCThreadState::self()->getCallingPid(); disconnect(); @@ -464,6 +485,9 @@ status_t CameraService::Client::startPreview() status_t CameraService::Client::startRecording() { + if (mMediaPlayerBeep.get() != NULL) { + mMediaPlayerBeep->start(); + } return startCameraMode(CAMERA_RECORDING_MODE); } @@ -502,6 +526,9 @@ void CameraService::Client::stopRecording() return; } + if (mMediaPlayerBeep.get() != NULL) { + mMediaPlayerBeep->start(); + } mHardware->stopRecording(); LOGV("stopRecording(), hardware stopped OK"); mPreviewBuffer.clear(); @@ -684,6 +711,9 @@ status_t CameraService::Client::takePicture() return INVALID_OPERATION; } + if (mMediaPlayerClick.get() != NULL) { + mMediaPlayerClick->start(); + } return mHardware->takePicture(shutterCallback, yuvPictureCallback, jpegPictureCallback, diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h index d9b79276a72a..6752f265dabb 100644 --- a/camera/libcameraservice/CameraService.h +++ b/camera/libcameraservice/CameraService.h @@ -27,6 +27,8 @@ class android::MemoryHeapBase; namespace android { +class MediaPlayer; + // ---------------------------------------------------------------------------- #define LIKELY( exp ) (__builtin_expect( (exp) != 0, true )) @@ -178,6 +180,9 @@ private: sp mPreviewBuffer; int mPreviewCallbackFlag; + sp mMediaPlayerClick; + sp mMediaPlayerBeep; + // these are immutable once the object is created, // they don't need to be protected by a lock sp mCameraClient; diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index cb1e903d2bb3..acf41eeb0f3b 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -114,6 +114,7 @@ public final class ActivityThread { private static final boolean DEBUG = false; private static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV; private static final boolean DEBUG_BROADCAST = false; + private static final boolean DEBUG_RESULTS = false; private static final long MIN_TIME_BETWEEN_GCS = 5*1000; private static final Pattern PATTERN_SEMICOLON = Pattern.compile(";"); private static final int SQLITE_MEM_RELEASED_EVENT_LOG_TAG = 75003; @@ -2118,6 +2119,8 @@ public final class ActivityThread { public final void sendActivityResult( IBinder token, String id, int requestCode, int resultCode, Intent data) { + if (DEBUG_RESULTS) Log.v(TAG, "sendActivityResult: id=" + id + + " req=" + requestCode + " res=" + resultCode + " data=" + data); ArrayList list = new ArrayList(); list.add(new ResultInfo(id, requestCode, resultCode, data)); mAppThread.scheduleSendResult(token, list); @@ -2993,6 +2996,8 @@ public final class ActivityThread { if (ri.mData != null) { ri.mData.setExtrasClassLoader(r.activity.getClassLoader()); } + if (DEBUG_RESULTS) Log.v(TAG, + "Delivering result to activity " + r + " : " + ri); r.activity.dispatchActivityResult(ri.mResultWho, ri.mRequestCode, ri.mResultCode, ri.mData); } catch (Exception e) { @@ -3008,7 +3013,7 @@ public final class ActivityThread { private final void handleSendResult(ResultData res) { ActivityRecord r = mActivities.get(res.token); - if (localLOGV) Log.v(TAG, "Handling send result to " + r); + if (DEBUG_RESULTS) Log.v(TAG, "Handling send result to " + r); if (r != null) { final boolean resumed = !r.paused; if (!r.activity.mFinished && r.activity.mDecor != null diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index ecef38f4378e..55fce4932e6d 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -2723,10 +2723,8 @@ class ApplicationContext extends Context { mTimestamp = mFileStatus.mtime; } - // Writing was successful, delete the backup file - if (!mBackupFile.delete()) { - Log.e(TAG, "Couldn't delete new backup file " + mBackupFile); - } + // Writing was successful, delete the backup file if there is one. + mBackupFile.delete(); return true; } catch (XmlPullParserException e) { Log.w(TAG, "writeFileLocked: Got exception:", e); diff --git a/core/java/android/app/DatePickerDialog.java b/core/java/android/app/DatePickerDialog.java index ee5e0d5b577c..863cbcc4d113 100644 --- a/core/java/android/app/DatePickerDialog.java +++ b/core/java/android/app/DatePickerDialog.java @@ -47,6 +47,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, private final OnDateSetListener mCallBack; private final Calendar mCalendar; private final java.text.DateFormat mDateFormat; + private final java.text.DateFormat mTitleDateFormat; private final String[] mWeekDays; private int mInitialYear; @@ -108,6 +109,8 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, mWeekDays = symbols.getShortWeekdays(); mDateFormat = DateFormat.getMediumDateFormat(context); + mTitleDateFormat = java.text.DateFormat. + getDateInstance(java.text.DateFormat.FULL); mCalendar = Calendar.getInstance(); updateTitle(mInitialYear, mInitialMonth, mInitialDay); @@ -126,7 +129,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, @Override public void show() { super.show(); - + /* Sometimes the full month is displayed causing the title * to be very long, in those cases ensure it doesn't wrap to * 2 lines (as that looks jumpy) and ensure we ellipsize the end. @@ -160,8 +163,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, mCalendar.set(Calendar.YEAR, year); mCalendar.set(Calendar.MONTH, month); mCalendar.set(Calendar.DAY_OF_MONTH, day); - String weekday = mWeekDays[mCalendar.get(Calendar.DAY_OF_WEEK)]; - setTitle(weekday + ", " + mDateFormat.format(mCalendar.getTime())); + setTitle(mTitleDateFormat.format(mCalendar.getTime())); } @Override diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 25544deac10d..5cc5730c098f 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -172,7 +172,8 @@ public abstract class ContentProvider implements ComponentCallbacks { public ISyncAdapter getSyncAdapter() { checkWritePermission(null); - return ContentProvider.this.getSyncAdapter().getISyncAdapter(); + SyncAdapter sa = ContentProvider.this.getSyncAdapter(); + return sa != null ? sa.getISyncAdapter() : null; } private void checkReadPermission(Uri uri) { diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 306c02eca3d8..c514df754cef 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1125,7 +1125,8 @@ public class Intent implements Parcelable { public static final String ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL"; /** * Broadcast Action: A new application package has been installed on the - * device. The data contains the name of the package. + * device. The data contains the name of the package. Note that the + * newly installed package does not receive this broadcast. *

My include the following extras: *

    *
  • {@link #EXTRA_UID} containing the integer uid assigned to the new package. @@ -1135,6 +1136,17 @@ public class Intent implements Parcelable { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED"; + /** + * Broadcast Action: A new version of an application package has been + * installed, replacing an existing version that was previously installed. + * The data contains the name of the package. + *

    My include the following extras: + *

      + *
    • {@link #EXTRA_UID} containing the integer uid assigned to the new package. + *
    + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED"; /** * Broadcast Action: An existing application package has been removed from * the device. The data contains the name of the package. The package @@ -1163,7 +1175,9 @@ public class Intent implements Parcelable { * Broadcast Action: The user has restarted a package, and all of its * processes have been killed. All runtime state * associated with it (processes, alarms, notifications, etc) should - * be removed. The data contains the name of the package. + * be removed. Note that the restarted package does not + * receive this broadcast. + * The data contains the name of the package. *
      *
    • {@link #EXTRA_UID} containing the integer uid assigned to the package. *
    @@ -1173,8 +1187,9 @@ public class Intent implements Parcelable { /** * Broadcast Action: The user has cleared the data of a package. This should * be preceded by {@link #ACTION_PACKAGE_RESTARTED}, after which all of - * its persistent data is erased and this broadcast sent. The data contains - * the name of the package. + * its persistent data is erased and this broadcast sent. + * Note that the cleared package does not + * receive this broadcast. The data contains the name of the package. *
      *
    • {@link #EXTRA_UID} containing the integer uid assigned to the package. *
    diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java index 0edbe5b7e1a1..91fa90079923 100644 --- a/core/java/android/net/http/CertificateChainValidator.java +++ b/core/java/android/net/http/CertificateChainValidator.java @@ -43,7 +43,8 @@ class CertificateChainValidator { /** * The singleton instance of the certificate chain validator */ - private static CertificateChainValidator sInstance; + private static final CertificateChainValidator sInstance + = new CertificateChainValidator(); /** * Default trust manager (used to perform CA certificate validation) @@ -54,10 +55,6 @@ class CertificateChainValidator { * @return The singleton instance of the certificator chain validator */ public static CertificateChainValidator getInstance() { - if (sInstance == null) { - sInstance = new CertificateChainValidator(); - } - return sInstance; } @@ -159,13 +156,11 @@ class CertificateChainValidator { // report back to the user. // try { - synchronized (mDefaultTrustManager) { - mDefaultTrustManager.checkServerTrusted( - serverCertificates, "RSA"); + mDefaultTrustManager.checkServerTrusted( + serverCertificates, "RSA"); - // no errors!!! - return null; - } + // no errors!!! + return null; } catch (CertificateException e) { if (HttpLog.LOGV) { HttpLog.v( @@ -191,10 +186,8 @@ class CertificateChainValidator { // check if the last certificate in the chain (root) is trusted X509Certificate[] rootCertificateChain = { currCertificate }; try { - synchronized (mDefaultTrustManager) { - mDefaultTrustManager.checkServerTrusted( - rootCertificateChain, "RSA"); - } + mDefaultTrustManager.checkServerTrusted( + rootCertificateChain, "RSA"); } catch (CertificateExpiredException e) { String errorMessage = e.getMessage(); if (errorMessage == null) { diff --git a/core/java/android/net/http/HttpsConnection.java b/core/java/android/net/http/HttpsConnection.java index fe02d3ea6430..55b733f3ea6f 100644 --- a/core/java/android/net/http/HttpsConnection.java +++ b/core/java/android/net/http/HttpsConnection.java @@ -17,61 +17,41 @@ package android.net.http; import android.content.Context; - -import junit.framework.Assert; - -import java.io.IOException; - -import java.security.cert.X509Certificate; - -import java.net.Socket; -import java.net.InetSocketAddress; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - +import android.util.Log; +import org.apache.harmony.xnet.provider.jsse.FileClientSessionCache; +import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache; +import org.apache.harmony.xnet.provider.jsse.SSLContextImpl; import org.apache.http.Header; -import org.apache.http.HttpClientConnection; import org.apache.http.HttpException; import org.apache.http.HttpHost; -import org.apache.http.HttpRequest; -import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.ParseException; import org.apache.http.ProtocolVersion; import org.apache.http.StatusLine; -import org.apache.http.impl.DefaultHttpClientConnection; import org.apache.http.message.BasicHttpRequest; import org.apache.http.params.BasicHttpParams; -import org.apache.http.params.HttpParams; import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; -/** - * Simple exception we throw if the SSL connection is closed by the user. - * - * {@hide} - */ -class SSLConnectionClosedByUserException extends SSLException { - - public SSLConnectionClosedByUserException(String reason) { - super(reason); - } -} +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.File; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.security.KeyManagementException; +import java.security.cert.X509Certificate; /** * A Connection connecting to a secure http server or tunneling through * a http proxy server to a https server. + * + * @hide */ -class HttpsConnection extends Connection { - - /** - * SSL context - */ - private static SSLContext mSslContext = null; +public class HttpsConnection extends Connection { /** * SSL socket factory @@ -79,42 +59,59 @@ class HttpsConnection extends Connection { private static SSLSocketFactory mSslSocketFactory = null; static { - // initialize the socket factory + // This intiialization happens in the zygote. It triggers some + // lazy initialization that can will benefit later invocations of + // initializeEngine(). + initializeEngine(null); + } + + /** + * @hide + * + * @param sessionDir directory to cache SSL sessions + */ + public static void initializeEngine(File sessionDir) { try { - mSslContext = SSLContext.getInstance("TLS"); - if (mSslContext != null) { - // here, trust managers is a single trust-all manager - TrustManager[] trustManagers = new TrustManager[] { - new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; - } + SSLClientSessionCache cache = null; + if (sessionDir != null) { + Log.d("HttpsConnection", "Caching SSL sessions in " + + sessionDir + "."); + cache = FileClientSessionCache.usingDirectory(sessionDir); + } - public void checkClientTrusted( - X509Certificate[] certs, String authType) { - } + SSLContextImpl sslContext = new SSLContextImpl(); - public void checkServerTrusted( - X509Certificate[] certs, String authType) { - } + // here, trust managers is a single trust-all manager + TrustManager[] trustManagers = new TrustManager[] { + new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; } - }; - mSslContext.init(null, trustManagers, null); - mSslSocketFactory = mSslContext.getSocketFactory(); - } - } catch (Exception t) { - if (HttpLog.LOGV) { - HttpLog.v("HttpsConnection: failed to initialize the socket factory"); + public void checkClientTrusted( + X509Certificate[] certs, String authType) { + } + + public void checkServerTrusted( + X509Certificate[] certs, String authType) { + } + } + }; + + sslContext.engineInit(null, trustManagers, null, cache, null); + + synchronized (HttpsConnection.class) { + mSslSocketFactory = sslContext.engineGetSocketFactory(); } + } catch (KeyManagementException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); } } - /** - * @return The shared SSL context. - */ - /*package*/ static SSLContext getContext() { - return mSslContext; + private synchronized static SSLSocketFactory getSocketFactory() { + return mSslSocketFactory; } /** @@ -252,10 +249,8 @@ class HttpsConnection extends Connection { if (statusCode == HttpStatus.SC_OK) { try { - synchronized (mSslSocketFactory) { - sslSock = (SSLSocket) mSslSocketFactory.createSocket( + sslSock = (SSLSocket) getSocketFactory().createSocket( proxySock, mHost.getHostName(), mHost.getPort(), true); - } } catch(IOException e) { if (sslSock != null) { sslSock.close(); @@ -288,14 +283,11 @@ class HttpsConnection extends Connection { } else { // if we do not have a proxy, we simply connect to the host try { - synchronized (mSslSocketFactory) { - sslSock = (SSLSocket) mSslSocketFactory.createSocket(); - - sslSock.setSoTimeout(SOCKET_TIMEOUT); - sslSock.connect(new InetSocketAddress(mHost.getHostName(), - mHost.getPort())); - - } + sslSock = (SSLSocket) getSocketFactory().createSocket(); + + sslSock.setSoTimeout(SOCKET_TIMEOUT); + sslSock.connect(new InetSocketAddress(mHost.getHostName(), + mHost.getPort())); } catch(IOException e) { if (sslSock != null) { sslSock.close(); @@ -371,6 +363,7 @@ class HttpsConnection extends Connection { BasicHttpParams params = new BasicHttpParams(); params.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE, 8192); conn.bind(sslSock, params); + return conn; } @@ -425,3 +418,15 @@ class HttpsConnection extends Connection { return "https"; } } + +/** + * Simple exception we throw if the SSL connection is closed by the user. + * + * {@hide} + */ +class SSLConnectionClosedByUserException extends SSLException { + + public SSLConnectionClosedByUserException(String reason) { + super(reason); + } +} diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 76c74df27838..d492b6ae2c69 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -292,7 +292,7 @@ public abstract class BatteryStats implements Parcelable { * {@hide} */ public abstract long getPhoneOnTime(long batteryRealtime, int which); - + /** * Returns the time in milliseconds that wifi has been on while the device was * running on battery. @@ -300,7 +300,15 @@ public abstract class BatteryStats implements Parcelable { * {@hide} */ public abstract long getWifiOnTime(long batteryRealtime, int which); - + + /** + * Returns the time in milliseconds that wifi has been on and the driver has + * been in the running state while the device was running on battery. + * + * {@hide} + */ + public abstract long getWifiRunningTime(long batteryRealtime, int which); + /** * Returns the time in milliseconds that bluetooth has been on while the device was * running on battery. @@ -535,6 +543,7 @@ public abstract class BatteryStats implements Parcelable { final long screenOnTime = getScreenOnTime(batteryRealtime, which); final long phoneOnTime = getPhoneOnTime(batteryRealtime, which); final long wifiOnTime = getWifiOnTime(batteryRealtime, which); + final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which); final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which); StringBuilder sb = new StringBuilder(128); @@ -549,7 +558,8 @@ public abstract class BatteryStats implements Parcelable { // Dump misc stats dumpLine(pw, 0 /* uid */, category, MISC_DATA, - screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000, bluetoothOnTime / 1000); + screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000, + wifiRunningTime / 1000, bluetoothOnTime / 1000); if (which == STATS_UNPLUGGED) { dumpLine(pw, 0 /* uid */, category, BATTERY_DATA, getUnpluggedStartLevel(), @@ -667,7 +677,7 @@ public abstract class BatteryStats implements Parcelable { final long rawUptime = SystemClock.uptimeMillis() * 1000; final long rawRealtime = SystemClock.elapsedRealtime() * 1000; final long batteryUptime = getBatteryUptime(rawUptime); - final long batteryRealtime = getBatteryUptime(rawRealtime); + final long batteryRealtime = getBatteryRealtime(rawRealtime); final long whichBatteryUptime = computeBatteryUptime(rawUptime, which); final long whichBatteryRealtime = computeBatteryRealtime(rawRealtime, which); @@ -692,6 +702,7 @@ public abstract class BatteryStats implements Parcelable { final long screenOnTime = getScreenOnTime(batteryRealtime, which); final long phoneOnTime = getPhoneOnTime(batteryRealtime, which); + final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which); final long wifiOnTime = getWifiOnTime(batteryRealtime, which); final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which); pw.println(prefix @@ -701,6 +712,8 @@ public abstract class BatteryStats implements Parcelable { + "(" + formatRatioLocked(phoneOnTime, whichBatteryRealtime) + "), time with wifi on: " + formatTimeMs(wifiOnTime / 1000) + "(" + formatRatioLocked(wifiOnTime, whichBatteryRealtime) + + "), time with wifi running: " + formatTimeMs(wifiRunningTime / 1000) + + "(" + formatRatioLocked(wifiRunningTime, whichBatteryRealtime) + "), time with bluetooth on: " + formatTimeMs(bluetoothOnTime / 1000) + "(" + formatRatioLocked(bluetoothOnTime, whichBatteryRealtime)+ ")"); diff --git a/core/java/android/os/LocalPowerManager.java b/core/java/android/os/LocalPowerManager.java index 55d7972dd007..9e88f5ae4ef0 100644 --- a/core/java/android/os/LocalPowerManager.java +++ b/core/java/android/os/LocalPowerManager.java @@ -20,12 +20,16 @@ package android.os; public interface LocalPowerManager { public static final int OTHER_EVENT = 0; public static final int CHEEK_EVENT = 1; - public static final int TOUCH_EVENT = 2; - public static final int BUTTON_EVENT = 3; // Button and trackball events. + public static final int TOUCH_EVENT = 2; // touch events are TOUCH for 300ms, and then either + // up events or LONG_TOUCH events. + public static final int LONG_TOUCH_EVENT = 3; + public static final int TOUCH_UP_EVENT = 4; + public static final int BUTTON_EVENT = 5; // Button and trackball events. public static final int POKE_LOCK_IGNORE_CHEEK_EVENTS = 0x1; public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2; public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4; + public static final int POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS = 0x8; public static final int POKE_LOCK_TIMEOUT_MASK = 0x6; diff --git a/core/java/android/provider/Checkin.java b/core/java/android/provider/Checkin.java index d11a9c52f86d..a87f5fa23a61 100644 --- a/core/java/android/provider/Checkin.java +++ b/core/java/android/provider/Checkin.java @@ -144,6 +144,43 @@ public final class Checkin { TEST, NETWORK_RX_MOBILE, NETWORK_TX_MOBILE, + MARKET_DOWNLOAD_REQUESTED, + MARKET_DOWNLOAD_SCHEDULED, + MARKET_DOWNLOAD_CANCELLED_PENDING, + MARKET_DOWNLOAD_CANCELLED, + MARKET_DOWNLOAD_OK, + MARKET_DOWNLOAD_FAILED, + MARKET_DOWNLOAD_DECLINED, + MARKET_INSTALL_SCHEDULED, + MARKET_INSTALL_FAILED, + MARKET_INSTALL_OK, + MARKET_REMOVE_SCHEDULED, + MARKET_REMOVE_MALICIOUS_SCHEDULED, + MARKET_REMOVE_ABORTED, + MARKET_REMOVE_FAILED, + MARKET_REMOVE_OK, + MARKET_UNINSTALL_SCHEDULED, + MARKET_REFUND_REQUESTED, + MARKET_REFUND_OK, + MARKET_REFUND_FAILED, + MARKET_REASON_ALREADY_EXISTS, + MARKET_REASON_INVALID_APK, + MARKET_REASON_INSUFFICIENT_STORAGE, + MARKET_REASON_DUPLICATE_PACKAGE, + MARKET_REASON_UPDATE_INCOMPATIBLE, + MARKET_REASON_MISSING_SHARED_LIBRARY, + MARKET_REASON_REPLACE_COULDNT_DELETE, + MARKET_REASON_PARSE_NOT_APK, + MARKET_REASON_PARSE_BAD_MANIFEST, + MARKET_REASON_PARSE_NO_CERTIFICATES, + MARKET_REASON_PARSE_INCONSISTENT_CERTIFICATES, + MARKET_REASON_PARSE_CERTIFICATE_ENCODING, + MARKET_REASON_PARSE_BAD_PACKAGE_NAME, + MARKET_REASON_PARSE_BAD_SHARED_USER_ID, + MARKET_REASON_PARSE_MANIFEST_MALFORMED, + MARKET_REASON_PARSE_MANIFEST_EMPTY, + MARKET_REASON_UNKNOWN, + MARKET_STALE_INSTALL_ATTEMPT, } } diff --git a/core/java/android/server/BluetoothDeviceService.java b/core/java/android/server/BluetoothDeviceService.java index b7e3846ab9eb..a815e573ee78 100644 --- a/core/java/android/server/BluetoothDeviceService.java +++ b/core/java/android/server/BluetoothDeviceService.java @@ -385,13 +385,14 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub { // Parrot, Zhongshan General K-mate Electronics, Great Well // Electronics, Flaircomm Electronics, Jatty Electronics, Delphi, // Clarion, Novero, Denso (Lexus, Toyota), Johnson Controls (Acura), + // Continental Automotive, Harman/Becker private final ArrayList mAutoPairingBlacklisted = new ArrayList(Arrays.asList( "00:02:C7", "00:16:FE", "00:19:C1", "00:1B:FB", "00:1E:3D", "00:21:4F", "00:23:06", "00:24:33", "00:A0:79", "00:0E:6D", "00:13:E0", "00:21:E8", "00:60:57", "00:0E:9F", "00:12:1C", "00:18:91", "00:18:96", "00:13:04", "00:16:FD", "00:22:A0", "00:0B:4C", "00:60:6F", "00:23:3D", "00:C0:59", - "00:0A:30" + "00:0A:30", "00:1E:AE", "00:1C:D7" )); public synchronized void loadBondState() { diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index 6be8eb96ba21..6eabea461dec 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -343,7 +343,7 @@ class BluetoothEventLoop { private void onPasskeyAgentCancel(String address) { address = address.toUpperCase(); - mPasskeyAgentRequestData.remove(address); + mBluetoothService.cancelPin(address); Intent intent = new Intent(BluetoothIntent.PAIRING_CANCEL_ACTION); intent.putExtra(BluetoothIntent.ADDRESS, address); mContext.sendBroadcast(intent, BLUETOOTH_ADMIN_PERM); diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java index 6f0be3a64f8d..200bbf4a1500 100644 --- a/core/java/android/text/Html.java +++ b/core/java/android/text/Html.java @@ -151,26 +151,22 @@ public class Html { for (int i = 0; i < text.length(); i = next) { next = text.nextSpanTransition(i, len, ParagraphStyle.class); ParagraphStyle[] style = text.getSpans(i, next, ParagraphStyle.class); - if (style.length > 0) { - out.append("
    0) { - out.append(">"); + out.append("
    "); } withinDiv(out, text, i, next); diff --git a/core/java/android/text/method/ArrowKeyMovementMethod.java b/core/java/android/text/method/ArrowKeyMovementMethod.java index 17c7a6cd8c88..92f628967d71 100644 --- a/core/java/android/text/method/ArrowKeyMovementMethod.java +++ b/core/java/android/text/method/ArrowKeyMovementMethod.java @@ -18,6 +18,7 @@ package android.text.method; import android.util.Log; import android.view.KeyEvent; +import android.graphics.Rect; import android.text.*; import android.widget.TextView; import android.view.View; @@ -202,23 +203,54 @@ implements MovementMethod public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { + int initialScrollX = -1, initialScrollY = -1; + if (event.getAction() == MotionEvent.ACTION_UP) { + initialScrollX = Touch.getInitialScrollX(widget, buffer); + initialScrollY = Touch.getInitialScrollY(widget, buffer); + } + boolean handled = Touch.onTouchEvent(widget, buffer, event); if (widget.isFocused() && !widget.didTouchFocusSelect()) { if (event.getAction() == MotionEvent.ACTION_UP) { + // If we have scrolled, then the up shouldn't move the cursor, + // but we do need to make sure the cursor is still visible at + // the current scroll offset to avoid the scroll jumping later + // to show it. + if ((initialScrollY >= 0 && initialScrollY != widget.getScrollY()) || + (initialScrollX >= 0 && initialScrollX != widget.getScrollX())) { + widget.moveCursorToVisibleOffset(); + return true; + } + int x = (int) event.getX(); int y = (int) event.getY(); x -= widget.getTotalPaddingLeft(); y -= widget.getTotalPaddingTop(); + // Clamp the position to inside of the view. + if (x < 0) { + x = 0; + } else if (x >= (widget.getWidth()-widget.getTotalPaddingRight())) { + x = widget.getWidth()-widget.getTotalPaddingRight() - 1; + } + if (y < 0) { + y = 0; + } else if (y >= (widget.getHeight()-widget.getTotalPaddingBottom())) { + y = widget.getHeight()-widget.getTotalPaddingBottom() - 1; + } + x += widget.getScrollX(); y += widget.getScrollY(); Layout layout = widget.getLayout(); int line = layout.getLineForVertical(y); + int off = layout.getOffsetForHorizontal(line, x); + // XXX should do the same adjust for x as we do for the line. + boolean cap = (MetaKeyKeyListener.getMetaState(buffer, KeyEvent.META_SHIFT_ON) == 1) || (MetaKeyKeyListener.getMetaState(buffer, diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java index 65036ad46d01..f2fb9cb68d7f 100644 --- a/core/java/android/text/method/Touch.java +++ b/core/java/android/text/method/Touch.java @@ -21,7 +21,6 @@ import android.text.NoCopySpan; import android.text.Layout.Alignment; import android.text.Spannable; import android.view.MotionEvent; -import android.view.View; import android.view.ViewConfiguration; import android.widget.TextView; @@ -82,8 +81,9 @@ public class Touch { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: - buffer.setSpan(new DragState(event.getX(), event.getY()), - 0, 0, Spannable.SPAN_MARK_MARK); + buffer.setSpan(new DragState(event.getX(), event.getY(), + widget.getScrollX(), widget.getScrollY()), + 0, 0, Spannable.SPAN_MARK_MARK); return true; case MotionEvent.ACTION_UP: @@ -142,15 +142,29 @@ public class Touch { return false; } + public static int getInitialScrollX(TextView widget, Spannable buffer) { + DragState[] ds = buffer.getSpans(0, buffer.length(), DragState.class); + return ds.length > 0 ? ds[0].mScrollX : -1; + } + + public static int getInitialScrollY(TextView widget, Spannable buffer) { + DragState[] ds = buffer.getSpans(0, buffer.length(), DragState.class); + return ds.length > 0 ? ds[0].mScrollY : -1; + } + private static class DragState implements NoCopySpan { public float mX; public float mY; + public int mScrollX; + public int mScrollY; public boolean mFarEnough; public boolean mUsed; - public DragState(float x, float y) { + public DragState(float x, float y, int scrollX, int scrollY) { mX = x; mY = y; + mScrollX = scrollX; + mScrollY = scrollY; } } } diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java index deca910c6fbf..11de3e2ed433 100644 --- a/core/java/android/view/inputmethod/BaseInputConnection.java +++ b/core/java/android/view/inputmethod/BaseInputConnection.java @@ -51,7 +51,6 @@ public class BaseInputConnection implements InputConnection { static final Object COMPOSING = new ComposingText(); final InputMethodManager mIMM; - final Handler mH; final View mTargetView; final boolean mDummyMode; @@ -60,19 +59,17 @@ public class BaseInputConnection implements InputConnection { Editable mEditable; KeyCharacterMap mKeyCharacterMap; - BaseInputConnection(InputMethodManager mgr, boolean dummyMode) { + BaseInputConnection(InputMethodManager mgr, boolean fullEditor) { mIMM = mgr; mTargetView = null; - mH = null; - mDummyMode = dummyMode; + mDummyMode = !fullEditor; } - public BaseInputConnection(View targetView, boolean dummyMode) { + public BaseInputConnection(View targetView, boolean fullEditor) { mIMM = (InputMethodManager)targetView.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); - mH = targetView.getHandler(); mTargetView = targetView; - mDummyMode = dummyMode; + mDummyMode = !fullEditor; } public static final void removeComposingSpans(Spannable text) { @@ -403,7 +400,7 @@ public class BaseInputConnection implements InputConnection { */ public boolean sendKeyEvent(KeyEvent event) { synchronized (mIMM.mH) { - Handler h = mH; + Handler h = mTargetView != null ? mTargetView.getHandler() : null; if (h == null) { if (mIMM.mServedView != null) { h = mIMM.mServedView.getHandler(); diff --git a/core/java/android/view/inputmethod/InputConnectionWrapper.java b/core/java/android/view/inputmethod/InputConnectionWrapper.java index e3d5e62151b1..210559aed904 100644 --- a/core/java/android/view/inputmethod/InputConnectionWrapper.java +++ b/core/java/android/view/inputmethod/InputConnectionWrapper.java @@ -24,9 +24,21 @@ import android.view.KeyEvent; * and have fun! */ public class InputConnectionWrapper implements InputConnection { - private final InputConnection mTarget; + private InputConnection mTarget; + final boolean mMutable; - public InputConnectionWrapper(InputConnection target) { + public InputConnectionWrapper(InputConnection target, boolean mutable) { + mMutable = mutable; + mTarget = target; + } + + /** + * Change the target of the input connection. + */ + public void setTarget(InputConnection target) { + if (mTarget != null && !mMutable) { + throw new SecurityException("not mutable"); + } mTarget = target; } diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 4de9eef04d40..d79789059ca8 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -426,7 +426,7 @@ public final class InputMethodManager { } }; - final InputConnection mDummyInputConnection = new BaseInputConnection(this, true); + final InputConnection mDummyInputConnection = new BaseInputConnection(this, false); InputMethodManager(IInputMethodManager service, Looper looper) { mService = service; diff --git a/core/java/android/webkit/ContentLoader.java b/core/java/android/webkit/ContentLoader.java index fb01c8c6e85b..f6d7f6990a45 100644 --- a/core/java/android/webkit/ContentLoader.java +++ b/core/java/android/webkit/ContentLoader.java @@ -105,6 +105,9 @@ class ContentLoader extends StreamLoader { if (mContentType != null) { headers.setContentType("text/html"); } + // override the cache-control header set by StreamLoader as content can + // change, we don't want WebKit to cache it + headers.setCacheControl("no-store, no-cache"); } /** diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 965d900f32ac..05636871064a 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -41,8 +41,10 @@ import android.view.ViewConfiguration; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; +import android.view.inputmethod.InputConnectionWrapper; import android.view.inputmethod.InputMethodManager; import android.view.ContextMenu.ContextMenuInfo; @@ -429,6 +431,9 @@ public abstract class AbsListView extends AdapterView implements Te private float mDensityScale; + private InputConnection mDefInputConnection; + private InputConnectionWrapper mPublicInputConnection; + /** * Interface definition for a callback to be invoked when the list or grid * has been scrolled. @@ -2932,7 +2937,46 @@ public abstract class AbsListView extends AdapterView implements Te // InputConnection to proxy to. Unfortunately this means we pretty // much need to make it as soon as a list view gets focus. createTextFilter(false); - return mTextFilter.onCreateInputConnection(outAttrs); + if (mPublicInputConnection == null) { + mDefInputConnection = new BaseInputConnection(this, false); + mPublicInputConnection = new InputConnectionWrapper( + mTextFilter.onCreateInputConnection(outAttrs), true) { + @Override + public boolean reportFullscreenMode(boolean enabled) { + // Use our own input connection, since it is + // the "real" one the IME is talking with. + return mDefInputConnection.reportFullscreenMode(enabled); + } + + @Override + public boolean performEditorAction(int editorAction) { + // The editor is off in its own window; we need to be + // the one that does this. + if (editorAction == EditorInfo.IME_ACTION_DONE) { + InputMethodManager imm = (InputMethodManager) + getContext().getSystemService( + Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.hideSoftInputFromWindow(getWindowToken(), 0); + } + return true; + } + return false; + } + + @Override + public boolean sendKeyEvent(KeyEvent event) { + // Use our own input connection, since the filter + // text view may not be shown in a window so has + // no ViewRoot to dispatch events with. + return mDefInputConnection.sendKeyEvent(event); + } + }; + } + outAttrs.inputType = EditorInfo.TYPE_CLASS_TEXT + | EditorInfo.TYPE_TEXT_VARIATION_FILTER; + outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE; + return mPublicInputConnection; } return null; } @@ -3019,14 +3063,16 @@ public abstract class AbsListView extends AdapterView implements Te } /** - * For our text watcher that associated with the text filter + * For our text watcher that is associated with the text filter. Does + * nothing. */ public void beforeTextChanged(CharSequence s, int start, int count, int after) { } /** - * For our text watcher that associated with the text filter. Performs the actual - * filtering as the text changes. + * For our text watcher that is associated with the text filter. Performs + * the actual filtering as the text changes, and takes care of hiding and + * showing the popup displaying the currently entered filter text. */ public void onTextChanged(CharSequence s, int start, int before, int count) { if (mPopup != null && isTextFilterEnabled()) { @@ -3038,7 +3084,7 @@ public abstract class AbsListView extends AdapterView implements Te mFiltered = true; } else if (showing && length == 0) { // Remove the filter popup if the user has cleared all text - mPopup.dismiss(); + dismissPopup(); mFiltered = false; } if (mAdapter instanceof Filterable) { @@ -3055,7 +3101,8 @@ public abstract class AbsListView extends AdapterView implements Te } /** - * For our text watcher that associated with the text filter + * For our text watcher that is associated with the text filter. Does + * nothing. */ public void afterTextChanged(Editable s) { } diff --git a/core/java/android/widget/CursorAdapter.java b/core/java/android/widget/CursorAdapter.java index 898e501a183f..da90a9f40294 100644 --- a/core/java/android/widget/CursorAdapter.java +++ b/core/java/android/widget/CursorAdapter.java @@ -127,7 +127,7 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, /** * @see android.widget.ListAdapter#getCount() */ - public final int getCount() { + public int getCount() { if (mDataValid && mCursor != null) { return mCursor.getCount(); } else { @@ -138,7 +138,7 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, /** * @see android.widget.ListAdapter#getItem(int) */ - public final Object getItem(int position) { + public Object getItem(int position) { if (mDataValid && mCursor != null) { mCursor.moveToPosition(position); return mCursor; @@ -150,7 +150,7 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, /** * @see android.widget.ListAdapter#getItemId(int) */ - public final long getItemId(int position) { + public long getItemId(int position) { if (mDataValid && mCursor != null) { if (mCursor.moveToPosition(position)) { return mCursor.getLong(mRowIDColumn); diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 2bb716cbf151..47db6f274538 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -56,7 +56,9 @@ public class FrameLayout extends ViewGroup { private final Rect mSelfBounds = new Rect(); private final Rect mOverlayBounds = new Rect(); private int mForegroundGravity = Gravity.FILL; - private boolean mForegroundInPadding = true; + + /** {@hide} */ + protected boolean mForegroundInPadding = true; public FrameLayout(Context context) { super(context); diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index aced533192a3..4d5032ea3129 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -2054,18 +2054,19 @@ public class ListView extends AbsListView { */ private boolean handleHorizontalFocusWithinListItem(int direction) { if (direction != View.FOCUS_LEFT && direction != View.FOCUS_RIGHT) { - throw new IllegalArgumentException("direction must be one of {View.FOCUS_LEFT, View.FOCUS_RIGHT}"); + throw new IllegalArgumentException("direction must be one of" + + " {View.FOCUS_LEFT, View.FOCUS_RIGHT}"); } final int numChildren = getChildCount(); if (mItemsCanFocus && numChildren > 0 && mSelectedPosition != INVALID_POSITION) { final View selectedView = getSelectedView(); - if (selectedView.hasFocus() && selectedView instanceof ViewGroup) { + if (selectedView != null && selectedView.hasFocus() && + selectedView instanceof ViewGroup) { + final View currentFocus = selectedView.findFocus(); final View nextFocus = FocusFinder.getInstance().findNextFocus( - (ViewGroup) selectedView, - currentFocus, - direction); + (ViewGroup) selectedView, currentFocus, direction); if (nextFocus != null) { // do the math to get interesting rect in next focus' coordinates currentFocus.getFocusedRect(mTempRect); @@ -2079,11 +2080,8 @@ public class ListView extends AbsListView { // if the global result is going to be some other view within this // list. this is to acheive the overall goal of having // horizontal d-pad navigation remain in the current item. - final View globalNextFocus = FocusFinder.getInstance() - .findNextFocus( - (ViewGroup) getRootView(), - currentFocus, - direction); + final View globalNextFocus = FocusFinder.getInstance().findNextFocus( + (ViewGroup) getRootView(), currentFocus, direction); if (globalNextFocus != null) { return isViewAncestorOf(globalNextFocus, this); } @@ -2769,6 +2767,8 @@ public class ListView extends AbsListView { final boolean headerDividers = mHeaderDividersEnabled; final boolean footerDividers = mFooterDividersEnabled; final int first = mFirstPosition; + final boolean areAllItemsSelectable = mAreAllItemsSelectable; + final ListAdapter adapter = mAdapter; if (!mStackFromBottom) { int bottom; @@ -2779,7 +2779,10 @@ public class ListView extends AbsListView { (footerDividers || first + i < footerLimit)) { View child = getChildAt(i); bottom = child.getBottom(); - if (bottom < listBottom) { + // Don't draw dividers next to items that are not enabled + if (bottom < listBottom && (areAllItemsSelectable || + (adapter.isEnabled(first + i) && (i == count - 1 || + adapter.isEnabled(first + i + 1))))) { bounds.top = bottom; bounds.bottom = bottom + dividerHeight; drawDivider(canvas, bounds, i); @@ -2795,7 +2798,10 @@ public class ListView extends AbsListView { (footerDividers || first + i < footerLimit)) { View child = getChildAt(i); top = child.getTop(); - if (top > listTop) { + // Don't draw dividers next to items that are not enabled + if (top > listTop && (areAllItemsSelectable || + (adapter.isEnabled(first + i) && (i == count - 1 || + adapter.isEnabled(first + i + 1))))) { bounds.top = top - dividerHeight; bounds.bottom = top; // Give the method the child ABOVE the divider, so we diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 136752b9f3a2..81516b9158dc 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -727,7 +727,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE); } else if (phone) { mInput = DialerKeyListener.getInstance(); - inputType = EditorInfo.TYPE_CLASS_PHONE; + mInputType = inputType = EditorInfo.TYPE_CLASS_PHONE; } else if (numeric != 0) { mInput = DigitsKeyListener.getInstance((numeric & SIGNED) != 0, (numeric & DECIMAL) != 0); @@ -5421,6 +5421,62 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return changed; } + /** + * Move the cursor, if needed, so that it is at an offset that is visible + * to the user. This will not move the cursor if it represents more than + * one character (a selection range). This will only work if the + * TextView contains spannable text; otherwise it will do nothing. + */ + public boolean moveCursorToVisibleOffset() { + if (!(mText instanceof Spannable)) { + return false; + } + int start = Selection.getSelectionStart(mText); + int end = Selection.getSelectionEnd(mText); + if (start != end) { + return false; + } + + // First: make sure the line is visible on screen: + + int line = mLayout.getLineForOffset(start); + + final int top = mLayout.getLineTop(line); + final int bottom = mLayout.getLineTop(line+1); + final int vspace = mBottom - mTop - getExtendedPaddingTop() - getExtendedPaddingBottom(); + int vslack = (bottom - top) / 2; + if (vslack > vspace / 4) + vslack = vspace / 4; + final int vs = mScrollY; + + if (top < (vs+vslack)) { + line = mLayout.getLineForVertical(vs+vslack+(bottom-top)); + } else if (bottom > (vspace+vs-vslack)) { + line = mLayout.getLineForVertical(vspace+vs-vslack-(bottom-top)); + } + + // Next: make sure the character is visible on screen: + + final int hspace = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(); + final int hs = mScrollX; + final int leftChar = mLayout.getOffsetForHorizontal(line, hs); + final int rightChar = mLayout.getOffsetForHorizontal(line, hspace+hs); + + int newStart = start; + if (newStart < leftChar) { + newStart = leftChar; + } else if (newStart > rightChar) { + newStart = rightChar; + } + + if (newStart != start) { + Selection.setSelection((Spannable)mText, newStart); + return true; + } + + return false; + } + @Override public void computeScroll() { if (mScroller != null) { diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl index d25975653065..e0de42145085 100644 --- a/core/java/com/android/internal/app/IBatteryStats.aidl +++ b/core/java/com/android/internal/app/IBatteryStats.aidl @@ -32,6 +32,8 @@ interface IBatteryStats { void notePhoneOff(); void noteWifiOn(); void noteWifiOff(); + void noteWifiRunning(); + void noteWifiStopped(); void noteBluetoothOn(); void noteBluetoothOff(); void noteFullWifiLockAcquired(int uid); diff --git a/core/java/com/android/internal/database/SortCursor.java b/core/java/com/android/internal/database/SortCursor.java index af0efc9195cf..99410bcaa478 100644 --- a/core/java/com/android/internal/database/SortCursor.java +++ b/core/java/com/android/internal/database/SortCursor.java @@ -253,7 +253,15 @@ public class SortCursor extends AbstractCursor if (mCursor != null) { return mCursor.getColumnNames(); } else { - return new String[0]; + // All of the cursors may be empty, but they can still return + // this information. + int length = mCursors.length; + for (int i = 0 ; i < length ; i++) { + if (mCursors[i] != null) { + return mCursors[i].getColumnNames(); + } + } + throw new IllegalStateException("No cursor that can return names"); } } diff --git a/core/java/com/android/internal/logging/AndroidHandler.java b/core/java/com/android/internal/logging/AndroidHandler.java index d9fcf60756ea..c4a147959a9b 100644 --- a/core/java/com/android/internal/logging/AndroidHandler.java +++ b/core/java/com/android/internal/logging/AndroidHandler.java @@ -151,7 +151,7 @@ public class AndroidHandler extends Handler { Log.e("AndroidHandler", "Error logging message.", e); } } - + /** * Converts a {@link java.util.logging.Logger} logging level into an Android one. * @@ -159,20 +159,16 @@ public class AndroidHandler extends Handler { * * @return The resulting Android logging level. */ - static int getAndroidLevel(Level level) - { + static int getAndroidLevel(Level level) { int value = level.intValue(); - - if (value >= Level.SEVERE.intValue()) { + if (value >= 1000) { // SEVERE return Log.ERROR; - } else if (value >= Level.WARNING.intValue()) { + } else if (value >= 900) { // WARNING return Log.WARN; - } else if (value >= Level.INFO.intValue()) { + } else if (value >= 800) { // INFO return Log.INFO; - } else if (value >= Level.CONFIG.intValue()) { + } else { return Log.DEBUG; - } else { - return Log.VERBOSE; } } diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index b3ae0d6adaa7..38335b55fbe7 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -47,7 +47,7 @@ public final class BatteryStatsImpl extends BatteryStats { private static final int MAGIC = 0xBA757475; // 'BATSTATS' // Current on-disk Parcel version - private static final int VERSION = 27; + private static final int VERSION = 28; private final File mFile; private final File mBackupFile; @@ -94,6 +94,9 @@ public final class BatteryStatsImpl extends BatteryStats { boolean mWifiOn; Timer mWifiOnTimer; + + boolean mWifiRunning; + Timer mWifiRunningTimer; boolean mBluetoothOn; Timer mBluetoothOnTimer; @@ -497,6 +500,20 @@ public final class BatteryStatsImpl extends BatteryStats { } } + public void noteWifiRunningLocked() { + if (!mWifiRunning) { + mWifiRunning = true; + mWifiRunningTimer.startRunningLocked(this); + } + } + + public void noteWifiStoppedLocked() { + if (mWifiRunning) { + mWifiRunning = false; + mWifiRunningTimer.stopRunningLocked(this); + } + } + public void noteBluetoothOnLocked() { if (!mBluetoothOn) { mBluetoothOn = true; @@ -551,6 +568,10 @@ public final class BatteryStatsImpl extends BatteryStats { return mWifiOnTimer.getTotalTime(batteryRealtime, which); } + @Override public long getWifiRunningTime(long batteryRealtime, int which) { + return mWifiRunningTimer.getTotalTime(batteryRealtime, which); + } + @Override public long getBluetoothOnTime(long batteryRealtime, int which) { return mBluetoothOnTimer.getTotalTime(batteryRealtime, which); } @@ -1597,7 +1618,8 @@ public final class BatteryStatsImpl extends BatteryStats { mScreenOnTimer = new Timer(-1, null, mUnpluggables); mPhoneOnTimer = new Timer(-2, null, mUnpluggables); mWifiOnTimer = new Timer(-3, null, mUnpluggables); - mBluetoothOnTimer = new Timer(-4, null, mUnpluggables); + mWifiRunningTimer = new Timer(-4, null, mUnpluggables); + mBluetoothOnTimer = new Timer(-5, null, mUnpluggables); mOnBattery = mOnBatteryInternal = false; mTrackBatteryPastUptime = 0; mTrackBatteryPastRealtime = 0; @@ -1935,6 +1957,8 @@ public final class BatteryStatsImpl extends BatteryStats { mPhoneOnTimer.readSummaryFromParcelLocked(in); mWifiOn = false; mWifiOnTimer.readSummaryFromParcelLocked(in); + mWifiRunning = false; + mWifiRunningTimer.readSummaryFromParcelLocked(in); mBluetoothOn = false; mBluetoothOnTimer.readSummaryFromParcelLocked(in); @@ -2038,6 +2062,7 @@ public final class BatteryStatsImpl extends BatteryStats { mScreenOnTimer.writeSummaryFromParcelLocked(out, NOWREAL); mPhoneOnTimer.writeSummaryFromParcelLocked(out, NOWREAL); mWifiOnTimer.writeSummaryFromParcelLocked(out, NOWREAL); + mWifiRunningTimer.writeSummaryFromParcelLocked(out, NOWREAL); mBluetoothOnTimer.writeSummaryFromParcelLocked(out, NOWREAL); final int NU = mUidStats.size(); @@ -2163,6 +2188,8 @@ public final class BatteryStatsImpl extends BatteryStats { mPhoneOnTimer = new Timer(-2, null, mUnpluggables, in); mWifiOn = false; mWifiOnTimer = new Timer(-2, null, mUnpluggables, in); + mWifiRunning = false; + mWifiRunningTimer = new Timer(-2, null, mUnpluggables, in); mBluetoothOn = false; mBluetoothOnTimer = new Timer(-2, null, mUnpluggables, in); mUptime = in.readLong(); @@ -2217,6 +2244,7 @@ public final class BatteryStatsImpl extends BatteryStats { mScreenOnTimer.writeToParcel(out, batteryRealtime); mPhoneOnTimer.writeToParcel(out, batteryRealtime); mWifiOnTimer.writeToParcel(out, batteryRealtime); + mWifiRunningTimer.writeToParcel(out, batteryRealtime); mBluetoothOnTimer.writeToParcel(out, batteryRealtime); out.writeLong(mUptime); out.writeLong(mUptimeStart); @@ -2264,6 +2292,8 @@ public final class BatteryStatsImpl extends BatteryStats { mPhoneOnTimer.logState(); Log.i(TAG, "*** Wifi timer:"); mWifiOnTimer.logState(); + Log.i(TAG, "*** WifiRunning timer:"); + mWifiRunningTimer.logState(); Log.i(TAG, "*** Bluetooth timer:"); mBluetoothOnTimer.logState(); } diff --git a/core/java/com/android/internal/widget/EditStyledText.java b/core/java/com/android/internal/widget/EditStyledText.java index 8a4675a4c82f..b36707e17da0 100644 --- a/core/java/com/android/internal/widget/EditStyledText.java +++ b/core/java/com/android/internal/widget/EditStyledText.java @@ -16,6 +16,8 @@ package com.android.internal.widget; +import java.util.ArrayList; + import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; @@ -23,14 +25,21 @@ import android.net.Uri; import android.os.Bundle; import android.text.Editable; import android.text.Html; +import android.text.Layout; import android.text.Spannable; +import android.text.method.ArrowKeyMovementMethod; import android.text.style.AbsoluteSizeSpan; +import android.text.style.AlignmentSpan; import android.text.style.ForegroundColorSpan; import android.text.style.ImageSpan; import android.util.AttributeSet; import android.util.Log; +import android.view.KeyEvent; import android.view.MotionEvent; +import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.EditText; +import android.widget.TextView; /** * EditStyledText extends EditText for managing the flow and status to edit @@ -57,6 +66,10 @@ public class EditStyledText extends EditText { public static final int MODE_COLOR = 4; /** The mode of selection. */ public static final int MODE_SELECT = 5; + /** The mode of changing alignment. */ + public static final int MODE_ALIGN = 6; + /** The mode of changing cut. */ + public static final int MODE_CUT = 7; /** * The state of selection. @@ -85,6 +98,7 @@ public class EditStyledText extends EditText { */ public interface EditStyledTextNotifier { public void notifyHintMsg(int msgId); + public void notifyStateChanged(int mode, int state); } private EditStyledTextNotifier mESTInterface; @@ -167,14 +181,23 @@ public class EditStyledText extends EditText { sizesendints); } + public void setAlignAlertParams(CharSequence aligntitle, + CharSequence[] alignnames) { + mToast.setAlignAlertParams(aligntitle, alignnames); + } + @Override public boolean onTouchEvent(MotionEvent event) { + if (mManager.isSoftKeyBlocked() && + event.getAction() == MotionEvent.ACTION_UP) { + cancelLongPress(); + } final boolean superResult = super.onTouchEvent(event); if (event.getAction() == MotionEvent.ACTION_UP) { if (DBG) { Log.d(LOG_TAG, "--- onTouchEvent"); } - mManager.onTouchScreen(); + mManager.onCursorMoved(); } return superResult; } @@ -201,6 +224,13 @@ public class EditStyledText extends EditText { mManager.onStartCopy(); } + /** + * Start "Cut" action. + */ + public void onStartCut() { + mManager.onStartCut(); + } + /** * Start "Paste" action. */ @@ -222,6 +252,13 @@ public class EditStyledText extends EditText { mManager.onStartColor(); } + /** + * Start changing "Alignment" action. + */ + public void onStartAlign() { + mManager.onStartAlign(); + } + /** * Start "Select" action. */ @@ -236,6 +273,13 @@ public class EditStyledText extends EditText { mManager.onStartSelectAll(); } + /** + * Fix Selected Item. + */ + public void onFixSelectedItem() { + mManager.onFixSelectedItem(); + } + /** * InsertImage to TextView by using URI * @@ -256,13 +300,6 @@ public class EditStyledText extends EditText { mManager.onInsertImage(resId); } - /** - * Fix Selected Item. - */ - public void fixSelectedItem() { - mManager.onFixSelectItem(); - } - /** * Set Size of the Item. * @@ -283,16 +320,12 @@ public class EditStyledText extends EditText { mManager.setItemColor(color); } - public void onShowColorAlert() { - mToast.onShowColorAlertDialog(); - } - - public void onShowSizeAlert() { - mToast.onShowSizeAlertDialog(); + public void setAlignment(Layout.Alignment align) { + mManager.setAlignment(align); } /** - * Check editing is started. + * Check whether editing is started or not. * * @return Whether editing is started or not. */ @@ -300,6 +333,15 @@ public class EditStyledText extends EditText { return mManager.isEditting(); } + /** + * Check whether SoftKey is Blocked or not. + * + * @return whether SoftKey is Blocked or not. + */ + public boolean isSoftKeyBlocked() { + return mManager.isSoftKeyBlocked(); + } + /** * Get the mode of the action. * @@ -318,7 +360,33 @@ public class EditStyledText extends EditText { return mManager.getSelectState(); } - public String getBody() { + @Override + public Bundle getInputExtras(boolean create) { + Bundle bundle = super.getInputExtras(create); + if (bundle != null) { + bundle.putBoolean("allowEmoji", true); + } + return bundle; + } + + /** + * Get the state of the selection. + * + * @return The state of the selection. + */ + public String getHtml() { + return mConverter.getConvertedBody(); + } + + /** + * Get the state of the selection. + * + * @param uris + * The array of used uris. + * @return The state of the selection. + */ + public String getHtml(ArrayList uris) { + mConverter.getUriArray(uris, this.getText()); return mConverter.getConvertedBody(); } @@ -333,6 +401,28 @@ public class EditStyledText extends EditText { mManager = new EditorManager(this); mConverter = new StyledTextConverter(this); mToast = new StyledTextToast(this); + setMovementMethod(new StyledTextArrowKeyMethod(mManager)); + } + + /** + * Show Color Selecting Dialog. + */ + private void onShowColorAlert() { + mToast.onShowColorAlertDialog(); + } + + /** + * Show Size Selecting Dialog. + */ + private void onShowSizeAlert() { + mToast.onShowSizeAlertDialog(); + } + + /** + * Show Alignment Selecting Dialog. + */ + private void onShowAlignAlert() { + mToast.onShowAlignAlertDialog(); } /** @@ -347,27 +437,31 @@ public class EditStyledText extends EditText { } } - @Override - public Bundle getInputExtras(boolean create) { - Bundle bundle = super.getInputExtras(create); - if (bundle != null) { - bundle.putBoolean("allowEmoji", true); + /** + * Notify the event that the mode and state are changed. + * + * @param mode + * Mode of the editing action. + * @param state + * Mode of the selection state. + */ + private void notifyStateChanged(int mode, int state) { + if (mESTInterface != null) { + mESTInterface.notifyStateChanged(mode, state); } - return bundle; } /** - * Object which manages the flow and status of editing actions. + * EditorManager manages the flow and status of editing actions. */ private class EditorManager { private boolean mEditFlag = false; + private boolean mSoftKeyBlockFlag = false; private int mMode = 0; private int mState = 0; private int mCurStart = 0; private int mCurEnd = 0; private EditStyledText mEST; - private Editable mTextSelectBuffer; - private CharSequence mTextCopyBufer; EditorManager(EditStyledText est) { mEST = est; @@ -375,57 +469,59 @@ public class EditStyledText extends EditText { public void onStartEdit() { if (DBG) { - Log.d(LOG_TAG, "--- onEdit"); + Log.d(LOG_TAG, "--- onStartEdit"); } + Log.d(LOG_TAG, "--- onstartedit:" + this.getSelectionStart() + this.getSelectionEnd()); handleResetEdit(); + mEST.notifyStateChanged(mMode, mState); } public void onEndEdit() { if (DBG) { - Log.d(LOG_TAG, "--- onClickCancel"); + Log.d(LOG_TAG, "--- onEndEdit"); } handleCancel(); + mEST.notifyStateChanged(mMode, mState); } public void onStartCopy() { if (DBG) { - Log.d(LOG_TAG, "--- onClickCopy"); + Log.d(LOG_TAG, "--- onStartCopy"); } handleCopy(); + mEST.notifyStateChanged(mMode, mState); } - public void onStartPaste() { + public void onStartCut() { if (DBG) { - Log.d(LOG_TAG, "--- onClickPaste"); + Log.d(LOG_TAG, "--- onStartCut"); } - handlePaste(); + handleCut(); + mEST.notifyStateChanged(mMode, mState); } - public void onStartSize() { + public void onStartPaste() { if (DBG) { - Log.d(LOG_TAG, "--- onClickSize"); + Log.d(LOG_TAG, "--- onStartPaste"); } - handleSize(); + handlePaste(); + mEST.notifyStateChanged(mMode, mState); } - public void setItemSize(int size) { + public void onStartSize() { if (DBG) { - Log.d(LOG_TAG, "--- onClickSizeItem"); - } - if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) { - changeSizeSelectedText(size); - handleResetEdit(); + Log.d(LOG_TAG, "--- onStartSize"); } + handleSize(); + mEST.notifyStateChanged(mMode, mState); } - public void setItemColor(int color) { + public void onStartAlign() { if (DBG) { - Log.d(LOG_TAG, "--- onClickColorItem"); - } - if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) { - changeColorSelectedText(color); - handleResetEdit(); + Log.d(LOG_TAG, "--- onStartAlignRight"); } + handleAlign(); + mEST.notifyStateChanged(mMode, mState); } public void onStartColor() { @@ -433,6 +529,7 @@ public class EditStyledText extends EditText { Log.d(LOG_TAG, "--- onClickColor"); } handleColor(); + mEST.notifyStateChanged(mMode, mState); } public void onStartSelect() { @@ -443,32 +540,36 @@ public class EditStyledText extends EditText { if (mState == STATE_SELECT_OFF) { handleSelect(); } else { - offSelect(); + unsetSelect(); handleSelect(); } + mEST.notifyStateChanged(mMode, mState); } - public void onStartSelectAll() { - if (DBG) { - Log.d(LOG_TAG, "--- onClickSelectAll"); - } - handleSelectAll(); - } - - public void onTouchScreen() { + public void onCursorMoved() { if (DBG) { Log.d(LOG_TAG, "--- onClickView"); } if (mState == STATE_SELECT_ON || mState == STATE_SELECTED) { handleSelect(); + mEST.notifyStateChanged(mMode, mState); } } - public void onFixSelectItem() { + public void onStartSelectAll() { + if (DBG) { + Log.d(LOG_TAG, "--- onClickSelectAll"); + } + handleSelectAll(); + mEST.notifyStateChanged(mMode, mState); + } + + public void onFixSelectedItem() { if (DBG) { Log.d(LOG_TAG, "--- onClickComplete"); } handleComplete(); + mEST.notifyStateChanged(mMode, mState); } public void onInsertImage(Uri uri) { @@ -476,27 +577,65 @@ public class EditStyledText extends EditText { Log.d(LOG_TAG, "--- onInsertImage by URI: " + uri.getPath() + "," + uri.toString()); } - - mEST.getText().append("a"); - mEST.getText().setSpan(new ImageSpan(mEST.getContext(), uri), - mEST.getText().length() - 1, mEST.getText().length(), + int curpos = mEST.getSelectionStart(); + mEST.getText().insert(curpos, "a"); + ImageSpan is = new ImageSpan(mEST.getContext(), uri); + mEST.getText().setSpan(is, + curpos, curpos + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + mEST.notifyStateChanged(mMode, mState); } public void onInsertImage(int resID) { if (DBG) { Log.d(LOG_TAG, "--- onInsertImage by resID"); } - mEST.getText().append("b"); + int curpos = mEST.getSelectionStart(); + mEST.getText().insert(curpos, "a"); mEST.getText().setSpan(new ImageSpan(mEST.getContext(), resID), - mEST.getText().length() - 1, mEST.getText().length(), + curpos, curpos + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + mEST.notifyStateChanged(mMode, mState); + } + + public void setItemSize(int size) { + if (DBG) { + Log.d(LOG_TAG, "--- onClickSizeItem"); + } + if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) { + changeSizeSelectedText(size); + handleResetEdit(); + } + } + + public void setItemColor(int color) { + if (DBG) { + Log.d(LOG_TAG, "--- onClickColorItem"); + } + if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) { + changeColorSelectedText(color); + handleResetEdit(); + } + } + + public void setAlignment(Layout.Alignment align) { + if (DBG) { + Log.d(LOG_TAG, "--- onClickColorItem"); + } + if (mState == STATE_SELECTED || mState == STATE_SELECT_FIX) { + changeAlign(align); + handleResetEdit(); + } } public boolean isEditting() { return mEditFlag; } + public boolean isSoftKeyBlocked() { + return this.mSoftKeyBlockFlag; + } + public int getEditMode() { return mMode; } @@ -505,6 +644,42 @@ public class EditStyledText extends EditText { return mState; } + public int getSelectionStart() { + return mCurStart; + } + + public int getSelectionEnd() { + return mCurEnd; + } + + private void doNextHandle() { + if (DBG) { + Log.d(LOG_TAG, "--- doNextHandle: " + mMode + "," + mState); + } + switch (mMode) { + case MODE_COPY: + handleCopy(); + break; + case MODE_CUT: + handleCut(); + break; + case MODE_PASTE: + handlePaste(); + break; + case MODE_SIZE: + handleSize(); + break; + case MODE_COLOR: + handleColor(); + break; + case MODE_ALIGN: + handleAlign(); + break; + default: + break; + } + } + private void handleCancel() { if (DBG) { Log.d(LOG_TAG, "--- handleCancel"); @@ -512,7 +687,9 @@ public class EditStyledText extends EditText { mMode = MODE_NOTHING; mState = STATE_SELECT_OFF; mEditFlag = false; - offSelect(); + Log.d(LOG_TAG, "--- handleCancel:" + mEST.getInputType()); + unblockSoftKey(); + unsetSelect(); } private void handleComplete() { @@ -525,122 +702,115 @@ public class EditStyledText extends EditText { if (mState == STATE_SELECTED) { mState = STATE_SELECT_FIX; } - switch (mMode) { - case MODE_COPY: - handleCopy(); - break; - case MODE_COLOR: - handleColor(); - break; - case MODE_SIZE: - handleSize(); - break; - default: - break; - } + doNextHandle(); } - private void handleCopy() { + private void handleTextViewFunc(int mode, int id) { if (DBG) { - Log.d(LOG_TAG, "--- handleCopy: " + mMode + "," + mState); + Log.d(LOG_TAG, "--- handleTextView: " + mMode + "," + mState + + "," + id); } if (!mEditFlag) { return; } if (mMode == MODE_NOTHING || mMode == MODE_SELECT) { - mMode = MODE_COPY; + mMode = mode; if (mState == STATE_SELECTED) { mState = STATE_SELECT_FIX; - storeSelectedText(); + handleTextViewFunc(mode, id); } else { handleSelect(); } - } else if (mMode != MODE_COPY) { + } else if (mMode != mode) { handleCancel(); - mMode = MODE_COPY; - handleCopy(); + mMode = mode; + handleTextViewFunc(mode, id); } else if (mState == STATE_SELECT_FIX) { - mEST.setHintMessage(HINT_MSG_NULL); - storeSelectedText(); + mEST.onTextContextMenuItem(id); handleResetEdit(); } } - private void handlePaste() { + private void handleCopy() { if (DBG) { - Log.d(LOG_TAG, "--- handlePaste"); - } - if (!mEditFlag) { - return; + Log.d(LOG_TAG, "--- handleCopy: " + mMode + "," + mState); } - if (mTextSelectBuffer != null && mTextCopyBufer.length() > 0) { - mTextSelectBuffer.insert(mEST.getSelectionStart(), - mTextCopyBufer); - } else { - mEST.setHintMessage(HINT_MSG_COPY_BUF_BLANK); + handleTextViewFunc(MODE_COPY, android.R.id.copy); + } + + private void handleCut() { + if (DBG) { + Log.d(LOG_TAG, "--- handleCopy: " + mMode + "," + mState); } + handleTextViewFunc(MODE_CUT, android.R.id.cut); } - private void handleSize() { + private void handlePaste() { if (DBG) { - Log.d(LOG_TAG, "--- handleSize: " + mMode + "," + mState); + Log.d(LOG_TAG, "--- handlePaste"); } if (!mEditFlag) { - Log.e(LOG_TAG, "--- Editing is not started for handlesize."); return; } - if (mMode == MODE_NOTHING || mMode == MODE_SELECT) { - mMode = MODE_SIZE; - if (mState == STATE_SELECTED) { - mState = STATE_SELECT_FIX; - handleSize(); - } else { - handleSelect(); - } - } else if (mMode != MODE_SIZE) { - handleCancel(); - mMode = MODE_SIZE; - handleSize(); - } else { - if (mState == STATE_SELECT_FIX) { - mEST.setHintMessage(HINT_MSG_NULL); - mEST.onShowSizeAlert(); - } else { - Log.d(LOG_TAG, "--- handlesize: do nothing"); - } - } + mEST.onTextContextMenuItem(android.R.id.paste); } - private void handleColor() { + private void handleSetSpan(int mode) { if (DBG) { - Log.d(LOG_TAG, "--- handleSize: " + mMode + "," + mState); + Log.d(LOG_TAG, "--- handleSetSpan:" + mEditFlag + "," + + mState + ',' + mMode); } if (!mEditFlag) { - Log.e(LOG_TAG, "--- Editing is not started for handlecolor."); + Log.e(LOG_TAG, "--- handleSetSpan: Editing is not started."); return; } if (mMode == MODE_NOTHING || mMode == MODE_SELECT) { - mMode = MODE_COLOR; + mMode = mode; if (mState == STATE_SELECTED) { mState = STATE_SELECT_FIX; - handleColor(); + handleSetSpan(mode); } else { handleSelect(); } - } else if (mMode != MODE_COLOR) { + } else if (mMode != mode) { handleCancel(); - mMode = MODE_COLOR; - handleSize(); + mMode = mode; + handleSetSpan(mode); } else { if (mState == STATE_SELECT_FIX) { mEST.setHintMessage(HINT_MSG_NULL); - mEST.onShowColorAlert(); + switch (mode) { + case MODE_COLOR: + mEST.onShowColorAlert(); + break; + case MODE_SIZE: + mEST.onShowSizeAlert(); + break; + case MODE_ALIGN: + mEST.onShowAlignAlert(); + break; + default: + Log.e(LOG_TAG, "--- handleSetSpan: invalid mode."); + break; + } } else { - Log.d(LOG_TAG, "--- handlecolor: do nothing"); + Log.d(LOG_TAG, "--- handleSetSpan: do nothing."); } } } + private void handleSize() { + handleSetSpan(MODE_SIZE); + } + + private void handleColor() { + handleSetSpan(MODE_COLOR); + } + + private void handleAlign() { + handleSetSpan(MODE_ALIGN); + } + private void handleSelect() { if (DBG) { Log.d(LOG_TAG, "--- handleSelect:" + mEditFlag + "," + mState); @@ -653,19 +823,20 @@ public class EditStyledText extends EditText { Log.e(LOG_TAG, "Selection is off, but selected"); } setSelectStartPos(); + blockSoftKey(); mEST.setHintMessage(HINT_MSG_SELECT_END); } else if (mState == STATE_SELECT_ON) { if (isTextSelected()) { Log.e(LOG_TAG, "Selection now start, but selected"); } - setSelectEndPos(); + setSelectedEndPos(); mEST.setHintMessage(HINT_MSG_PUSH_COMPETE); doNextHandle(); } else if (mState == STATE_SELECTED) { if (!isTextSelected()) { Log.e(LOG_TAG, "Selection is done, but not selected"); } - setSelectEndPos(); + setSelectedEndPos(); doNextHandle(); } } @@ -678,47 +849,30 @@ public class EditStyledText extends EditText { return; } mEST.selectAll(); - } - - private void doNextHandle() { - if (DBG) { - Log.d(LOG_TAG, "--- doNextHandle: " + mMode + "," + mState); - } - switch (mMode) { - case MODE_COPY: - handleCopy(); - break; - case MODE_PASTE: - handlePaste(); - break; - case MODE_SIZE: - handleSize(); - break; - case MODE_COLOR: - handleColor(); - break; - default: - break; - } + mState = STATE_SELECTED; } private void handleResetEdit() { if (DBG) { Log.d(LOG_TAG, "Reset Editor"); } + blockSoftKey(); handleCancel(); mEditFlag = true; mEST.setHintMessage(HINT_MSG_SELECT_START); } - // Methods of selection - private void onSelect() { + private void setSelection() { if (DBG) { Log.d(LOG_TAG, "--- onSelect:" + mCurStart + "," + mCurEnd); } if (mCurStart >= 0 && mCurStart <= mEST.getText().length() && mCurEnd >= 0 && mCurEnd <= mEST.getText().length()) { - mEST.setSelection(mCurStart, mCurEnd); + if (mCurStart < mCurEnd) { + mEST.setSelection(mCurStart, mCurEnd); + } else { + mEST.setSelection(mCurEnd, mCurStart); + } mState = STATE_SELECTED; } else { Log.e(LOG_TAG, @@ -728,7 +882,7 @@ public class EditStyledText extends EditText { } } - private void offSelect() { + private void unsetSelect() { if (DBG) { Log.d(LOG_TAG, "--- offSelect"); } @@ -745,22 +899,23 @@ public class EditStyledText extends EditText { mState = STATE_SELECT_ON; } - private void setSelectEndPos() { + private void setSelectedEndPos() { if (DBG) { - Log.d(LOG_TAG, "--- setSelectEndPos:" - + mEST.getSelectionStart()); + Log.d(LOG_TAG, "--- setSelectEndPos:"); } - int curpos = mEST.getSelectionStart(); - if (curpos < mCurStart) { - if (DBG) { - Log.d(LOG_TAG, "--- setSelectEndPos: swap is done."); - } - mCurEnd = mCurStart; - mCurStart = curpos; + if (mEST.getSelectionStart() == mCurStart) { + setSelectedEndPos(mEST.getSelectionEnd()); } else { - mCurEnd = curpos; + setSelectedEndPos(mEST.getSelectionStart()); } - onSelect(); + } + + public void setSelectedEndPos(int pos) { + if (DBG) { + Log.d(LOG_TAG, "--- setSelectedEndPos:"); + } + mCurEnd = pos; + setSelection(); } private boolean isTextSelected() { @@ -773,30 +928,96 @@ public class EditStyledText extends EditText { mState == STATE_SELECT_FIX); } - private void storeSelectedText() { + private void setStyledTextSpan(Object span, int start, int end) { if (DBG) { - Log.d(LOG_TAG, "--- storeSelectedText"); + Log.d(LOG_TAG, "--- setStyledTextSpan:" + mMode + "," + + start + "," + end); + } + if (start < end) { + mEST.getText().setSpan(span, start, end, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } else { + mEST.getText().setSpan(span, end, start, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - mTextSelectBuffer = mEST.getText(); - mTextCopyBufer = mTextSelectBuffer.subSequence(mCurStart, mCurEnd); } private void changeSizeSelectedText(int size) { if (DBG) { - Log.d(LOG_TAG, "--- changeSizeSelectedText:" + size + "," - + mCurStart + "," + mCurEnd); + Log.d(LOG_TAG, "--- changeAlign:" + size); } - mEST.getText().setSpan(new AbsoluteSizeSpan(size), mCurStart, - mCurEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + setStyledTextSpan(new AbsoluteSizeSpan(size), + mCurStart, mCurEnd); } private void changeColorSelectedText(int color) { if (DBG) { - Log.d(LOG_TAG, "--- changeCollorSelectedText:" + color + "," - + mCurStart + "," + mCurEnd); + Log.d(LOG_TAG, "--- changeAlign:" + color); } - mEST.getText().setSpan(new ForegroundColorSpan(color), mCurStart, - mCurEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + setStyledTextSpan(new ForegroundColorSpan(color), + mCurStart, mCurEnd); + } + + private void changeAlign(Layout.Alignment align) { + if (DBG) { + Log.d(LOG_TAG, "--- changeAlign:" + align); + } + setStyledTextSpan(new AlignmentSpan.Standard(align), + findLineStart(mEST.getText(), mCurStart), + findLineEnd(mEST.getText(), mCurEnd)); + } + + private int findLineStart(Editable text, int current) { + if (DBG) { + Log.d(LOG_TAG, "--- findLineStart: curr:" + current + + ", length:" + text.length()); + } + int pos = current; + for (; pos > 0; pos--) { + if (text.charAt(pos - 1) == '\n') { + break; + } + } + return pos; + } + + private int findLineEnd(Editable text, int current) { + if (DBG) { + Log.d(LOG_TAG, "--- findLineEnd: curr:" + current + + ", length:" + text.length()); + } + int pos = current; + for (; pos < text.length(); pos++) { + if (pos > 0 && text.charAt(pos - 1) == '\n') { + break; + } + } + return pos; + } + + private void blockSoftKey() { + if (DBG) { + Log.d(LOG_TAG, "--- blockSoftKey:"); + } + InputMethodManager imm = (InputMethodManager) mEST.getContext(). + getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(mEST.getWindowToken(), 0); + mEST.setOnClickListener( + new OnClickListener() { + public void onClick(View v) { + Log.d(LOG_TAG, "--- ontrackballclick:"); + onFixSelectedItem(); + } + }); + mSoftKeyBlockFlag = true; + } + + private void unblockSoftKey() { + if (DBG) { + Log.d(LOG_TAG, "--- unblockSoftKey:"); + } + mEST.setOnClickListener(null); + this.mSoftKeyBlockFlag = false; } } @@ -809,19 +1030,45 @@ public class EditStyledText extends EditText { public String getConvertedBody() { String htmlBody = Html.toHtml(mEST.getText()); + if (DBG) { + Log.d(LOG_TAG, "--- getConvertedBody:" + htmlBody); + } return htmlBody; } + + public void getUriArray(ArrayList uris, Editable text) { + uris.clear(); + if (DBG) { + Log.d(LOG_TAG, "--- getUriArray:"); + } + int len = text.length(); + int next; + for (int i = 0; i < text.length(); i = next) { + next = text.nextSpanTransition(i, len, ImageSpan.class); + ImageSpan[] images = text.getSpans(i, next, ImageSpan.class); + for (int j = 0; j < images.length; j++) { + if (DBG) { + Log.d(LOG_TAG, "--- getUriArray: foundArray" + + ((ImageSpan) images[j]).getSource()); + } + uris.add(Uri.parse( + ((ImageSpan) images[j]).getSource())); + } + } + } } private class StyledTextToast { Builder mBuilder; CharSequence mColorTitle; CharSequence mSizeTitle; + CharSequence mAlignTitle; CharSequence[] mColorNames; CharSequence[] mColorInts; CharSequence[] mSizeNames; CharSequence[] mSizeDisplayInts; CharSequence[] mSizeSendInts; + CharSequence[] mAlignNames; EditStyledText mEST; public StyledTextToast(EditStyledText est) { @@ -848,6 +1095,12 @@ public class EditStyledText extends EditText { mSizeSendInts = sizesendints; } + public void setAlignAlertParams(CharSequence aligntitle, + CharSequence[] alignnames) { + mAlignTitle = aligntitle; + mAlignNames = alignnames; + } + public boolean checkColorAlertParams() { if (DBG) { Log.d(LOG_TAG, "--- checkParams"); @@ -873,13 +1126,30 @@ public class EditStyledText extends EditText { } if (mBuilder == null) { Log.e(LOG_TAG, "--- builder is null."); + return false; } else if (mSizeTitle == null || mSizeNames == null || mSizeDisplayInts == null || mSizeSendInts == null) { Log.e(LOG_TAG, "--- size alert params are null."); + return false; } else if (mSizeNames.length != mSizeDisplayInts.length && mSizeSendInts.length != mSizeDisplayInts.length) { Log.e(LOG_TAG, "--- the length of size alert params are " + "different."); + return false; + } + return true; + } + + public boolean checkAlignAlertParams() { + if (DBG) { + Log.d(LOG_TAG, "--- checkAlignAlertParams"); + } + if (mBuilder == null) { + Log.e(LOG_TAG, "--- builder is null."); + return false; + } else if (mAlignTitle == null) { + Log.e(LOG_TAG, "--- align alert params are null."); + return false; } return true; } @@ -919,7 +1189,7 @@ public class EditStyledText extends EditText { setItems(mSizeNames, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - Log.d("EETVM", "mBuilder.onclick:" + which); + Log.d(LOG_TAG, "mBuilder.onclick:" + which); int size = Integer .parseInt((String) mSizeDisplayInts[which]); mEST.setItemSize(size); @@ -927,5 +1197,165 @@ public class EditStyledText extends EditText { }); mBuilder.show(); } + + private void onShowAlignAlertDialog() { + if (DBG) { + Log.d(LOG_TAG, "--- onShowAlertDialog"); + } + if (!checkAlignAlertParams()) { + return; + } + mBuilder.setTitle(mAlignTitle); + mBuilder.setIcon(0); + mBuilder. + setItems(mAlignNames, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + Log.d(LOG_TAG, "mBuilder.onclick:" + which); + Layout.Alignment align = Layout.Alignment.ALIGN_NORMAL; + switch (which) { + case 0: + align = Layout.Alignment.ALIGN_NORMAL; + break; + case 1: + align = Layout.Alignment.ALIGN_CENTER; + break; + case 2: + align = Layout.Alignment.ALIGN_OPPOSITE; + break; + default: + break; + } + mEST.setAlignment(align); + } + }); + mBuilder.show(); + } + } + + private class StyledTextArrowKeyMethod extends ArrowKeyMovementMethod { + EditorManager mManager; + StyledTextArrowKeyMethod(EditorManager manager) { + super(); + mManager = manager; + } + + @Override + public boolean onKeyDown(TextView widget, Spannable buffer, + int keyCode, KeyEvent event) { + if (!mManager.isSoftKeyBlocked()) { + return super.onKeyDown(widget, buffer, keyCode, event); + } + if (executeDown(widget, buffer, keyCode)) { + return true; + } + return false; + } + + private int getEndPos(TextView widget) { + int end; + if (widget.getSelectionStart() == mManager.getSelectionStart()) { + end = widget.getSelectionEnd(); + } else { + end = widget.getSelectionStart(); + } + return end; + } + + private boolean up(TextView widget, Spannable buffer) { + if (DBG) { + Log.d(LOG_TAG, "--- up:"); + } + Layout layout = widget.getLayout(); + int end = getEndPos(widget); + int line = layout.getLineForOffset(end); + if (line > 0) { + int to; + if (layout.getParagraphDirection(line) == + layout.getParagraphDirection(line - 1)) { + float h = layout.getPrimaryHorizontal(end); + to = layout.getOffsetForHorizontal(line - 1, h); + } else { + to = layout.getLineStart(line - 1); + } + mManager.setSelectedEndPos(to); + mManager.onCursorMoved(); + return true; + } + return false; + } + + private boolean down(TextView widget, Spannable buffer) { + if (DBG) { + Log.d(LOG_TAG, "--- down:"); + } + Layout layout = widget.getLayout(); + int end = getEndPos(widget); + int line = layout.getLineForOffset(end); + if (line < layout.getLineCount() - 1) { + int to; + if (layout.getParagraphDirection(line) == + layout.getParagraphDirection(line + 1)) { + float h = layout.getPrimaryHorizontal(end); + to = layout.getOffsetForHorizontal(line + 1, h); + } else { + to = layout.getLineStart(line + 1); + } + mManager.setSelectedEndPos(to); + mManager.onCursorMoved(); + return true; + } + return false; + } + + private boolean left(TextView widget, Spannable buffer) { + if (DBG) { + Log.d(LOG_TAG, "--- left:"); + } + Layout layout = widget.getLayout(); + int to = layout.getOffsetToLeftOf(getEndPos(widget)); + mManager.setSelectedEndPos(to); + mManager.onCursorMoved(); + return true; + } + + private boolean right(TextView widget, Spannable buffer) { + if (DBG) { + Log.d(LOG_TAG, "--- right:"); + } + Layout layout = widget.getLayout(); + int to = layout.getOffsetToRightOf(getEndPos(widget)); + mManager.setSelectedEndPos(to); + mManager.onCursorMoved(); + return true; + } + + private boolean executeDown(TextView widget, Spannable buffer, + int keyCode) { + if (DBG) { + Log.d(LOG_TAG, "--- executeDown: " + keyCode); + } + boolean handled = false; + + switch (keyCode) { + case KeyEvent.KEYCODE_DPAD_UP: + handled |= up(widget, buffer); + break; + case KeyEvent.KEYCODE_DPAD_DOWN: + handled |= down(widget, buffer); + break; + case KeyEvent.KEYCODE_DPAD_LEFT: + handled |= left(widget, buffer); + break; + case KeyEvent.KEYCODE_DPAD_RIGHT: + handled |= right(widget, buffer); + break; + case KeyEvent.KEYCODE_DPAD_CENTER: + mManager.onFixSelectedItem(); + handled = true; + break; + } + return handled; + } } } diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java index f2ec0649860c..ad329d18db54 100644 --- a/core/java/com/android/internal/widget/EditableInputConnection.java +++ b/core/java/com/android/internal/widget/EditableInputConnection.java @@ -33,7 +33,7 @@ public class EditableInputConnection extends BaseInputConnection { private final TextView mTextView; public EditableInputConnection(TextView textview) { - super(textview, false); + super(textview, true); mTextView = textview; } diff --git a/core/java/com/google/android/gdata/client/AndroidGDataClient.java b/core/java/com/google/android/gdata/client/AndroidGDataClient.java index fe7d8601c2e0..998f940e63a1 100644 --- a/core/java/com/google/android/gdata/client/AndroidGDataClient.java +++ b/core/java/com/google/android/gdata/client/AndroidGDataClient.java @@ -51,7 +51,7 @@ public class AndroidGDataClient implements GDataClient { private static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; - private static final String USER_AGENT_APP_VERSION = "Android-GData/1.0"; + private static final String DEFAULT_USER_AGENT_APP_VERSION = "Android-GData/1.1"; private static final int MAX_REDIRECTS = 10; @@ -121,7 +121,7 @@ public class AndroidGDataClient implements GDataClient { * @deprecated Use AndroidGDAtaClient(Context) instead. */ public AndroidGDataClient(ContentResolver resolver) { - mHttpClient = new GoogleHttpClient(resolver, USER_AGENT_APP_VERSION, + mHttpClient = new GoogleHttpClient(resolver, DEFAULT_USER_AGENT_APP_VERSION, true /* gzip capable */); mHttpClient.enableCurlLogging(TAG, Log.VERBOSE); mResolver = resolver; @@ -136,7 +136,21 @@ public class AndroidGDataClient implements GDataClient { * SSL session persistence. */ public AndroidGDataClient(Context context) { - mHttpClient = new GoogleHttpClient(context, USER_AGENT_APP_VERSION, + this(context, DEFAULT_USER_AGENT_APP_VERSION); + } + + /** + * Creates a new AndroidGDataClient. + * + * @param context The ContentResolver to get URL rewriting rules from + * through the Android proxy server, using null to indicate not using proxy. + * The context will also be used by GoogleHttpClient for configuration of + * SSL session persistence. + * @param appAndVersion The application name and version to be used as the basis of the + * User-Agent. e.g., Android-GData/1.5.0. + */ + public AndroidGDataClient(Context context, String appAndVersion) { + mHttpClient = new GoogleHttpClient(context, appAndVersion, true /* gzip capable */); mHttpClient.enableCurlLogging(TAG, Log.VERBOSE); mResolver = context.getContentResolver(); diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp index e345af621314..3727f4b228ed 100644 --- a/core/jni/android_media_JetPlayer.cpp +++ b/core/jni/android_media_JetPlayer.cpp @@ -14,8 +14,7 @@ * limitations under the License. */ -//FIXME: remove log before release -#define LOG_NDEBUG 0 +//#define LOG_NDEBUG 0 #define LOG_TAG "JET_JNI" diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 1b145af033f3..9a569a1a6dd0 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -797,7 +797,7 @@ + android:protectionLevel="signatureOrSystem" /> + android:protectionLevel="signatureOrSystem" /> @@ -909,7 +909,7 @@ + android:protectionLevel="signatureOrSystem" /> diff --git a/core/res/assets/images/android-logo-mask.png b/core/res/assets/images/android-logo-mask.png new file mode 100644 index 000000000000..1e8ab95fa99d Binary files /dev/null and b/core/res/assets/images/android-logo-mask.png differ diff --git a/core/res/assets/images/android-logo-shine.png b/core/res/assets/images/android-logo-shine.png new file mode 100644 index 000000000000..60144f1f7ca7 Binary files /dev/null and b/core/res/assets/images/android-logo-shine.png differ diff --git a/core/res/assets/images/android_320x480.png b/core/res/assets/images/android_320x480.png deleted file mode 100644 index d2665bb7221a..000000000000 Binary files a/core/res/assets/images/android_320x480.png and /dev/null differ diff --git a/core/res/assets/images/boot_robot.png b/core/res/assets/images/boot_robot.png deleted file mode 100644 index f4555afe7419..000000000000 Binary files a/core/res/assets/images/boot_robot.png and /dev/null differ diff --git a/core/res/assets/images/boot_robot_glow.png b/core/res/assets/images/boot_robot_glow.png deleted file mode 100644 index 2a67a3f0c7a4..000000000000 Binary files a/core/res/assets/images/boot_robot_glow.png and /dev/null differ diff --git a/core/res/assets/images/cylon_dot.png b/core/res/assets/images/cylon_dot.png deleted file mode 100644 index 150b8b162d69..000000000000 Binary files a/core/res/assets/images/cylon_dot.png and /dev/null differ diff --git a/core/res/assets/images/cylon_left.png b/core/res/assets/images/cylon_left.png deleted file mode 100644 index 50c6296fbafd..000000000000 Binary files a/core/res/assets/images/cylon_left.png and /dev/null differ diff --git a/core/res/assets/images/cylon_right.png b/core/res/assets/images/cylon_right.png deleted file mode 100644 index 89b7d719d0bd..000000000000 Binary files a/core/res/assets/images/cylon_right.png and /dev/null differ diff --git a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png index 326397cbf036..914662d41c37 100644 Binary files a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png and b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_disabled.png differ diff --git a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png index 55834010e7ac..3b67c6d6559f 100644 Binary files a/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png and b/core/res/res/drawable/ic_btn_square_browser_zoom_fit_page_normal.png differ diff --git a/core/res/res/drawable/ic_emergency.png b/core/res/res/drawable/ic_emergency.png index d99abf83e725..45d0f21736c3 100755 Binary files a/core/res/res/drawable/ic_emergency.png and b/core/res/res/drawable/ic_emergency.png differ diff --git a/core/res/res/drawable/timepicker_down_disabled.9.png b/core/res/res/drawable/timepicker_down_disabled.9.png index 7d8e0b98352c..596294b62080 100755 Binary files a/core/res/res/drawable/timepicker_down_disabled.9.png and b/core/res/res/drawable/timepicker_down_disabled.9.png differ diff --git a/core/res/res/drawable/timepicker_down_disabled_focused.9.png b/core/res/res/drawable/timepicker_down_disabled_focused.9.png index 6f2373ea88a1..662cffd19081 100755 Binary files a/core/res/res/drawable/timepicker_down_disabled_focused.9.png and b/core/res/res/drawable/timepicker_down_disabled_focused.9.png differ diff --git a/core/res/res/drawable/timepicker_down_normal.9.png b/core/res/res/drawable/timepicker_down_normal.9.png index a9463552ec68..f17e8f942ac6 100755 Binary files a/core/res/res/drawable/timepicker_down_normal.9.png and b/core/res/res/drawable/timepicker_down_normal.9.png differ diff --git a/core/res/res/drawable/timepicker_down_pressed.9.png b/core/res/res/drawable/timepicker_down_pressed.9.png index fb4d817c48f0..777bcf5f35c5 100755 Binary files a/core/res/res/drawable/timepicker_down_pressed.9.png and b/core/res/res/drawable/timepicker_down_pressed.9.png differ diff --git a/core/res/res/drawable/timepicker_down_selected.9.png b/core/res/res/drawable/timepicker_down_selected.9.png index 1db8bc1aacf8..b45db62121d4 100755 Binary files a/core/res/res/drawable/timepicker_down_selected.9.png and b/core/res/res/drawable/timepicker_down_selected.9.png differ diff --git a/core/res/res/drawable/timepicker_up_disabled.9.png b/core/res/res/drawable/timepicker_up_disabled.9.png index 93d0db48326c..327b0b5ad926 100755 Binary files a/core/res/res/drawable/timepicker_up_disabled.9.png and b/core/res/res/drawable/timepicker_up_disabled.9.png differ diff --git a/core/res/res/drawable/timepicker_up_disabled_focused.9.png b/core/res/res/drawable/timepicker_up_disabled_focused.9.png index b5bf68d1b7c0..4c96680fefb9 100755 Binary files a/core/res/res/drawable/timepicker_up_disabled_focused.9.png and b/core/res/res/drawable/timepicker_up_disabled_focused.9.png differ diff --git a/core/res/res/drawable/timepicker_up_normal.9.png b/core/res/res/drawable/timepicker_up_normal.9.png index 978251d70ace..dcd26e0115e0 100755 Binary files a/core/res/res/drawable/timepicker_up_normal.9.png and b/core/res/res/drawable/timepicker_up_normal.9.png differ diff --git a/core/res/res/drawable/timepicker_up_pressed.9.png b/core/res/res/drawable/timepicker_up_pressed.9.png index 924b03cff0f2..7dac77868749 100755 Binary files a/core/res/res/drawable/timepicker_up_pressed.9.png and b/core/res/res/drawable/timepicker_up_pressed.9.png differ diff --git a/core/res/res/drawable/timepicker_up_selected.9.png b/core/res/res/drawable/timepicker_up_selected.9.png index 5c94d0dfe577..35dae8ef11a4 100755 Binary files a/core/res/res/drawable/timepicker_up_selected.9.png and b/core/res/res/drawable/timepicker_up_selected.9.png differ diff --git a/core/res/res/layout/always_use_checkbox.xml b/core/res/res/layout/always_use_checkbox.xml index 5e6e3886facb..1f8d256d3712 100644 --- a/core/res/res/layout/always_use_checkbox.xml +++ b/core/res/res/layout/always_use_checkbox.xml @@ -21,7 +21,8 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="14dip" - android:paddingRight="15dip"> + android:paddingRight="15dip" + android:orientation="vertical"> diff --git a/core/res/res/layout/keyguard_screen_lock.xml b/core/res/res/layout/keyguard_screen_lock.xml index 952fc5d9dc60..b5fbace14861 100644 --- a/core/res/res/layout/keyguard_screen_lock.xml +++ b/core/res/res/layout/keyguard_screen_lock.xml @@ -211,7 +211,7 @@ android:layout_marginTop="5dip" android:layout_gravity="center_horizontal" android:drawableLeft="@drawable/ic_emergency" - android:drawablePadding="3dip" + android:drawablePadding="8dip" android:text="@android:string/lockscreen_emergency_call" /> diff --git a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml index 881652ba6cbb..4c583d84eeb2 100644 --- a/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml +++ b/core/res/res/layout/keyguard_screen_sim_pin_landscape.xml @@ -87,12 +87,7 @@ android:layout_weight="1.0" android:layout_marginBottom="8dip" android:layout_marginRight="8dip" - android:paddingLeft="4dip" - android:paddingRight="4dip" - android:paddingTop="8dip" - android:paddingBottom="8dip" android:textSize="18sp" - android:drawablePadding="3dip" />