summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2012-02-25 14:36:15 -0800
committerKoushik Dutta <koushd@gmail.com>2012-02-25 14:36:15 -0800
commit6a1770f403d83957668b56e01c2940573f7db7e9 (patch)
tree32ea6ca97129cd3d395ca8a709504e97d6fcb5f2
parent5b18b58ee8d3097eefd261073c13316a0dde78a5 (diff)
parent5eeec666b0b3fb03f27ae00d967a63bebd55d214 (diff)
downloadframeworks_base-6a1770f403d83957668b56e01c2940573f7db7e9.zip
frameworks_base-6a1770f403d83957668b56e01c2940573f7db7e9.tar.gz
frameworks_base-6a1770f403d83957668b56e01c2940573f7db7e9.tar.bz2
Merge branch 'gingerbread' of git://github.com/CyanogenMod/android_frameworks_base into gingerbread
-rw-r--r--core/java/android/bluetooth/BluetoothDeviceProfileState.java13
-rw-r--r--core/java/android/bluetooth/BluetoothUuid.java14
-rw-r--r--core/java/android/net/wimax/WimaxHelper.java52
-rw-r--r--core/java/android/provider/CmSystem.java155
-rw-r--r--core/java/android/provider/Settings.java60
-rwxr-xr-xcore/java/android/server/BluetoothService.java9
-rw-r--r--core/java/android/view/Surface.java13
-rw-r--r--core/java/android/view/WindowManagerPolicy.java11
-rw-r--r--core/java/android/view/animation/ScaleAnimation.java93
-rw-r--r--core/java/android/widget/AbsListView.java37
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java103
-rw-r--r--core/java/com/android/internal/widget/RingSelector.java28
-rw-r--r--core/jni/Android.mk4
-rw-r--r--core/jni/android_hardware_fm_bcm4325.cpp73
-rw-r--r--core/jni/android_view_Surface.cpp100
-rw-r--r--core/res/res/anim/accelerate_cubic.xml3
-rw-r--r--core/res/res/anim/accelerate_decelerate.xml2
-rw-r--r--core/res/res/anim/accelerate_quad.xml2
-rw-r--r--core/res/res/anim/accelerate_quint.xml3
-rw-r--r--core/res/res/anim/activity_close_enter.xml31
-rw-r--r--core/res/res/anim/activity_close_exit.xml30
-rw-r--r--core/res/res/anim/activity_open_enter.xml30
-rw-r--r--core/res/res/anim/activity_open_exit.xml31
-rw-r--r--core/res/res/anim/anticipate.xml2
-rw-r--r--core/res/res/anim/anticipate_overshoot.xml2
-rw-r--r--core/res/res/anim/app_starting_exit.xml29
-rw-r--r--core/res/res/anim/bounce.xml2
-rw-r--r--core/res/res/anim/cycle.xml2
-rw-r--r--core/res/res/anim/decelerate_cubic.xml3
-rw-r--r--core/res/res/anim/decelerate_quad.xml2
-rw-r--r--core/res/res/anim/decelerate_quint.xml3
-rw-r--r--core/res/res/anim/dialog_enter.xml34
-rw-r--r--core/res/res/anim/dialog_exit.xml34
-rw-r--r--core/res/res/anim/grow_fade_in.xml35
-rw-r--r--core/res/res/anim/grow_fade_in_center.xml35
-rw-r--r--core/res/res/anim/grow_fade_in_from_bottom.xml35
-rw-r--r--core/res/res/anim/input_method_enter.xml33
-rw-r--r--core/res/res/anim/input_method_exit.xml32
-rw-r--r--core/res/res/anim/input_method_extract_enter.xml27
-rw-r--r--core/res/res/anim/input_method_extract_exit.xml28
-rw-r--r--core/res/res/anim/input_method_fancy_enter.xml35
-rw-r--r--core/res/res/anim/input_method_fancy_exit.xml34
-rw-r--r--core/res/res/anim/linear.xml2
-rw-r--r--core/res/res/anim/lock_screen_behind_enter.xml28
-rw-r--r--core/res/res/anim/lock_screen_enter.xml29
-rw-r--r--core/res/res/anim/lock_screen_exit.xml29
-rw-r--r--core/res/res/anim/overshoot.xml2
-rw-r--r--core/res/res/anim/screen_rotate_0_enter.xml25
-rw-r--r--core/res/res/anim/screen_rotate_0_exit.xml25
-rw-r--r--core/res/res/anim/screen_rotate_180_enter.xml34
-rw-r--r--core/res/res/anim/screen_rotate_180_exit.xml30
-rw-r--r--core/res/res/anim/screen_rotate_minus_90_enter.xml26
-rw-r--r--core/res/res/anim/screen_rotate_minus_90_exit.xml34
-rw-r--r--core/res/res/anim/screen_rotate_plus_90_enter.xml26
-rw-r--r--core/res/res/anim/screen_rotate_plus_90_exit.xml34
-rw-r--r--core/res/res/anim/search_bar_enter.xml32
-rw-r--r--core/res/res/anim/search_bar_exit.xml33
-rw-r--r--core/res/res/anim/task_close_enter.xml37
-rw-r--r--core/res/res/anim/task_close_exit.xml31
-rw-r--r--core/res/res/anim/task_open_enter.xml30
-rw-r--r--core/res/res/anim/task_open_exit.xml38
-rw-r--r--core/res/res/anim/wallpaper_close_enter.xml75
-rw-r--r--core/res/res/anim/wallpaper_close_exit.xml79
-rw-r--r--core/res/res/anim/wallpaper_enter.xml34
-rw-r--r--core/res/res/anim/wallpaper_exit.xml34
-rw-r--r--core/res/res/anim/wallpaper_intra_close_enter.xml36
-rw-r--r--core/res/res/anim/wallpaper_intra_close_exit.xml35
-rw-r--r--core/res/res/anim/wallpaper_intra_open_enter.xml35
-rw-r--r--core/res/res/anim/wallpaper_intra_open_exit.xml36
-rw-r--r--core/res/res/anim/wallpaper_open_enter.xml78
-rw-r--r--core/res/res/anim/wallpaper_open_exit.xml75
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_answer.pngbin0 -> 6412 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_custom.pngbin0 -> 681 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_decline.pngbin0 -> 5387 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_off.pngbin0 -> 5716 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_on.pngbin0 -> 5172 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_unlock.pngbin0 -> 1974 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 4007 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_ring_normal.pngbin0 -> 29701 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_gray.pngbin0 -> 29797 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_green.pngbin0 -> 29446 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_red.pngbin0 -> 28430 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_yellow.pngbin0 -> 27990 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_blade_secback_normal.pngbin0 -> 14009 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_holo_ring_normal.pngbin0 -> 10466 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_holo_ring_pressed.pngbin0 -> 12980 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_holo_secback_normal.pngbin0 -> 4285 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_ring_normal.pngbin0 -> 10878 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_gray.pngbin0 -> 11488 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_green.pngbin0 -> 20384 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_red.pngbin0 -> 20192 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_yellow.pngbin0 -> 18962 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_ring_rev_secback_normal.pngbin0 -> 5002 bytes
-rw-r--r--core/res/res/drawable-hdpi/jog_tab_target_holo.pngbin0 -> 395 bytes
-rw-r--r--core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_off.pngbin0 -> 6264 bytes
-rw-r--r--core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_on.pngbin0 -> 6024 bytes
-rw-r--r--core/res/res/drawable-land-hdpi/ic_jog_dial_holo_unlock.pngbin0 -> 1974 bytes
-rw-r--r--core/res/res/drawable-land-hdpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 4298 bytes
-rw-r--r--core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_off.pngbin0 -> 2123 bytes
-rw-r--r--core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_on.pngbin0 -> 2092 bytes
-rw-r--r--core/res/res/drawable-land-ldpi/ic_jog_dial_holo_unlock.pngbin0 -> 733 bytes
-rw-r--r--core/res/res/drawable-land-ldpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 2034 bytes
-rw-r--r--core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_off.pngbin0 -> 3364 bytes
-rw-r--r--core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_on.pngbin0 -> 3280 bytes
-rw-r--r--core/res/res/drawable-land-mdpi/ic_jog_dial_holo_unlock.pngbin0 -> 1044 bytes
-rw-r--r--core/res/res/drawable-land-mdpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 2754 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_answer.pngbin0 -> 1933 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_custom.pngbin0 -> 330 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_decline.pngbin0 -> 1842 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_off.pngbin0 -> 2123 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_on.pngbin0 -> 2092 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_unlock.pngbin0 -> 733 bytes
-rw-r--r--core/res/res/drawable-ldpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 2034 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_ring_normal.pngbin0 -> 9292 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_gray.pngbin0 -> 9364 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_green.pngbin0 -> 9668 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_red.pngbin0 -> 9465 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_yellow.pngbin0 -> 9433 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_blade_secback_normal.pngbin0 -> 6669 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_holo_ring_normal.pngbin0 -> 3400 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_holo_ring_pressed.pngbin0 -> 3993 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_ring_holo_secback_normal.pngbin0 -> 1376 bytes
-rw-r--r--core/res/res/drawable-ldpi/jog_tab_target_holo.pngbin0 -> 368 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_answer.pngbin0 -> 3732 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_custom.pngbin0 -> 433 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_decline.pngbin0 -> 3028 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_off.pngbin0 -> 3123 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_on.pngbin0 -> 2871 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_unlock.pngbin0 -> 1044 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_holo_vibrate_on.pngbin0 -> 2754 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_ring_normal.pngbin0 -> 19010 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_gray.pngbin0 -> 19210 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_green.pngbin0 -> 19845 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_red.pngbin0 -> 19312 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_yellow.pngbin0 -> 19418 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_blade_secback_normal.pngbin0 -> 10539 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_holo_ring_normal.pngbin0 -> 6662 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_holo_ring_pressed.pngbin0 -> 8540 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_holo_secback_normal.pngbin0 -> 2805 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_ring_normal.pngbin0 -> 18356 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_gray.pngbin0 -> 20717 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_green.pngbin0 -> 22170 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_red.pngbin0 -> 21740 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_yellow.pngbin0 -> 21047 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_ring_rev_secback_normal.pngbin0 -> 6722 bytes
-rw-r--r--core/res/res/drawable-mdpi/jog_tab_target_holo.pngbin0 -> 379 bytes
-rw-r--r--core/res/res/drawable/jog_ring_blade_ring_gray.xml28
-rw-r--r--core/res/res/drawable/jog_ring_blade_ring_green.xml28
-rw-r--r--core/res/res/drawable/jog_ring_blade_ring_red.xml28
-rw-r--r--core/res/res/drawable/jog_ring_blade_ring_yellow.xml28
-rw-r--r--core/res/res/drawable/jog_ring_holo_ring.xml28
-rw-r--r--core/res/res/drawable/jog_ring_rev_ring_gray.xml28
-rw-r--r--core/res/res/drawable/jog_ring_rev_ring_green.xml28
-rw-r--r--core/res/res/drawable/jog_ring_rev_ring_red.xml28
-rw-r--r--core/res/res/drawable/jog_ring_rev_ring_yellow.xml28
-rw-r--r--core/res/res/layout/keyguard_screen_sim_pin_land_nokey.xml125
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock.xml76
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock_land.xml70
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_landscape.xml1
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_portrait.xml4
-rw-r--r--core/res/res/values-cs/strings.xml7
-rw-r--r--core/res/res/values-de/strings.xml2
-rw-r--r--core/res/res/values-es/strings.xml29
-rw-r--r--core/res/res/values-fr/strings.xml6
-rw-r--r--core/res/res/values-hu/strings.xml14
-rw-r--r--core/res/res/values-ja/strings.xml4
-rw-r--r--core/res/res/values-nl/strings.xml1
-rw-r--r--core/res/res/values-tr/strings.xml62
-rw-r--r--core/res/res/values-zh-rCN/strings.xml2
-rwxr-xr-xcore/res/res/values/attrs.xml8
-rw-r--r--core/res/res/values/config.xml6
-rw-r--r--core/res/res/values/strings.xml3
-rw-r--r--include/camera/Camera.h18
-rw-r--r--include/camera/CameraHardwareInterface.h6
-rw-r--r--include/camera/CameraParameters.h66
-rw-r--r--include/camera/ICamera.h4
-rw-r--r--include/ui/EventHub.h10
-rw-r--r--include/ui/InputReader.h5
-rw-r--r--libs/camera/Android.mk4
-rw-r--r--libs/camera/Camera.cpp13
-rw-r--r--libs/camera/CameraParameters.cpp83
-rw-r--r--libs/camera/ICamera.cpp22
-rw-r--r--libs/ui/EventHub.cpp26
-rw-r--r--libs/ui/InputReader.cpp25
-rw-r--r--libs/ui/tests/InputReader_test.cpp4
-rw-r--r--location/java/android/location/ILocationManager.aidl3
-rw-r--r--location/java/android/location/LocationManager.java10
-rw-r--r--media/libstagefright/OMXCodec.cpp2
-rw-r--r--obex/javax/obex/ClientOperation.java13
-rw-r--r--obex/javax/obex/Operation.java4
-rw-r--r--obex/javax/obex/ServerOperation.java37
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CarrierLabel.java125
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ExpandedView.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ItemTouchDispatcher.java49
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/LatestItemContainer.java45
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/WimaxButton.java14
-rw-r--r--packages/VpnServices/src/com/android/server/vpn/OpenvpnService.java8
-rw-r--r--policy/src/com/android/internal/policy/impl/LockScreen.java441
-rw-r--r--policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java113
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java65
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java9
-rw-r--r--policy/src/com/android/internal/policy/impl/SimUnlockScreen.java3
-rw-r--r--services/camera/libcameraservice/Android.mk9
-rw-r--r--services/camera/libcameraservice/CameraService.cpp235
-rw-r--r--services/camera/libcameraservice/CameraService.h12
-rw-r--r--services/java/com/android/server/LocationManagerService.java50
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java67
-rw-r--r--services/java/com/android/server/ScreenRotationAnimation.java329
-rw-r--r--services/java/com/android/server/SystemServer.java21
-rw-r--r--services/java/com/android/server/UiModeManagerService.java3
-rw-r--r--services/java/com/android/server/WindowManagerService.java207
-rwxr-xr-xservices/java/com/android/server/am/ActivityManagerService.java3
-rw-r--r--services/java/com/android/server/am/ActivityRecord.java9
-rw-r--r--services/java/com/android/server/am/ActivityStack.java3
-rw-r--r--services/java/com/android/server/location/BTGPSService.java465
-rw-r--r--services/java/com/android/server/location/BTGpsLocationProvider.java858
-rw-r--r--services/java/com/android/server/location/NMEAParser.java544
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp259
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h8
-rw-r--r--telephony/java/com/android/internal/telephony/IccFileHandler.java212
-rw-r--r--telephony/java/com/android/internal/telephony/LGEStarRIL.java24
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java11
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/sms/BearerData.java2
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GSMPhone.java4
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java15
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/SuppServiceNotification.java3
-rw-r--r--vpn/java/android/net/vpn/OpenvpnProfile.java36
228 files changed, 5955 insertions, 1716 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
index 69710d9..afbfb79 100644
--- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java
+++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
@@ -25,6 +25,7 @@ import android.content.IntentFilter;
import android.os.Message;
import android.os.PowerManager;
import android.os.SystemClock;
+import android.provider.Settings;
import android.server.BluetoothA2dpService;
import android.server.BluetoothService;
import android.util.Log;
@@ -83,6 +84,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
private static final int AUTO_CONNECT_DELAY = 6000; // 6 secs
private static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs
+ private static final int CONNECT_OTHER_PROFILES_DELAY_FAST = 100; // 100ms
private static final int CONNECTION_ACCESS_REQUEST_EXPIRY_TIMEOUT = 7000; // 7 secs
private static final int CONNECTION_ACCESS_UNDEFINED = -1;
private static final long INIT_INCOMING_REJECT_TIMER = 1000; // 1 sec
@@ -824,7 +826,16 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine
i.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
i.putExtra(ACTION_CONNECT_TYPE, type);
PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, i, 0);
- mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + CONNECT_OTHER_PROFILES_DELAY, pi);
+
+ long delayTime = CONNECT_OTHER_PROFILES_DELAY;
+
+ // Many devices don't need the long delay.
+ if (Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.BLUETOOTH_FAST_CONNECT, 0) != 0) {
+ delayTime = CONNECT_OTHER_PROFILES_DELAY_FAST;
+ }
+
+ mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delayTime, pi);
}
private int getTrust() {
diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java
index f5f0ba6..515d89f 100644
--- a/core/java/android/bluetooth/BluetoothUuid.java
+++ b/core/java/android/bluetooth/BluetoothUuid.java
@@ -51,10 +51,14 @@ public final class BluetoothUuid {
ParcelUuid.fromString("00001105-0000-1000-8000-00805f9b34fb");
public static final ParcelUuid HID =
ParcelUuid.fromString("00001124-0000-1000-8000-00805f9b34fb");
+ public static final ParcelUuid MessageAccessServer =
+ ParcelUuid.fromString("00001132-0000-1000-8000-00805f9b34fb");
+ public static final ParcelUuid MessageNotificationServer =
+ ParcelUuid.fromString("00001133-0000-1000-8000-00805f9b34fb");
public static final ParcelUuid[] RESERVED_UUIDS = {
AudioSink, AudioSource, AdvAudioDist, HSP, Handsfree, AvrcpController, AvrcpTarget,
- ObexObjectPush,HID};
+ ObexObjectPush, HID, MessageAccessServer, MessageNotificationServer};
public static boolean isAudioSource(ParcelUuid uuid) {
return uuid.equals(AudioSource);
@@ -88,6 +92,14 @@ public final class BluetoothUuid {
return uuid.equals(HID);
}
+ public static boolean isMessageAccessServer(ParcelUuid uuid) {
+ return uuid.equals(MessageAccessServer);
+ }
+
+ public static boolean isMessageNotificationServer(ParcelUuid uuid) {
+ return uuid.equals(MessageNotificationServer);
+ }
+
/**
* Returns true if ParcelUuid is present in uuidArray
*
diff --git a/core/java/android/net/wimax/WimaxHelper.java b/core/java/android/net/wimax/WimaxHelper.java
index 69a358b..07a8fcf 100644
--- a/core/java/android/net/wimax/WimaxHelper.java
+++ b/core/java/android/net/wimax/WimaxHelper.java
@@ -35,7 +35,11 @@ public class WimaxHelper {
private static final String TAG = "WimaxHelper";
+ private static final String WIMAX_CONTROLLER_CLASSNAME = "com.htc.net.wimax.WimaxController";
+ private static final String WIMAX_MANAGER_CLASSNAME = "android.net.wimax.WimaxManager";
+
private static DexClassLoader sWimaxClassLoader;
+ private static String sWimaxManagerClassname, sGetWimaxStateMethodname;
public static boolean isWimaxSupported(Context context) {
return context.getResources().getBoolean(
@@ -45,6 +49,17 @@ public class WimaxHelper {
public static DexClassLoader getWimaxClassLoader(Context context) {
if (isWimaxSupported(context)) {
if (sWimaxClassLoader == null) {
+ sWimaxManagerClassname = context.getResources().getString(
+ com.android.internal.R.string.config_wimaxManagerClassname);
+
+ // WimaxController::getWimaxState == WimaxManager::getWimaxStatus.
+ // However, WimaxManager also implements a different getWimaxState method,
+ // which returns a WimaxState object describing the connection state, not
+ // the enabled state.
+ if (sWimaxManagerClassname.equals(WIMAX_CONTROLLER_CLASSNAME))
+ sGetWimaxStateMethodname = "getWimaxState";
+ else if (sWimaxManagerClassname.equals(WIMAX_MANAGER_CLASSNAME))
+ sGetWimaxStateMethodname = "getWimaxStatus";
String wimaxJarLocation = context.getResources().getString(
com.android.internal.R.string.config_wimaxServiceJarLocation);
@@ -64,20 +79,33 @@ public class WimaxHelper {
try {
DexClassLoader wimaxClassLoader = getWimaxClassLoader(context);
- IBinder b = ServiceManager.getService(WimaxManagerConstants.WIMAX_SERVICE);
- if (b != null) {
- Class<?> klass = wimaxClassLoader.loadClass("com.htc.net.wimax.IWimaxController$Stub");
- if (klass != null) {
- Method asInterface = klass.getMethod("asInterface", IBinder.class);
- Object wc = asInterface.invoke(null, b);
- if (wc != null) {
- klass = wimaxClassLoader.loadClass("com.htc.net.wimax.WimaxController");
- if (klass != null) {
- Constructor<?> ctor = klass.getDeclaredConstructors()[1];
- controller = ctor.newInstance(wc, handler);
+ if (sWimaxManagerClassname.equals(WIMAX_CONTROLLER_CLASSNAME)) {
+ // Load supersonic's and speedy's WimaxController.
+ IBinder b = ServiceManager.getService(WimaxManagerConstants.WIMAX_SERVICE);
+ if (b != null) {
+ Class<?> klass = wimaxClassLoader.loadClass("com.htc.net.wimax.IWimaxController$Stub");
+ if (klass != null) {
+ Method asInterface = klass.getMethod("asInterface", IBinder.class);
+ Object wc = asInterface.invoke(null, b);
+ if (wc != null) {
+ klass = wimaxClassLoader.loadClass(WIMAX_CONTROLLER_CLASSNAME);
+ if (klass != null) {
+ Constructor<?> ctor = klass.getDeclaredConstructors()[1];
+ controller = ctor.newInstance(wc, handler);
+ }
}
}
}
+ } else if (sWimaxManagerClassname.equals(WIMAX_MANAGER_CLASSNAME)) {
+ // Load crespo4g's (and epicmtd's) WimaxManager.
+ // Note that crespo4g's implementation grabs WIMAX_SERVICE internally, so
+ // it doesn't need to be passed in. Other implementations (may) require
+ // WIMAX_SERVICE to be grabbed externally, so check WimaxManager::<init>.
+ Class<?> klass = wimaxClassLoader.loadClass(WIMAX_MANAGER_CLASSNAME);
+ if (klass != null) {
+ Constructor<?> ctor = klass.getDeclaredConstructors()[0];
+ controller = ctor.newInstance();
+ }
}
} catch (Exception e) {
Log.e(TAG, "Unable to create WimaxController instance", e);
@@ -117,7 +145,7 @@ public class WimaxHelper {
int ret = 0;
try {
Object wimaxService = context.getSystemService(WimaxManagerConstants.WIMAX_SERVICE);
- Method m = wimaxService.getClass().getMethod("getWimaxState");
+ Method m = wimaxService.getClass().getMethod(sGetWimaxStateMethodname);
ret = (Integer) m.invoke(wimaxService);
} catch (Exception e) {
Log.e(TAG, "Unable to get WiMAX state!", e);
diff --git a/core/java/android/provider/CmSystem.java b/core/java/android/provider/CmSystem.java
index 5fe9a80..5644a8b 100644
--- a/core/java/android/provider/CmSystem.java
+++ b/core/java/android/provider/CmSystem.java
@@ -68,6 +68,161 @@ public final class CmSystem {
public static final int KEYCODE_NONE = -1;
+ public enum LockscreenStyle {
+ Slider,
+ Rotary,
+ Lense,
+ Ring;
+
+ static public LockscreenStyle getStyleById(int id) {
+ switch (id) {
+ case 1:
+ return Slider;
+ case 2:
+ return Rotary;
+ case 3:
+ /* backwards compat */
+ return Rotary;
+ case 4:
+ return Lense;
+ case 5:
+ return Ring;
+ default:
+ return Ring;
+ }
+ }
+
+ static public LockscreenStyle getStyleById(String id) {
+ return getStyleById(Integer.valueOf(id));
+ }
+
+ static public int getIdByStyle(LockscreenStyle lockscreenstyle) {
+ switch (lockscreenstyle){
+ case Slider:
+ return 1;
+ case Rotary:
+ return 2;
+ case Lense:
+ return 4;
+ case Ring:
+ return 5;
+ default:
+ return 5;
+ }
+ }
+ }
+
+ public enum InCallStyle {
+ Slider,
+ Rotary,
+ Ring;
+
+ static public InCallStyle getStyleById(int id) {
+ switch (id) {
+ case 1:
+ return Slider;
+ case 2:
+ return Rotary;
+ case 3:
+ /* backwards compat */
+ return Rotary;
+ case 4:
+ return Ring;
+ default:
+ return Ring;
+ }
+ }
+
+ static public InCallStyle getStyleById(String id) {
+ return getStyleById(Integer.valueOf(id));
+ }
+
+ static public int getIdByStyle(InCallStyle inCallStyle) {
+ switch (inCallStyle) {
+ case Slider:
+ return 1;
+ case Rotary:
+ return 2;
+ case Ring:
+ return 4;
+ default:
+ return 4;
+ }
+ }
+ }
+
+ public enum RotaryStyle {
+ Normal,
+ Revamped;
+
+ static public RotaryStyle getStyleById(int id) {
+ switch (id) {
+ case 1:
+ return Normal;
+ case 2:
+ return Revamped;
+ default:
+ return Normal;
+ }
+ }
+
+ static public RotaryStyle getStyleById(String id) {
+ return getStyleById(Integer.valueOf(id));
+ }
+
+ static public int getIdByStyle(RotaryStyle style) {
+ switch (style) {
+ case Normal:
+ return 1;
+ case Revamped:
+ return 2;
+ default:
+ return 1;
+ }
+ }
+ }
+
+ public enum RinglockStyle {
+ Bubble,
+ Revamped,
+ Holo,
+ Blade;
+
+ static public RinglockStyle getStyleById(int id) {
+ switch (id) {
+ case 1:
+ return Bubble;
+ case 2:
+ return Revamped;
+ case 3:
+ return Holo;
+ case 4:
+ return Blade;
+ default:
+ return Bubble;
+ }
+ }
+
+ static public RinglockStyle getStyleById(String id) {
+ return getStyleById(Integer.valueOf(id));
+ }
+
+ static public int getIdByStyle(RinglockStyle style) {
+ switch (style) {
+ case Bubble:
+ return 1;
+ case Revamped:
+ return 2;
+ case Holo:
+ return 3;
+ case Blade:
+ return 4;
+ default:
+ return 1;
+ }
+ }
+ }
+
public CmSystem(){
//nothing to be done, as long as only static functions in here
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 11c82db..f70744f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1204,6 +1204,12 @@ public final class Settings {
public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
/**
+ * Whether Bluetooth fast connections are enabled.
+ * @hide
+ */
+ public static final String BLUETOOTH_FAST_CONNECT = "bluetooth_fast_connect";
+
+ /**
* The policy for deciding when Wi-Fi should go to sleep (which will in
* turn switch to using the mobile data as an Internet connection).
* <p>
@@ -1648,6 +1654,13 @@ public final class Settings {
public static final String VOLUME_CONTROL_SILENT = "volume_contol_silent";
/**
+ * Whether to lock ringer volume changes in silent mode.
+ *
+ * @hide
+ */
+ public static final String LOCK_VOLUME_KEYS = "lock_volume_keys";
+
+ /**
* Whether notifications should vibrate during phone calls or not.
*
* @hide
@@ -2252,6 +2265,23 @@ public final class Settings {
public static final String LOCK_MMS_IN_MEMORY = "lock_mms_in_memory";
/**
+ * What text to show as carrier label
+ * 0: use system default
+ * 1: show spn
+ * 2: show plmn
+ * 3: show custom string
+ * default: 0
+ * @hide
+ */
+ public static final String CARRIER_LABEL_TYPE = "carrier_label_type";
+
+ /**
+ * The custom string to show as carrier label
+ * @hide
+ */
+ public static final String CARRIER_LABEL_CUSTOM_STRING = "carrier_label_custom_string";
+
+ /**
* Display style of AM/PM next to clock in status bar
* 0: Normal display (Eclair stock)
* 1: Small display (Froyo stock)
@@ -2586,6 +2616,18 @@ public final class Settings {
public static final String IN_CALL_STYLE_PREF = "in_call_style_pref";
/**
+ * Sets the rotary lock style
+ * @hide
+ */
+ public static final String ROTARY_STYLE_PREF = "rotary_style_pref";
+
+ /**
+ * Sets the ringlock style
+ * @hide
+ */
+ public static final String RINGLOCK_STYLE_PREF = "ringlock_style_pref";
+
+ /**
* Pulse the Trackball with Screen On. The value is boolean (1 or 0).
* @hide
*/
@@ -2846,6 +2888,12 @@ public final class Settings {
*/
public static final String EXPANDED_FLASH_MODE = "expanded_flash_mode";
+ /**
+ * Notification Power Widget - Mobile Data Auto 2G/3G Toggle
+ * @hide
+ */
+ public static final String EXPANDED_MOBILEDATANETWORK_MODE = "expanded_mobiledatanetwork_mode";
+
/**
* Enables the Screen-on animation
* @hide
@@ -3528,6 +3576,11 @@ public final class Settings {
public static final String ADB_ENABLED = "adb_enabled";
/**
+ * The TCP/IP port to run ADB on, or -1 for USB
+ */
+ public static final String ADB_PORT = "adb_port";
+
+ /**
* Whether to show ADB notifications.
* @hide
*/
@@ -3698,6 +3751,12 @@ public final class Settings {
* @hide
*/
public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
+
+ /**
+ * External BT GPS device
+ * @hide
+ */
+ public static final String EXTERNAL_GPS_BT_DEVICE = "0";
/**
* The Logging ID (a unique 64-bit value) as a hex string.
@@ -5065,4 +5124,5 @@ public final class Settings {
public static String getGTalkDeviceId(long androidId) {
return "android-" + Long.toHexString(androidId);
}
+
}
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 5915a08..544318f 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -121,7 +121,8 @@ public class BluetoothService extends IBluetooth.Stub {
private static final ParcelUuid[] RFCOMM_UUIDS = {
BluetoothUuid.Handsfree,
BluetoothUuid.HSP,
- BluetoothUuid.ObexObjectPush };
+ BluetoothUuid.ObexObjectPush,
+ BluetoothUuid.MessageNotificationServer };
// TODO(): Optimize all these string handling
private final Map<String, String> mAdapterProperties;
@@ -492,6 +493,12 @@ public class BluetoothService extends IBluetooth.Stub {
mHandler.obtainMessage(MESSAGE_REGISTER_SDP_RECORDS, 4, -1), 500);
break;
case 4:
+ Log.d(TAG, "Registering map record");
+ SystemService.start("map");
+ mHandler.sendMessageDelayed(
+ mHandler.obtainMessage(MESSAGE_REGISTER_SDP_RECORDS, 5, -1), 500);
+ break;
+ case 5:
Log.d(TAG, "Registering pbap record");
SystemService.start("pbap");
break;
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index cd0ae3b..e759498 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -365,6 +365,19 @@ public class Surface implements Parcelable {
}
/**
+ * Copy the current screen contents into a bitmap and return it.
+ *
+ * @param width The desired width of the returned bitmap; the raw
+ * screen will be scaled down to this size.
+ * @param height The desired height of the returned bitmap; the raw
+ * screen will be scaled down to this size.
+ * @return Returns a Bitmap containing the screen contents.
+ *
+ * @hide
+ */
+ public static native Bitmap screenshot(int width, int height);
+
+ /**
* set surface parameters.
* needs to be inside open/closeTransaction block
*/
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index 1a341e1..ab6c4b0 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -357,6 +357,17 @@ public interface WindowManagerPolicy {
/** Screen turned off because of proximity sensor */
public final int OFF_BECAUSE_OF_PROX_SENSOR = 4;
+ /** When not otherwise specified by the activity's screenOrientation, rotation should be
+ * determined by the system (that is, using sensors).
+ * @hide
+ */
+ public final int USER_ROTATION_FREE = 0;
+ /** When not otherwise specified by the activity's screenOrientation, rotation is set by
+ * the user.
+ * @hide
+ */
+ public final int USER_ROTATION_LOCKED = 1;
+
/**
* Magic constant to {@link IWindowManager#setRotation} to not actually
* modify the rotation.
diff --git a/core/java/android/view/animation/ScaleAnimation.java b/core/java/android/view/animation/ScaleAnimation.java
index 1a56c8b..558a2ad 100644
--- a/core/java/android/view/animation/ScaleAnimation.java
+++ b/core/java/android/view/animation/ScaleAnimation.java
@@ -17,8 +17,10 @@
package android.view.animation;
import android.content.Context;
+import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
+import android.util.TypedValue;
/**
* An animation that controls the scale of an object. You can specify the point
@@ -26,11 +28,23 @@ import android.util.AttributeSet;
*
*/
public class ScaleAnimation extends Animation {
+ private final Resources mResources;
+
private float mFromX;
private float mToX;
private float mFromY;
private float mToY;
+ private int mFromXType = TypedValue.TYPE_NULL;
+ private int mToXType = TypedValue.TYPE_NULL;
+ private int mFromYType = TypedValue.TYPE_NULL;
+ private int mToYType = TypedValue.TYPE_NULL;
+
+ private int mFromXData = 0;
+ private int mToXData = 0;
+ private int mFromYData = 0;
+ private int mToYData = 0;
+
private int mPivotXType = ABSOLUTE;
private int mPivotYType = ABSOLUTE;
private float mPivotXValue = 0.0f;
@@ -48,14 +62,60 @@ public class ScaleAnimation extends Animation {
public ScaleAnimation(Context context, AttributeSet attrs) {
super(context, attrs);
+ mResources = context.getResources();
+
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ScaleAnimation);
- mFromX = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_fromXScale, 0.0f);
- mToX = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_toXScale, 0.0f);
+ TypedValue tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_fromXScale);
+ mFromX = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mFromX = tv.getFloat();
+ } else {
+ mFromXType = tv.type;
+ mFromXData = tv.data;
+ }
+ }
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_toXScale);
+ mToX = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mToX = tv.getFloat();
+ } else {
+ mToXType = tv.type;
+ mToXData = tv.data;
+ }
+ }
- mFromY = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_fromYScale, 0.0f);
- mToY = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_toYScale, 0.0f);
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_fromYScale);
+ mFromY = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mFromY = tv.getFloat();
+ } else {
+ mFromYType = tv.type;
+ mFromYData = tv.data;
+ }
+ }
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_toYScale);
+ mToY = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mToY = tv.getFloat();
+ } else {
+ mToYType = tv.type;
+ mToYData = tv.data;
+ }
+ }
Description d = Description.parseValue(a.peekValue(
com.android.internal.R.styleable.ScaleAnimation_pivotX));
@@ -81,6 +141,7 @@ public class ScaleAnimation extends Animation {
* @param toY Vertical scaling factor to apply at the end of the animation
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -107,6 +168,7 @@ public class ScaleAnimation extends Animation {
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY,
float pivotX, float pivotY) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -146,6 +208,7 @@ public class ScaleAnimation extends Animation {
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY,
int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -176,10 +239,32 @@ public class ScaleAnimation extends Animation {
}
}
+ float resolveScale(float scale, int type, int data, int size, int psize) {
+ float targetSize;
+ if (type == TypedValue.TYPE_FRACTION) {
+ targetSize = TypedValue.complexToFraction(data, size, psize);
+ } else if (type == TypedValue.TYPE_DIMENSION) {
+ targetSize = TypedValue.complexToDimension(data, mResources.getDisplayMetrics());
+ } else {
+ return scale;
+ }
+
+ if (size == 0) {
+ return 1;
+ }
+
+ return targetSize/(float)size;
+ }
+
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
+ mFromX = resolveScale(mFromX, mFromXType, mFromXData, width, parentWidth);
+ mToX = resolveScale(mToX, mToXType, mToXData, width, parentWidth);
+ mFromY = resolveScale(mFromY, mFromYType, mFromYData, height, parentHeight);
+ mToY = resolveScale(mToY, mToYType, mToYData, height, parentHeight);
+
mPivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
mPivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
}
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 4a35533..51107ea 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -29,6 +29,7 @@ import android.os.Debug;
import android.os.Handler;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemProperties;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
@@ -330,6 +331,15 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
boolean mStackFromBottom;
/**
+ * Indicates whether to system-wide-override to enable/disable or not.
+ * 0 = force to enable scrollingCacheEnabled regardless of app setting
+ * 1 = default is to enable scrollingCacheEnabled unless app specifies
+ * 2 = default is to disable scrollingCacheEnabled unless app specifies
+ * 3 = force to disable scrollingCacheEnabled regardless of app setting
+ */
+ int mScrollingCacheProperty = SystemProperties.getInt("persist.sys.scrollingcache",1);
+
+ /**
* When set to true, the list automatically discards the children's
* bitmap cache after scrolling.
*/
@@ -471,6 +481,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
private Runnable mClearScrollingCache;
private int mMinimumVelocity;
private int mMaximumVelocity;
+ private int mDecacheThreshold;
final boolean[] mIsScrap = new boolean[1];
@@ -618,7 +629,21 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
boolean stackFromBottom = a.getBoolean(R.styleable.AbsListView_stackFromBottom, false);
setStackFromBottom(stackFromBottom);
- boolean scrollingCacheEnabled = a.getBoolean(R.styleable.AbsListView_scrollingCache, true);
+ boolean scrollingCacheEnabled = true;
+ switch(mScrollingCacheProperty) {
+ case 0:
+ scrollingCacheEnabled = true;
+ break;
+ default:
+ scrollingCacheEnabled = a.getBoolean(R.styleable.AbsListView_scrollingCache, true);
+ break;
+ case 2:
+ scrollingCacheEnabled = a.getBoolean(R.styleable.AbsListView_scrollingCache, false);
+ break;
+ case 3:
+ scrollingCacheEnabled = false;
+ break;
+ }
setScrollingCacheEnabled(scrollingCacheEnabled);
boolean useTextFilter = a.getBoolean(R.styleable.AbsListView_textFilterEnabled, false);
@@ -646,12 +671,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
setFocusableInTouchMode(true);
setWillNotDraw(false);
setAlwaysDrawnWithCacheEnabled(false);
- setScrollingCacheEnabled(true);
+ boolean scrollingCacheEnabled = (mScrollingCacheProperty < 2);
+ setScrollingCacheEnabled(scrollingCacheEnabled);
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
mTouchSlop = configuration.getScaledTouchSlop();
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
+ mDecacheThreshold = mMaximumVelocity / 2;
mOverscrollDistance = configuration.getScaledOverscrollDistance();
mOverflingDistance = configuration.getScaledOverflingDistance();
@@ -817,6 +844,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
clearScrollingCache();
}
mScrollingCacheEnabled = enabled;
+ Log.d(ViewDebug.CONSISTENCY_LOG_TAG, "AbsListView " + this + " enabled= " + enabled);
}
/**
@@ -2838,6 +2866,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
void start(int initialVelocity) {
+ if (Math.abs(initialVelocity) > mDecacheThreshold) {
+ // For long flings, scrolling cache causes stutter, so don't use it
+ clearScrollingCache();
+ }
+
int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0;
mLastFlingY = initialY;
mScroller.fling(0, initialY, 0, initialVelocity,
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index ba31992..668b029 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -20,6 +20,7 @@ import android.app.admin.DevicePolicyManager;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
+import android.net.Uri;
import android.os.FileObserver;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -735,83 +736,53 @@ public class LockPatternUtils {
}
where.append(") ");
}
+
+ String[] projection = new String[] {
+ Calendar.EventsColumns.TITLE,
+ Calendar.Instances.BEGIN,
+ Calendar.EventsColumns.DESCRIPTION,
+ Calendar.EventsColumns.EVENT_LOCATION,
+ Calendar.EventsColumns.ALL_DAY
+ };
+
+ Uri uri = Uri.withAppendedPath(Calendar.Instances.CONTENT_URI,
+ String.format("%d/%d", now, later));
String nextCalendarAlarm = null;
Cursor cursor = null;
+
try {
- cursor = Calendar.Instances.query(mContentResolver,
- new String[] {
- Calendar.EventsColumns.TITLE,
- Calendar.EventsColumns.DTSTART,
- Calendar.EventsColumns.DTEND,
- Calendar.EventsColumns.DESCRIPTION,
- Calendar.EventsColumns.EVENT_LOCATION,
- Calendar.EventsColumns.ALL_DAY,
- },
- now,
- later,
- where.toString(),
- Calendar.EventsColumns.DTSTART + " ASC");
+ cursor = mContentResolver.query(uri,
+ projection, where.toString(), null,
+ Calendar.Instances.DEFAULT_SORT_ORDER);
if (cursor != null && cursor.moveToFirst()) {
- // All day events are given in UTC. This can cause them to be sorted
- // as earlier events compared to a normal event on the night before
- // we can fix this by doing UTC time - offset => local time and then
- // compare that to the next event on the cursor.
- long offset = (new Date()).getTimezoneOffset() * 60000;
- String title, description, location;
- Date start;
- boolean allDay, isRepeat;
- int i = cursor.getCount() - 1;
-
- do {
- title = cursor.getString(0);
- start = new Date(cursor.getLong(1));
- isRepeat = cursor.getLong(2) == 0;
- description = cursor.getString(3);
- location = cursor.getString(4);
- allDay = cursor.getInt(5) != 0;
-
- // repeat events always report the first day of the event as
- // start >.<' Fix the date then, to match today
- if (isRepeat) {
- java.util.Calendar today = java.util.Calendar.getInstance();
- java.util.Calendar startc = java.util.Calendar.getInstance();
- startc.setTime(start);
-
- // Event is repetitive in the future
- if (today.getTimeInMillis() < startc.getTimeInMillis()) {
- Log.i(TAG, "Repetitive event detected in the future");
- } else {
- startc.set(java.util.Calendar.DATE, today.get(java.util.Calendar.DATE));
- startc.set(java.util.Calendar.MONTH, today.get(java.util.Calendar.MONTH));
- startc.set(java.util.Calendar.YEAR, today.get(java.util.Calendar.YEAR));
-
- // Event already old, probably tomorrow is desired
- if (today.getTimeInMillis() > startc.getTimeInMillis()) {
- startc.roll(java.util.Calendar.DATE, true);
- Log.i(TAG, "Repetitive event hour already old, using tomorrow");
- }
-
- Log.i(TAG, "Repetitive event detected, date corrected (" +
- start.getTime() + " -> " + startc.getTimeInMillis() + ")");
- start = startc.getTime();
- }
- }
-
- // i prevents out of range comparisons
- // if it's not an all day event, we're sure it's the earliest event
- if (i == 0 || !allDay)
- break;
+ String title = cursor.getString(0);
+ long begin = cursor.getLong(1);
+ String description = cursor.getString(2);
+ String location = cursor.getString(3);
+ boolean allDay = cursor.getInt(4) != 0;
+ // Check the next event in the case of allday event. As UTC is used for allday
+ // events, the next event may be the one that actually starts sooner
+ if (allDay && !cursor.isLast()) {
cursor.moveToNext();
- i = i-1;
- } while ((new Date(cursor.getLong(1) - offset)).before(start));
+ long nextBegin = cursor.getLong(1);
+ if (nextBegin < begin + TimeZone.getDefault().getOffset(begin)) {
+ title = cursor.getString(0);
+ begin = nextBegin;
+ description = cursor.getString(2);
+ location = cursor.getString(3);
+ allDay = cursor.getInt(4) != 0;
+ }
+ }
+ Date start = new Date(begin);
StringBuilder sb = new StringBuilder();
- if (allDay == true) {
- SimpleDateFormat sdf = new SimpleDateFormat(mContext.getString(R.string.abbrev_wday_month_day_no_year));
+ if (allDay) {
+ SimpleDateFormat sdf = new SimpleDateFormat(
+ mContext.getString(R.string.abbrev_wday_month_day_no_year));
// Calendar stores all-day events in UTC -- setting the timezone ensures
// the correct date is shown.
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
diff --git a/core/java/com/android/internal/widget/RingSelector.java b/core/java/com/android/internal/widget/RingSelector.java
index 0ef9066..72ce320 100644
--- a/core/java/com/android/internal/widget/RingSelector.java
+++ b/core/java/com/android/internal/widget/RingSelector.java
@@ -90,6 +90,7 @@ public class RingSelector extends ViewGroup {
*/
private int mOrientation;
private int mSelectedRingId;
+ private int mHighlightBackgroundResId;
private Ring mLeftRing;
private Ring mRightRing;
private Ring mMiddleRing;
@@ -207,6 +208,8 @@ public class RingSelector extends ViewGroup {
private int alignCenterX;
private int alignCenterY;
+ private int backgroundId;
+
/**
* Constructor
*
@@ -222,6 +225,8 @@ public class RingSelector extends ViewGroup {
ring.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
+ backgroundId = ringId;
+
// Create target
target = new ImageView(parent.getContext());
target.setImageResource(targetId);
@@ -252,9 +257,17 @@ public class RingSelector extends ViewGroup {
}
void setRingBackgroundResource(int ringId) {
+ backgroundId = ringId;
ring.setBackgroundResource(ringId);
}
+ void setHighlighted(int highlightId) {
+ if (highlightId == 0) {
+ highlightId = backgroundId;
+ }
+ ring.setBackgroundResource(highlightId);
+ }
+
void hide() {
if (isHidden) return;
if (ring.getVisibility() == View.INVISIBLE) return;
@@ -704,6 +717,8 @@ public class RingSelector extends ViewGroup {
mSecRingBottomOffset = (int) (mDensity * mDensityScaleFactor * mSecRingBottomOffsetDIP);
mSecRingCenterOffset = (int) (mDensity * mDensityScaleFactor * mSecRingCenterOffsetDIP);
+ mHighlightBackgroundResId = R.drawable.jog_ring_ring_pressed_red;
+
mSecRings = new SecRing[] {
new SecRing(this, R.drawable.jog_ring_secback_normal),
new SecRing(this, R.drawable.jog_ring_secback_normal),
@@ -982,7 +997,7 @@ public class RingSelector extends ViewGroup {
super.setVisibility(View.INVISIBLE);
if ((mMiddlePrimary && isLeft) || (!mMiddlePrimary && !isRight && !isLeft)) {
if (mPrevTriggered) {
- mCurrentRing.setRingBackgroundResource(R.drawable.jog_ring_ring_green);
+ mCurrentRing.setHighlighted(0);
}
mSecRings[mSelectedRingId].deactivate();
}
@@ -1039,14 +1054,21 @@ public class RingSelector extends ViewGroup {
}
}
if (ringsTouched && !mPrevTriggered) {
- mCurrentRing.setRingBackgroundResource(R.drawable.jog_ring_ring_pressed_red);
+ mCurrentRing.setHighlighted(mHighlightBackgroundResId);
mPrevTriggered = true;
} else if (!ringsTouched && mPrevTriggered) {
- mCurrentRing.setRingBackgroundResource(R.drawable.jog_ring_ring_green);
+ mCurrentRing.setHighlighted(0);
mPrevTriggered = false;
}
}
+ public void setHighlightBackgroundResource(int backgroundId) {
+ mHighlightBackgroundResId = backgroundId;
+ if (mPrevTriggered) {
+ mCurrentRing.setHighlighted(backgroundId);
+ }
+ }
+
/**
* Sets the left ring icon to a given resource.
*
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 08d6f13..6fcee88 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -158,6 +158,10 @@ ifeq ($(BOARD_HAVE_FM_RADIO),true)
ifeq ($(BOARD_FM_DEVICE),si4708)
LOCAL_SRC_FILES += android_hardware_fm_si4708.cpp
endif
+ ifeq ($(BOARD_FM_DEVICE),bcm2049)
+ LOCAL_CFLAGS += -DHAS_BCM20780
+ LOCAL_SRC_FILES += android_hardware_fm_bcm4325.cpp
+ endif
ifeq ($(BOARD_FM_DEVICE),bcm4329)
LOCAL_SRC_FILES += android_hardware_fm_bcm4325.cpp
endif
diff --git a/core/jni/android_hardware_fm_bcm4325.cpp b/core/jni/android_hardware_fm_bcm4325.cpp
index fa2bb8c..1e010bf 100644
--- a/core/jni/android_hardware_fm_bcm4325.cpp
+++ b/core/jni/android_hardware_fm_bcm4325.cpp
@@ -192,6 +192,31 @@ int hci_w(int reg, int val)
return returnval;
}
+int hci_w16(int reg, int val1, int val2)
+{
+ int returnval = 0;
+
+ char s1[100] = "hcitool cmd 0x3f 0x15 ";
+ char stemp[10] = "";
+ char starget[100] = "";
+ char *pstarget = starget;
+
+ sprintf(stemp, "0x%x ", reg);
+ pstarget = strcat(s1, stemp);
+
+ sprintf(stemp, "0x%x ", 0);
+ pstarget = strcat(pstarget, stemp);
+
+ sprintf(stemp, "0x%x ", val1);
+ pstarget = strcat(pstarget, stemp);
+
+ sprintf(stemp, "0x%x ", val2);
+ pstarget = strcat(pstarget, stemp);
+
+ returnval = system(pstarget);
+ return returnval;
+}
+
int hci_r(int reg)
{
FILE* returnval;
@@ -258,13 +283,20 @@ static jint android_hardware_fmradio_FmReceiverJNI_acquireFdNative
if(hci_w(BCM4325_I2C_FM_CTRL, BCM4325_FM_CTRL_MANUAL |BCM4325_FM_CTRL_STEREO) < 0){
return FM_JNI_FAILURE;
}
-
+#ifdef HAS_BCM20780
+ if (hci_w16(BCM4325_I2C_FM_AUDIO_CTRL0,
+ BCM4325_FM_AUDIO_CTRL0_RF_MUTE_ENABLE |
+ BCM4325_FM_AUDIO_CTRL0_DAC_OUT_LEFT_ON | BCM4325_FM_AUDIO_CTRL0_DAC_OUT_RIGHT_ON |
+ BCM4325_FM_AUDIO_CTRL0_ROUTE_DAC_ENABLE | BCM4325_FM_AUDIO_CTRL0_DEMPH_75US, 0) < 0) {
+ return FM_JNI_FAILURE;
+ }
+#else
if (hci_w(BCM4325_I2C_FM_AUDIO_CTRL0,
BCM4325_FM_AUDIO_CTRL0_DAC_OUT_LEFT_ON | BCM4325_FM_AUDIO_CTRL0_DAC_OUT_RIGHT_ON |
BCM4325_FM_AUDIO_CTRL0_ROUTE_DAC_ENABLE | BCM4325_FM_AUDIO_CTRL0_DEMPH_75US) < 0) {
return FM_JNI_FAILURE;
}
-
+#endif
return FM_JNI_SUCCESS;
}
@@ -360,24 +392,29 @@ static jint android_hardware_fmradio_FmReceiverJNI_startSearchNative
LOGD("Can't seek %s. Already at end of band.",dir?"up":"down");
return FM_JNI_FAILURE;
}
- else
+ else {
+ if ( hci_w(BCM4325_I2C_FM_SEARCH_METHOD, BCM4325_SEARCH_NORMAL) < 0){
+ LOGE("fail search method\n");
+ return FM_JNI_FAILURE;
+ }
+ if ( hci_w(BCM4325_I2C_FM_SEARCH_CTRL1, BCM4325_I2C_FM_AF_FREQ0) < 0){
+ LOGE("fail search set SEARCH_CTRL1 reg\n");
+ return FM_JNI_FAILURE;
+ }
+ if ( hci_w(BCM4325_I2C_FM_MAX_PRESET, 0) < 0 ){
+ LOGE("fail search set MAX_PRESET reg\n");
+ return FM_JNI_FAILURE;
+ }
+ if ( hci_w(BCM4325_I2C_FM_SEARCH_CTRL0, (dir ? BCM4325_FM_SEARCH_CTRL0_UP : BCM4325_FM_SEARCH_CTRL0_DOWN ) | BCM4325_FLAG_STEREO_ACTIVE | BCM4325_FLAG_STEREO_DETECTION ) < 0){
+ LOGE("fail search set SEARCH_CTRL0 reg\n");
+ return FM_JNI_FAILURE;
+ }
android_hardware_fmradio_FmReceiverJNI_setFreqNative(NULL,NULL,NULL,oldFreq+(dir?100:-100));
-
- if ( hci_w(BCM4325_I2C_FM_SEARCH_CTRL0, (dir ? BCM4325_FM_SEARCH_CTRL0_UP : BCM4325_FM_SEARCH_CTRL0_DOWN ) | BCM4325_FLAG_STEREO_ACTIVE | BCM4325_FLAG_STEREO_DETECTION ) < 0){
- LOGE("fail search up/down\n");
- return FM_JNI_FAILURE;
- }
-
- if ( hci_w(BCM4325_I2C_FM_SEARCH_METHOD, BCM4325_SEARCH_NORMAL) < 0){
- LOGE("fail search method\n");
- return FM_JNI_FAILURE;
- }
-
- if ( hci_w(BCM4325_I2C_FM_SEARCH_TUNE_MODE, BCM4325_FM_AUTO_SEARCH_MODE) < 0){
- LOGE("fail tuning\n");
- return FM_JNI_FAILURE;
+ if ( hci_w(BCM4325_I2C_FM_SEARCH_TUNE_MODE, BCM4325_FM_AUTO_SEARCH_MODE) < 0){
+ LOGE("fail tuning\n");
+ return FM_JNI_FAILURE;
+ }
}
-
// before returning wait for tuning to finish and seek to start.
// I have seen this go into an infinite loop once, so limit it to 20 iterations (usually takes 1-4).
for (int i=0; i < 20 && android_hardware_fmradio_FmReceiverJNI_getFreqNative(NULL,NULL,NULL) == oldFreq+(dir?100:-100); i++){
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index 15aab20..793b5e1 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -19,7 +19,9 @@
#include <stdio.h>
#include "android_util_Binder.h"
+#include "android/graphics/GraphicsJNI.h"
+#include <binder/IMemory.h>
#include <surfaceflinger/SurfaceComposerClient.h>
#include <surfaceflinger/Surface.h>
#include <ui/Region.h>
@@ -30,6 +32,7 @@
#include <SkCanvas.h>
#include <SkBitmap.h>
#include <SkRegion.h>
+#include <SkPixelRef.h>
#include "jni.h"
#include <android_runtime/AndroidRuntime.h>
@@ -91,15 +94,6 @@ struct no_t {
static no_t no;
-static __attribute__((noinline))
-void doThrow(JNIEnv* env, const char* exc, const char* msg = NULL)
-{
- if (!env->ExceptionOccurred()) {
- jclass npeClazz = env->FindClass(exc);
- env->ThrowNew(npeClazz, msg);
- }
-}
-
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
@@ -450,6 +444,93 @@ static void Surface_unfreezeDisplay(
}
}
+class ScreenshotPixelRef : public SkPixelRef {
+public:
+ ScreenshotPixelRef(SkColorTable* ctable) {
+ fCTable = ctable;
+ ctable->safeRef();
+ setImmutable();
+ }
+ virtual ~ScreenshotPixelRef() {
+ SkSafeUnref(fCTable);
+ }
+
+ status_t update(int width, int height) {
+ status_t res = (width > 0 && height > 0)
+ ? mScreenshot.update(width, height)
+ : mScreenshot.update();
+ if (res != NO_ERROR) {
+ return res;
+ }
+
+ return NO_ERROR;
+ }
+
+ uint32_t getWidth() const {
+ return mScreenshot.getWidth();
+ }
+
+ uint32_t getHeight() const {
+ return mScreenshot.getHeight();
+ }
+
+ uint32_t getStride() const {
+ return mScreenshot.getStride();
+ }
+
+ uint32_t getFormat() const {
+ return mScreenshot.getFormat();
+ }
+
+protected:
+ // overrides from SkPixelRef
+ virtual void* onLockPixels(SkColorTable** ct) {
+ *ct = fCTable;
+ return (void*)mScreenshot.getPixels();
+ }
+
+ virtual void onUnlockPixels() {
+ }
+
+private:
+ ScreenshotClient mScreenshot;
+ SkColorTable* fCTable;
+
+ typedef SkPixelRef INHERITED;
+};
+
+static jobject Surface_screenshot(JNIEnv* env, jobject clazz, jint width, jint height)
+{
+ ScreenshotPixelRef* pixels = new ScreenshotPixelRef(NULL);
+ if (pixels->update(width, height) != NO_ERROR) {
+ delete pixels;
+ return 0;
+ }
+
+ uint32_t w = pixels->getWidth();
+ uint32_t h = pixels->getHeight();
+ uint32_t s = pixels->getStride();
+ uint32_t f = pixels->getFormat();
+ ssize_t bpr = s * android::bytesPerPixel(f);
+
+ SkBitmap* bitmap = new SkBitmap();
+ bitmap->setConfig(convertPixelFormat(f), w, h, bpr);
+ if (f == PIXEL_FORMAT_RGBX_8888) {
+ bitmap->setIsOpaque(true);
+ }
+
+ if (w > 0 && h > 0) {
+ bitmap->setPixelRef(pixels)->unref();
+ bitmap->lockPixels();
+ } else {
+ // be safe with an empty bitmap.
+ delete pixels;
+ bitmap->setPixels(NULL);
+ }
+
+ return GraphicsJNI::createBitmap(env, bitmap, false, NULL);
+}
+
static void Surface_setLayer(
JNIEnv* env, jobject clazz, jint zorder)
{
@@ -675,6 +756,7 @@ static JNINativeMethod gSurfaceMethods[] = {
{"setOrientation", "(III)V", (void*)Surface_setOrientation },
{"freezeDisplay", "(I)V", (void*)Surface_freezeDisplay },
{"unfreezeDisplay", "(I)V", (void*)Surface_unfreezeDisplay },
+ {"screenshot", "(II)Landroid/graphics/Bitmap;", (void*)Surface_screenshot },
{"setLayer", "(I)V", (void*)Surface_setLayer },
{"setPosition", "(II)V",(void*)Surface_setPosition },
{"setSize", "(II)V",(void*)Surface_setSize },
diff --git a/core/res/res/anim/accelerate_cubic.xml b/core/res/res/anim/accelerate_cubic.xml
new file mode 100644
index 0000000..aa5c900
--- /dev/null
+++ b/core/res/res/anim/accelerate_cubic.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<accelerateInterpolator android:factor="1.5"
+ xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/core/res/res/anim/accelerate_decelerate.xml b/core/res/res/anim/accelerate_decelerate.xml
new file mode 100644
index 0000000..80b951a
--- /dev/null
+++ b/core/res/res/anim/accelerate_decelerate.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<accelerateDecelerateInterpolator />
diff --git a/core/res/res/anim/accelerate_quad.xml b/core/res/res/anim/accelerate_quad.xml
new file mode 100644
index 0000000..ed41940
--- /dev/null
+++ b/core/res/res/anim/accelerate_quad.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<accelerateInterpolator />
diff --git a/core/res/res/anim/accelerate_quint.xml b/core/res/res/anim/accelerate_quint.xml
new file mode 100644
index 0000000..064e4e7
--- /dev/null
+++ b/core/res/res/anim/accelerate_quint.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<accelerateInterpolator android:factor="2.5"
+ xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/core/res/res/anim/activity_close_enter.xml b/core/res/res/anim/activity_close_enter.xml
index f1258e8..807ac5a 100644
--- a/core/res/res/anim/activity_close_enter.xml
+++ b/core/res/res/anim/activity_close_enter.xml
@@ -1,25 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <translate android:fromXDelta="-100%" android:toXDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:zAdjustment="normal"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="@integer/config_shortAnimTime" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="1.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/accelerate_quint" android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:fromXScale="0.95" android:toXScale="1.0" android:fromYScale="0.95" android:toYScale="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/activity_close_exit.xml b/core/res/res/anim/activity_close_exit.xml
index bf3d8cd3..7011bd9 100644
--- a/core/res/res/anim/activity_close_exit.xml
+++ b/core/res/res/anim/activity_close_exit.xml
@@ -1,24 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="0%" android:toXDelta="33%"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_shortAnimTime" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:fromXScale="1.0" android:toXScale="1.1" android:fromYScale="1.0" android:toYScale="1.1" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/activity_open_enter.xml b/core/res/res/anim/activity_open_enter.xml
index a9ea381..49f346a 100644
--- a/core/res/res/anim/activity_open_enter.xml
+++ b/core/res/res/anim/activity_open_enter.xml
@@ -1,24 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="33%" android:toXDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_shortAnimTime" android:fillBefore="false" android:fillAfter="false" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="false" android:fillAfter="false" android:fromXScale="1.1" android:toXScale="1.0" android:fromYScale="1.1" android:toYScale="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/activity_open_exit.xml b/core/res/res/anim/activity_open_exit.xml
index b04b79e..a37a32e 100644
--- a/core/res/res/anim/activity_open_exit.xml
+++ b/core/res/res/anim/activity_open_exit.xml
@@ -1,25 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <translate android:fromXDelta="0%" android:toXDelta="-100%"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:zAdjustment="normal"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="@integer/config_shortAnimTime" android:fillBefore="false" android:fillAfter="false" android:fromAlpha="1.0" android:toAlpha="1.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="false" android:fillAfter="false" android:fromXScale="1.0" android:toXScale="0.95" android:fromYScale="1.0" android:toYScale="0.95" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/anticipate.xml b/core/res/res/anim/anticipate.xml
new file mode 100644
index 0000000..65e06a8
--- /dev/null
+++ b/core/res/res/anim/anticipate.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<anticipateInterpolator />
diff --git a/core/res/res/anim/anticipate_overshoot.xml b/core/res/res/anim/anticipate_overshoot.xml
new file mode 100644
index 0000000..5621472
--- /dev/null
+++ b/core/res/res/anim/anticipate_overshoot.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<anticipateOvershootInterpolator />
diff --git a/core/res/res/anim/app_starting_exit.xml b/core/res/res/anim/app_starting_exit.xml
index 0675575..3ede168 100644
--- a/core/res/res/anim/app_starting_exit.xml
+++ b/core/res/res/anim/app_starting_exit.xml
@@ -1,24 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_exit.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator">
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="@android:integer/config_mediumAnimTime" />
-</set>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/decelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="160" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/bounce.xml b/core/res/res/anim/bounce.xml
new file mode 100644
index 0000000..2aac423
--- /dev/null
+++ b/core/res/res/anim/bounce.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<bounceInterpolator />
diff --git a/core/res/res/anim/cycle.xml b/core/res/res/anim/cycle.xml
new file mode 100644
index 0000000..779a2c2
--- /dev/null
+++ b/core/res/res/anim/cycle.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<cycleInterpolator />
diff --git a/core/res/res/anim/decelerate_cubic.xml b/core/res/res/anim/decelerate_cubic.xml
new file mode 100644
index 0000000..5caf065
--- /dev/null
+++ b/core/res/res/anim/decelerate_cubic.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<decelerateInterpolator android:factor="1.5"
+ xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/core/res/res/anim/decelerate_quad.xml b/core/res/res/anim/decelerate_quad.xml
new file mode 100644
index 0000000..425b8d0
--- /dev/null
+++ b/core/res/res/anim/decelerate_quad.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<decelerateInterpolator />
diff --git a/core/res/res/anim/decelerate_quint.xml b/core/res/res/anim/decelerate_quint.xml
new file mode 100644
index 0000000..ee26d3a
--- /dev/null
+++ b/core/res/res/anim/decelerate_quint.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<decelerateInterpolator android:factor="2.5"
+ xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/core/res/res/anim/dialog_enter.xml b/core/res/res/anim/dialog_enter.xml
index d4983c6..0b9e90c 100644
--- a/core/res/res/anim/dialog_enter.xml
+++ b/core/res/res/anim/dialog_enter.xml
@@ -1,28 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale="0.9" android:toXScale="1.0"
- android:fromYScale="0.9" android:toYScale="1.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_shortAnimTime" />
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_activityDefaultDur" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="0.9" android:toXScale="1.0" android:fromYScale="0.9" android:toYScale="1.0" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_activityShortDur" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/dialog_exit.xml b/core/res/res/anim/dialog_exit.xml
index 2aa629a..4564e5a 100644
--- a/core/res/res/anim/dialog_exit.xml
+++ b/core/res/res/anim/dialog_exit.xml
@@ -1,28 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <scale android:fromXScale="1.0" android:toXScale="0.9"
- android:fromYScale="1.0" android:toYScale="0.9"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_shortAnimTime" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_activityDefaultDur" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="1.0" android:toXScale="0.9" android:fromYScale="1.0" android:toYScale="0.9" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_activityShortDur" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/grow_fade_in.xml b/core/res/res/anim/grow_fade_in.xml
index 5dc41cb..1cbcb1c 100644
--- a/core/res/res/anim/grow_fade_in.xml
+++ b/core/res/res/anim/grow_fade_in.xml
@@ -1,29 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android">
- <scale android:fromXScale="1.0" android:toXScale="1.0"
- android:fromYScale="0.3" android:toYScale="1.0"
- android:pivotX="0%" android:pivotY="0%"
- android:duration="@android:integer/config_shortAnimTime" />
- <alpha android:interpolator="@anim/decelerate_interpolator"
- android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_activityDefaultDur" android:pivotX="50.0%" android:pivotY="0.0%" android:fromXScale="0.9" android:toXScale="1.0" android:fromYScale="0.9" android:toYScale="1.0" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_activityShortDur" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/grow_fade_in_center.xml b/core/res/res/anim/grow_fade_in_center.xml
index c07a82e..0b9e90c 100644
--- a/core/res/res/anim/grow_fade_in_center.xml
+++ b/core/res/res/anim/grow_fade_in_center.xml
@@ -1,29 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android">
- <scale android:fromXScale="0.6" android:toXScale="1.0"
- android:fromYScale="0.6" android:toYScale="1.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_shortAnimTime" />
- <alpha android:interpolator="@anim/decelerate_interpolator"
- android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_activityDefaultDur" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="0.9" android:toXScale="1.0" android:fromYScale="0.9" android:toYScale="1.0" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_activityShortDur" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/grow_fade_in_from_bottom.xml b/core/res/res/anim/grow_fade_in_from_bottom.xml
index 848c677..f8482d8 100644
--- a/core/res/res/anim/grow_fade_in_from_bottom.xml
+++ b/core/res/res/anim/grow_fade_in_from_bottom.xml
@@ -1,29 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android">
- <scale android:fromXScale="0.5" android:toXScale="1.0"
- android:fromYScale="0.5" android:toYScale="1.0"
- android:pivotX="0%" android:pivotY="100%"
- android:duration="@android:integer/config_shortAnimTime" />
- <alpha android:interpolator="@anim/decelerate_interpolator"
- android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_activityDefaultDur" android:pivotX="50.0%" android:pivotY="100.0%" android:fromXScale="0.9" android:toXScale="1.0" android:fromYScale="0.9" android:toYScale="1.0" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_activityShortDur" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_enter.xml b/core/res/res/anim/input_method_enter.xml
index 3858651..f7c7878 100644
--- a/core/res/res/anim/input_method_enter.xml
+++ b/core/res/res/anim/input_method_enter.xml
@@ -1,27 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromYDelta="20%" android:toYDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
- <alpha android:fromAlpha="0.5" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:interpolator="@anim/decelerate_quint" android:duration="@integer/config_shortAnimTime" android:fromYDelta="10.000002%" android:toYDelta="0.0" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="@integer/config_shortAnimTime" android:fromAlpha="0.5" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_exit.xml b/core/res/res/anim/input_method_exit.xml
index 25369ab..0b837f9 100644
--- a/core/res/res/anim/input_method_exit.xml
+++ b/core/res/res/anim/input_method_exit.xml
@@ -1,26 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_out.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <translate android:fromYDelta="0" android:toYDelta="20%"
- android:duration="@android:integer/config_shortAnimTime"/>
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:interpolator="@anim/accelerate_quint" android:duration="@integer/config_shortAnimTime" android:fromYDelta="0.0" android:toYDelta="10.000002%" />
+ <alpha android:interpolator="@anim/accelerate_cubic" android:duration="@integer/config_shortAnimTime" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_extract_enter.xml b/core/res/res/anim/input_method_extract_enter.xml
index 96b049f..1076c90 100644
--- a/core/res/res/anim/input_method_extract_enter.xml
+++ b/core/res/res/anim/input_method_extract_enter.xml
@@ -1,24 +1,3 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
+<?xml version="1.0" encoding="UTF-8"?>
+<alpha android:interpolator="@anim/decelerate_quad" android:duration="@integer/config_shortAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android" /> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_extract_exit.xml b/core/res/res/anim/input_method_extract_exit.xml
index 26db13f..1cf4d64 100644
--- a/core/res/res/anim/input_method_extract_exit.xml
+++ b/core/res/res/anim/input_method_extract_exit.xml
@@ -1,25 +1,3 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_out.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/accelerate_interpolator"
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:duration="@android:integer/config_shortAnimTime"
-/>
+<?xml version="1.0" encoding="UTF-8"?>
+<alpha android:interpolator="@anim/accelerate_quad" android:duration="@integer/config_shortAnimTime" android:fromAlpha="1.0" android:toAlpha="0.0"
+ xmlns:android="http://schemas.android.com/apk/res/android" /> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_fancy_enter.xml b/core/res/res/anim/input_method_fancy_enter.xml
index c6949b3..c7756ce 100644
--- a/core/res/res/anim/input_method_fancy_enter.xml
+++ b/core/res/res/anim/input_method_fancy_enter.xml
@@ -1,29 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_in.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_shortAnimTime" />
- <translate android:fromYDelta="100%" android:toYDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/decelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="2.0" android:toXScale="1.0" android:fromYScale="2.0" android:toYScale="1.0" />
+ <translate android:duration="@integer/config_shortAnimTime" android:fromYDelta="100.0%" android:toYDelta="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/input_method_fancy_exit.xml b/core/res/res/anim/input_method_fancy_exit.xml
index 7333cca..a2f0055 100644
--- a/core/res/res/anim/input_method_fancy_exit.xml
+++ b/core/res/res/anim/input_method_fancy_exit.xml
@@ -1,28 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/fade_out.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_shortAnimTime" />
- <translate android:fromYDelta="0" android:toYDelta="100%"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/accelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:duration="@integer/config_shortAnimTime" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="1.0" android:toXScale="2.0" android:fromYScale="1.0" android:toYScale="2.0" />
+ <translate android:duration="@integer/config_shortAnimTime" android:fromYDelta="0.0" android:toYDelta="100.0%" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/linear.xml b/core/res/res/anim/linear.xml
new file mode 100644
index 0000000..b950a00
--- /dev/null
+++ b/core/res/res/anim/linear.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<linearInterpolator />
diff --git a/core/res/res/anim/lock_screen_behind_enter.xml b/core/res/res/anim/lock_screen_behind_enter.xml
index b243223..7bcea8d 100644
--- a/core/res/res/anim/lock_screen_behind_enter.xml
+++ b/core/res/res/anim/lock_screen_behind_enter.xml
@@ -1,23 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/accelerate_interpolator">
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_longAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/accelerate_interpolator"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="@integer/config_longAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/lock_screen_enter.xml b/core/res/res/anim/lock_screen_enter.xml
index dd47ff8..e311d7f 100644
--- a/core/res/res/anim/lock_screen_enter.xml
+++ b/core/res/res/anim/lock_screen_enter.xml
@@ -1,24 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/decelerate_interpolator"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="@integer/config_mediumAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/lock_screen_exit.xml b/core/res/res/anim/lock_screen_exit.xml
index 077fc6b..20b1857 100644
--- a/core/res/res/anim/lock_screen_exit.xml
+++ b/core/res/res/anim/lock_screen_exit.xml
@@ -1,24 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_longAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/accelerate_interpolator"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:duration="@integer/config_longAnimTime" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/overshoot.xml b/core/res/res/anim/overshoot.xml
new file mode 100644
index 0000000..2b7c206
--- /dev/null
+++ b/core/res/res/anim/overshoot.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<overshootInterpolator />
diff --git a/core/res/res/anim/screen_rotate_0_enter.xml b/core/res/res/anim/screen_rotate_0_enter.xml
new file mode 100644
index 0000000..85ba3ba
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_0_enter.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_0_exit.xml b/core/res/res/anim/screen_rotate_0_exit.xml
new file mode 100644
index 0000000..89d0595
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_0_exit.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_180_enter.xml b/core/res/res/anim/screen_rotate_180_enter.xml
new file mode 100644
index 0000000..6fe0b47
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_180_enter.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="1.0" android:toXScale="1.0"
+ android:fromYScale=".9" android:toYScale="1.0"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:fillEnabled="true" android:fillBefore="true"
+ android:interpolator="@anim/decelerate_quint"
+ android:startOffset="160"
+ android:duration="300" />
+ <alpha android:fromAlpha="0" android:toAlpha="1.0"
+ android:fillEnabled="true" android:fillBefore="true"
+ android:interpolator="@anim/decelerate_quint"
+ android:startOffset="160"
+ android:duration="300"/>
+</set>
diff --git a/core/res/res/anim/screen_rotate_180_exit.xml b/core/res/res/anim/screen_rotate_180_exit.xml
new file mode 100644
index 0000000..fd4071c
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_180_exit.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="1.0" android:toXScale="1.0"
+ android:fromYScale="1.0" android:toYScale="0.0"
+ android:pivotX="50%p" android:pivotY="50%p"
+ android:interpolator="@anim/accelerate_cubic"
+ android:duration="160" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_cubic"
+ android:duration="160"/>
+</set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_enter.xml b/core/res/res/anim/screen_rotate_minus_90_enter.xml
new file mode 100644
index 0000000..7d11471
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_minus_90_enter.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <rotate android:fromDegrees="-90" android:toDegrees="0"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_exit.xml b/core/res/res/anim/screen_rotate_minus_90_exit.xml
new file mode 100644
index 0000000..aa41232
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_minus_90_exit.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%" android:toXScale="100%p"
+ android:fromYScale="100%" android:toYScale="100%p"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="0" android:toDegrees="90"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_enter.xml b/core/res/res/anim/screen_rotate_plus_90_enter.xml
new file mode 100644
index 0000000..a9954ec
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_plus_90_enter.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <rotate android:fromDegrees="90" android:toDegrees="0"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_exit.xml b/core/res/res/anim/screen_rotate_plus_90_exit.xml
new file mode 100644
index 0000000..991ed96
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_plus_90_exit.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%" android:toXScale="100%p"
+ android:fromYScale="100%" android:toYScale="100%p"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="0" android:toDegrees="-90"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/search_bar_enter.xml b/core/res/res/anim/search_bar_enter.xml
index c85caaa..79f10a0 100644
--- a/core/res/res/anim/search_bar_enter.xml
+++ b/core/res/res/anim/search_bar_enter.xml
@@ -1,26 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_enter.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromYDelta="-25%" android:toYDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/decelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:duration="@integer/config_shortAnimTime" android:fromYDelta="-25.0%" android:toYDelta="0.0" />
+ <alpha android:duration="@integer/config_shortAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/search_bar_exit.xml b/core/res/res/anim/search_bar_exit.xml
index 1609a12..7f3a1c1 100644
--- a/core/res/res/anim/search_bar_exit.xml
+++ b/core/res/res/anim/search_bar_exit.xml
@@ -1,27 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_exit.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/accelerate_interpolator">
- <translate android:fromYDelta="0" android:toYDelta="-50%"
- android:duration="@android:integer/config_shortAnimTime"/>
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/accelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:duration="@integer/config_shortAnimTime" android:fromYDelta="0.0" android:toYDelta="-50.0%" />
+ <alpha android:duration="@integer/config_shortAnimTime" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/task_close_enter.xml b/core/res/res/anim/task_close_enter.xml
index c42ad83..f4d1602 100644
--- a/core/res/res/anim/task_close_enter.xml
+++ b/core/res/res/anim/task_close_enter.xml
@@ -1,31 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <!-- For now stay like the normal activity transition.
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_shortAnimTime" />
- -->
- <translate android:fromXDelta="-100%" android:toXDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:background="#ff000000" android:shareInterpolator="false" android:zAdjustment="normal"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="300" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:startOffset="200" android:fromXScale="0.95" android:toXScale="1.0" android:fromYScale="0.95" android:toYScale="1.0" android:fillEnabled="true" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="300" android:fillBefore="true" android:fillAfter="true" android:startOffset="200" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/task_close_exit.xml b/core/res/res/anim/task_close_exit.xml
index 66d3480..1d994a8 100644
--- a/core/res/res/anim/task_close_exit.xml
+++ b/core/res/res/anim/task_close_exit.xml
@@ -1,24 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="0%" android:toXDelta="33%"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:background="#ff000000" android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/accelerate_cubic" android:duration="200" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/accelerate_quint" android:duration="200" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:fromXScale="1.0" android:toXScale="1.2" android:fromYScale="1.0" android:toYScale="0.8" android:fillEnabled="true" />
+ <alpha android:duration="500" android:fromAlpha="1.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/task_open_enter.xml b/core/res/res/anim/task_open_enter.xml
index 66adf9f..fb9590e 100644
--- a/core/res/res/anim/task_open_enter.xml
+++ b/core/res/res/anim/task_open_enter.xml
@@ -1,24 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="33%" android:toXDelta="0"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:background="#ff000000" android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="240" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:startOffset="300" android:fromXScale="1.2" android:toXScale="1.0" android:fromYScale="0.8" android:toYScale="1.0" android:fillEnabled="true" />
+ <alpha android:interpolator="@anim/decelerate_quad" android:duration="300" android:fillBefore="true" android:fillAfter="true" android:startOffset="300" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/task_open_exit.xml b/core/res/res/anim/task_open_exit.xml
index 4a2cef4..8d7b4b6 100644
--- a/core/res/res/anim/task_open_exit.xml
+++ b/core/res/res/anim/task_open_exit.xml
@@ -1,31 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <!-- For now stay like the normal activity transition.
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_shortAnimTime" />
- -->
- <translate android:fromXDelta="0%" android:toXDelta="-100%"
- android:duration="@android:integer/config_shortAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:background="#ff000000" android:shareInterpolator="false" android:zAdjustment="normal"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="200" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="300" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:fromXScale="1.0" android:toXScale="0.95" android:fromYScale="1.0" android:toYScale="0.95" android:fillEnabled="true" />
+ <alpha android:duration="540" android:fromAlpha="1.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_close_enter.xml b/core/res/res/anim/wallpaper_close_enter.xml
index 6eb2a89..3ce1e14 100644
--- a/core/res/res/anim/wallpaper_close_enter.xml
+++ b/core/res/res/anim/wallpaper_close_enter.xml
@@ -1,69 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- This version zooms the new non-wallpaper up out of the
- wallpaper, without zooming the wallpaper itself. -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:zAdjustment="top">
- <scale android:fromXScale=".5" android:toXScale="1.0"
- android:fromYScale=".5" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:interpolator="@anim/decelerate_interpolator"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="0" android:toAlpha="1.0"
- android:interpolator="@anim/accelerate_decelerate_interpolator"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper, without zooming the wallpaper itself. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="0" android:toAlpha="1.0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
--->
-
-<!-- This version is a variation on the inter-activity slide that
- also scales the wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="33%" android:toXDelta="0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="240" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:startOffset="300" android:fromXScale="1.2" android:toXScale="1.0" android:fromYScale="0.8" android:toYScale="1.0" android:fillEnabled="true" />
+ <alpha android:interpolator="@anim/decelerate_quad" android:duration="300" android:fillBefore="true" android:fillAfter="true" android:startOffset="300" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_close_exit.xml b/core/res/res/anim/wallpaper_close_exit.xml
index eccce81..6e0c941 100644
--- a/core/res/res/anim/wallpaper_close_exit.xml
+++ b/core/res/res/anim/wallpaper_close_exit.xml
@@ -1,72 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- This version zooms the new non-wallpaper up out of the
- wallpaper, without zooming the wallpaper itself. -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:detachWallpaper="true">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper, without zooming the wallpaper itself. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:detachWallpaper="true">
- <scale android:fromXScale="1.0" android:toXScale=".5"
- android:fromYScale="1.0" android:toYScale=".5"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
--->
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper. The wallpaper here just stays fixed behind. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="1.0" android:toXScale=".5"
- android:fromYScale="1.0" android:toYScale=".5"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
-
-<!-- This version is a variation on the inter-activity slide that
- also scales the wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="0%" android:toXDelta="-100%"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="normal" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="200" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="300" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillAfter="true" android:fromXScale="1.0" android:toXScale="0.95" android:fromYScale="1.0" android:toYScale="0.95" android:fillEnabled="true" />
+ <alpha android:duration="600" android:fromAlpha="1.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_enter.xml b/core/res/res/anim/wallpaper_enter.xml
index c240a9a..d2a7bcf 100644
--- a/core/res/res/anim/wallpaper_enter.xml
+++ b/core/res/res/anim/wallpaper_enter.xml
@@ -1,28 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*\
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale="3.0" android:toXScale="1.0"
- android:fromYScale="3.0" android:toYScale="1.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_longAnimTime" />
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_longAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/decelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:duration="@integer/config_longAnimTime" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="3.0" android:toXScale="1.0" android:fromYScale="3.0" android:toYScale="1.0" />
+ <alpha android:duration="@integer/config_longAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_exit.xml b/core/res/res/anim/wallpaper_exit.xml
index 742286f..0e08133 100644
--- a/core/res/res/anim/wallpaper_exit.xml
+++ b/core/res/res/anim/wallpaper_exit.xml
@@ -1,28 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <scale android:fromXScale="1.0" android:toXScale="3.0"
- android:fromYScale="1.0" android:toYScale="3.0"
- android:pivotX="50%" android:pivotY="50%"
- android:duration="@android:integer/config_longAnimTime" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_longAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:interpolator="@anim/accelerate_quad"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:duration="@integer/config_longAnimTime" android:pivotX="50.0%" android:pivotY="50.0%" android:fromXScale="1.0" android:toXScale="3.0" android:fromYScale="1.0" android:toYScale="3.0" />
+ <alpha android:duration="@integer/config_longAnimTime" android:fromAlpha="1.0" android:toAlpha="0.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_intra_close_enter.xml b/core/res/res/anim/wallpaper_intra_close_enter.xml
index 5c4f5c9..58ba52f 100644
--- a/core/res/res/anim/wallpaper_intra_close_enter.xml
+++ b/core/res/res/anim/wallpaper_intra_close_enter.xml
@@ -1,31 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="-150%p" android:toXDelta="0%p"
- android:duration="@android:integer/config_mediumAnimTime"/>
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="normal" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/accelerate_cubic" android:duration="280" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_intra_close_exit.xml b/core/res/res/anim/wallpaper_intra_close_exit.xml
index acaf773..0e3fece 100644
--- a/core/res/res/anim/wallpaper_intra_close_exit.xml
+++ b/core/res/res/anim/wallpaper_intra_close_exit.xml
@@ -1,30 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator">
- <scale android:fromXScale="1.0" android:toXScale=".5"
- android:fromYScale="1.0" android:toYScale=".5"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="0%p" android:toXDelta="100%p"
- android:duration="@android:integer/config_mediumAnimTime"/>
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/accelerate_cubic" android:duration="280" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_intra_open_enter.xml b/core/res/res/anim/wallpaper_intra_open_enter.xml
index 81c9991..130b183 100644
--- a/core/res/res/anim/wallpaper_intra_open_enter.xml
+++ b/core/res/res/anim/wallpaper_intra_open_enter.xml
@@ -1,30 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale=".5" android:toXScale="1.0"
- android:fromYScale=".5" android:toYScale="1.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="100%p" android:toXDelta="0"
- android:duration="@android:integer/config_mediumAnimTime"/>
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="280" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_intra_open_exit.xml b/core/res/res/anim/wallpaper_intra_open_exit.xml
index 28c4287..65c7dfd 100644
--- a/core/res/res/anim/wallpaper_intra_open_exit.xml
+++ b/core/res/res/anim/wallpaper_intra_open_exit.xml
@@ -1,31 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/accelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="0" android:toXDelta="-150%p"
- android:duration="@android:integer/config_mediumAnimTime"/>
- <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="normal" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="280" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_open_enter.xml b/core/res/res/anim/wallpaper_open_enter.xml
index a32c39e..8dd4825 100644
--- a/core/res/res/anim/wallpaper_open_enter.xml
+++ b/core/res/res/anim/wallpaper_open_enter.xml
@@ -1,72 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- This version zooms the exiting non-wallpaper down in to the
- wallpaper, without zooming the wallpaper itself. -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:detachWallpaper="true">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper, without zooming the wallpaper itself. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:detachWallpaper="true">
- <scale android:fromXScale=".5" android:toXScale="1.0"
- android:fromYScale=".5" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
--->
-
-<!-- This version zooms the new non-wallpaper up off the wallpaper the
- wallpaper. The wallpaper here just stays fixed behind. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale=".5" android:toXScale="1.0"
- android:fromYScale=".5" android:toYScale="1.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
-
-<!-- This version is a variation on the inter-activity slide that
- also scales the wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="2.0" android:toXScale="1.0"
- android:fromYScale="2.0" android:toYScale="1.0"
- android:pivotX="100%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <translate android:fromXDelta="-100%" android:toXDelta="0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="normal" android:detachWallpaper="true"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <scale android:interpolator="@anim/decelerate_quint" android:duration="300" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:startOffset="200" android:fromXScale="0.95" android:toXScale="1.0" android:fromYScale="0.95" android:toYScale="1.0" android:fillEnabled="true" />
+ <alpha android:interpolator="@anim/decelerate_cubic" android:duration="300" android:fillBefore="true" android:fillAfter="true" android:startOffset="200" android:fromAlpha="0.0" android:toAlpha="1.0" android:fillEnabled="true" />
+</set> \ No newline at end of file
diff --git a/core/res/res/anim/wallpaper_open_exit.xml b/core/res/res/anim/wallpaper_open_exit.xml
index 8f0e012..a3381df 100644
--- a/core/res/res/anim/wallpaper_open_exit.xml
+++ b/core/res/res/anim/wallpaper_open_exit.xml
@@ -1,68 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-<!-- This version zooms the exiting non-wallpaper down in to the
- wallpaper, without zooming the wallpaper itself. -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:zAdjustment="top">
- <scale android:fromXScale="1.0" android:toXScale=".5"
- android:fromYScale="1.0" android:toYScale=".5"
- android:pivotX="50%p" android:pivotY="50%p"
- android:interpolator="@anim/decelerate_interpolator"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0"
- android:interpolator="@anim/accelerate_decelerate_interpolator"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper, without zooming the wallpaper itself. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator"
- android:zAdjustment="top">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
- <alpha android:fromAlpha="1.0" android:toAlpha="0"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
-
-<!-- This version zooms the new non-wallpaper down on top of the
- wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <scale android:fromXScale="1.0" android:toXScale="2.0"
- android:fromYScale="1.0" android:toYScale="2.0"
- android:pivotX="50%p" android:pivotY="50%p"
- android:duration="@android:integer/config_mediumAnimTime" />
-</set>
--->
-
-<!-- This version is a variation on the inter-activity slide that
- also scales the wallpaper. -->
-<!--
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@anim/decelerate_interpolator">
- <translate android:fromXDelta="0%" android:toXDelta="33%"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
--->
+<?xml version="1.0" encoding="UTF-8"?>
+<set android:shareInterpolator="false" android:zAdjustment="top"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <alpha android:interpolator="@anim/accelerate_cubic" android:duration="200" android:fillBefore="true" android:fillAfter="true" android:fromAlpha="1.0" android:toAlpha="0.0" android:fillEnabled="true" />
+ <scale android:interpolator="@anim/accelerate_quint" android:duration="200" android:pivotX="50.0%p" android:pivotY="50.0%p" android:fillBefore="true" android:fillAfter="true" android:fromXScale="1.0" android:toXScale="1.2" android:fromYScale="1.0" android:toYScale="0.8" android:fillEnabled="true" />
+ <alpha android:duration="500" android:fromAlpha="1.0" android:toAlpha="1.0" />
+</set> \ No newline at end of file
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_answer.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_answer.png
new file mode 100644
index 0000000..176d448
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_answer.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_custom.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_custom.png
new file mode 100644
index 0000000..086c2c1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_custom.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_decline.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_decline.png
new file mode 100644
index 0000000..d88087b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_decline.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..b47cd08
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..0dd81c0
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..6e79d10
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-hdpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..f549ccb
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_ring_normal.png b/core/res/res/drawable-hdpi/jog_ring_blade_ring_normal.png
new file mode 100644
index 0000000..5b71e14
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_gray.png b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_gray.png
new file mode 100644
index 0000000..827a7fc
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_gray.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_green.png b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_green.png
new file mode 100644
index 0000000..2c3e665
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_green.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_red.png b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_red.png
new file mode 100644
index 0000000..42dde94
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_red.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_yellow.png b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_yellow.png
new file mode 100644
index 0000000..3b25057
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_ring_pressed_yellow.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_blade_secback_normal.png b/core/res/res/drawable-hdpi/jog_ring_blade_secback_normal.png
new file mode 100644
index 0000000..cfb1608
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_blade_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_holo_ring_normal.png b/core/res/res/drawable-hdpi/jog_ring_holo_ring_normal.png
new file mode 100644
index 0000000..3ac247d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_holo_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_holo_ring_pressed.png b/core/res/res/drawable-hdpi/jog_ring_holo_ring_pressed.png
new file mode 100644
index 0000000..fbc9311c
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_holo_ring_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_holo_secback_normal.png b/core/res/res/drawable-hdpi/jog_ring_holo_secback_normal.png
new file mode 100644
index 0000000..ba5fc97
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_holo_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_ring_normal.png b/core/res/res/drawable-hdpi/jog_ring_rev_ring_normal.png
new file mode 100644
index 0000000..ef5376f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_gray.png b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_gray.png
new file mode 100644
index 0000000..4adaf32
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_gray.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_green.png b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_green.png
new file mode 100644
index 0000000..b861d2b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_green.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_red.png b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_red.png
new file mode 100644
index 0000000..7791a1e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_red.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_yellow.png b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_yellow.png
new file mode 100644
index 0000000..1b61a71
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_ring_pressed_yellow.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_ring_rev_secback_normal.png b/core/res/res/drawable-hdpi/jog_ring_rev_secback_normal.png
new file mode 100644
index 0000000..5e50c53
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_ring_rev_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/jog_tab_target_holo.png b/core/res/res/drawable-hdpi/jog_tab_target_holo.png
new file mode 100644
index 0000000..1643dc3
--- /dev/null
+++ b/core/res/res/drawable-hdpi/jog_tab_target_holo.png
Binary files differ
diff --git a/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..ec33997
--- /dev/null
+++ b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..b2fed4f
--- /dev/null
+++ b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..6e79d10
--- /dev/null
+++ b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..dc51308
--- /dev/null
+++ b/core/res/res/drawable-land-hdpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..f21bd49
--- /dev/null
+++ b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..1f4ace2
--- /dev/null
+++ b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..ee5b2df
--- /dev/null
+++ b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..b015226
--- /dev/null
+++ b/core/res/res/drawable-land-ldpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..05af04b
--- /dev/null
+++ b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..f62ebd4
--- /dev/null
+++ b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..71bfe51
--- /dev/null
+++ b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..f971ca5
--- /dev/null
+++ b/core/res/res/drawable-land-mdpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_answer.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_answer.png
new file mode 100644
index 0000000..076325c
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_answer.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_custom.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_custom.png
new file mode 100644
index 0000000..1a510a6
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_custom.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_decline.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_decline.png
new file mode 100644
index 0000000..97b89bd
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_decline.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..f21bd49
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..1f4ace2
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..ee5b2df
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-ldpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..b015226
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_ring_normal.png b/core/res/res/drawable-ldpi/jog_ring_blade_ring_normal.png
new file mode 100644
index 0000000..1f53a60
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_gray.png b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_gray.png
new file mode 100644
index 0000000..0d50739
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_gray.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_green.png b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_green.png
new file mode 100644
index 0000000..6a7481c
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_green.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_red.png b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_red.png
new file mode 100644
index 0000000..26d4f4e
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_red.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_yellow.png b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_yellow.png
new file mode 100644
index 0000000..58ef702
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_ring_pressed_yellow.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_blade_secback_normal.png b/core/res/res/drawable-ldpi/jog_ring_blade_secback_normal.png
new file mode 100644
index 0000000..0c3f7e7
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_blade_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_holo_ring_normal.png b/core/res/res/drawable-ldpi/jog_ring_holo_ring_normal.png
new file mode 100644
index 0000000..46da134
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_holo_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_holo_ring_pressed.png b/core/res/res/drawable-ldpi/jog_ring_holo_ring_pressed.png
new file mode 100644
index 0000000..a64ea05
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_holo_ring_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_ring_holo_secback_normal.png b/core/res/res/drawable-ldpi/jog_ring_holo_secback_normal.png
new file mode 100644
index 0000000..6f6aa7f
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_ring_holo_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/jog_tab_target_holo.png b/core/res/res/drawable-ldpi/jog_tab_target_holo.png
new file mode 100644
index 0000000..9c865fa
--- /dev/null
+++ b/core/res/res/drawable-ldpi/jog_tab_target_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_answer.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_answer.png
new file mode 100644
index 0000000..ddeeb18
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_answer.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_custom.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_custom.png
new file mode 100644
index 0000000..6928714
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_custom.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_decline.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_decline.png
new file mode 100644
index 0000000..722027e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_decline.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_off.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_off.png
new file mode 100644
index 0000000..c288ce4
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_off.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_on.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_on.png
new file mode 100644
index 0000000..eb6ceed
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_sound_on.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_unlock.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_unlock.png
new file mode 100644
index 0000000..71bfe51
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_unlock.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_holo_vibrate_on.png b/core/res/res/drawable-mdpi/ic_jog_dial_holo_vibrate_on.png
new file mode 100644
index 0000000..f971ca5
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_holo_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_ring_normal.png b/core/res/res/drawable-mdpi/jog_ring_blade_ring_normal.png
new file mode 100644
index 0000000..2027bb2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_gray.png b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_gray.png
new file mode 100644
index 0000000..eeed5b9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_gray.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_green.png b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_green.png
new file mode 100644
index 0000000..23e3908
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_green.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_red.png b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_red.png
new file mode 100644
index 0000000..f5bf8ac
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_red.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_yellow.png b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_yellow.png
new file mode 100644
index 0000000..065541b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_ring_pressed_yellow.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_blade_secback_normal.png b/core/res/res/drawable-mdpi/jog_ring_blade_secback_normal.png
new file mode 100644
index 0000000..8962d96
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_blade_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_holo_ring_normal.png b/core/res/res/drawable-mdpi/jog_ring_holo_ring_normal.png
new file mode 100644
index 0000000..62f589a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_holo_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_holo_ring_pressed.png b/core/res/res/drawable-mdpi/jog_ring_holo_ring_pressed.png
new file mode 100644
index 0000000..7a518a2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_holo_ring_pressed.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_holo_secback_normal.png b/core/res/res/drawable-mdpi/jog_ring_holo_secback_normal.png
new file mode 100644
index 0000000..c3c82e4
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_holo_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_ring_normal.png b/core/res/res/drawable-mdpi/jog_ring_rev_ring_normal.png
new file mode 100644
index 0000000..f303266
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_ring_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_gray.png b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_gray.png
new file mode 100644
index 0000000..d1967e2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_gray.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_green.png b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_green.png
new file mode 100644
index 0000000..90506f0
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_green.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_red.png b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_red.png
new file mode 100644
index 0000000..e0e9aa4
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_red.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_yellow.png b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_yellow.png
new file mode 100644
index 0000000..6f5c307
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_ring_pressed_yellow.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_ring_rev_secback_normal.png b/core/res/res/drawable-mdpi/jog_ring_rev_secback_normal.png
new file mode 100644
index 0000000..953b5f4
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_ring_rev_secback_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/jog_tab_target_holo.png b/core/res/res/drawable-mdpi/jog_tab_target_holo.png
new file mode 100644
index 0000000..8873692
--- /dev/null
+++ b/core/res/res/drawable-mdpi/jog_tab_target_holo.png
Binary files differ
diff --git a/core/res/res/drawable/jog_ring_blade_ring_gray.xml b/core/res/res/drawable/jog_ring_blade_ring_gray.xml
new file mode 100644
index 0000000..8fb963a
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_blade_ring_gray.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_gray" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_blade_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_gray" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_blade_ring_green.xml b/core/res/res/drawable/jog_ring_blade_ring_green.xml
new file mode 100644
index 0000000..109c01e
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_blade_ring_green.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_green" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_blade_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_green" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_blade_ring_red.xml b/core/res/res/drawable/jog_ring_blade_ring_red.xml
new file mode 100644
index 0000000..f89f91d
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_blade_ring_red.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_red" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_blade_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_red" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_blade_ring_yellow.xml b/core/res/res/drawable/jog_ring_blade_ring_yellow.xml
new file mode 100644
index 0000000..21834dc
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_blade_ring_yellow.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_yellow" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_blade_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_blade_ring_pressed_yellow" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_holo_ring.xml b/core/res/res/drawable/jog_ring_holo_ring.xml
new file mode 100644
index 0000000..f6218f1
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_holo_ring.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_holo_ring_pressed" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_holo_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_holo_ring_pressed" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_rev_ring_gray.xml b/core/res/res/drawable/jog_ring_rev_ring_gray.xml
new file mode 100644
index 0000000..8abbb03
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_rev_ring_gray.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_gray" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_rev_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_gray" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_rev_ring_green.xml b/core/res/res/drawable/jog_ring_rev_ring_green.xml
new file mode 100644
index 0000000..7013a6b
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_rev_ring_green.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_green" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_rev_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_green" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_rev_ring_red.xml b/core/res/res/drawable/jog_ring_rev_ring_red.xml
new file mode 100644
index 0000000..c8a6988
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_rev_ring_red.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_red" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_rev_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_red" />
+
+</selector>
diff --git a/core/res/res/drawable/jog_ring_rev_ring_yellow.xml b/core/res/res/drawable/jog_ring_rev_ring_yellow.xml
new file mode 100644
index 0000000..39d7154
--- /dev/null
+++ b/core/res/res/drawable/jog_ring_rev_ring_yellow.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- StateListDrawable used for buttons in the in-call onscreen touch UI. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_yellow" />
+
+ <item android:state_enabled="true"
+ android:drawable="@drawable/jog_ring_rev_ring_normal" />
+
+ <item android:state_active="true"
+ android:drawable="@drawable/jog_ring_rev_ring_pressed_yellow" />
+
+</selector>
diff --git a/core/res/res/layout/keyguard_screen_sim_pin_land_nokey.xml b/core/res/res/layout/keyguard_screen_sim_pin_land_nokey.xml
new file mode 100644
index 0000000..ad92b31
--- /dev/null
+++ b/core/res/res/layout/keyguard_screen_sim_pin_land_nokey.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:gravity="center"
+ android:background="@android:color/background_dark">
+
+ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:background="@android:color/background_dark">
+
+ <!-- header text ('Enter Pin Code') -->
+ <TextView android:id="@+id/headerText"
+ android:layout_above="@+id/carrier"
+ android:layout_centerHorizontal="true"
+ android:layout_marginBottom="30dip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="24sp"
+ />
+
+ <!-- Carrier info -->
+ <TextView android:id="@+id/carrier"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/pinDisplayGroup"
+ android:layout_marginTop="9dip"
+ android:gravity="left|bottom"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ />
+
+ <!-- displays dots as user enters pin -->
+ <LinearLayout android:id="@+id/pinDisplayGroup"
+ android:orientation="horizontal"
+ android:layout_centerInParent="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:addStatesFromChildren="true"
+ android:gravity="center_vertical"
+ android:baselineAligned="false"
+ android:paddingRight="0dip"
+ android:layout_marginRight="30dip"
+ android:layout_marginLeft="30dip"
+ android:background="@android:drawable/edit_text">
+
+ <EditText android:id="@+id/pinDisplay"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:maxLines="1"
+ android:background="@null"
+ android:textSize="32sp"
+ android:inputType="textPassword"
+ />
+
+ <ImageButton android:id="@+id/backspace"
+ android:src="@android:drawable/ic_input_delete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="2dip"
+ android:layout_marginRight="2dip"
+ android:layout_marginBottom="2dip"
+ android:gravity="center"
+ />
+
+ </LinearLayout>
+
+ <!-- emergency call button -->
+ <Button
+ android:id="@+id/emergencyCall"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dip"
+ android:layout_marginLeft="8dip"
+ android:layout_marginRight="8dip"
+ android:drawableLeft="@android:drawable/ic_emergency"
+ android:drawablePadding="8dip"
+ android:text="@android:string/lockscreen_emergency_call"
+ />
+
+ </RelativeLayout>
+
+ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:background="@android:color/background_dark">
+
+ <include
+ android:id="@+id/keyPad"
+ layout="@android:layout/twelve_key_entry"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ />
+
+ </RelativeLayout>
+
+</LinearLayout>
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml
index b085e1b..103ea93 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml
@@ -44,6 +44,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginTop="5dip"
+ android:layout_marginLeft="8dip"
android:layout_marginRight="8dip"
android:singleLine="true"
android:ellipsize="marquee"
@@ -61,6 +62,7 @@
android:layout_alignParentRight="true"
android:layout_marginTop="0dip"
android:layout_marginRight="8dip"
+ android:layout_marginLeft="8dip"
android:text="@string/emergency_calls_only"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white"
@@ -73,6 +75,7 @@
android:layout_below="@id/carrier"
android:layout_marginTop="10dip"
android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
android:paddingBottom="8dip"
>
@@ -113,34 +116,59 @@
android:layout_height="wrap_content"
android:layout_below="@id/time"
android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
- <TextView
- android:id="@+id/status1"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:id="@+id/status_box"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/date"
- android:layout_marginTop="4dip"
- android:layout_marginLeft="24dip"
- android:maxLines="2"
- android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:drawablePadding="4dip"
- />
+ android:orientation="vertical"
+ android:layout_below="@id/date">
- <TextView
- android:id="@+id/status2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/status1"
- android:layout_marginTop="4dip"
- android:layout_marginLeft="24dip"
- android:maxLines="2"
- android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:drawablePadding="4dip"
- />
+ <TextView
+ android:id="@+id/status_charging"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dip"
+ android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
+ android:maxLines="2"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ />
+
+ <TextView
+ android:id="@+id/status_alarm"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dip"
+ android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
+ android:maxLines="2"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ android:drawableLeft="@drawable/ic_lock_idle_alarm"
+ />
+
+ <TextView
+ android:id="@+id/status_calendar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dip"
+ android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
+ android:maxLines="3"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ android:drawableLeft="@drawable/ic_lock_idle_calendar"
+ />
+
+ </LinearLayout>
<TextView
android:id="@+id/customMsg"
@@ -149,7 +177,7 @@
android:layout_marginTop="4.0dip"
android:layout_marginLeft="24dip"
android:layout_marginRight="24dip"
- android:layout_below="@id/status2"
+ android:layout_below="@id/status_box"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
index fedf1e6..58c53d5 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
@@ -44,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
android:layout_marginTop="10dip"
android:singleLine="true"
android:ellipsize="marquee"
@@ -58,6 +59,7 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
android:layout_marginTop="10dip"
android:text="@string/emergency_calls_only"
android:textAppearance="?android:attr/textAppearanceSmall"
@@ -69,6 +71,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/carrier"
android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
android:layout_marginTop="20dip"
android:layout_marginBottom="5dip"
>
@@ -87,7 +90,6 @@
android:layout_marginBottom="6dip"
/>
-
<TextView android:id="@+id/am_pm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -112,39 +114,63 @@
android:layout_height="wrap_content"
android:layout_below="@id/time"
android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
android:layout_marginTop="3dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
- <TextView
- android:id="@+id/status1"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:id="@+id/status_box"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/date"
- android:layout_marginLeft="10dip"
- android:layout_marginTop="3dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:drawablePadding="4dip"
- />
+ android:orientation="vertical"
+ android:layout_below="@id/date">
+
+ <TextView
+ android:id="@+id/status_charging"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
+ android:layout_marginTop="3dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ />
+
+ <TextView
+ android:id="@+id/status_alarm"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
+ android:layout_marginTop="3dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ android:drawableLeft="@drawable/ic_lock_idle_alarm"
+ />
+
+ <TextView
+ android:id="@+id/status_calendar"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
+ android:layout_marginTop="3dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:drawablePadding="4dip"
+ android:drawableLeft="@drawable/ic_lock_idle_calendar"
+ />
+
+ </LinearLayout>
- <TextView
- android:id="@+id/status2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/status1"
- android:layout_marginLeft="10dip"
- android:layout_marginTop="3dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:drawablePadding="4dip"
- />
-
<TextView
android:id="@+id/customMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
android:layout_marginTop="3dip"
- android:layout_below="@id/status2"
+ android:layout_below="@id/status_box"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
diff --git a/core/res/res/layout/keyguard_screen_unlock_landscape.xml b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
index e171b80..269a9eb 100644
--- a/core/res/res/layout/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
@@ -37,6 +37,7 @@
android:layout_height="match_parent"
android:layout_weight="1.0"
android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
android:gravity="left"
>
<TextView
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index 94fe893..b074396 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -41,6 +41,7 @@
android:layout_alignParentTop="true"
android:layout_marginTop="6dip"
android:layout_alignParentRight="true"
+ android:layout_marginLeft="8dip"
android:layout_marginRight="8dip"
android:layout_toRightOf="@+id/time"
android:singleLine="true"
@@ -56,6 +57,7 @@
android:layout_alignParentTop="true"
android:layout_marginTop="15dip"
android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
>
<TextView android:id="@+id/timeDisplay"
@@ -96,6 +98,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/time"
android:layout_marginLeft="24dip"
+ android:layout_marginRight="24dip"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
@@ -129,6 +132,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="0dip"
android:layout_marginLeft="12dip"
+ android:layout_marginRight="12dip"
android:gravity="left"
>
<TextView
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index b097067..f1decb1 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -144,10 +144,11 @@
<string name="power_off" msgid="4266614107412865048">"Vypnout"</string>
<string name="reboot_system">"Restartovat telefon"</string>
<string name="reboot_reboot">"Restartovat"</string>
- <string name="reboot_recovery">"Servisní nabídka"</string>
+ <string name="reboot_recovery">"Servisní oddíl"</string>
<string name="reboot_bootloader">"Zavaděč"</string>
<string name="reboot_bootmenu">"Nabídka startu"</string>
<string name="reboot_fastboot">"Rychlý start"</string>
+ <string name="reboot_download">"Stažení"</string>
<string name="shutdown_progress" msgid="2281079257329981203">"Vypínání\u2026"</string>
<string name="reboot_progress">"Restart\u2026"</string>
@@ -861,6 +862,10 @@
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Formátovat"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"Ladění přes rozhraní USB připojeno"</string>
<string name="adb_active_notification_message" msgid="8470296818270110396">"Vyberte, chcete-li zakázat ladění USB."</string>
+
+ <string name="adb_net_enabled_notification_title">Povoleno ladění po síti</string>
+ <string name="adb_net_enabled_notification_message">Zvolte pro zrušení ladění po síti.</string>
+
<string name="select_input_method" msgid="6865512749462072765">"Výběr metody zadávání dat"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" AÁBCČDĎEÉĚFGHCHIÍJKLMNŇOÓPQRŘSŠTŤUÚVWXYÝZŽ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789AÁBCČDĎEÉĚFGHCHIÍJKLMNŇOÓPQRŘSŠTŤUÚVWXYÝZŽ"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 0007297..75b8d99 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -871,6 +871,8 @@
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Formatieren"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"USB-Debugging verbunden"</string>
<string name="adb_active_notification_message" msgid="8470296818270110396">"Zum deaktivieren auswählen"</string>
+ <string name="adb_net_enabled_notification_title">"Netzwerk-Debugging aktiviert"</string>
+ <string name="adb_net_enabled_notification_message">"Zum deaktivieren auswählen"</string>
<string name="select_input_method" msgid="6865512749462072765">"Eingabemethode auswählen"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 4f5ea67..4a359eb 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -40,7 +40,7 @@
<string name="profileNameHome">Casa</string>
<string name="profileNameSilent">Silencio</string>
<string name="profileNameNight">Noche</string>
- <string name="profileGroupPhone">Telefono</string>
+ <string name="profileGroupPhone">Teléfono</string>
<string name="profileGroupCalendar">Calendario</string>
<string name="profileGroupGmail">Gmail</string>
<string name="profileGroupEmail">Correo-e</string>
@@ -144,7 +144,13 @@
<string name="turn_off_radio" msgid="8198784949987062346">"Desactivar función inalámbrica"</string>
<string name="screen_lock" msgid="799094655496098153">"Bloqueo de pantalla"</string>
<string name="power_off" msgid="4266614107412865048">"Apagar"</string>
- <string name="reboot_system">Reiniciar teléfono</string>
+ <string name="reboot_system">Reiniciar</string>
+ <string name="reboot_reboot">Modo Normal</string>
+ <string name="reboot_recovery">Modo Recovery</string>
+ <string name="reboot_bootloader">Modo Bootloader</string>
+ <string name="reboot_bootmenu">Modo Bootmenu</string>
+ <string name="reboot_fastboot">Modo Fastboot</string>
+ <string name="reboot_download">Modo Download</string>
<string name="shutdown_progress" msgid="2281079257329981203">"Apagando\u2026"</string>
<string name="reboot_progress">Reiniciando\u2026</string>
<string name="shutdown_confirm" msgid="649792175242821353">"El teléfono se apagará."</string>
@@ -157,11 +163,12 @@
<string name="global_action_reboot">Reiniciar</string>
<string name="global_action_choose_profile">Cambiar Perfil</string>
<string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Modo silencio"</string>
- <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"El sonido está desactivado. Activar."</string>
- <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"El sonido está activado. Desactivar."</string>
+ <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"El sonido está desactivado"</string>
+ <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"El sonido está activado"</string>
<string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Modo avión"</string>
- <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Modo avión activado. Desactivar."</string>
- <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Modo avión desactivado. Activar."</string>
+ <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Modo avión activado"</string>
+ <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Modo avión desactivado"</string>
+ <string name="global_action_screenshot">Capturar pantalla</string>
<string name="safeMode" msgid="2788228061547930246">"Modo seguro"</string>
<string name="android_system_label" msgid="6577375335728551336">"Sistema Android"</string>
<string name="permgrouplab_costMoney" msgid="5429808217861460401">"Servicios por los que tienes que pagar"</string>
@@ -763,6 +770,8 @@
<string name="aerr_title" msgid="653922989522758100">"Lo sentimos."</string>
<string name="aerr_application" msgid="4683614104336409186">"La aplicación <xliff:g id="APPLICATION">%1$s</xliff:g> (proceso <xliff:g id="PROCESS">%2$s</xliff:g>) se ha interrumpido inesperadamente. Inténtalo de nuevo."</string>
<string name="aerr_process" msgid="1551785535966089511">"El proceso <xliff:g id="PROCESS">%1$s</xliff:g> se ha interrumpido inesperadamente. Inténtalo de nuevo."</string>
+ <string name="aerr_revoked_application">La aplicación <xliff:g id="application">%1$s</xliff:g> (proceso <xliff:g id="process">%2$s</xliff:g>) se ha interrumpido inesperadamente.\n¡AVISO!\nEsta aplicación tiene uno o más permisos RESTRINGIDOS que pueden ser la causa de su mal funcionamiento. Por favor, restaura los permisos e inténtalo de nuevo.</string>
+ <string name="aerr_revoked_process">El proceso <xliff:g id="process">%1$s</xliff:g> se ha interrumpido inesperadamente.\n¡AVISO!\nEste proceso tiene uno o más permisos RESTRINGIDOS que pueden ser la causa de su mal funcionamiento. Por favor, restaura los permisos e inténtalo de nuevo.</string>
<string name="anr_title" msgid="3100070910664756057">"Lo sentimos."</string>
<string name="anr_activity_application" msgid="3538242413112507636">"La actividad <xliff:g id="ACTIVITY">%1$s</xliff:g> (<xliff:g id="APPLICATION">%2$s</xliff:g> en aplicación) no está respondiendo."</string>
<string name="anr_activity_process" msgid="5420826626009561014">"La actividad <xliff:g id="ACTIVITY">%1$s</xliff:g> (<xliff:g id="PROCESS">%2$s</xliff:g> en curso) no está respondiendo."</string>
@@ -770,6 +779,8 @@
<string name="anr_process" msgid="1246866008169975783">"El proceso <xliff:g id="PROCESS">%1$s</xliff:g> no está respondiendo."</string>
<string name="force_close" msgid="3653416315450806396">"Forzar cierre"</string>
<string name="report" msgid="4060218260984795706">"Informe"</string>
+ <string name="edit_perms">Editar permisos</string>
+ <string name="reset_perms">Restablecer permisos</string>
<string name="wait" msgid="7147118217226317732">"Esperar"</string>
<string name="launch_warning_title" msgid="8323761616052121936">"Aplicación redireccionada"</string>
<string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> se está ejecutando."</string>
@@ -843,8 +854,10 @@
<string name="extmedia_format_message" product="nosdcard" msgid="8296908079722897772">"¿Quieres formatear el USB y borrar todos los archivos? Esta acción no se puede deshacer."</string>
<string name="extmedia_format_message" product="default" msgid="3621369962433523619">"¿Estás seguro de que quieres formatear la tarjeta SD? Se perderán todos los datos de la tarjeta."</string>
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Formato"</string>
- <string name="adb_active_notification_title" msgid="6729044778949189918">"Dispositivo de depuración USB conectado"</string>
- <string name="adb_active_notification_message" msgid="8470296818270110396">"Seleccionar para inhabilitar la depuración USB"</string>
+ <string name="adb_active_notification_title" msgid="6729044778949189918">"Depuración USB activada"</string>
+ <string name="adb_active_notification_message" msgid="8470296818270110396">"Seleccionar para desactivar la depuración USB"</string>
+ <string name="adb_net_enabled_notification_title">Depuración sobre red activada</string>
+ <string name="adb_net_enabled_notification_message">Seleccionar para desactivar la depuración sobre red</string>
<string name="select_input_method" msgid="6865512749462072765">"Seleccionar método de introducción de texto"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index a043543..afd887c 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -843,8 +843,10 @@
<string name="extmedia_format_message" product="nosdcard" msgid="8296908079722897772">"Formater la mémoire de stockage USB en effaçant tous les fichiers ? Cette action est irréversible."</string>
<string name="extmedia_format_message" product="default" msgid="3621369962433523619">"Voulez-vous vraiment formater la carte SD ? Toutes les données de cette carte seront perdues."</string>
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Format"</string>
- <string name="adb_active_notification_title" msgid="6729044778949189918">"Débogage USB connecté"</string>
- <string name="adb_active_notification_message" msgid="8470296818270110396">"Sélectionnez cette option pour désactiver le débogage USB."</string>
+ <string name="adb_active_notification_title">Débogage via USB connecté</string>
+ <string name="adb_active_notification_message">Désactiver le débogage android USB (adb).</string>
+ <string name="adb_net_enabled_notification_title">Débogage via TCP/IP activé</string>
+ <string name="adb_net_enabled_notification_message">Désactiver le débogage android (adb).</string>
<string name="select_input_method" msgid="6865512749462072765">"Sélectionner un mode de saisie"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 2cecb82..be1bb73 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -139,6 +139,8 @@
<string name="no_recent_tasks" msgid="279702952298056674">"Nincs új alkalmazás."</string>
<string name="global_actions" msgid="2406416831541615258">"Telefonbeállítások"</string>
<string name="global_action_lock" msgid="2844945191792119712">"Képernyő lezárása"</string>
+ <string name="global_action_menu">Menü</string>
+ <string name="global_action_back">Vissza</string>
<string name="global_action_power_off" msgid="4471879440839879722">"Kikapcsolás"</string>
<string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Néma üzemmód"</string>
<string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"Hang kikapcsolva"</string>
@@ -718,6 +720,7 @@
<string name="elapsed_time_short_format_mm_ss" msgid="4431555943828711473">"<xliff:g id="MINUTES">%1$02d</xliff:g>:<xliff:g id="SECONDS">%2$02d</xliff:g>"</string>
<string name="elapsed_time_short_format_h_mm_ss" msgid="1846071997616654124">"<xliff:g id="HOURS">%1$d</xliff:g>:<xliff:g id="MINUTES">%2$02d</xliff:g>:<xliff:g id="SECONDS">%3$02d</xliff:g>"</string>
<string name="selectAll" msgid="6876518925844129331">"Összes kijelölése"</string>
+ <string name="copyAll">Összes másolása</string>
<string name="selectText" msgid="4862359311088898878">"Szó kiválasztása"</string>
<string name="cut" msgid="3092569408438626261">"Kivágás"</string>
<string name="copy" msgid="2681946229533511987">"Másolás"</string>
@@ -744,6 +747,8 @@
<string name="aerr_title" msgid="653922989522758100">"Sajnáljuk!"</string>
<string name="aerr_application" msgid="4683614104336409186">"A(z) <xliff:g id="APPLICATION">%1$s</xliff:g> alkalmazás <xliff:g id="PROCESS">%2$s</xliff:g> folyamata váratlanul leállt. Kérjük, próbálja újra."</string>
<string name="aerr_process" msgid="1551785535966089511">"A(z) <xliff:g id="PROCESS">%1$s</xliff:g> folyamat váratlanul leállt. Kérjük, próbálja újra."</string>
+ <string name="aerr_revoked_application">"Az alkalmazás %1$s (folyamat %2$s) váratlanul leállt. FIGYELEM! Ettől az alkalmazástól több engedély is meg lett vonva, ami leállást okozhatott. Kérem ellenőrizze az engedélyeket és próbálja újra!"</string>
+ <string name="aerr_revoked_process">"A(z) %1$s folyamat váratlanul leállt. FIGYELEM! Ettől az alkalmazástól több engedély is meg lett vonva, ami leállást okozhatott. Kérem ellenőrizze az engedélyeket és próbálja újra!"</string>
<string name="anr_title" msgid="3100070910664756057">"Sajnáljuk!"</string>
<string name="anr_activity_application" msgid="3538242413112507636">"A(z) <xliff:g id="APPLICATION">%2$s</xliff:g> alkalmazásban levő <xliff:g id="ACTIVITY">%1$s</xliff:g> tevékenység nem válaszol."</string>
<string name="anr_activity_process" msgid="5420826626009561014">"A(z) <xliff:g id="PROCESS">%2$s</xliff:g> folyamatban levő <xliff:g id="ACTIVITY">%1$s</xliff:g> tevékenység nem válaszol."</string>
@@ -751,6 +756,8 @@
<string name="anr_process" msgid="1246866008169975783">"A(z) <xliff:g id="PROCESS">%1$s</xliff:g> folyamat nem válaszol."</string>
<string name="force_close" msgid="3653416315450806396">"Bezárás most"</string>
<string name="report" msgid="4060218260984795706">"Jelentés"</string>
+ <string name="edit_perms">Engedélyek szerkesztése</string>
+ <string name="reset_perms">Engedélyek visszaállítása</string>
<string name="wait" msgid="7147118217226317732">"Várakozás"</string>
<string name="launch_warning_title" msgid="8323761616052121936">"Alk. átirányítva"</string>
<string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> éppen fut."</string>
@@ -829,7 +836,7 @@
<string name="select_input_method" msgid="6865512749462072765">"Válassza ki a beviteli módszert"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
- <string name="candidates_style" msgid="4333913089637062257"><u>"jelöltek"</u></string>
+ <string name="candidates_style" msgid="4333913089637062257"><u>"Jelöltek"</u></string>
<string name="ext_media_checking_notification_title" product="nosdcard" msgid="3449816005351468560">"Az USB-tár előkészítése"</string>
<string name="ext_media_checking_notification_title" product="default" msgid="5457603418970994050">"SD-kártya előkészítése"</string>
<string name="ext_media_checking_notification_message" msgid="8287319882926737053">"Hibakeresés."</string>
@@ -889,7 +896,7 @@
<string name="upload_file" msgid="2897957172366730416">"Fájl kiválasztása"</string>
<string name="reset" msgid="2448168080964209908">"Alaphelyzet"</string>
<string name="submit" msgid="1602335572089911941">"Elküldés"</string>
- <string name="description_star" msgid="2654319874908576133">"kedvenc"</string>
+ <string name="description_star" msgid="2654319874908576133">"Kedvenc"</string>
<string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Gépkocsi üzemmód bekapcsolva"</string>
<string name="car_mode_disable_notification_message" msgid="668663626721675614">"Válassza ezt a kilépéshez a gépkocsi üzemmódból."</string>
<string name="tethered_notification_title" msgid="3146694234398202601">"Megosztás vagy aktív hotspot"</string>
@@ -913,6 +920,7 @@
<string name="media_unknown_state" msgid="729192782197290385">"A külső meghajtó állapota ismeretlen."</string>
<string name="reboot_system">Újraindítás</string>
+ <string name="reboot_reboot">Újraindítás</string>
<string name="reboot_progress">Újraindítás...</string>
<string name="reboot_confirm">A telefon újra fog indulni.</string>
<string name="global_action_reboot">Újraindítás</string>
@@ -939,4 +947,6 @@
<string name="profileGroupEmail">Email</string>
<string name="profileGroupSMS">SMS</string>
<string name="wildcardProfile">Egyéb</string>
+ <string name="permlab_revokePermissions">Engedélyezi a visszavont jogoultságok megtekintését és szerkesztését. Normál alkalmazásoknál nem használják.</string>
+ <string name="permdesc_revokePermissions">Engedélyezi a visszavont jogoultságok olvasását és szerkesztését. Normál alkalmazásoknál nem használják.</string>
</resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 73895aa..1c64dac 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -830,6 +830,10 @@
<string name="extmedia_format_button_format" msgid="4131064560127478695">"フォーマット"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"USBデバッグが接続されました"</string>
<string name="adb_active_notification_message" msgid="8470296818270110396">"USBデバッグを無効にする場合に選択します。"</string>
+
+ <string name="adb_net_enabled_notification_title">ネットワークデバッグが有効になりました</string>
+ <string name="adb_net_enabled_notification_message">ネットワークデバッグを無効にする場合に選択します。</string>
+
<string name="select_input_method" msgid="6865512749462072765">"入力方法の選択"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 1f4bf52..3daaf3c 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -721,6 +721,7 @@
<string name="selectText" msgid="4862359311088898878">"Woord selecteren"</string>
<string name="cut" msgid="3092569408438626261">"Knippen"</string>
<string name="copy" msgid="2681946229533511987">"Kopiëren"</string>
+ <string name="copyAll">Alles kopiëren</string>
<string name="paste" msgid="5629880836805036433">"Plakken"</string>
<string name="copyUrl" msgid="2538211579596067402">"URL kopiëren"</string>
<string name="inputMethod" msgid="1653630062304567879">"Invoermethode"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 22896f5..2c1f839 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -35,6 +35,17 @@
<string name="defaultMsisdnAlphaTag" msgid="2850889754919584674">"MSISDN1"</string>
<string name="mmiError" msgid="5154499457739052907">"Bağlantı sorunu veya geçersiz MMI kodu."</string>
<string name="mmiFdnError" msgid="5224398216385316471">"İşlem sadece sabit arama numaralarıyla sınırlandırılmıştır."</string>
+ <string name="profileNameDefault">Normal</string>
+ <string name="profileNameWork">İş</string>
+ <string name="profileNameHome">Ev</string>
+ <string name="profileNameSilent">Sessiz</string>
+ <string name="profileNameNight">Gece</string>
+ <string name="profileGroupPhone">Telefon</string>
+ <string name="profileGroupCalendar">Takvim</string>
+ <string name="profileGroupGmail">Gmail</string>
+ <string name="profileGroupEmail">E-Posta</string>
+ <string name="profileGroupSMS">SMS</string>
+ <string name="wildcardProfile">Diğer</string>
<string name="serviceEnabled" msgid="8147278346414714315">"Hizmet etkindi."</string>
<string name="serviceEnabledFor" msgid="6856228140453471041">"Hizmet şunun için etkinleştirildi:"</string>
<string name="serviceDisabled" msgid="1937553226592516411">"Hizmet devre dışı bırakıldı."</string>
@@ -133,19 +144,34 @@
<string name="turn_off_radio" msgid="8198784949987062346">"Kablosuzu kapat"</string>
<string name="screen_lock" msgid="799094655496098153">"Ekran kilidi"</string>
<string name="power_off" msgid="4266614107412865048">"Kapat"</string>
+ <string name="reboot_system">Telefonu yeniden başlat</string>
+ <string name="reboot_reboot">Yeniden başlat</string>
+ <string name="reboot_recovery">Kurtar</string>
+ <string name="reboot_bootloader">Boot yükleyici</string>
+ <string name="reboot_bootmenu">Boot menüsü</string>
+ <string name="reboot_fastboot">Hızlı boot</string>
+ <string name="reboot_download">Download</string>
<string name="shutdown_progress" msgid="2281079257329981203">"Kapanıyor…"</string>
+ <string name="reboot_progress">Yeniden başlatılıyor\u2026</string>
<string name="shutdown_confirm" msgid="649792175242821353">"Telefonunuz kapanacak."</string>
+ <string name="reboot_confirm">Telefonunuz yeniden başlatılacak.</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"En Son Görevler"</string>
<string name="no_recent_tasks" msgid="279702952298056674">"Hiçbir yeni uygulama yok."</string>
<string name="global_actions" msgid="2406416831541615258">"Telefon seçenekleri"</string>
+ <string name="global_action_home">Ana sayfa</string>
+ <string name="global_action_menu">Menü</string>
+ <string name="global_action_back">Geri</string>
<string name="global_action_lock" msgid="2844945191792119712">"Ekran kilidi"</string>
<string name="global_action_power_off" msgid="4471879440839879722">"Kapat"</string>
+ <string name="global_action_reboot">Yeniden başlat</string>
+ <string name="global_action_choose_profile">Profil seç</string>
<string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Sessiz mod"</string>
<string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"Ses KAPALI"</string>
<string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"Ses AÇIK"</string>
<string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Uçak modu"</string>
<string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Uçak modu AÇIK"</string>
<string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Uçak modu KAPALI"</string>
+ <string name="global_action_screenshot">Ekran görüntüsü</string>
<string name="safeMode" msgid="2788228061547930246">"Güvenli mod"</string>
<string name="android_system_label" msgid="6577375335728551336">"Android Sistemi"</string>
<string name="permgrouplab_costMoney" msgid="5429808217861460401">"Size maliyet getiren hizmetler"</string>
@@ -271,8 +297,12 @@
<string name="permdesc_movePackage" msgid="6323049291923925277">"Bir uygulamanın, uygulama kaynaklarını dahili ve harici ortamlar arasında taşımasına olanak tanır."</string>
<string name="permlab_readLogs" msgid="6615778543198967614">"hassas günlük verilerini okuma"</string>
<string name="permdesc_readLogs" msgid="8896449437464867766">"Bir uygulamanın, sistemin çeşitli günlük dosyalarındaki bilgileri okumasına izin verir. Bu izin, uygulamanın, telefonda yaptıklarınızla ilgili genel bilgileri bulmasına olanak sağlar ve bunlar kişisel ve gizli bilgilerinizi de içerebilir."</string>
+ <string name="permlab_preventpower">güç tuşunu değiştir</string>
+ <string name="permdesc_preventpower">Uygulamaya güç tuşunu değiştirme izni verir.</string>
<string name="permlab_diagnostic" msgid="8076743953908000342">"sahibi tanılama olan kaynakları oku/bunlara yaz"</string>
<string name="permdesc_diagnostic" msgid="3121238373951637049">"Uygulamanın tanılama grubundaki bir kaynağa ait herhangi bir kaynağı; örneğin /dev içindeki dosyaları okumasına ve bunlara yazmasına izin verir. Bu işlevin sistem kararlılığını ve güvenliğini olumsuz etkileme olasılığı vardır. Üretici veya operatör tarafından YALNIZCA donanıma özgü tanılama için kullanılmalıdır."</string>
+ <string name="permlab_rawAudio">ses donanımına eriş</string>
+ <string name="permdesc_rawAudio">Uygulamaya ses donanımına tam erişim izni verir.</string>
<string name="permlab_changeComponentState" msgid="79425198834329406">"uygulama bileşenlerini etkinleştir veya devre dışı bırak"</string>
<string name="permdesc_changeComponentState" msgid="4569107043246700630">"Uygulamaların başka bir uygulamanın bir bileşenini etkinleştirme ayarını değiştirmesine izin verir. Kötü amaçlı uygulamalar bu ayarı telefonun önemli yeteneklerini devre dışı bırakmak için kullanabilir. Bu iznin verilmesi uygulama bileşenlerini kullanılamaz, tutarsız veya kararsız bir duruma sokabileceği için izin verilirken dikkatli olunmalıdır."</string>
<string name="permlab_setPreferredApplications" msgid="3393305202145172005">"tercih edilen uygulamaları ayarla"</string>
@@ -559,9 +589,10 @@
<string name="lockscreen_pattern_correct" msgid="9039008650362261237">"Doğru!"</string>
<string name="lockscreen_pattern_wrong" msgid="4817583279053112312">"Üzgünüz, lütfen yeniden deneyin"</string>
<string name="lockscreen_plugged_in" msgid="613343852842944435">"Şarj oluyor (<xliff:g id="PERCENT">%%</xliff:g><xliff:g id="NUMBER">%d</xliff:g>)"</string>
+ <string name="lockscreen_discharging">Pil (<xliff:g id="percent">%%</xliff:g><xliff:g id="number">%d</xliff:g>)</string>
<string name="lockscreen_charged" msgid="4938930459620989972">"Şarj oldu."</string>
<string name="lockscreen_battery_short" msgid="3617549178603354656">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
- <string name="lockscreen_low_battery" msgid="1482873981919249740">"Şarj cihazınızı bağlayın."</string>
+ <string name="lockscreen_low_battery">Şarj cihazını bağlayın (<xliff:g id="percent">%%</xliff:g><xliff:g id="number">%d</xliff:g>)</string>
<string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"SIM kart yok."</string>
<string name="lockscreen_missing_sim_message" msgid="2186920585695169078">"Telefonda SIM kart yok."</string>
<string name="lockscreen_missing_sim_instructions" msgid="8874620818937719067">"Lütfen SIM kart takın."</string>
@@ -586,6 +617,7 @@
<string name="lockscreen_unlock_label" msgid="737440483220667054">"Kilit Aç"</string>
<string name="lockscreen_sound_on_label" msgid="9068877576513425970">"Sesi aç"</string>
<string name="lockscreen_sound_off_label" msgid="996822825154319026">"Sesi kapat"</string>
+ <string name="lockscreen_phone_label">Telefon</string>
<string name="password_keyboard_label_symbol_key" msgid="992280756256536042">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
@@ -718,6 +750,7 @@
<string name="elapsed_time_short_format_mm_ss" msgid="4431555943828711473">"<xliff:g id="MINUTES">%1$02d</xliff:g>:<xliff:g id="SECONDS">%2$02d</xliff:g>"</string>
<string name="elapsed_time_short_format_h_mm_ss" msgid="1846071997616654124">"<xliff:g id="HOURS">%1$d</xliff:g>:<xliff:g id="MINUTES">%2$02d</xliff:g>:<xliff:g id="SECONDS">%3$02d</xliff:g>"</string>
<string name="selectAll" msgid="6876518925844129331">"Tümünü seç"</string>
+ <string name="copyAll">Tümünü kopyala</string>
<string name="selectText" msgid="4862359311088898878">"Kelime seçin"</string>
<string name="cut" msgid="3092569408438626261">"Kes"</string>
<string name="copy" msgid="2681946229533511987">"Kopyala"</string>
@@ -744,6 +777,8 @@
<string name="aerr_title" msgid="653922989522758100">"Üzgünüz!"</string>
<string name="aerr_application" msgid="4683614104336409186">"<xliff:g id="APPLICATION">%1$s</xliff:g> uygulaması (<xliff:g id="PROCESS">%2$s</xliff:g> işlemi) beklenmedik biçimde durdu. Lütfen yeniden deneyin."</string>
<string name="aerr_process" msgid="1551785535966089511">"<xliff:g id="PROCESS">%1$s</xliff:g> işlemi beklenmedik biçimde durdu. Lütfen yeniden deneyin."</string>
+ <string name="aerr_revoked_application"><xliff:g id="application">%1$s</xliff:g> uygulaması (<xliff:g id="process">%2$s</xliff:g> işlemi) beklenmedik biçimde durdu.\nUYARI!\nBu uygulamanın bir veya birden fazla izni ENGELLENDİĞİ için hata vermiş olabilir. Lütfen izni verin ve yeniden deneyin.</string>
+ <string name="aerr_revoked_process"><xliff:g id="process">%1$s</xliff:g> işlemi beklenmedik biçimde durdu.\nUYARI!\nBu işlemin bir veya birden fazla izni ENGELLENDİĞİ için hata vermiş olabilir. Lütfen izni verin ve yeniden deneyin.</string>
<string name="anr_title" msgid="3100070910664756057">"Üzgünüz!"</string>
<string name="anr_activity_application" msgid="3538242413112507636">"<xliff:g id="ACTIVITY">%1$s</xliff:g> etkinliği (<xliff:g id="APPLICATION">%2$s</xliff:g> uygulamasında) yanıt vermiyor."</string>
<string name="anr_activity_process" msgid="5420826626009561014">"<xliff:g id="ACTIVITY">%1$s</xliff:g> etkinliği (<xliff:g id="PROCESS">%2$s</xliff:g> işleminde) yanıt vermiyor."</string>
@@ -751,6 +786,8 @@
<string name="anr_process" msgid="1246866008169975783">"<xliff:g id="PROCESS">%1$s</xliff:g> işlemi yanıt vermiyor."</string>
<string name="force_close" msgid="3653416315450806396">"Kapanmaya zorla"</string>
<string name="report" msgid="4060218260984795706">"Bildir"</string>
+ <string name="edit_perms">İzinleri düzenle</string>
+ <string name="reset_perms">İzinleri sıfırla</string>
<string name="wait" msgid="7147118217226317732">"Bekle"</string>
<string name="launch_warning_title" msgid="8323761616052121936">"Uygulama yönlendirildi"</string>
<string name="launch_warning_replace" msgid="6202498949970281412">"<xliff:g id="APP_NAME">%1$s</xliff:g> şimdi çalışıyor."</string>
@@ -826,26 +863,28 @@
<string name="extmedia_format_button_format" msgid="4131064560127478695">"Biçimlendir"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"USB hata ayıklaması bağlandı"</string>
<string name="adb_active_notification_message" msgid="8470296818270110396">"USB hata ayıklamasını devre dışı bırakmak için tıklayın."</string>
+ <string name="adb_net_enabled_notification_title">Ağ üzerinden hata ayıklama etkin</string>
+ <string name="adb_net_enabled_notification_message">Ağ üzerinden hata ayıklamayı kapatmak için seçin.</string>
<string name="select_input_method" msgid="6865512749462072765">"Giriş yöntemini seç"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="candidates_style" msgid="4333913089637062257"><u>"adaylar"</u></string>
- <string name="ext_media_checking_notification_title" product="nosdcard" msgid="3449816005351468560">"USB depolm birimi hazırlanıyor"</string>
+ <string name="ext_media_checking_notification_title" product="nosdcard">"USB disk hazırlanıyor"</string>
<string name="ext_media_checking_notification_title" product="default" msgid="5457603418970994050">"SD kart hazırlanıyor"</string>
<string name="ext_media_checking_notification_message" msgid="8287319882926737053">"Hatalar denetleniyor."</string>
<string name="ext_media_nofs_notification_title" product="nosdcard" msgid="7788040745686229307">"Boş USB depolama birimi"</string>
<string name="ext_media_nofs_notification_title" product="default" msgid="780477838241212997">"Boş SD kart"</string>
<string name="ext_media_nofs_notification_message" product="nosdcard" msgid="8623130522556087311">"USB depolama birimi boş veya desteklenmeyen bir dosya sistemine sahip."</string>
<string name="ext_media_nofs_notification_message" product="default" msgid="3817704088027829380">"SD kart boş veya desteklenmeyen dosya sistemi içeriyor"</string>
- <string name="ext_media_unmountable_notification_title" product="nosdcard" msgid="2090046769532713563">"USB depolm birimi zarar görmüş"</string>
+ <string name="ext_media_unmountable_notification_title" product="nosdcard">"USB disk zarar görmüş"</string>
<string name="ext_media_unmountable_notification_title" product="default" msgid="6410723906019100189">"Hasarlı SD kart"</string>
<string name="ext_media_unmountable_notification_message" product="nosdcard" msgid="529021299294450667">"USB depolama birimi zarar görmüş. Yeniden biçimlendirmeniz gerekebilir."</string>
<string name="ext_media_unmountable_notification_message" product="default" msgid="6902531775948238989">"SD kart zarar gördü. Yeniden biçimlendirmeniz gerekebilir."</string>
- <string name="ext_media_badremoval_notification_title" product="nosdcard" msgid="1661683031330951073">"USB dep br bklnmd şekl çıkarld"</string>
+ <string name="ext_media_badremoval_notification_title" product="nosdcard">"USB disk bklnmd şekl çıkarld"</string>
<string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"SD kart beklenmedik biçimde çıkarıldı"</string>
<string name="ext_media_badremoval_notification_message" product="nosdcard" msgid="4329848819865594241">"Veri kaybı olmaması için çıkarmadan önce USB depolama biriminin bağlantısını kesin."</string>
- <string name="ext_media_badremoval_notification_message" product="default" msgid="7260183293747448241">"Veri kaybından kaçınmak için SD kartı çıkarmadan önce bağlantısını kesin."</string>
- <string name="ext_media_safe_unmount_notification_title" product="nosdcard" msgid="3967973893270360230">"USB depl birm güvenle çıkrlblr"</string>
+ <string name="ext_media_badremoval_notification_message" product="default">"Veri kaybını önlemek için SD kartı çıkarmadan önce bağlantısını kesin."</string>
+ <string name="ext_media_safe_unmount_notification_title" product="nosdcard">"USB disk güvenle çıkrlblr"</string>
<string name="ext_media_safe_unmount_notification_title" product="default" msgid="6729801130790616200">"SD kart güvenle çıkarılabilir"</string>
<string name="ext_media_safe_unmount_notification_message" product="nosdcard" msgid="6142195361606493530">"USB depolama birimini güvenli bir şekilde çıkarabilirsiniz."</string>
<string name="ext_media_safe_unmount_notification_message" product="default" msgid="568841278138377604">"SD kartı güvenle kaldırabilirsiniz."</string>
@@ -886,6 +925,7 @@
<string name="l2tp_vpn_description" msgid="3750692169378923304">"Katman 2 Tünel Protokolü"</string>
<string name="l2tp_ipsec_psk_vpn_description" msgid="3945043564008303239">"L2TP/IPSec VPN temelli önceden paylaşılmış anahtar"</string>
<string name="l2tp_ipsec_crt_vpn_description" msgid="5382714073103653577">"L2TP/IPSec VPN temelli sertifika"</string>
+ <string name="openvpn_vpn_description">OpenVPN SSL VPN</string>
<string name="upload_file" msgid="2897957172366730416">"Dosya seç"</string>
<string name="reset" msgid="2448168080964209908">"Sıfırla"</string>
<string name="submit" msgid="1602335572089911941">"Gönder"</string>
@@ -911,4 +951,14 @@
<string name="media_shared" product="nosdcard" msgid="5830814349250834225">"USB depolama birimi, şu anda bir bilgisayar tarafından kullanılıyor."</string>
<string name="media_shared" product="default" msgid="5706130568133540435">"SD kart şu anda bir bilgisayar tarafından kullanılıyor."</string>
<string name="media_unknown_state" msgid="729192782197290385">"Harici medyanın durumu bilinmiyor."</string>
+ <string name="app_killed_message">Uygulama kapatıldı</string>
+ <string name="phone_goggles_problem_count">Problem #%1$d: </string>
+ <string name="phone_goggles_description">İletişiminizi devam ettirebilmek için aşağıdaki %1$d matematik problemini %2$d saniye içinde çözün.</string>
+ <plurals name="phone_goggles_countdown">
+ <item quantity="one">%d saniye kaldı</item>
+ <item quantity="other">%d saniye kaldı</item>
+ </plurals>
+ <string name="permlab_revokePermissions">Engellenmiş izinleri görmenize ve düzenlemenize izin verir. Normal uygulamalar tarafından kullanılmaz.</string>
+ <string name="permdesc_revokePermissions">Engellenmiş izinleri okuyup/yazmanıza izin verir. Normal uygulamalar tarafından kullanılmaz.</string>
</resources>
+
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 12fbc4d..2c66101 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -842,6 +842,8 @@
<string name="extmedia_format_button_format" msgid="4131064560127478695">"格式化"</string>
<string name="adb_active_notification_title" msgid="6729044778949189918">"已连接 USB 调试"</string>
<string name="adb_active_notification_message" msgid="8470296818270110396">"选择停用 USB 调试。"</string>
+ <string name="adb_net_enabled_notification_title">已开启网络调试</string>
+ <string name="adb_net_enabled_notification_message">选择停用网络调试.</string>
<string name="select_input_method" msgid="6865512749462072765">"选择输入法"</string>
<string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 0b75c58..e8c3744 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2809,10 +2809,10 @@
</declare-styleable>
<declare-styleable name="ScaleAnimation">
- <attr name="fromXScale" format="float" />
- <attr name="toXScale" format="float" />
- <attr name="fromYScale" format="float" />
- <attr name="toYScale" format="float" />
+ <attr name="fromXScale" format="float|fraction|dimension" />
+ <attr name="toXScale" format="float|fraction|dimension" />
+ <attr name="fromYScale" format="float|fraction|dimension" />
+ <attr name="toYScale" format="float|fraction|dimension" />
<attr name="pivotX" />
<attr name="pivotY" />
</declare-styleable>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 1e73ade..6d5c256 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -64,6 +64,8 @@
<!-- The duration (in milliseconds) of a short animation. -->
<integer name="config_shortAnimTime">150</integer>
+ <integer name="config_activityShortDur">150</integer>
+ <integer name="config_activityDefaultDur">220</integer>
<!-- The duration (in milliseconds) of a medium-length animation. -->
<integer name="config_mediumAnimTime">300</integer>
@@ -165,6 +167,10 @@
<!-- XXXXXX END OF RESOURCES USING WRONG NAMING CONVENTION -->
+ <!-- If true, the screen can be rotated via the accelerometer in all 4
+ rotations as the default behavior. -->
+ <bool name="config_allowAllRotations">true</bool>
+
<!-- The number of degrees to rotate the display when the keyboard is open. -->
<integer name="config_lidOpenRotation">90</integer>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 9d4c72f..e91d0d2 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2235,6 +2235,9 @@
<!-- Message of notification shown when ADB is actively connected to the phone. -->
<string name="adb_active_notification_message">Select to disable USB debugging.</string>
+ <string name="adb_net_enabled_notification_title">Network debugging enabled</string>
+ <string name="adb_net_enabled_notification_message">Select to disable network debugging.</string>
+
<!-- Used to replace %s in urls retreived from the signin server with locales. For Some -->
<!-- devices we don't support all the locales we ship to and need to replace the '%s' with a -->
<!-- locale string based on mcc values. By default (0-length string) we don't replace the %s -->
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index 230e24c..2222a79 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -85,7 +85,14 @@ enum {
#endif
+#ifdef CAF_CAMERA_GB_REL
+ CAMERA_MSG_STATS_DATA = 0x200,
+ CAMERA_MSG_META_DATA = 0x400,
+ CAMERA_MSG_ALL_MSGS = 0x7FF
+#else
CAMERA_MSG_ALL_MSGS = 0x1FF
+#endif
+
};
// cmdType in sendCommand functions
@@ -105,11 +112,18 @@ enum {
// or CAMERA_MSG_COMPRESSED_IMAGE. This is not allowed to be set during
// preview.
CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3,
+ CAMERA_CMD_HISTOGRAM_ON = 4,
+ CAMERA_CMD_HISTOGRAM_OFF = 5,
+ CAMERA_CMD_HISTOGRAM_SEND_DATA = 6,
+ CAMERA_CMD_FACE_DETECTION_ON = 7,
+ CAMERA_CMD_FACE_DETECTION_OFF = 8,
+ CAMERA_CMD_SEND_META_DATA = 9,
};
// camera fatal errors
enum {
CAMERA_ERROR_UKNOWN = 1,
+ CAMERA_ERROR_RESOURCE = 2,
CAMERA_ERROR_SERVER_DIED = 100
};
@@ -188,6 +202,10 @@ public:
// query the recording buffer information from HAL layer.
status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);
#endif
+#ifdef CAF_CAMERA_GB_REL
+ //encode the YUV data
+ void encodeData();
+#endif
// start preview mode, must call setPreviewDisplay first
status_t startPreview();
diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h
index 3226f56..b6e8bf1 100644
--- a/include/camera/CameraHardwareInterface.h
+++ b/include/camera/CameraHardwareInterface.h
@@ -142,6 +142,12 @@ public:
*/
virtual status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) = 0;
#endif
+#ifdef CAF_CAMERA_GB_REL
+ /**
+ * Encode the YUV data.
+ */
+ virtual void encodeData() = 0;
+#endif
/**
* Only used if overlays are used for camera preview.
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index a0c495a..5391426 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -371,6 +371,50 @@ public:
static const char KEY_SUPPORTED_CAF[];
static const char KEY_SUPPORTED_CONTINUOUS_AF[];
+ //Face Detection
+ static const char KEY_FACE_DETECTION[];
+ static const char KEY_SUPPORTED_FACE_DETECTION[];
+
+ //Continuous AF.
+ static const char KEY_SELECTABLE_ZONE_AF[];
+ static const char KEY_SUPPORTED_SELECTABLE_ZONE_AF[];
+
+ static const char KEY_SHUTTER_SOUND[];
+ static const char KEY_BRIGHTNESS_MODE[];
+
+ static const char KEY_HISTOGRAM[] ;
+ static const char KEY_SUPPORTED_HISTOGRAM_MODES[] ;
+ // Values for HISTOGRAM
+ static const char HISTOGRAM_ENABLE[] ;
+ static const char HISTOGRAM_DISABLE[] ;
+
+ static const char KEY_SKIN_TONE_ENHANCEMENT[] ;
+ static const char KEY_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ;
+ // Values for SKIN TONE ENHANCEMENT
+ static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ;
+ static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ;
+
+ // Values for auto scene detection settings.
+ static const char SCENE_DETECT_OFF[];
+ static const char SCENE_DETECT_ON[];
+
+ // Values for auto exposure settings.
+ static const char SELECTABLE_ZONE_AF_AUTO[];
+ static const char SELECTABLE_ZONE_AF_SPOT_METERING[];
+ static const char SELECTABLE_ZONE_AF_CENTER_WEIGHTED[];
+ static const char SELECTABLE_ZONE_AF_FRAME_AVERAGE[];
+
+ // Values for Face Detection settings.
+ static const char FACE_DETECTION_OFF[];
+ static const char FACE_DETECTION_ON[];
+
+
+ // Current auto scene detection mode.
+ // Example value: "off" or SCENE_DETECT_XXX constants. Read/write.
+ static const char KEY_SCENE_DETECT[];
+ // Supported auto scene detection settings.
+ // Example value: "off,backlight,snow/cloudy". Read only.
+ static const char KEY_SUPPORTED_SCENE_DETECT[];
// Values for white balance settings.
static const char WHITE_BALANCE_AUTO[];
static const char WHITE_BALANCE_INCANDESCENT[];
@@ -391,6 +435,9 @@ public:
static const char EFFECT_WHITEBOARD[];
static const char EFFECT_BLACKBOARD[];
static const char EFFECT_AQUA[];
+ static const char EFFECT_NEGATIVE_SEPIA[];
+ static const char EFFECT_PASTEL[];
+ static const char EFFECT_BLUE[];
// Values for Touch AF/AEC
static const char TOUCH_AF_AEC_OFF[] ;
@@ -436,6 +483,9 @@ public:
// Applications are looking for a barcode. Camera driver will be optimized
// for barcode reading.
static const char SCENE_MODE_BARCODE[];
+ static const char SCENE_MODE_BACKLIGHT[];
+ static const char SCENE_MODE_FLOWERS[];
+ static const char SCENE_MODE_AR[];
// Formats for setPreviewFormat and setPictureFormat.
static const char PIXEL_FORMAT_YUV422SP[];
@@ -445,7 +495,7 @@ public:
static const char PIXEL_FORMAT_RGB565[];
static const char PIXEL_FORMAT_JPEG[];
static const char PIXEL_FORMAT_RAW[];
-
+ static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO
// Values for focus mode settings.
// Auto-focus mode. Applications should call
@@ -475,6 +525,7 @@ public:
// CameraHardwareInterface.autoFocus in this mode. To stop continuous focus,
// applications should change the focus mode to other modes.
static const char FOCUS_MODE_CONTINUOUS_VIDEO[];
+ static const char FOCUS_MODE_CONTINUOUS_CAMERA[];
// Values for Continuous AF
static const char CAF_OFF[] ;
@@ -494,6 +545,19 @@ public:
static const char LENSSHADE_ENABLE[] ;
static const char LENSSHADE_DISABLE[] ;
+ static const char KEY_LUMA_ADAPTION[];
+ static const char FOCUS_MODE_MANUAL[];
+ static const char KEY_MANUAL_FOCUS[];
+ static const char KEY_VT_MODE[];
+
+ enum {
+ CAMERA_ORIENTATION_UNKNOWN = 0,
+ CAMERA_ORIENTATION_PORTRAIT = 1,
+ CAMERA_ORIENTATION_LANDSCAPE = 2,
+ };
+ int getOrientation() const;
+ void setOrientation(int orientation);
+ void setPreviewFpsRange(int minFPS,int maxFPS);
private:
DefaultKeyedVector<String8,String8> mMap;
diff --git a/include/camera/ICamera.h b/include/camera/ICamera.h
index f4c0282..1e0d8bf 100644
--- a/include/camera/ICamera.h
+++ b/include/camera/ICamera.h
@@ -57,6 +57,10 @@ public:
// get the recording buffer information from HAL layer.
virtual status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) = 0;
#endif
+#ifdef CAF_CAMERA_GB_REL
+ //encode the YUV data
+ virtual void encodeData() = 0;
+#endif
// start preview mode, must call setPreviewDisplay first
virtual status_t startPreview() = 0;
diff --git a/include/ui/EventHub.h b/include/ui/EventHub.h
index 6211e9d..8a1f29b 100644
--- a/include/ui/EventHub.h
+++ b/include/ui/EventHub.h
@@ -158,7 +158,7 @@ public:
virtual String8 getDeviceName(int32_t deviceId) const = 0;
- virtual bool getDeviceBluetooth(int32_t deviceId) const = 0;
+ virtual uint32_t getDeviceBusType(int32_t deviceId) const = 0;
virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
RawAbsoluteAxisInfo* outAxisInfo) const = 0;
@@ -206,7 +206,7 @@ public:
virtual String8 getDeviceName(int32_t deviceId) const;
- virtual bool getDeviceBluetooth(int32_t deviceId) const;
+ virtual uint32_t getDeviceBusType(int32_t deviceId) const;
virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
RawAbsoluteAxisInfo* outAxisInfo) const;
@@ -249,10 +249,12 @@ private:
KeyLayoutMap* layoutMap;
String8 keylayoutFilename;
int fd;
+ uint32_t bustype;
bool bluetooth;
+ bool usb;
device_t* next;
-
- device_t(int32_t _id, const char* _path, const char* name, bool _bluetooth);
+
+ device_t(int32_t _id, const char* _path, const char* name, uint32_t bustype);
~device_t();
};
diff --git a/include/ui/InputReader.h b/include/ui/InputReader.h
index bc8508b..3f0d102 100644
--- a/include/ui/InputReader.h
+++ b/include/ui/InputReader.h
@@ -405,7 +405,7 @@ private:
class KeyboardInputMapper : public InputMapper {
public:
KeyboardInputMapper(InputDevice* device, int32_t associatedDisplayId, uint32_t sources,
- int32_t keyboardType, bool bluetooth = false);
+ int32_t keyboardType, uint32_t bustype = 0);
virtual ~KeyboardInputMapper();
virtual uint32_t getSources();
@@ -432,7 +432,10 @@ private:
int32_t mAssociatedDisplayId;
uint32_t mSources;
int32_t mKeyboardType;
+
+ uint32_t mBusType;
bool mBluetooth;
+ bool mUSB;
struct LockedState {
Vector<KeyDown> keyDowns; // keys that are down
diff --git a/libs/camera/Android.mk b/libs/camera/Android.mk
index df27cb1..65211f8 100644
--- a/libs/camera/Android.mk
+++ b/libs/camera/Android.mk
@@ -18,6 +18,10 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= libcamera_client
+ifeq ($(BOARD_USE_CAF_LIBCAMERA_GB_REL),true)
+ LOCAL_CFLAGS += -DCAF_CAMERA_GB_REL
+endif
+
ifeq ($(BOARD_CAMERA_USE_GETBUFFERINFO),true)
LOCAL_CFLAGS += -DUSE_GETBUFFERINFO
endif
diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp
index 1ddf2f2..432565e 100644
--- a/libs/camera/Camera.cpp
+++ b/libs/camera/Camera.cpp
@@ -208,6 +208,16 @@ status_t Camera::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize)
}
#endif
+#ifdef CAF_CAMERA_GB_REL
+void Camera::encodeData()
+{
+ LOGV("encodeData");
+ sp <ICamera> c = mCamera;
+ if (c == 0) return;
+ c->encodeData();
+}
+#endif
+
// start preview mode
status_t Camera::startPreview()
{
@@ -305,6 +315,7 @@ status_t Camera::setParameters(const String8& params)
return c->setParameters(params);
}
+
#ifdef MOTO_CUSTOM_PARAMETERS
// set preview/capture custom parameters - key/value pairs
status_t Camera::setCustomParameters(const String8& params)
@@ -316,7 +327,7 @@ status_t Camera::setCustomParameters(const String8& params)
}
#endif
-// get preview/capture custom parameters - key/value pairs
+// get preview/capture parameters - key/value pairs
String8 Camera::getParameters() const
{
LOGV("getParameters");
diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp
index 0c03743..703f2a9 100644
--- a/libs/camera/CameraParameters.cpp
+++ b/libs/camera/CameraParameters.cpp
@@ -110,6 +110,9 @@ const char CameraParameters::EFFECT_POSTERIZE[] = "posterize";
const char CameraParameters::EFFECT_WHITEBOARD[] = "whiteboard";
const char CameraParameters::EFFECT_BLACKBOARD[] = "blackboard";
const char CameraParameters::EFFECT_AQUA[] = "aqua";
+const char CameraParameters::EFFECT_NEGATIVE_SEPIA[] = "negative-sepia";
+const char CameraParameters::EFFECT_PASTEL[] = "pastel";
+const char CameraParameters::EFFECT_BLUE[] = "blue";
// Values for auto exposure settings.
const char CameraParameters::TOUCH_AF_AEC_OFF[] = "touch-off";
@@ -145,10 +148,14 @@ const char CameraParameters::SCENE_MODE_SPORTS[] = "sports";
const char CameraParameters::SCENE_MODE_PARTY[] = "party";
const char CameraParameters::SCENE_MODE_CANDLELIGHT[] = "candlelight";
const char CameraParameters::SCENE_MODE_BARCODE[] = "barcode";
+const char CameraParameters::SCENE_MODE_BACKLIGHT[] = "backlight";
+const char CameraParameters::SCENE_MODE_FLOWERS[] = "flowers";
+const char CameraParameters::SCENE_MODE_AR[] = "AR";
// Formats for setPreviewFormat and setPictureFormat.
const char CameraParameters::PIXEL_FORMAT_YUV422SP[] = "yuv422sp";
const char CameraParameters::PIXEL_FORMAT_YUV420SP[] = "yuv420sp";
+const char CameraParameters::PIXEL_FORMAT_YUV420SP_ADRENO[] = "yuv420sp-adreno";
const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p";
const char CameraParameters::PIXEL_FORMAT_YUV422I[] = "yuv422i-yuyv";
const char CameraParameters::PIXEL_FORMAT_RGB565[] = "rgb565";
@@ -163,6 +170,7 @@ const char CameraParameters::FOCUS_MODE_FIXED[] = "fixed";
const char CameraParameters::FOCUS_MODE_EDOF[] = "edof";
const char CameraParameters::FOCUS_MODE_NORMAL[] = "normal";
const char CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO[] = "continuous-video";
+const char CameraParameters::FOCUS_MODE_CONTINUOUS_CAMERA[] = "continuous-camera";
const char CameraParameters::KEY_SUPPORTED_THUMBNAIL_SIZES[] = "jpeg-thumbnail-size-values";
const char CameraParameters::KEY_GPS_LATITUDE_REF[] = "gps-latitude-ref";
@@ -185,6 +193,41 @@ const char CameraParameters::KEY_MAX_CONTRAST[] = "max-contrast";
const char CameraParameters::KEY_SATURATION[] = "saturation";
const char CameraParameters::KEY_MAX_SATURATION[] = "max-saturation";
+const char CameraParameters::KEY_FACE_DETECTION[] = "face-detection";
+const char CameraParameters::KEY_SUPPORTED_FACE_DETECTION[] = "face-detection-values";
+
+const char CameraParameters::KEY_SCENE_DETECT[] = "scene-detect";
+const char CameraParameters::KEY_SUPPORTED_SCENE_DETECT[] = "scene-detect-values";
+
+const char CameraParameters::KEY_SELECTABLE_ZONE_AF[] = "selectable-zone-af";
+const char CameraParameters::KEY_SUPPORTED_SELECTABLE_ZONE_AF[] = "selectable-zone-af-values";
+const char CameraParameters::KEY_SHUTTER_SOUND[] = "shutter-sound";
+const char CameraParameters::KEY_BRIGHTNESS_MODE[] = "brightness-mode";
+
+const char CameraParameters::KEY_HISTOGRAM[] = "histogram";
+const char CameraParameters::KEY_SUPPORTED_HISTOGRAM_MODES[] = "histogram-values";
+//Values for Histogram Shading
+const char CameraParameters::HISTOGRAM_ENABLE[] = "enable";
+const char CameraParameters::HISTOGRAM_DISABLE[] = "disable";
+
+const char CameraParameters::KEY_SKIN_TONE_ENHANCEMENT[] = "skinToneEnhancement";
+const char CameraParameters::KEY_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] = "skinToneEnhancement-values";
+//Values for Skin Tone Enhancement Modes
+const char CameraParameters::SKIN_TONE_ENHANCEMENT_ENABLE[] = "enable";
+const char CameraParameters::SKIN_TONE_ENHANCEMENT_DISABLE[] = "disable";
+
+const char CameraParameters::SELECTABLE_ZONE_AF_AUTO[] = "auto";
+const char CameraParameters::SELECTABLE_ZONE_AF_SPOT_METERING[] = "spot-metering";
+const char CameraParameters::SELECTABLE_ZONE_AF_CENTER_WEIGHTED[] = "center-weighted";
+const char CameraParameters::SELECTABLE_ZONE_AF_FRAME_AVERAGE[] = "frame-average";
+
+// Values for Face Detection settings.
+const char CameraParameters::FACE_DETECTION_OFF[] = "off";
+const char CameraParameters::FACE_DETECTION_ON[] = "on";
+
+// Values for auto scene detection settings.
+const char CameraParameters::SCENE_DETECT_OFF[] = "off";
+const char CameraParameters::SCENE_DETECT_ON[] = "on";
// Values for auto exposure settings.
const char CameraParameters::AUTO_EXPOSURE_FRAME_AVG[] = "frame-average";
@@ -212,6 +255,33 @@ const char CameraParameters::CAF_ON[] = "caf-on";
const char CameraParameters::CONTINUOUS_AF_OFF[] = "caf-off";
const char CameraParameters::CONTINUOUS_AF_ON[] = "caf-on";
+//LGE Victor
+const char CameraParameters::FOCUS_MODE_MANUAL[] = "manual";
+const char CameraParameters::KEY_MANUAL_FOCUS[] = "manual-focus";
+const char CameraParameters::KEY_LUMA_ADAPTION[] = "luma-adaption";
+const char CameraParameters::KEY_VT_MODE[] = "vt-mode";
+
+#ifdef CAF_CAMERA_GB_REL
+static const char* portrait = "portrait";
+static const char* landscape = "landscape";
+
+int CameraParameters::getOrientation() const
+{
+ const char* orientation = get("orientation");
+ if (orientation && !strcmp(orientation, portrait))
+ return CAMERA_ORIENTATION_PORTRAIT;
+ return CAMERA_ORIENTATION_LANDSCAPE;
+}
+void CameraParameters::setOrientation(int orientation)
+{
+ if (orientation == CAMERA_ORIENTATION_PORTRAIT) {
+ set("orientation", portrait);
+ } else {
+ set("orientation", landscape);
+ }
+}
+#endif
+
CameraParameters::CameraParameters()
: mMap()
{
@@ -420,6 +490,13 @@ void CameraParameters::getVideoSize(int *width, int *height) const
parse_pair(p, width, height, 'x');
}
+void CameraParameters::setPreviewFpsRange(int minFPS, int maxFPS)
+{
+ char str[32];
+ sprintf(str,"%d,%d",minFPS,maxFPS);
+ set(KEY_PREVIEW_FPS_RANGE,str);
+}
+
void CameraParameters::setPreviewFrameRate(int fps)
{
set(KEY_PREVIEW_FRAME_RATE, fps);
@@ -549,6 +626,12 @@ void CameraParameters::getTouchIndexAf(int *x, int *y) const
}
}
+// LGE Victor
+extern "C" status_t _ZNK7android16CameraParameters14getManualfocusEv () {
+ return NO_ERROR;
+}
+// LGE Victor
+
status_t CameraParameters::dump(int fd, const Vector<String16>& args) const
{
const size_t SIZE = 256;
diff --git a/libs/camera/ICamera.cpp b/libs/camera/ICamera.cpp
index cc39d39..b04dd2d 100644
--- a/libs/camera/ICamera.cpp
+++ b/libs/camera/ICamera.cpp
@@ -53,6 +53,9 @@ enum {
GET_CUSTOM_PARAMETERS,
SET_CUSTOM_PARAMETERS,
#endif
+#ifdef CAF_CAMERA_GB_REL
+ ENCODE_YUV_DATA,
+#endif
};
class BpCamera: public BpInterface<ICamera>
@@ -108,6 +111,17 @@ public:
*alignedSize = reply.readInt32();
return ret;
}
+
+#endif
+#ifdef CAF_CAMERA_GB_REL
+ // encode the YUV data.
+ void encodeData()
+ {
+ LOGV("encodeData");
+ Parcel data, reply;
+ data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
+ remote()->transact(ENCODE_YUV_DATA, data, &reply);
+ }
#endif
// start preview mode, must call setPreviewDisplay first
@@ -328,6 +342,14 @@ status_t BnCamera::onTransact(
return NO_ERROR;
} break;
#endif
+#ifdef CAF_CAMERA_GB_REL
+ case ENCODE_YUV_DATA:{
+ LOGV("ENCODE_YUV_DATA");
+ CHECK_INTERFACE(ICamera, data, reply);
+ encodeData();
+ return NO_ERROR;
+ } break;
+#endif
case START_PREVIEW: {
LOGV("START_PREVIEW");
CHECK_INTERFACE(ICamera, data, reply);
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 01facbb..9c78a74 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -77,6 +77,9 @@
#define INDENT2 " "
#define INDENT3 " "
+//#define DEBUG_SHOW_DEVICES
+//#define DEBUG_SHOW_KEYSDOWN
+
namespace android {
static const char *WAKE_LOCK_ID = "KeyEvents";
@@ -92,9 +95,11 @@ static inline const char* toString(bool value) {
return value ? "true" : "false";
}
-EventHub::device_t::device_t(int32_t _id, const char* _path, const char* name, bool _bluetooth)
+EventHub::device_t::device_t(int32_t _id, const char* _path, const char* name, uint32_t _bustype)
: id(_id), path(_path), name(name), classes(0)
- , keyBitmask(NULL), layoutMap(new KeyLayoutMap()), fd(-1), bluetooth(_bluetooth), next(NULL) {
+ , keyBitmask(NULL), layoutMap(new KeyLayoutMap()), fd(-1), bustype(_bustype), next(NULL) {
+ bluetooth = (_bustype == BUS_BLUETOOTH);
+ usb = (_bustype == BUS_USB);
}
EventHub::device_t::~device_t() {
@@ -137,11 +142,11 @@ String8 EventHub::getDeviceName(int32_t deviceId) const
return device->name;
}
-bool EventHub::getDeviceBluetooth(int32_t deviceId) const
+uint32_t EventHub::getDeviceBusType(int32_t deviceId) const
{
AutoMutex _l(mLock);
device_t* device = getDeviceLocked(deviceId);
- return device->bluetooth;
+ return device->bustype;
}
uint32_t EventHub::getDeviceClasses(int32_t deviceId) const
@@ -217,16 +222,13 @@ int32_t EventHub::getKeyCodeStateLocked(device_t* device, int32_t keyCode) const
uint8_t key_bitmask[sizeof_bit_array(KEY_MAX + 1)];
memset(key_bitmask, 0, sizeof(key_bitmask));
if (ioctl(device->fd, EVIOCGKEY(sizeof(key_bitmask)), key_bitmask) >= 0) {
- #if 0
- for (size_t i=0; i<=KEY_MAX; i++) {
- LOGI("(Scan code %d: down=%d)", i, test_bit(i, key_bitmask));
- }
- #endif
const size_t N = scanCodes.size();
for (size_t i=0; i<N && i<=KEY_MAX; i++) {
int32_t sc = scanCodes.itemAt(i);
- //LOGI("Code %d: down=%d", sc, test_bit(sc, key_bitmask));
if (sc >= 0 && sc <= KEY_MAX && test_bit(sc, key_bitmask)) {
+ #ifdef DEBUG_SHOW_KEYSDOWN
+ LOGI("Code %d: down=%d", sc, test_bit(sc, key_bitmask));
+ #endif
return AKEY_STATE_DOWN;
}
}
@@ -662,7 +664,7 @@ int EventHub::openDevice(const char *deviceName) {
mFDs = new_mFDs;
mDevices = new_devices;
-#if 0
+#ifdef DEBUG_SHOW_DEVICES
LOGI("add device %d: %s\n", mFDCount, deviceName);
LOGI(" bus: %04x\n"
" vendor %04x\n"
@@ -676,7 +678,7 @@ int EventHub::openDevice(const char *deviceName) {
version >> 16, (version >> 8) & 0xff, version & 0xff);
#endif
- device_t* device = new device_t(devid|mDevicesById[devid].seq, deviceName, name, BUS_BLUETOOTH == id.bustype);
+ device_t* device = new device_t(devid|mDevicesById[devid].seq, deviceName, name, id.bustype);
if (device == NULL) {
LOGE("out of memory");
return -1;
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index 4cd24859..7626b15 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -22,6 +22,9 @@
// Log debug messages about pointer assignment calculations.
#define DEBUG_POINTER_ASSIGNMENT 0
+// Log mouse events
+#define DEBUG_MOUSE_EVENTS 0
+
#include <cutils/log.h>
#include <ui/InputReader.h>
@@ -331,8 +334,8 @@ InputDevice* InputReader::createDevice(int32_t deviceId, const String8& name, ui
}
if (keyboardSources != 0) {
- device->addMapper(new KeyboardInputMapper(device,
- associatedDisplayId, keyboardSources, keyboardType, mEventHub->getDeviceBluetooth(deviceId)));
+ device->addMapper(new KeyboardInputMapper(device, associatedDisplayId, keyboardSources,
+ keyboardType, mEventHub->getDeviceBusType(deviceId)));
}
// Trackball-like devices.
@@ -873,10 +876,12 @@ int32_t SwitchInputMapper::getSwitchState(uint32_t sourceMask, int32_t switchCod
// --- KeyboardInputMapper ---
KeyboardInputMapper::KeyboardInputMapper(InputDevice* device, int32_t associatedDisplayId,
- uint32_t sources, int32_t keyboardType, bool bluetooth) :
+ uint32_t sources, int32_t keyboardType, uint32_t bustype) :
InputMapper(device), mAssociatedDisplayId(associatedDisplayId), mSources(sources),
- mKeyboardType(keyboardType), mBluetooth(bluetooth) {
+ mKeyboardType(keyboardType), mBusType(bustype) {
initializeLocked();
+ mBluetooth = (mBusType == BUS_BLUETOOTH);
+ mUSB = (mBusType == BUS_USB);
}
KeyboardInputMapper::~KeyboardInputMapper() {
@@ -965,7 +970,7 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
if (down) {
// Rotate key codes according to orientation if needed.
// Note: getDisplayInfo is non-reentrant so we can continue holding the lock.
- if (!mBluetooth && mAssociatedDisplayId >= 0) {
+ if (!mBluetooth && !mUSB && mAssociatedDisplayId >= 0) {
int32_t orientation;
if (! getPolicy()->getDisplayInfo(mAssociatedDisplayId, NULL, NULL, & orientation)) {
return;
@@ -3514,10 +3519,14 @@ void MouseInputMapper::sync(nsecs_t when) {
float x = fields & Accumulator::FIELD_REL_X ? mAccumulator.relX : 0.0f;
float y = fields & Accumulator::FIELD_REL_Y ? mAccumulator.relY : 0.0f;
- int32_t screenWidth;
- int32_t screenHeight;
- int32_t orientation;
+ static int32_t screenWidth;
+ static int32_t screenHeight;
+ static int32_t orientation;
+#if DEBUG_MOUSE_EVENTS
+ LOGI("MouseInputMapper: x,y=%.1f,%.1f abs %dx%d, screen %dx%d",
+ x, y, mAccumulator.absX, mAccumulator.absY, screenWidth, screenHeight);
+#endif
mAccumulator.absX = (mAccumulator.absX + x) > screenWidth ? screenWidth -1 : ((mAccumulator.absX + x) < 0 ? 0 : mAccumulator.absX + x);
mAccumulator.absY = (mAccumulator.absY + y) > screenHeight ? screenHeight -1 : ((mAccumulator.absY + y) < 0 ? 0 : mAccumulator.absY + y);
pointerCoords.x = mAccumulator.absX;
diff --git a/libs/ui/tests/InputReader_test.cpp b/libs/ui/tests/InputReader_test.cpp
index aec7ba9..abfc157 100644
--- a/libs/ui/tests/InputReader_test.cpp
+++ b/libs/ui/tests/InputReader_test.cpp
@@ -486,8 +486,8 @@ private:
return device ? device->name : String8("unknown");
}
- virtual bool getDeviceBluetooth(int32_t deviceId) const {
- return false;
+ virtual uint32_t getDeviceBusType(int32_t deviceId) const {
+ return 0;
}
virtual status_t getAbsoluteAxisInfo(int32_t deviceId, int axis,
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index 2255bf2..3e7437b 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -88,4 +88,7 @@ interface ILocationManager
// for NI support
boolean sendNiResponse(int notifId, int userResponse);
+
+ // add set gps source
+ void setGPSSource(String device);
}
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 9aa84a03..42e4318 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -271,7 +271,15 @@ public class LocationManager {
provider.setAccuracy(info.getInt("accuracy"));
return provider;
}
-
+
+ public void setGPSSource(String device) {
+ try {
+ mService.setGPSSource(device);
+ } catch (RemoteException e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+
/**
* Returns a list of the names of all known location providers. All
* providers are returned, including ones that are not permitted to be
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index da4703a..2994e5c 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -807,7 +807,7 @@ sp<MediaSource> OMXCodec::Create(
CHECK(success);
// We need this for 720p video without AVC profile
// Not a good solution, but ..
- if (width*height > 409920) { //854*480
+ if (width*height > 412800) { //860*480
componentName = "OMX.TI.720P.Decoder";
LOGE("Format exceed the decoder's capabilities.");
continue;
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index 9e0700f..111b1c4 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008-2009, Motorola, Inc.
+ * Copyright (c) 2010-2011, Motorola, Inc.
*
* All rights reserved.
*
@@ -124,6 +124,13 @@ public final class ClientOperation implements Operation, BaseStream {
(header).mAuthResp.length);
}
+ if ((header).mConnectionID != null) {
+ mRequestHeader.mConnectionID = new byte[4];
+ System.arraycopy((header).mConnectionID, 0, mRequestHeader.mConnectionID, 0,
+ 4);
+
+ }
+
}
/**
@@ -721,4 +728,8 @@ public final class ClientOperation implements Operation, BaseStream {
}
}
}
+
+ public void noEndofBody() {
+
+ }
}
diff --git a/obex/javax/obex/Operation.java b/obex/javax/obex/Operation.java
index 25656ed..05cecc5 100644
--- a/obex/javax/obex/Operation.java
+++ b/obex/javax/obex/Operation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008-2009, Motorola, Inc.
+ * Copyright (c) 2010-2011, Motorola, Inc.
*
* All rights reserved.
*
@@ -175,6 +175,8 @@ public interface Operation {
DataOutputStream openDataOutputStream() throws IOException;
+ void noEndofBody();
+
void close() throws IOException;
int getMaxPacketSize();
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java
index 89c0779..b94a5f5 100644
--- a/obex/javax/obex/ServerOperation.java
+++ b/obex/javax/obex/ServerOperation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008-2009, Motorola, Inc.
+ * Copyright (c) 2010-2011, Motorola, Inc.
*
* All rights reserved.
*
@@ -93,6 +93,8 @@ public final class ServerOperation implements Operation, BaseStream {
private ObexByteBuffer mHeaderBuffer;
+ private boolean mEndofBody = true;
+
/**
* Creates new ServerOperation
* @param p the parent that created this object
@@ -365,24 +367,30 @@ public final class ServerOperation implements Operation, BaseStream {
* (End of Body) otherwise, we need to send 0x48 (Body)
*/
if ((finalBitSet) || (mPrivateOutput.isClosed())) {
- mBodyBuffer.write((byte)0x49);
+ if (mEndofBody) {
+ mBodyBuffer.write((byte)0x49);
+ bodyLength += 3;
+ mBodyBuffer.write((byte)(bodyLength >> 8));
+ mBodyBuffer.write((byte)bodyLength);
+ mPrivateOutput.writeTo(mBodyBuffer, bodyLength - 3);
+ }
} else {
mBodyBuffer.write((byte)0x48);
+ bodyLength += 3;
+ mBodyBuffer.write((byte)(bodyLength >> 8));
+ mBodyBuffer.write((byte)bodyLength);
+ mPrivateOutput.writeTo(mBodyBuffer, bodyLength - 3);
}
-
- bodyLength += 3;
- mBodyBuffer.write((byte)(bodyLength >> 8));
- mBodyBuffer.write((byte)bodyLength);
- mPrivateOutput.writeTo(mBodyBuffer, bodyLength - 3);
}
}
if ((finalBitSet) && (type == ResponseCodes.OBEX_HTTP_OK) && (orginalBodyLength <= 0)) {
- mBodyBuffer.write((byte)0x49);
- orginalBodyLength = 3;
- mBodyBuffer.write((byte)(orginalBodyLength >> 8));
- mBodyBuffer.write((byte)orginalBodyLength);
-
+ if (mEndofBody) {
+ mBodyBuffer.write((byte)0x49);
+ orginalBodyLength = 3;
+ mBodyBuffer.write((byte)(orginalBodyLength >> 8));
+ mBodyBuffer.write((byte)orginalBodyLength);
+ }
}
mResponseSize = 3;
@@ -704,4 +712,9 @@ public final class ServerOperation implements Operation, BaseStream {
public void streamClosed(boolean inStream) throws IOException {
}
+
+ public void noEndofBody() {
+ mEndofBody = false;
+ }
+
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CarrierLabel.java b/packages/SystemUI/src/com/android/systemui/statusbar/CarrierLabel.java
index 1b8723f..204a6a7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CarrierLabel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CarrierLabel.java
@@ -17,15 +17,22 @@
package com.android.systemui.statusbar;
import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.database.ContentObserver;
+import android.os.Handler;
+import android.os.SystemProperties;
+import android.provider.CmSystem;
+import android.provider.Settings;
import android.provider.Telephony;
import android.util.AttributeSet;
import android.util.Slog;
import android.widget.TextView;
import com.android.internal.R;
+import com.android.internal.telephony.TelephonyProperties;
/**
* This widget display the current network status or registered PLMN, and/or
@@ -34,6 +41,47 @@ import com.android.internal.R;
public class CarrierLabel extends TextView {
private boolean mAttached;
+ private boolean mShowSpn;
+ private String mSpn;
+ private boolean mShowPlmn;
+ private String mPlmn;
+
+ private int mCarrierLabelType;
+ private String mCarrierLabelCustom;
+
+ private static final int TYPE_DEFAULT = 0;
+
+ private static final int TYPE_SPN = 1;
+
+ private static final int TYPE_PLMN = 2;
+
+ private static final int TYPE_CUSTOM = 3;
+
+ Handler mHandler;
+
+ private class SettingsObserver extends ContentObserver {
+ SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
+ void observe() {
+ ContentResolver resolver = mContext.getContentResolver();
+ resolver.registerContentObserver(
+ Settings.System.getUriFor(Settings.System.CARRIER_LABEL_TYPE),
+ false, this);
+ resolver.registerContentObserver(
+ Settings.System.getUriFor(Settings.System.CARRIER_LABEL_CUSTOM_STRING),
+ false, this);
+ onChange(true);
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ updateSettings();
+ updateNetworkName(mShowSpn, mSpn, mShowPlmn, mPlmn);
+ }
+ }
+
public CarrierLabel(Context context) {
this(context, null);
}
@@ -44,6 +92,12 @@ public class CarrierLabel extends TextView {
public CarrierLabel(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+
+ mHandler = new Handler();
+ SettingsObserver settingsObserver = new SettingsObserver(mHandler);
+ settingsObserver.observe();
+
+ updateSettings();
updateNetworkName(false, null, false, null);
}
@@ -81,26 +135,71 @@ public class CarrierLabel extends TextView {
}
};
+ void updateSettings() {
+ ContentResolver resolver = mContext.getContentResolver();
+
+ mCarrierLabelType = Settings.System.getInt(resolver,
+ Settings.System.CARRIER_LABEL_TYPE, TYPE_DEFAULT);
+ mCarrierLabelCustom = Settings.System.getString(resolver,
+ Settings.System.CARRIER_LABEL_CUSTOM_STRING);
+ }
+
void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) {
if (false) {
Slog.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
}
- StringBuilder str = new StringBuilder();
- if (showPlmn) {
- if (plmn != null) {
- str.append(plmn);
- } else {
- str.append(mContext.getText(R.string.lockscreen_carrier_default));
- }
+
+ mShowSpn = showSpn;
+ mSpn = spn;
+ mShowPlmn = showPlmn;
+ mPlmn = plmn;
+
+ boolean haveSignal = (showPlmn && plmn != null) || (showSpn && spn != null);
+ if (!haveSignal) {
+ setText(com.android.internal.R.string.lockscreen_carrier_default);
+ return;
}
- if (showSpn && spn != null) {
- if (showPlmn) {
- str.append('\n');
- }
- str.append(spn);
+
+ String realPlmn = SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ALPHA);
+ int carrierLabelType = mCarrierLabelType;
+
+ if (plmn != null && !(plmn.equals(realPlmn))) {
+ carrierLabelType = TYPE_DEFAULT;
+ }
+
+ switch (carrierLabelType) {
+ default:
+ case TYPE_DEFAULT:
+ StringBuilder str = new StringBuilder();
+ if (showPlmn) {
+ if (plmn != null) {
+ str.append(plmn);
+ } else {
+ str.append(mContext.getText(R.string.lockscreen_carrier_default));
+ }
+ }
+ if (showSpn && spn != null) {
+ if (showPlmn) {
+ str.append('\n');
+ }
+ str.append(spn);
+ }
+ setText(str.toString());
+ break;
+
+ case TYPE_SPN:
+ setText(spn);
+ break;
+
+ case TYPE_PLMN:
+ setText(plmn);
+ break;
+
+ case TYPE_CUSTOM:
+ setText(mCarrierLabelCustom);
+ break;
}
- setText(str.toString());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandedView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandedView.java
index 3367154..d83d26b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandedView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandedView.java
@@ -48,7 +48,7 @@ public class ExpandedView extends LinearLayout {
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
- if (mTouchDispatcher.needsInterceptTouch()) {
+ if (mTouchDispatcher.needsInterceptTouch(event)) {
return true;
}
return super.onInterceptTouchEvent(event);
@@ -56,8 +56,13 @@ public class ExpandedView extends LinearLayout {
@Override
public boolean onTouchEvent(MotionEvent event) {
- mTouchDispatcher.handleTouchEvent(event);
- return super.onTouchEvent(event);
+ boolean handled = mTouchDispatcher.handleTouchEvent(event);
+
+ if (super.onTouchEvent(event)) {
+ handled = true;
+ }
+
+ return handled;
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ItemTouchDispatcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/ItemTouchDispatcher.java
index 0ed29ba..ad8bc1d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ItemTouchDispatcher.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ItemTouchDispatcher.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar;
import android.content.Context;
+import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
@@ -24,6 +25,9 @@ import android.view.ViewConfiguration;
import com.android.systemui.R;
public class ItemTouchDispatcher {
+ private static final String TAG = "NotificationTouchDispatcher";
+ /* package */ static final boolean DBG = false;
+
private final GestureDetector mGestureDetector;
private LatestItemContainer mItem;
/* stored as class member to avoid garbage creation */
@@ -36,12 +40,22 @@ public class ItemTouchDispatcher {
final ViewConfiguration vc = ViewConfiguration.get(context);
int minDistance = vc.getScaledTouchSlop();
int distance = (int) Math.abs(e2.getX() - e1.getX());
+ boolean result = false;
+
+ if (DBG) {
+ Log.v(TAG, "Fling detected, distance " + distance + " vs. " +
+ minDistance + " vX " + vX + " vY " + vY);
+ }
+
if (distance > minDistance && Math.abs(vX) > Math.abs(vY)) {
mItem.finishSwipe(vX > 0);
- mItem = null;
- return true;
+ result = true;
+ } else {
+ mItem.stopSwipe();
}
- return false;
+
+ mItem = null;
+ return result;
}
});
}
@@ -50,8 +64,30 @@ public class ItemTouchDispatcher {
mItem = item;
}
- public boolean needsInterceptTouch() {
- return mItem != null;
+ public void releaseItem(LatestItemContainer item) {
+ if (item == mItem) {
+ mItem = null;
+ }
+ }
+
+ public boolean needsInterceptTouch(MotionEvent event) {
+ if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
+ if (mItem != null) {
+ /*
+ * If we get a DOWN event and still have an item, we must have missed unregistering
+ * the item on the last UP event. In that case, do it here to preserve sanity.
+ */
+ Log.w(TAG, "Clearing stale item " + mItem);
+ mItem.stopSwipe();
+ mItem = null;
+ }
+ }
+ if (mItem != null) {
+ if (DBG) Log.v(TAG, "Need to intercept touch event " + event + " due to item " + mItem);
+ mItem.setEventsControlledByDispatcher();
+ return true;
+ }
+ return false;
}
public boolean handleTouchEvent(MotionEvent event) {
@@ -63,6 +99,7 @@ public class ItemTouchDispatcher {
real.setLocation(event.getRawX(), event.getRawY());
boolean handled = mGestureDetector.onTouchEvent(real);
+ if (DBG) Log.v(TAG, "Handling touch event " + event + " handled " + handled);
if (mItem != null) {
/*
@@ -71,12 +108,14 @@ public class ItemTouchDispatcher {
mItem.getLocationOnScreen(mItemLocation);
real.offsetLocation(mItemLocation[0], mItemLocation[1]);
mItem.dispatchTouchEvent(real);
+ if (DBG) Log.v(TAG, "Converted event to " + real);
switch (real.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mItem.stopSwipe();
mItem = null;
+ handled = true;
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemContainer.java
index 2a5bf1b..7732005 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemContainer.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.graphics.Point;
import android.os.Handler;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@@ -30,7 +31,10 @@ import android.widget.LinearLayout;
import com.android.systemui.R;
public class LatestItemContainer extends LinearLayout {
- private boolean mIsDragged = false;
+ private static final String TAG = "NotificationContainer";
+ private static final boolean DBG = ItemTouchDispatcher.DBG;
+
+ private boolean mEventsControlledByDispatcher = false;
private ItemTouchDispatcher mDispatcher = null;
private Runnable mSwipeCallback = null;
private final Handler mHandler = new Handler();
@@ -46,46 +50,63 @@ public class LatestItemContainer extends LinearLayout {
public void finishSwipe(boolean toRight) {
int id = toRight ? R.anim.slide_out_right_basic : R.anim.slide_out_left_basic;
Animation animation = AnimationUtils.loadAnimation(getContext(), id);
+
+ if (DBG) Log.v(TAG, "Finishing swipe of item " + this + " to " + (toRight ? "right" : "left"));
startAnimation(animation);
mHandler.postDelayed(mSwipeCallback, animation.getDuration());
- mIsDragged = false;
+ mEventsControlledByDispatcher = false;
}
public void stopSwipe() {
+ if (DBG) Log.v(TAG, "Swipe of item " + this + "cancelled");
reset();
- mIsDragged = false;
+ mEventsControlledByDispatcher = false;
+ }
+
+ public void setEventsControlledByDispatcher() {
+ mEventsControlledByDispatcher = true;
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
- if (mDispatcher != null) {
- boolean handled = false;
+ boolean handled = false;
+ if (mDispatcher != null) {
/*
* Only call into dispatcher when we're not registered with it yet,
* otherwise we get into a loop
*/
- if (!mIsDragged) {
+ if (!mEventsControlledByDispatcher) {
handled = mDispatcher.handleTouchEvent(event);
}
+ if (DBG) {
+ Log.v(TAG, "Got touch event " + event + " dispatcher handled " +
+ handled + " controlled " + mEventsControlledByDispatcher);
+ }
+
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
mStartPoint.set((int) event.getX(), (int) event.getY());
+ handled = true;
break;
case MotionEvent.ACTION_MOVE:
int diffX = ((int) event.getX()) - mStartPoint.x;
int diffY = ((int) event.getY()) - mStartPoint.y;
if (Math.abs(diffX) > mTouchSlop && Math.abs(diffX) > Math.abs(diffY)) {
- mIsDragged = true;
mDispatcher.setItem(this);
}
scrollTo(-diffX, 0);
+ handled = true;
break;
case MotionEvent.ACTION_UP:
if (!handled) {
reset();
}
+ if (!mEventsControlledByDispatcher) {
+ mDispatcher.releaseItem(this);
+ }
+ handled = true;
break;
case MotionEvent.ACTION_CANCEL:
/*
@@ -94,14 +115,20 @@ public class LatestItemContainer extends LinearLayout {
* event control). The dispatcher will call stopSwipe() when
* the gesture is aborted.
*/
- if (!mIsDragged) {
+ if (!mEventsControlledByDispatcher) {
+ mDispatcher.releaseItem(this);
reset();
}
+ handled = true;
break;
}
}
- return super.dispatchTouchEvent(event);
+ if (super.dispatchTouchEvent(event)) {
+ handled = true;
+ }
+
+ return handled;
}
private void reset() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
index d5d3282..562ac2d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/MobileDataButton.java
@@ -10,11 +10,16 @@ import android.net.ConnectivityManager;
import android.provider.Settings;
import com.android.internal.telephony.TelephonyIntents;
+import com.android.internal.telephony.Phone;
public class MobileDataButton extends PowerButton {
public static final String MOBILE_DATA_CHANGED = "com.android.internal.telephony.MOBILE_DATA_CHANGED";
+ public static final String ACTION_MODIFY_NETWORK_MODE = "com.android.internal.telephony.MODIFY_NETWORK_MODE";
+
+ public static final String EXTRA_NETWORK_MODE = "networkMode";
+
public static boolean STATE_CHANGE_REQUEST = false;
public MobileDataButton() { mType = BUTTON_MOBILEDATA; }
@@ -36,13 +41,30 @@ public class MobileDataButton extends PowerButton {
@Override
protected void toggleState() {
Context context = mView.getContext();
- boolean enabled = getDataState(context);
+ boolean mobiledataEnabled = getDataState(context);
+
+ boolean toggleNetworkMode = Settings.System.getInt(context.getContentResolver(),
+ Settings.System.EXPANDED_MOBILEDATANETWORK_MODE, 0) == 1;
ConnectivityManager cm = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
- if (enabled) {
+ if (mobiledataEnabled) {
+ if (toggleNetworkMode) {
+ // mobile data being disabled - switch network mode to 2g only
+ Intent intent = new Intent(ACTION_MODIFY_NETWORK_MODE);
+ intent.putExtra(EXTRA_NETWORK_MODE, Phone.NT_MODE_GSM_ONLY);
+ context.sendBroadcast(intent);
+ }
+ // disable mobile data
cm.setMobileDataEnabled(false);
} else {
+ if (toggleNetworkMode) {
+ // mobile data being enabled - switch network mode to 2g/3g
+ Intent intent = new Intent(ACTION_MODIFY_NETWORK_MODE);
+ intent.putExtra(EXTRA_NETWORK_MODE, Phone.NT_MODE_WCDMA_PREF);
+ context.sendBroadcast(intent);
+ }
+ // enable mobile data
cm.setMobileDataEnabled(true);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/WimaxButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/WimaxButton.java
index 1bedd34..43e6a5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/WimaxButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/WimaxButton.java
@@ -65,10 +65,18 @@ public class WimaxButton extends PowerButton {
@Override
public void onActualStateChange(Context context, Intent intent) {
- if (!WimaxManagerConstants.WIMAX_ENABLED_CHANGED_ACTION.equals(intent.getAction())) {
+ String action = intent.getAction();
+ int wimaxState;
+
+ if (action.equals(WimaxManagerConstants.WIMAX_ENABLED_STATUS_CHANGED)) {
+ wimaxState = intent.getIntExtra(WimaxManagerConstants.EXTRA_WIMAX_STATUS,
+ WimaxManagerConstants.WIMAX_STATUS_UNKNOWN);
+ } else if (action.equals(WimaxManagerConstants.WIMAX_ENABLED_CHANGED_ACTION)) {
+ wimaxState = intent.getIntExtra(WimaxManagerConstants.CURRENT_WIMAX_ENABLED_STATE,
+ WimaxManagerConstants.WIMAX_ENABLED_STATE_UNKNOWN);
+ } else {
return;
}
- int wimaxState = intent.getIntExtra(WimaxManagerConstants.CURRENT_WIMAX_ENABLED_STATE, WimaxManagerConstants.WIMAX_ENABLED_STATE_UNKNOWN);
int widgetState = wimaxStateToFiveState(wimaxState);
setCurrentState(context, widgetState);
}
@@ -76,6 +84,7 @@ public class WimaxButton extends PowerButton {
/**
* Converts WimaxController's state values into our
* WiMAX-common state values.
+ * Also compatible with WimaxManager status values.
*/
private static int wimaxStateToFiveState(int wimaxState) {
switch (wimaxState) {
@@ -142,6 +151,7 @@ public class WimaxButton extends PowerButton {
@Override
protected IntentFilter getBroadcastIntentFilter() {
IntentFilter filter = new IntentFilter();
+ filter.addAction(WimaxManagerConstants.WIMAX_ENABLED_STATUS_CHANGED);
filter.addAction(WimaxManagerConstants.WIMAX_ENABLED_CHANGED_ACTION);
return filter;
}
diff --git a/packages/VpnServices/src/com/android/server/vpn/OpenvpnService.java b/packages/VpnServices/src/com/android/server/vpn/OpenvpnService.java
index 405d2e0..3b61cb7 100644
--- a/packages/VpnServices/src/com/android/server/vpn/OpenvpnService.java
+++ b/packages/VpnServices/src/com/android/server/vpn/OpenvpnService.java
@@ -124,6 +124,14 @@ class OpenvpnService extends VpnService<OpenvpnProfile> {
args.add("--keysize");
args.add(p.getKeySize());
}
+
+ if (p.getUseTlsAuth() && !p.getTlsAuthKey().equals("") && !p.getTlsAuthKeyDirection().equals("")) {
+ args.add("--tls-auth");
+ args.add(p.getTlsAuthKey());
+ if (!p.getTlsAuthKeyDirection().equals("None")) {
+ args.add(p.getTlsAuthKeyDirection());
+ }
+ }
args.add("--up");
args.add("/system/xbin/openvpn-up.sh");
args.add("--script-security");
diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java
index 5f299a5..6ae6681 100644
--- a/policy/src/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/LockScreen.java
@@ -18,6 +18,7 @@ package com.android.internal.policy.impl;
import com.android.internal.R;
import com.android.internal.telephony.IccCard;
+import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.widget.DigitalClock;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.RotarySelector;
@@ -34,13 +35,18 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.ColorStateList;
import android.net.Uri;
+import android.text.TextUtils;
import android.text.format.DateFormat;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.*;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
import android.gesture.Gesture;
import android.gesture.GestureLibraries;
import android.gesture.GestureLibrary;
@@ -62,6 +68,9 @@ import android.os.SystemProperties;
import android.os.Vibrator;
import android.preference.MultiSelectListPreference;
import android.provider.Settings;
+import android.provider.CmSystem.LockscreenStyle;
+import android.provider.CmSystem.RotaryStyle;
+import android.provider.CmSystem.RinglockStyle;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -87,6 +96,10 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private static final String TAG = "LockScreen";
private static final String ENABLE_MENU_KEY_FILE = "/data/local/enable_menu_key";
private static final Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
+ static final int CARRIER_TYPE_DEFAULT = 0;
+ static final int CARRIER_TYPE_SPN = 1;
+ static final int CARRIER_TYPE_PLMN = 2;
+ static final int CARRIER_TYPE_CUSTOM = 3;
private Status mStatus = Status.Normal;
@@ -104,8 +117,10 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private TextView mDate;
private TextView mTime;
private TextView mAmPm;
- private TextView mStatus1;
- private TextView mStatus2;
+ private LinearLayout mStatusBox;
+ private TextView mStatusCharging;
+ private TextView mStatusAlarm;
+ private TextView mStatusCalendar;
private TextView mScreenLocked;
private TextView mEmergencyCallText;
private Button mEmergencyCallButton;
@@ -136,7 +151,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private int mBatteryLevel = 100;
private String mNextAlarm = null;
- private Drawable mAlarmIcon = null;
+ private String mNextCalendar = null;
private String mCharging = null;
private Drawable mChargingIcon = null;
@@ -219,14 +234,21 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private boolean mRotaryHideArrows = (Settings.System.getInt(mContext.getContentResolver(),
Settings.System.LOCKSCREEN_ROTARY_HIDE_ARROWS, 0) == 1);
- private boolean mUseRotaryLockscreen = (mLockscreenStyle == 2);
+ private int mCarrierLabelType = (Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.CARRIER_LABEL_TYPE, CARRIER_TYPE_DEFAULT));
- private boolean mUseRotaryRevLockscreen = (mLockscreenStyle == 3);
+ private String mCarrierLabelCustom = (Settings.System.getString(mContext.getContentResolver(),
+ Settings.System.CARRIER_LABEL_CUSTOM_STRING));
- private boolean mUseLenseSquareLockscreen = (mLockscreenStyle == 4);
+ private boolean mUseRotaryLockscreen =
+ LockscreenStyle.getStyleById(mLockscreenStyle) == LockscreenStyle.Rotary;
+
+ private boolean mUseLenseSquareLockscreen =
+ LockscreenStyle.getStyleById(mLockscreenStyle) == LockscreenStyle.Lense;
private boolean mLensePortrait = false;
- private boolean mUseRingLockscreen = (mLockscreenStyle == 5);
+ private boolean mUseRingLockscreen =
+ LockscreenStyle.getStyleById(mLockscreenStyle) == LockscreenStyle.Ring;
private boolean mRingUnlockMiddle = (Settings.System.getInt(mContext.getContentResolver(),
Settings.System.LOCKSCREEN_RING_UNLOCK_MIDDLE, 0) == 1);
@@ -357,8 +379,11 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mTime = (TextView) findViewById(R.id.timeDisplay);
mAmPm = (TextView) findViewById(R.id.am_pm);
mDate = (TextView) findViewById(R.id.date);
- mStatus1 = (TextView) findViewById(R.id.status1);
- mStatus2 = (TextView) findViewById(R.id.status2);
+
+ mStatusBox = (LinearLayout) findViewById(R.id.status_box);
+ mStatusCharging = (TextView) findViewById(R.id.status_charging);
+ mStatusAlarm = (TextView) findViewById(R.id.status_alarm);
+ mStatusCalendar = (TextView) findViewById(R.id.status_calendar);
mCustomMsg = (TextView) findViewById(R.id.customMsg);
@@ -422,28 +447,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
}
- float density = getResources().getDisplayMetrics().density;
- int ringAppIconSize = context.getResources().getInteger(R.integer.config_ringSecIconSizeDIP);
- for (int q = 0; q < 4; q++) {
- if (mCustomRingAppActivities[q] != null) {
- mRingSelector.showSecRing(q);
- try {
- Intent i = Intent.parseUri(mCustomRingAppActivities[q], 0);
- PackageManager pm = context.getPackageManager();
- ActivityInfo ai = i.resolveActivityInfo(pm, PackageManager.GET_ACTIVITIES);
- if (ai != null) {
- Bitmap iconBmp = ((BitmapDrawable) ai.loadIcon(pm)).getBitmap();
- mCustomRingAppIcons[q] = Bitmap.createScaledBitmap(iconBmp,
- (int) (density * ringAppIconSize), (int) (density * ringAppIconSize), true);
- mRingSelector.setSecRingResources(q, mCustomRingAppIcons[q], R.drawable.jog_ring_secback_normal);
- }
- } catch (URISyntaxException e) {
- }
- } else {
- mRingSelector.hideSecRing(q);
- }
- }
-
if (mCustomAppIcon == null)
mCustomAppIcon=BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_jog_dial_custom);
@@ -536,54 +539,109 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mRotarySelector.setMidHandleResource(R.drawable.ic_jog_dial_unlock);
}
mRotarySelector.enableCustomAppDimple(mCustomAppToggle);
- mRotarySelector.setRevamped(mUseRotaryRevLockscreen);
- mRotarySelector.setLenseSquare(mUseRotaryRevLockscreen);
- if(mRotaryHideArrows)
+
+ int rotaryStyle = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.ROTARY_STYLE_PREF, RotaryStyle.getIdByStyle(RotaryStyle.Normal));
+ boolean revampedStyle = rotaryStyle == RotaryStyle.getIdByStyle(RotaryStyle.Revamped);
+
+ mRotarySelector.setRotary(!mUseLenseSquareLockscreen && !revampedStyle);
+ mRotarySelector.setRevamped(revampedStyle);
+ mRotarySelector.setLenseSquare(mUseLenseSquareLockscreen);
+
+ if (mRotaryHideArrows) {
mRotarySelector.hideArrows(true);
+ }
//hide most items when we are in potrait lense mode
mLensePortrait=(mUseLenseSquareLockscreen && mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE);
- if (mLensePortrait || mWidgetLayout == 1 )
+ if (mLensePortrait || mWidgetLayout == 1) {
setLenseWidgetsVisibility(View.INVISIBLE);
+ }
//Ring setup
+ int ringlockStyle = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Bubble));
+ int resSecNorm, resRingGreen, resRingHighlight;
+ int resUnlock, resCustom, resTarget;
+
+ switch (RinglockStyle.getStyleById(ringlockStyle)) {
+ case Revamped:
+ resSecNorm = R.drawable.jog_ring_rev_secback_normal;
+ resRingGreen = R.drawable.jog_ring_rev_ring_green;
+ resRingHighlight = R.drawable.jog_ring_rev_ring_pressed_red;
+ resUnlock = R.drawable.ic_jog_dial_unlock;
+ resCustom = R.drawable.ic_jog_dial_custom;
+ resTarget = R.drawable.jog_tab_target_green;
+ break;
+ case Holo:
+ resSecNorm = R.drawable.jog_ring_holo_secback_normal;
+ resRingGreen = R.drawable.jog_ring_holo_ring;
+ resRingHighlight = R.drawable.jog_ring_holo_ring_pressed;
+ resUnlock = R.drawable.ic_jog_dial_holo_unlock;
+ resCustom = R.drawable.ic_jog_dial_holo_custom;
+ resTarget = R.drawable.jog_tab_target_holo;
+ break;
+ case Blade:
+ resSecNorm = R.drawable.jog_ring_blade_secback_normal;
+ resRingGreen = R.drawable.jog_ring_blade_ring_green;
+ resRingHighlight = R.drawable.jog_ring_blade_ring_pressed_red;
+ resUnlock = R.drawable.ic_jog_dial_unlock;
+ resCustom = R.drawable.ic_jog_dial_custom;
+ resTarget = R.drawable.jog_tab_target_green;
+ break;
+ default:
+ resSecNorm = R.drawable.jog_ring_secback_normal;
+ resRingGreen = R.drawable.jog_ring_ring_green;
+ resRingHighlight = R.drawable.jog_ring_ring_pressed_red;
+ resUnlock = R.drawable.ic_jog_dial_unlock;
+ resCustom = R.drawable.ic_jog_dial_custom;
+ resTarget = R.drawable.jog_tab_target_green;
+ break;
+ }
+
+ mRingSelector.setHighlightBackgroundResource(resRingHighlight);
+
+ float density = getResources().getDisplayMetrics().density;
+ int ringAppIconSize = context.getResources().getInteger(R.integer.config_ringSecIconSizeDIP);
+ for (int q = 0; q < 4; q++) {
+ if (mCustomRingAppActivities[q] != null) {
+ mRingSelector.showSecRing(q);
+ try {
+ Intent i = Intent.parseUri(mCustomRingAppActivities[q], 0);
+ PackageManager pm = context.getPackageManager();
+ ActivityInfo ai = i.resolveActivityInfo(pm, PackageManager.GET_ACTIVITIES);
+ if (ai != null) {
+ Bitmap iconBmp = ((BitmapDrawable) ai.loadIcon(pm)).getBitmap();
+ mCustomRingAppIcons[q] = Bitmap.createScaledBitmap(iconBmp,
+ (int) (density * ringAppIconSize), (int) (density * ringAppIconSize), true);
+ mRingSelector.setSecRingResources(q, mCustomRingAppIcons[q], resSecNorm);
+ }
+ } catch (URISyntaxException e) {
+ }
+ } else {
+ mRingSelector.hideSecRing(q);
+ }
+ }
+
if (mRingMinimal) {
mRingSelector.enableRingMinimal(mRingMinimal);
//unlock with middle - left and right are hidden
- mRingSelector.setMiddleRingResources(
- R.drawable.ic_jog_dial_unlock,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
- }else if(mCustomAppToggle) {
+ mRingSelector.setMiddleRingResources(resUnlock, resTarget, resRingGreen);
+ } else if (mCustomAppToggle) {
mRingSelector.enableMiddleRing(mCustomAppToggle);
- if(mRingUnlockMiddle) {
+ if (mRingUnlockMiddle) {
mRingSelector.enableMiddlePrimary(mRingUnlockMiddle);
- mRingSelector.setLeftRingResources(
- R.drawable.ic_jog_dial_custom,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
+ mRingSelector.setLeftRingResources(resCustom, resTarget, resRingGreen);
//unlock with middle
- mRingSelector.setMiddleRingResources(
- R.drawable.ic_jog_dial_unlock,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
- }else{
+ mRingSelector.setMiddleRingResources(resUnlock, resTarget, resRingGreen);
+ } else {
//unlock on left
- mRingSelector.setLeftRingResources(
- R.drawable.ic_jog_dial_unlock,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
- mRingSelector.setMiddleRingResources(
- R.drawable.ic_jog_dial_custom,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
- }
- }else{
+ mRingSelector.setLeftRingResources(resUnlock, resTarget, resRingGreen);
+ mRingSelector.setMiddleRingResources(resCustom, resTarget, resRingGreen);
+ }
+ } else {
//no middle ring
- mRingSelector.setLeftRingResources(
- R.drawable.ic_jog_dial_unlock,
- R.drawable.jog_tab_target_green,
- R.drawable.jog_ring_ring_green);
+ mRingSelector.setLeftRingResources(resUnlock, resTarget, resRingGreen);
mRingSelector.enableRingMinimal(false);
}
@@ -599,6 +657,13 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mTabSelector.setOnTriggerListener(this);
mRingSelector.setOnRingTriggerListener(this);
+ //Standard slider setup
+ mTabSelector.setLeftTabResources(
+ R.drawable.ic_jog_dial_unlock,
+ R.drawable.jog_tab_target_green,
+ R.drawable.jog_tab_bar_left_unlock,
+ R.drawable.jog_tab_left_unlock);
+
if (mSelector2 != null) {
mSelector2.setLeftTabResources(R.drawable.ic_jog_dial_answer,
R.drawable.jog_tab_target_green, R.drawable.jog_tab_bar_left_generic,
@@ -673,31 +738,73 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
resetStatusInfo(updateMonitor);
- centerWidgets();
+ switch (mWidgetLayout) {
+ case 2:
+ centerWidgets();
+ break;
+ case 3:
+ alignWidgetsToRight();
+ break;
+ }
}
private void centerWidgets() {
- if (mWidgetLayout == 2) {
- RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams)
- mCarrier.getLayoutParams();
- layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
- mCarrier.setLayoutParams(layoutParams);
- mCarrier.setGravity(Gravity.CENTER_HORIZONTAL);
- layoutParams = (RelativeLayout.LayoutParams)mDate.getLayoutParams();
- layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
- mDate.setLayoutParams(layoutParams);
- layoutParams = (RelativeLayout.LayoutParams)mStatus1.getLayoutParams();
- layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
- layoutParams.leftMargin = 0;
- mStatus1.setLayoutParams(layoutParams);
- layoutParams = (RelativeLayout.LayoutParams)mStatus2.getLayoutParams();
- layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
- layoutParams.leftMargin = 0;
- mStatus2.setLayoutParams(layoutParams);
- layoutParams = (RelativeLayout.LayoutParams)mClock.getLayoutParams();
- layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
- mClock.setLayoutParams(layoutParams);
+ RelativeLayout.LayoutParams layoutParams;
+ layoutParams = (RelativeLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.CENTER_HORIZONTAL);
+
+ mStatusBox.setGravity(Gravity.CENTER_HORIZONTAL);
+
+ centerWidget(mClock);
+ centerWidget(mDate);
+ centerWidget(mStatusCharging);
+ centerWidget(mStatusAlarm);
+ centerWidget(mStatusCalendar);
+ }
+
+ private void centerWidget(View view) {
+ ViewGroup.LayoutParams params = view.getLayoutParams();
+ if (params instanceof RelativeLayout.LayoutParams) {
+ RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) params;
+ p.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
+ } else if (params instanceof LinearLayout.LayoutParams) {
+ LinearLayout.LayoutParams p = (LinearLayout.LayoutParams) params;
+ p.gravity = Gravity.CENTER_HORIZONTAL;
+ p.leftMargin = 0;
+ p.rightMargin = 0;
}
+ view.setLayoutParams(params);
+ }
+
+ private void alignWidgetsToRight() {
+ RelativeLayout.LayoutParams layoutParams;
+ layoutParams = (RelativeLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.LEFT);
+
+ mStatusBox.setGravity(Gravity.LEFT);
+
+ alignWidgetToRight(mClock);
+ alignWidgetToRight(mDate);
+ alignWidgetToRight(mStatusCharging);
+ alignWidgetToRight(mStatusAlarm);
+ alignWidgetToRight(mStatusCalendar);
+ }
+
+ private void alignWidgetToRight(View view) {
+ ViewGroup.LayoutParams params = view.getLayoutParams();
+ if (params instanceof RelativeLayout.LayoutParams) {
+ RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) params;
+ p.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 1);
+ p.addRule(RelativeLayout.ALIGN_PARENT_LEFT, 0);
+ } else if (params instanceof LinearLayout.LayoutParams) {
+ LinearLayout.LayoutParams p = (LinearLayout.LayoutParams) params;
+ p.gravity = Gravity.RIGHT;
+ }
+ view.setLayoutParams(params);
}
static void setBackground(Context bcontext, ViewGroup layout){
@@ -743,9 +850,39 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mSilentMode ? R.drawable.jog_tab_right_sound_on
: R.drawable.jog_tab_right_sound_off);
- mRingSelector.setRightRingResources(iconId, targetId,
- mSilentMode ? R.drawable.jog_ring_ring_yellow
- : R.drawable.jog_ring_ring_gray);
+ //Ringlock resource setup
+ int ringlockStyle = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Bubble));
+
+ int ringResource;
+
+ switch (RinglockStyle.getStyleById(ringlockStyle)) {
+ case Revamped:
+ ringResource = mSilentMode ? R.drawable.jog_ring_rev_ring_yellow :
+ R.drawable.jog_ring_rev_ring_gray;
+ break;
+ case Holo:
+ ringResource = R.drawable.jog_ring_holo_ring;
+ targetId = R.drawable.jog_tab_target_holo;
+ if (mSilentMode && vibe) {
+ iconId = R.drawable.ic_jog_dial_holo_vibrate_on;
+ } else if (mSilentMode) {
+ iconId = R.drawable.ic_jog_dial_holo_sound_off;
+ } else {
+ iconId = R.drawable.ic_jog_dial_holo_sound_on;
+ }
+ break;
+ case Blade:
+ ringResource = mSilentMode ? R.drawable.jog_ring_blade_ring_yellow :
+ R.drawable.jog_ring_blade_ring_gray;
+ break;
+ default:
+ ringResource = mSilentMode ? R.drawable.jog_ring_ring_yellow :
+ R.drawable.jog_ring_ring_gray;
+ break;
+ }
+
+ mRingSelector.setRightRingResources(iconId, targetId, ringResource);
}
private void resetStatusInfo(KeyguardUpdateMonitor updateMonitor) {
@@ -759,6 +896,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
refreshBatteryStringAndIcon();
refreshAlarmDisplay();
+ refreshCalendarDisplay();
refreshMusicStatus();
refreshPlayingTitle();
@@ -917,17 +1055,16 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private void refreshAlarmDisplay() {
mNextAlarm = mLockPatternUtils.getNextAlarm();
+ updateStatusLines();
+ }
- if (mNextAlarm != null) {
- mAlarmIcon = getContext().getResources().getDrawable(R.drawable.ic_lock_idle_alarm);
- } else if (mLockCalendarAlarm) {
- mNextAlarm = mLockPatternUtils.getNextCalendarAlarm(mLockCalendarLookahead,
+ private void refreshCalendarDisplay() {
+ if (mLockCalendarAlarm) {
+ mNextCalendar = mLockPatternUtils.getNextCalendarAlarm(mLockCalendarLookahead,
mCalendars, mLockCalendarRemindersOnly);
- if (mNextAlarm != null) {
- mAlarmIcon = getContext().getResources().getDrawable(R.drawable.ic_lock_idle_calendar);
- }
+ } else {
+ mNextCalendar = null;
}
-
updateStatusLines();
}
@@ -1043,33 +1180,32 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
private void updateStatusLines() {
- if (!mStatus.showStatusLines()
- || (mCharging == null && mNextAlarm == null) || mLensePortrait || mWidgetLayout == 1) {
- mStatus1.setVisibility(View.INVISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
- } else if (mCharging != null && mNextAlarm == null) {
- // charging only
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
-
- mStatus1.setText(mCharging);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(mChargingIcon, null, null, null);
- } else if (mNextAlarm != null && mCharging == null) {
- // next alarm only
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.INVISIBLE);
-
- mStatus1.setText(mNextAlarm);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(mAlarmIcon, null, null, null);
- } else if (mCharging != null && mNextAlarm != null) {
- // both charging and next alarm
- mStatus1.setVisibility(View.VISIBLE);
- mStatus2.setVisibility(View.VISIBLE);
-
- mStatus1.setText(mCharging);
- mStatus1.setCompoundDrawablesWithIntrinsicBounds(mChargingIcon, null, null, null);
- mStatus2.setText(mNextAlarm);
- mStatus2.setCompoundDrawablesWithIntrinsicBounds(mAlarmIcon, null, null, null);
+ if (!mStatus.showStatusLines() || mLensePortrait || mWidgetLayout == 1) {
+ mStatusBox.setVisibility(INVISIBLE);
+ } else {
+ mStatusBox.setVisibility(VISIBLE);
+
+ if (mCharging != null) {
+ mStatusCharging.setText(mCharging);
+ mStatusCharging.setCompoundDrawablesWithIntrinsicBounds(mChargingIcon, null, null, null);
+ mStatusCharging.setVisibility(VISIBLE);
+ } else {
+ mStatusCharging.setVisibility(GONE);
+ }
+
+ if (mNextAlarm != null) {
+ mStatusAlarm.setText(mNextAlarm);
+ mStatusAlarm.setVisibility(VISIBLE);
+ } else {
+ mStatusAlarm.setVisibility(GONE);
+ }
+
+ if (mNextCalendar != null) {
+ mStatusCalendar.setText(mNextCalendar);
+ mStatusCalendar.setVisibility(VISIBLE);
+ } else {
+ mStatusCalendar.setVisibility(GONE);
+ }
}
}
@@ -1129,13 +1265,19 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mEmergencyCallButton.setVisibility(View.GONE); // in almost all cases
+ String realPlmn = SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ALPHA);
+ String plmn = (String) mUpdateMonitor.getTelephonyPlmn();
+ String spn = (String) mUpdateMonitor.getTelephonySpn();
+
switch (status) {
case Normal:
// text
- mCarrier.setText(
- getCarrierString(
- mUpdateMonitor.getTelephonyPlmn(),
- mUpdateMonitor.getTelephonySpn()));
+ if (plmn == null || plmn.equals(realPlmn)) {
+ mCarrier.setText(getCarrierString(
+ plmn, spn, mCarrierLabelType, mCarrierLabelCustom));
+ } else {
+ mCarrier.setText(getCarrierString(plmn, spn));
+ }
// Empty now, but used for sliding tab feedback
mScreenLocked.setText("");
@@ -1218,10 +1360,8 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private void setUnlockWidgetsState(boolean show) {
if (show) {
- if (mUseRotaryLockscreen || mUseRotaryRevLockscreen || mUseLenseSquareLockscreen) {
+ if (mUseRotaryLockscreen || mUseLenseSquareLockscreen) {
mRotarySelector.setVisibility(View.VISIBLE);
- mRotarySelector.setRevamped(mUseRotaryRevLockscreen);
- mRotarySelector.setLenseSquare(mUseLenseSquareLockscreen);
mTabSelector.setVisibility(View.GONE);
mRingSelector.setVisibility(View.GONE);
if (mSelector2 != null) {
@@ -1257,17 +1397,38 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
static CharSequence getCarrierString(CharSequence telephonyPlmn, CharSequence telephonySpn) {
- if (telephonyPlmn != null && (telephonySpn == null || "".contentEquals(telephonySpn))) {
- return telephonyPlmn;
- } else if (telephonySpn != null && (telephonyPlmn == null || "".contentEquals(telephonyPlmn))) {
- return telephonySpn;
- } else if (telephonyPlmn != null && telephonySpn != null) {
- return telephonyPlmn + "|" + telephonySpn;
- } else {
- return "";
- }
+ return getCarrierString(telephonyPlmn, telephonySpn, CARRIER_TYPE_DEFAULT, "");
}
+ static CharSequence getCarrierString(CharSequence telephonyPlmn, CharSequence telephonySpn,
+ int carrierLabelType, String carrierLabelCustom) {
+ switch (carrierLabelType) {
+ default:
+ case CARRIER_TYPE_DEFAULT:
+ if (telephonyPlmn != null && TextUtils.isEmpty(telephonySpn)) {
+ return telephonyPlmn;
+ } else if (telephonySpn != null && TextUtils.isEmpty(telephonyPlmn)) {
+ return telephonySpn;
+ } else if (telephonyPlmn != null && telephonySpn != null) {
+ return telephonyPlmn + "|" + telephonySpn;
+ }
+ return "";
+ case CARRIER_TYPE_SPN:
+ if (telephonySpn != null) {
+ return telephonySpn;
+ }
+ break;
+ case CARRIER_TYPE_PLMN:
+ if (telephonyPlmn != null) {
+ return telephonyPlmn;
+ }
+ break;
+ case CARRIER_TYPE_CUSTOM:
+ return carrierLabelCustom;
+ }
+ return "";
+ }
+
public void onSimStateChanged(IccCard.State simState) {
if (DBG) Log.d(TAG, "onSimStateChanged(" + simState + ")");
mStatus = getCurrentStatus(simState);
diff --git a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
index 9e8ba8f0..90bd4c2 100644
--- a/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/PatternUnlockScreen.java
@@ -16,21 +16,29 @@
package com.android.internal.policy.impl;
+import com.android.internal.widget.DigitalClock;
+
import android.content.Context;
import android.content.res.Configuration;
import android.os.CountDownTimer;
import android.os.SystemClock;
+import android.provider.Settings;
+import android.view.Gravity;
+import android.os.SystemProperties;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.MotionEvent;
import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import android.text.format.DateFormat;
import android.text.TextUtils;
import android.util.Log;
import com.android.internal.R;
import com.android.internal.telephony.IccCard;
+import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternView;
@@ -78,6 +86,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
private String mDateFormatString;
private TextView mCarrier;
+ private DigitalClock mClock;
private TextView mDate;
// are we showing battery information?
@@ -102,6 +111,12 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
private ViewGroup mFooterNormal;
private ViewGroup mFooterForgotPattern;
+ private int mCarrierLabelType = (Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.CARRIER_LABEL_TYPE, LockScreen.CARRIER_TYPE_DEFAULT));
+
+ private String mCarrierLabelCustom = (Settings.System.getString(mContext.getContentResolver(),
+ Settings.System.CARRIER_LABEL_CUSTOM_STRING));
+
/**
* Keeps track of the last time we poked the wake lock during dispatching
* of the touch event, initalized to something gauranteed to make us
@@ -188,6 +203,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
ViewGroup lockWallpaper = (ViewGroup) findViewById(R.id.pattern);
LockScreen.setBackground(getContext(), lockWallpaper);
mCarrier = (TextView) findViewById(R.id.carrier);
+ mClock = (DigitalClock) findViewById(R.id.time);
mDate = (TextView) findViewById(R.id.date);
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
@@ -259,10 +275,90 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
mCarrier.setTextColor(0xffffffff);
// until we get an update...
- mCarrier.setText(
- LockScreen.getCarrierString(
- mUpdateMonitor.getTelephonyPlmn(),
- mUpdateMonitor.getTelephonySpn()));
+ String plmn = (String) mUpdateMonitor.getTelephonyPlmn();
+ String spn = (String) mUpdateMonitor.getTelephonySpn();
+ onRefreshCarrierInfo(plmn, spn);
+
+ int widgetLayout = Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.LOCKSCREEN_WIDGETS_LAYOUT, 0);
+
+ switch (widgetLayout) {
+ case 2:
+ centerWidgets();
+ break;
+ case 3:
+ alignWidgetsToRight();
+ break;
+ }
+ }
+
+ private void centerWidgets() {
+ if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
+ RelativeLayout.LayoutParams layoutParams =
+ (RelativeLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ layoutParams.addRule(RelativeLayout.RIGHT_OF, 0);
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 0);
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.CENTER_HORIZONTAL);
+ layoutParams = (RelativeLayout.LayoutParams) mDate.getLayoutParams();
+ layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
+ mDate.setLayoutParams(layoutParams);
+ layoutParams = (RelativeLayout.LayoutParams) mClock.getLayoutParams();
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, 0);
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
+ layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, 1);
+ layoutParams.addRule(RelativeLayout.BELOW, R.id.carrier);
+ mClock.setLayoutParams(layoutParams);
+ } else {
+ LinearLayout.LayoutParams layoutParams =
+ (LinearLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.CENTER_HORIZONTAL);
+ layoutParams = (LinearLayout.LayoutParams) mDate.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mDate.setLayoutParams(layoutParams);
+ mDate.setGravity(Gravity.CENTER_HORIZONTAL);
+ layoutParams = (LinearLayout.LayoutParams) mClock.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mClock.setGravity(Gravity.CENTER_HORIZONTAL);
+ mClock.setLayoutParams(layoutParams);
+ }
+ }
+
+ private void alignWidgetsToRight() {
+ if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
+ RelativeLayout.LayoutParams layoutParams =
+ (RelativeLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ layoutParams.addRule(RelativeLayout.RIGHT_OF, 0);
+ layoutParams.addRule(RelativeLayout.LEFT_OF, R.id.time);
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.LEFT);
+ layoutParams = (RelativeLayout.LayoutParams) mDate.getLayoutParams();
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 1);
+ mDate.setLayoutParams(layoutParams);
+ layoutParams = (RelativeLayout.LayoutParams) mClock.getLayoutParams();
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, 0);
+ layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 1);
+ mClock.setLayoutParams(layoutParams);
+ } else {
+ LinearLayout.LayoutParams layoutParams =
+ (LinearLayout.LayoutParams) mCarrier.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mCarrier.setLayoutParams(layoutParams);
+ mCarrier.setGravity(Gravity.RIGHT);
+ layoutParams = (LinearLayout.LayoutParams) mDate.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mDate.setLayoutParams(layoutParams);
+ mDate.setGravity(Gravity.RIGHT);
+ layoutParams = (LinearLayout.LayoutParams) mClock.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ mClock.setGravity(Gravity.RIGHT);
+ mClock.setLayoutParams(layoutParams);
+ }
}
private void refreshEmergencyButtonText() {
@@ -400,7 +496,14 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
/** {@inheritDoc} */
public void onRefreshCarrierInfo(CharSequence plmn, CharSequence spn) {
- mCarrier.setText(LockScreen.getCarrierString(plmn, spn));
+ String realPlmn = SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ALPHA);
+
+ if (plmn == null || plmn.equals(realPlmn)) {
+ mCarrier.setText(LockScreen.getCarrierString(
+ plmn, spn, mCarrierLabelType, mCarrierLabelCustom));
+ } else {
+ mCarrier.setText(LockScreen.getCarrierString(plmn, spn));
+ }
}
/** {@inheritDoc} */
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 09b3dc2..a4b5976 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -44,6 +44,7 @@ import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
+import android.media.AudioSystem;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
@@ -1177,15 +1178,25 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
Context.AUDIO_SERVICE);
if (audioManager != null) {
/*
- * Adjust the volume in on key down since it is more
- * responsive to the user.
+ * Adjust the volume in on key down
+ * since it is more responsive to the user.
+ * (if volume key lock condition unsatisfied)
*/
- audioManager.adjustSuggestedStreamVolume(
- keyCode == KeyEvent.KEYCODE_VOLUME_UP
- ? AudioManager.ADJUST_RAISE
- : AudioManager.ADJUST_LOWER,
- mVolumeControlStreamType,
- AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_VIBRATE);
+ if (shouldSuppressVolumeKey(audioManager)) {
+ //Show volume popup to acknowledge button press and
+ //show that volume did not change
+ audioManager.adjustSuggestedStreamVolume(
+ AudioManager.ADJUST_SAME,
+ mVolumeControlStreamType,
+ AudioManager.FLAG_SHOW_UI);
+ } else {
+ audioManager.adjustSuggestedStreamVolume(
+ keyCode == KeyEvent.KEYCODE_VOLUME_UP
+ ? AudioManager.ADJUST_RAISE
+ : AudioManager.ADJUST_LOWER,
+ mVolumeControlStreamType,
+ AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_VIBRATE);
+ }
}
return true;
}
@@ -1318,6 +1329,44 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
return false;
}
+ private boolean shouldSuppressVolumeKey(AudioManager audioManager) {
+ boolean lockVolumeKeys = Settings.System.getInt(
+ getContext().getContentResolver(), Settings.System.LOCK_VOLUME_KEYS, 0) == 1;
+
+ if (!lockVolumeKeys) {
+ /* don't suppress if the user doesn't want it */
+ return false;
+ }
+ if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) {
+ /* only suppress in silent mode */
+ return false;
+ }
+ if (mVolumeControlStreamType != AudioManager.USE_DEFAULT_STREAM_TYPE &&
+ mVolumeControlStreamType != AudioManager.STREAM_RING) {
+ /* only suppress ringtone volume changes */
+ return false;
+ }
+ if (AudioSystem.getForceUse(AudioSystem.FOR_COMMUNICATION) == AudioSystem.FORCE_BT_SCO) {
+ /* don't suppress BT volume changes */
+ return false;
+ }
+ if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC)) {
+ /* don't suppress music volume keys */
+ return false;
+ }
+ if (mTelephonyManager == null) {
+ mTelephonyManager = (TelephonyManager)
+ getContext().getSystemService(Context.TELEPHONY_SERVICE);
+ }
+ if (AudioSystem.isStreamActive(AudioSystem.STREAM_VOICE_CALL) ||
+ mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
+ /* don't suppress call volume changes */
+ return false;
+ }
+
+ return true;
+ }
+
/**
* @return A handle to the keyguard manager.
*/
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index a7c72b4..85d3b5d 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -229,6 +229,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mLidOpenRotation;
int mCarDockRotation;
int mDeskDockRotation;
+
+ int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
+ int mUserRotation = Surface.ROTATION_0;
+
+ boolean mAllowAllRotations;
boolean mCarDockEnablesAccelerometer;
boolean mDeskDockEnablesAccelerometer;
int mLidKeyboardAccessibility;
@@ -740,6 +745,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.integer.config_carDockRotation);
mDeskDockRotation = readRotation(
com.android.internal.R.integer.config_deskDockRotation);
+ mAllowAllRotations = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_allowAllRotations);
mCarDockEnablesAccelerometer = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_carDockEnablesAccelerometer);
mDeskDockEnablesAccelerometer = mContext.getResources().getBoolean(
@@ -2468,7 +2475,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return getCurrentPortraitRotation(lastRotation);
}
- mOrientationListener.setAllow180Rotation(
+ mOrientationListener.setAllow180Rotation(mAllowAllRotations ||
orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
// case for nosensor meaning ignore sensor and consider only lid
diff --git a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
index c63370f..e5ae964 100644
--- a/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/SimUnlockScreen.java
@@ -82,6 +82,9 @@ public class SimUnlockScreen extends LinearLayout implements KeyguardScreen, Vie
LayoutInflater inflater = LayoutInflater.from(context);
if (mKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
inflater.inflate(R.layout.keyguard_screen_sim_pin_landscape, this, true);
+ } else if (mCreationOrientation == Configuration.ORIENTATION_LANDSCAPE) {
+ inflater.inflate(R.layout.keyguard_screen_sim_pin_land_nokey, this, true);
+ new TouchInput();
} else {
inflater.inflate(R.layout.keyguard_screen_sim_pin_portrait, this, true);
new TouchInput();
diff --git a/services/camera/libcameraservice/Android.mk b/services/camera/libcameraservice/Android.mk
index 7b21f7d..b462a90 100644
--- a/services/camera/libcameraservice/Android.mk
+++ b/services/camera/libcameraservice/Android.mk
@@ -30,6 +30,10 @@ endif
LOCAL_SHARED_LIBRARIES:= libui
+ifeq ($(BOARD_USE_CAF_LIBCAMERA_GB_REL),true)
+LOCAL_CFLAGS += -DCAF_CAMERA_GB_REL
+endif
+
ifeq ($(BOARD_CAMERA_USE_GETBUFFERINFO),true)
LOCAL_CFLAGS += -DUSE_GETBUFFERINFO
endif
@@ -79,6 +83,11 @@ ifeq ($(BOARD_USE_REVERSE_FFC), true)
LOCAL_CFLAGS += -DBOARD_USE_REVERSE_FFC
endif
+ifeq ($(BOARD_USE_CAF_LIBCAMERA_GB_REL),true)
+LOCAL_CFLAGS += -DCAF_CAMERA_GB_REL
+LOCAL_C_INCLUDES += hardware/msm7k/libgralloc-qsd8k
+endif
+
ifeq ($(BOARD_CAMERA_USE_GETBUFFERINFO),true)
LOCAL_CFLAGS += -DUSE_GETBUFFERINFO
endif
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 4a32f8b..a575451 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <fcntl.h>
+
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/MemoryBase.h>
@@ -40,7 +41,7 @@
#include "CameraService.h"
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP) || defined(CAF_CAMERA_GB_REL)
#include "gralloc_priv.h"
#endif
@@ -450,6 +451,9 @@ CameraService::Client::Client(const sp<CameraService>& cameraService,
mCameraId = cameraId;
mCameraFacing = cameraFacing;
mClientPid = clientPid;
+#ifdef CAF_CAMERA_GB_REL
+ mUseOverlay = mHardware->useOverlay();
+#endif
mMsgEnabled = 0;
#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
if (mHardware != NULL) {
@@ -629,10 +633,14 @@ void CameraService::Client::disconnect() {
#endif
// Release the held overlay resources.
if (mUseOverlay) {
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP) || defined(CAF_CAMERA_GB_REL)
/* Release previous overlay handle */
if (mOverlay != NULL) {
mOverlay->destroy();
+#ifdef CAF_CAMERA_GB_REL
+ mOverlay = NULL;
+ mHardware->setOverlay(NULL);
+#endif
}
#endif
mOverlayRef = 0;
@@ -677,19 +685,10 @@ status_t CameraService::Client::setPreviewDisplay(const sp<ISurface>& surface) {
mOverlayRef = 0;
// If preview has been already started, set overlay or register preview
// buffers now.
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
if (mHardware->previewEnabled() || mUseOverlay) {
-#else
- if (mHardware->previewEnabled()) {
-#endif
if (mUseOverlay) {
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
- if (mSurface != NULL) {
-#endif
+ if (mSurface != NULL)
result = setOverlay();
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
- }
-#endif
} else if (mSurface != 0) {
result = registerPreviewBuffers();
}
@@ -712,9 +711,21 @@ status_t CameraService::Client::registerPreviewBuffers() {
}
#endif
+#ifdef CAF_CAMERA_GB_REL
+ /* Check for the preview format requested by the application and pass
+ * the same information while registering */
+ const char * previewFormat = params.get(CameraParameters::KEY_PREVIEW_FORMAT);
+ //if(!strcmp(previewFormat, CameraParameters::PIXEL_FORMAT_YUV420SP_ADRENO))
+ // mPixelFormat = HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO;
+ LOGI("registerPreviewBuffers: previewFormat = %s and PixelFormat = %d",
+ previewFormat, mPixelFormat);
+#else
// FIXME: don't use a hardcoded format here.
+ mPixelFormat = HAL_PIXEL_FORMAT_YCrCb_420_SP;
+#endif
+
ISurface::BufferHeap buffers(w, h, w, h,
- HAL_PIXEL_FORMAT_YCrCb_420_SP,
+ mPixelFormat,
mOrientation,
0,
mHardware->getPreviewHeap());
@@ -726,7 +737,11 @@ status_t CameraService::Client::registerPreviewBuffers() {
return result;
}
+#ifdef CAF_CAMERA_GB_REL
+status_t CameraService::Client::setOverlay(int pw, int ph) {
+#else
status_t CameraService::Client::setOverlay() {
+#endif
int w, h;
#ifdef OMAP_ENHANCEMENT
uint32_t overlayFormat;
@@ -735,7 +750,16 @@ status_t CameraService::Client::setOverlay() {
#endif
CameraParameters params(mHardware->getParameters());
+#ifdef CAF_CAMERA_GB_REL
+ if(pw == 0 && ph == 0)
+ params.getPreviewSize(&w, &h);
+ else {
+ w = pw;
+ h = ph;
+ }
+#else
params.getPreviewSize(&w, &h);
+#endif
#ifdef BOARD_USE_FROYO_LIBCAMERA
//for 720p recording , preview can be 800X448
@@ -795,6 +819,14 @@ status_t CameraService::Client::setOverlay() {
mOverlay->destroy();
}
#endif
+#ifdef CAF_CAMERA_GB_REL
+ if (mOverlay != NULL) {
+ mOverlay->destroy();
+ mOverlay = NULL;
+ mHardware->setOverlay(NULL);
+ }
+#endif
+
mOrientationChanged = false;
#ifdef OMAP_ENHANCEMENT
mS3DOverlay = isS3d;
@@ -818,7 +850,7 @@ status_t CameraService::Client::setOverlay() {
mOrientation, isS3d);
#else
mOverlayRef = mSurface->createOverlay(w, h,
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(CAF_CAMERA_GB_REL)
HAL_PIXEL_FORMAT_YCbCr_420_SP,
#elif defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
HAL_PIXEL_FORMAT_YCrCb_420_SP,
@@ -835,7 +867,7 @@ status_t CameraService::Client::setOverlay() {
LOGE("Overlay Creation Failed!");
return -EINVAL;
}
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP) || defined(CAF_CAMERA_GB_REL)
mOverlay = new Overlay(mOverlayRef);
result = mHardware->setOverlay(mOverlay);
#else
@@ -940,10 +972,15 @@ status_t CameraService::Client::startPreviewMode() {
}
if (mUseOverlay) {
+#ifdef CAF_CAMERA_GB_REL
+ result = mHardware->startPreview();
+ if (result != NO_ERROR) return result;
+#endif
// If preview display has been set, set overlay now.
if (mSurface != 0) {
result = setOverlay();
}
+#ifndef CAF_CAMERA_GB_REL
#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
result = mHardware->startPreview();
#endif
@@ -951,6 +988,7 @@ status_t CameraService::Client::startPreviewMode() {
#if !defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) && !defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
result = mHardware->startPreview();
#endif
+#endif
} else {
enableMsgType(CAMERA_MSG_PREVIEW_FRAME);
result = mHardware->startPreview();
@@ -979,6 +1017,19 @@ status_t CameraService::Client::getBufferInfo(sp<IMemory>& Frame, size_t *aligne
}
#endif
+#ifdef CAF_CAMERA_GB_REL
+void CameraService::Client::encodeData()
+{
+ LOGD("encodeData: E");
+ if(mHardware == NULL) {
+ LOGE("mHardware is NULL, returning.");
+ return;
+ }
+ mHardware->encodeData();
+ LOGD("encodeData: X");
+}
+#endif
+
status_t CameraService::Client::startRecordingMode() {
LOG1("startRecordingMode");
status_t result = NO_ERROR;
@@ -1011,6 +1062,21 @@ void CameraService::Client::stopPreview() {
LOG1("stopPreview (pid %d)", getCallingPid());
Mutex::Autolock lock(mLock);
if (checkPidAndHardware() != NO_ERROR) return;
+#ifdef CAF_CAMERA_GB_REL
+ LOGV("stopPreview :Destroying any previous overlay");
+ /*Force the destruction of any previous overlay
+ so that display will not refer to a buffer that
+ will be deallocated when hardware is stopped below */
+ sp<Overlay> dummy;
+ mHardware->setOverlay( dummy );
+ mOverlayRef = 0;
+ if(mOverlay != NULL){
+ mOverlay->destroy();
+ mHardware->setOverlay(NULL);
+ mOverlay = NULL;
+ }
+#endif
+
#ifdef OMAP_ENHANCEMENT
//According to framework documentation, preview needs
@@ -1033,7 +1099,7 @@ void CameraService::Client::stopPreview() {
if (mSurface != 0 && !mUseOverlay) {
mSurface->unregisterBuffers();
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP) || defined(CAF_CAMERA_GB_REL)
} else {
mOverlayW = 0;
mOverlayH = 0;
@@ -1130,6 +1196,35 @@ status_t CameraService::Client::setParameters(const String8& params) {
CameraParameters p(params);
+#ifdef CAF_CAMERA_GB_REL
+ if(mUseOverlay) {
+ const char *str = p.get("strtextures");
+ if( (str != NULL) &&
+ (!strncmp(str, "on", 2) || !strncmp(str, "ON", 2))){
+ LOGI("strtextures is ON");
+ /* destroy any overlay created */
+ if( mOverlay != NULL) {
+ LOGI("Destroying Overlay");
+ mOverlay->destroy();
+ if(mHardware != NULL)
+ mHardware->setOverlay(NULL);
+ mOverlay = NULL;
+ }
+ mOverlayRef = 0;
+
+ /* register preview buffers if mSurface is valid
+ * This check will make sure whether setPreviewDisplay has been
+ * executed or not */
+ if(mSurface != NULL) {
+ registerPreviewBuffers();
+ }
+ /* reset the mUseoverlay flag */
+ LOGI("Resetting mUseOverlay to false");
+ mUseOverlay = false;
+ }
+ }
+#endif
+
return mHardware->setParameters(p);
}
@@ -1176,22 +1271,45 @@ status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t a
status_t result = checkPidAndHardware();
if (result != NO_ERROR) return result;
- if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
- // The orientation cannot be set during preview.
- if (mHardware->previewEnabled()) {
- return INVALID_OPERATION;
- }
- // Mirror the preview if the camera is front-facing.
- orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
- if (orientation == -1) return BAD_VALUE;
+ switch(cmd) {
+ case CAMERA_CMD_SET_DISPLAY_ORIENTATION:
+ // The orientation cannot be set during preview.
+ if (mHardware->previewEnabled()) {
+ return INVALID_OPERATION;
+ }
+ // Mirror the preview if the camera is front-facing.
+ orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
+ if (orientation == -1) return BAD_VALUE;
- if (mOrientation != orientation) {
- mOrientation = orientation;
- if (mOverlayRef != 0) mOrientationChanged = true;
- }
- return OK;
- }
+ if (mOrientation != orientation) {
+ mOrientation = orientation;
+ if (mOverlayRef != 0) mOrientationChanged = true;
+ }
+ return OK;
+
+#ifdef CAF_CAMERA_GB_REL
+ case CAMERA_CMD_HISTOGRAM_ON:
+ enableMsgType(CAMERA_MSG_STATS_DATA);
+ break;
+
+ case CAMERA_CMD_HISTOGRAM_OFF:
+ disableMsgType(CAMERA_MSG_STATS_DATA);
+ break;
+ case CAMERA_CMD_HISTOGRAM_SEND_DATA:
+ break;
+ case CAMERA_CMD_FACE_DETECTION_ON:
+ enableMsgType(CAMERA_MSG_META_DATA);
+ break;
+
+ case CAMERA_CMD_FACE_DETECTION_OFF:
+ disableMsgType(CAMERA_MSG_META_DATA);
+ break;
+
+ case CAMERA_CMD_SEND_META_DATA:
+ break;
+#endif
+ }
return mHardware->sendCommand(cmd, arg1, arg2);
}
@@ -1315,8 +1433,15 @@ void CameraService::Client::dataCallback(int32_t msgType,
sp<Client> client = getClientFromCookie(user);
if (client == 0) return;
if (!client->lockIfMessageWanted(msgType)) return;
-
+#ifdef CAF_CAMERA_GB_REL
+ //In case of CAMERA_MSG_COMPRESSED_IMAGE dataCallback,
+ //when native_get_picture fails at driver, we need to
+ //send the callback with null data to application to recover
+ //into preview mode for next operations.
+ if ((dataPtr == 0) && (msgType != CAMERA_MSG_COMPRESSED_IMAGE)) {
+#else
if (dataPtr == 0) {
+#endif
LOGE("Null data returned in data callback");
client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
#if (defined(TARGET_OMAP3) && defined(OMAP_ENHANCEMENT))
@@ -1386,19 +1511,22 @@ void CameraService::Client::handleShutter(image_rect_type *size
#ifdef BOARD_USE_CAF_LIBCAMERA
, bool playShutterSoundOnly
#endif
-) {
+ ) {
#ifdef BOARD_USE_CAF_LIBCAMERA
if(playShutterSoundOnly) {
#endif
- mCameraService->playSound(SOUND_SHUTTER);
+ mCameraService->playSound(SOUND_SHUTTER);
#ifdef BOARD_USE_CAF_LIBCAMERA
- sp<ICameraClient> c = mCameraClient;
- if (c != 0) {
- mLock.unlock();
- c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
- }
- return;
+ sp<ICameraClient> c = mCameraClient;
+ if (c != 0) {
+ mLock.unlock();
+ c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
+ //Following method was used to get the lock after callback
+ //With shutter sound change acquiring lock is performed in caller
+ //if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
+ }
+ return;
}
#endif
@@ -1407,17 +1535,34 @@ void CameraService::Client::handleShutter(image_rect_type *size
mSurface->unregisterBuffers();
}
+#ifndef CAF_CAMERA_GB_REL
sp<ICameraClient> c = mCameraClient;
if (c != 0) {
mLock.unlock();
c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
}
+#endif
disableMsgType(CAMERA_MSG_SHUTTER);
+#ifdef CAF_CAMERA_GB_REL
+ int w, h;
+ CameraParameters params(mHardware->getParameters());
+ if (size == NULL) {
+ params.getPictureSize(&w, &h);
+ } else {
+ w = size->width;
+ h = size->height;
+ w &= ~1;
+ h &= ~1;
+ }
+ LOG1("Snapshot image width=%d, height=%d", w, h);
+#endif
+
// It takes some time before yuvPicture callback to be called.
// Register the buffer for raw image here to reduce latency.
if (mSurface != 0 && !mUseOverlay) {
+#ifndef CAF_CAMERA_GB_REL
int w, h;
CameraParameters params(mHardware->getParameters());
if (size == NULL) {
@@ -1427,17 +1572,23 @@ void CameraService::Client::handleShutter(image_rect_type *size
h = size->height;
w &= ~1;
h &= ~1;
- LOG1("Snapshot image width=%d, height=%d", w, h);
}
- // FIXME: don't use hardcoded format constants here
+ LOG1("Snapshot image width=%d, height=%d", w, h);
+#endif
+
ISurface::BufferHeap buffers(w, h, w, h,
- HAL_PIXEL_FORMAT_YCrCb_420_SP, mOrientation, 0,
+ mPixelFormat, mOrientation, 0,
mHardware->getRawHeap());
mSurface->registerBuffers(buffers);
IPCThreadState::self()->flushCommands();
}
+#ifdef CAF_CAMERA_GB_REL
+ if (mUseOverlay)
+ setOverlay(w, h);
+#endif
+
mLock.unlock();
}
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index d6bd4ab..81b18b4 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -103,6 +103,11 @@ private:
// get the recording buffers information from HAL Layer.
virtual status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);
#endif
+#ifdef CAF_CAMERA_GB_REL
+ // encode the YUV data
+ virtual void encodeData();
+#endif
+
virtual status_t startPreview();
virtual void stopPreview();
virtual bool previewEnabled();
@@ -139,7 +144,11 @@ private:
// these are internal functions used to set up preview buffers
status_t registerPreviewBuffers();
+#ifdef CAF_CAMERA_GB_REL
+ status_t setOverlay(int w = 0, int h = 0);
+#else
status_t setOverlay();
+#endif
// camera operation mode
enum camera_mode {
@@ -204,11 +213,12 @@ private:
sp<CameraHardwareInterface> mHardware; // cleared after disconnect()
bool mUseOverlay; // immutable after constructor
sp<OverlayRef> mOverlayRef;
-#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP)
+#if defined(USE_OVERLAY_FORMAT_YCbCr_420_SP) || defined(USE_OVERLAY_FORMAT_YCrCb_420_SP) || defined(CAF_CAMERA_GB_REL)
sp<Overlay> mOverlay;
#endif
int mOverlayW;
int mOverlayH;
+ int mPixelFormat;
int mPreviewCallbackFlag;
int mOrientation; // Current display orientation
// True if display orientation has been changed. This is only used in overlay.
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 10107c6..7bff4b4 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -54,6 +54,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.WorkSource;
import android.provider.Settings;
+import android.text.TextUtils;
import android.util.Log;
import android.util.Slog;
import android.util.PrintWriterPrinter;
@@ -61,6 +62,7 @@ import android.util.PrintWriterPrinter;
import com.android.internal.content.PackageMonitor;
import com.android.internal.location.GpsNetInitiatedHandler;
+import com.android.server.location.BTGpsLocationProvider;
import com.android.server.location.GeocoderProxy;
import com.android.server.location.GpsLocationProvider;
import com.android.server.location.LocationProviderInterface;
@@ -462,16 +464,48 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
}
}
+ public void setGPSSource(String device) {
+ synchronized (mLock) {
+ if (mGpsLocationProvider != null &&
+ mProvidersByName.containsKey(mGpsLocationProvider.getName())) {
+ Slog.i(TAG, "Disable and removing provider " + mGpsLocationProvider.getName());
+ mGpsLocationProvider.disable();
+ Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(),
+ LocationManager.GPS_PROVIDER, false);
+ removeProvider(mGpsLocationProvider);
+ mGpsLocationProvider = null;
+ }
+ Slog.i(TAG, "Setting GPS Source to: " + device);
+ if ("0".equals(device)) {
+ if (mGpsLocationProvider != null && !GpsLocationProvider.isSupported())
+ return;
+ GpsLocationProvider gpsProvider = new GpsLocationProvider(mContext, this);
+ mGpsStatusProvider = gpsProvider.getGpsStatusProvider();
+ mNetInitiatedListener = gpsProvider.getNetInitiatedListener();
+ addProvider(gpsProvider);
+ mGpsLocationProvider = gpsProvider;
+ } else {
+ BTGpsLocationProvider gpsProvider = new BTGpsLocationProvider(mContext, this);
+ mGpsStatusProvider = gpsProvider.getGpsStatusProvider();
+ mNetInitiatedListener = null;
+ addProvider(gpsProvider);
+ mGpsLocationProvider = gpsProvider;
+ }
+ }
+ }
+
private void _loadProvidersLocked() {
// Attempt to load "real" providers first
- if (GpsLocationProvider.isSupported()) {
- // Create a gps location provider
- GpsLocationProvider gpsProvider = new GpsLocationProvider(mContext, this);
- mGpsStatusProvider = gpsProvider.getGpsStatusProvider();
- mNetInitiatedListener = gpsProvider.getNetInitiatedListener();
- addProvider(gpsProvider);
- mGpsLocationProvider = gpsProvider;
- }
+ // Create a gps location provider based on the setting EXTERNAL_GPS_BT_DEVICE
+ String btDevice = Settings.System.getString(mContext.getContentResolver(),
+ Settings.Secure.EXTERNAL_GPS_BT_DEVICE);
+ if (TextUtils.isEmpty(btDevice)) {
+ // default option
+ btDevice = "0";
+ Settings.System.putString(mContext.getContentResolver(),
+ Settings.Secure.EXTERNAL_GPS_BT_DEVICE, btDevice);
+ }
+ setGPSSource(btDevice);
// create a passive location provider, which is always enabled
PassiveProvider passiveProvider = new PassiveProvider(this);
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index e102d62..785abb4 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -177,6 +177,7 @@ public class NotificationManagerService extends INotificationManager.Stub
// for adb connected notifications
private boolean mUsbConnected = false;
private boolean mAdbNotificationShown = false;
+ private boolean mAdbNotificationIsUsb = false;
private Notification mAdbNotification;
private final ArrayList<NotificationRecord> mNotificationList =
@@ -449,10 +450,18 @@ public class NotificationManagerService extends INotificationManager.Stub
}
} else if (action.equals(UsbManager.ACTION_USB_STATE)) {
Bundle extras = intent.getExtras();
+ ContentResolver resolver = mContext.getContentResolver();
+
mUsbConnected = extras.getBoolean(UsbManager.USB_CONNECTED);
- boolean adbEnabled = (UsbManager.USB_FUNCTION_ENABLED.equals(
- extras.getString(UsbManager.USB_FUNCTION_ADB)));
- updateAdbNotification(mUsbConnected && adbEnabled);
+ boolean adbUsbEnabled = (UsbManager.USB_FUNCTION_ENABLED.equals(
+ extras.getString(UsbManager.USB_FUNCTION_ADB)));
+
+ boolean adbEnabled = Settings.Secure.getInt(resolver,
+ Settings.Secure.ADB_ENABLED, 0) > 0;
+ boolean adbOverNetwork = Settings.Secure.getInt(resolver,
+ Settings.Secure.ADB_PORT, 0) > 0;
+
+ updateAdbNotification(adbUsbEnabled && mUsbConnected, adbEnabled && adbOverNetwork);
} else if (action.equals(Intent.ACTION_PACKAGE_REMOVED)
|| action.equals(Intent.ACTION_PACKAGE_RESTARTED)
|| (queryRestart=action.equals(Intent.ACTION_QUERY_PACKAGE_RESTART))
@@ -601,14 +610,20 @@ public class NotificationManagerService extends INotificationManager.Stub
Settings.Secure.ADB_ENABLED), false, this);
resolver.registerContentObserver(Settings.Secure.getUriFor(
Settings.Secure.ADB_NOTIFY), false, this);
+ resolver.registerContentObserver(Settings.Secure.getUriFor(
+ Settings.Secure.ADB_PORT), false, this);
}
@Override public void onChange(boolean selfChange) {
ContentResolver resolver = mContext.getContentResolver();
boolean adbEnabled = Settings.Secure.getInt(resolver,
Settings.Secure.ADB_ENABLED, 0) != 0;
+ boolean adbOverNetwork = Settings.Secure.getInt(resolver,
+ Settings.Secure.ADB_PORT, 0) > 0;
+
/* notify setting is checked inside updateAdbNotification() */
- updateAdbNotification(adbEnabled && mUsbConnected);
+ updateAdbNotification(adbEnabled && mUsbConnected,
+ adbEnabled && adbOverNetwork);
}
}
@@ -1741,35 +1756,51 @@ public class NotificationManagerService extends INotificationManager.Stub
// This is here instead of StatusBarPolicy because it is an important
// security feature that we don't want people customizing the platform
// to accidentally lose.
- private void updateAdbNotification(boolean adbEnabled) {
+ private void updateAdbNotification(boolean usbEnabled, boolean networkEnabled) {
if ("0".equals(SystemProperties.get("persist.adb.notify")) ||
Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.ADB_NOTIFY, 1) == 0) {
- adbEnabled = false;
+ usbEnabled = false;
+ networkEnabled = false;
}
- if (adbEnabled) {
- if (!mAdbNotificationShown) {
+ if (usbEnabled || networkEnabled) {
+ boolean needUpdate = !mAdbNotificationShown ||
+ (networkEnabled && mAdbNotificationIsUsb) ||
+ (!networkEnabled && !mAdbNotificationIsUsb);
+
+ if (needUpdate) {
NotificationManager notificationManager = (NotificationManager) mContext
.getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
Resources r = mContext.getResources();
- CharSequence title = r.getText(
- com.android.internal.R.string.adb_active_notification_title);
- CharSequence message = r.getText(
- com.android.internal.R.string.adb_active_notification_message);
+
+ /*
+ * Network takes precedence, as adbd doesn't listen to USB commands
+ * while it's switched to network
+ */
+ int titleId = networkEnabled ?
+ com.android.internal.R.string.adb_net_enabled_notification_title :
+ com.android.internal.R.string.adb_active_notification_title;
+ int messageId = networkEnabled ?
+ com.android.internal.R.string.adb_net_enabled_notification_message :
+ com.android.internal.R.string.adb_active_notification_message;
+
+ CharSequence title = r.getText(titleId);
+ CharSequence message = r.getText(messageId);
if (mAdbNotification == null) {
mAdbNotification = new Notification();
mAdbNotification.icon = com.android.internal.R.drawable.stat_sys_adb;
mAdbNotification.when = 0;
mAdbNotification.flags = Notification.FLAG_ONGOING_EVENT;
- mAdbNotification.tickerText = title;
mAdbNotification.defaults = 0; // please be quiet
mAdbNotification.sound = null;
mAdbNotification.vibrate = null;
}
+ mAdbNotification.tickerText = title;
+
Intent intent = new Intent(
Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
@@ -1785,19 +1816,17 @@ public class NotificationManagerService extends INotificationManager.Stub
mAdbNotification.setLatestEventInfo(mContext, title, message, pi);
mAdbNotificationShown = true;
- notificationManager.notify(
- com.android.internal.R.string.adb_active_notification_title,
- mAdbNotification);
+ mAdbNotificationIsUsb = !networkEnabled;
+
+ notificationManager.notify(mAdbNotification.icon, mAdbNotification);
}
}
-
} else if (mAdbNotificationShown) {
NotificationManager notificationManager = (NotificationManager) mContext
.getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
mAdbNotificationShown = false;
- notificationManager.cancel(
- com.android.internal.R.string.adb_active_notification_title);
+ notificationManager.cancel(mAdbNotification.icon);
}
}
}
diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java
new file mode 100644
index 0000000..b846b6f
--- /dev/null
+++ b/services/java/com/android/server/ScreenRotationAnimation.java
@@ -0,0 +1,329 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server; // TODO: use com.android.server.wm, once things move there
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.util.DisplayMetrics;
+import android.util.Slog;
+import android.view.Display;
+import android.view.Surface;
+import android.view.SurfaceSession;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Transformation;
+
+class ScreenRotationAnimation {
+ static final String TAG = "ScreenRotationAnimation";
+ static final boolean DEBUG = false;
+
+ final Context mContext;
+ final Display mDisplay;
+ Surface mSurface;
+ int mWidth, mHeight;
+
+ int mSnapshotRotation;
+ int mSnapshotDeltaRotation;
+ int mOriginalRotation;
+ int mOriginalWidth, mOriginalHeight;
+ int mCurRotation;
+
+ Animation mExitAnimation;
+ final Transformation mExitTransformation = new Transformation();
+ Animation mEnterAnimation;
+ final Transformation mEnterTransformation = new Transformation();
+ boolean mStarted;
+
+ final DisplayMetrics mDisplayMetrics = new DisplayMetrics();
+ final Matrix mSnapshotInitialMatrix = new Matrix();
+ final Matrix mSnapshotFinalMatrix = new Matrix();
+ final float[] mTmpFloats = new float[9];
+
+ public ScreenRotationAnimation(Context context, Display display, SurfaceSession session,
+ boolean inTransaction) {
+ mContext = context;
+ mDisplay = display;
+
+ display.getMetrics(mDisplayMetrics);
+
+ Bitmap screenshot = Surface.screenshot(0, 0);
+
+ if (screenshot != null) {
+ // Screenshot does NOT include rotation but we need to consider ro.sf.hwrotation!
+ mSnapshotRotation = (
+ (4 - android.os.SystemProperties.getInt("ro.sf.hwrotation",0) / 90) % 4);
+ mWidth = screenshot.getWidth();
+ mHeight = screenshot.getHeight();
+ } else {
+ // Just in case.
+ mSnapshotRotation = display.getRotation();
+ mWidth = mDisplayMetrics.widthPixels;
+ mHeight = mDisplayMetrics.heightPixels;
+ }
+
+ mOriginalRotation = display.getRotation();
+ mOriginalWidth = mDisplayMetrics.widthPixels;
+ mOriginalHeight = mDisplayMetrics.heightPixels;
+
+ if (!inTransaction) {
+ if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
+ ">>> OPEN TRANSACTION ScreenRotationAnimation");
+ Surface.openTransaction();
+ }
+
+ try {
+ try {
+ mSurface = new Surface(session, 0, "FreezeSurface",
+ -1, mWidth, mHeight, PixelFormat.OPAQUE, 0);
+ mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200);
+ } catch (Surface.OutOfResourcesException e) {
+ Slog.w(TAG, "Unable to allocate freeze surface", e);
+ }
+
+ setRotation(display.getRotation());
+
+ if (mSurface != null) {
+ Rect dirty = new Rect(0, 0, mWidth, mHeight);
+ Canvas c = null;
+ try {
+ c = mSurface.lockCanvas(dirty);
+ } catch (IllegalArgumentException e) {
+ Slog.w(TAG, "Unable to lock surface", e);
+ return;
+ } catch (Surface.OutOfResourcesException e) {
+ Slog.w(TAG, "Unable to lock surface", e);
+ return;
+ }
+ if (c == null) {
+ Slog.w(TAG, "Null surface");
+ return;
+ }
+
+ if (screenshot != null) {
+ c.drawBitmap(screenshot, 0, 0, new Paint(0));
+ } else {
+ c.drawColor(Color.GREEN);
+ }
+
+ mSurface.unlockCanvasAndPost(c);
+ }
+ } finally {
+ if (!inTransaction) {
+ Surface.closeTransaction();
+ if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG,
+ "<<< CLOSE TRANSACTION ScreenRotationAnimation");
+ }
+
+ if (screenshot != null) {
+ screenshot.recycle();
+ }
+ }
+ }
+
+ static int deltaRotation(int oldRotation, int newRotation) {
+ int delta = newRotation - oldRotation;
+ if (delta < 0) delta += 4;
+ return delta;
+ }
+
+ void setSnapshotTransform(Matrix matrix, float alpha) {
+ matrix.getValues(mTmpFloats);
+ mSurface.setPosition((int)mTmpFloats[Matrix.MTRANS_X],
+ (int)mTmpFloats[Matrix.MTRANS_Y]);
+ mSurface.setMatrix(
+ mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
+ mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
+ mSurface.setAlpha(alpha);
+ if (DEBUG) {
+ float[] srcPnts = new float[] { 0, 0, mWidth, mHeight };
+ float[] dstPnts = new float[4];
+ matrix.mapPoints(dstPnts, srcPnts);
+ Slog.i(TAG, "Original : (" + srcPnts[0] + "," + srcPnts[1]
+ + ")-(" + srcPnts[2] + "," + srcPnts[3] + ")");
+ Slog.i(TAG, "Transformed: (" + dstPnts[0] + "," + dstPnts[1]
+ + ")-(" + dstPnts[2] + "," + dstPnts[3] + ")");
+ }
+ }
+
+ // Must be called while in a transaction.
+ public void setRotation(int rotation) {
+ mCurRotation = rotation;
+
+ // Compute the transformation matrix that must be applied
+ // to the snapshot to make it stay in the same original position
+ // with the current screen rotation.
+ int delta = deltaRotation(rotation, mSnapshotRotation);
+ switch (delta) {
+ case Surface.ROTATION_0:
+ mSnapshotInitialMatrix.reset();
+ break;
+ case Surface.ROTATION_90:
+ mSnapshotInitialMatrix.setRotate(90, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(mHeight, 0);
+ break;
+ case Surface.ROTATION_180:
+ mSnapshotInitialMatrix.setRotate(180, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(mWidth, mHeight);
+ break;
+ case Surface.ROTATION_270:
+ mSnapshotInitialMatrix.setRotate(270, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(0, mWidth);
+ break;
+ }
+
+ if (DEBUG) Slog.v(TAG, "**** ROTATION: " + delta);
+ setSnapshotTransform(mSnapshotInitialMatrix, 1.0f);
+ }
+
+ /**
+ * Returns true if animating.
+ */
+ public boolean dismiss(long maxAnimationDuration, float animationScale) {
+ // Figure out how the screen has moved from the original rotation.
+ int delta = deltaRotation(mCurRotation, mOriginalRotation);
+ if (false && delta == 0) {
+ // Nothing changed, just remove the snapshot.
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ return false;
+ }
+
+ switch (delta) {
+ case Surface.ROTATION_0:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_0_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_0_enter);
+ break;
+ case Surface.ROTATION_90:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_plus_90_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_plus_90_enter);
+ break;
+ case Surface.ROTATION_180:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_180_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_180_enter);
+ break;
+ case Surface.ROTATION_270:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_minus_90_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_minus_90_enter);
+ break;
+ }
+
+ mDisplay.getMetrics(mDisplayMetrics);
+
+ // Initialize the animations. This is a hack, redefining what "parent"
+ // means to allow supplying the last and next size. In this definition
+ // "%p" is the original (let's call it "previous") size, and "%" is the
+ // screen's current/new size.
+ mEnterAnimation.initialize(mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels,
+ mOriginalWidth, mOriginalHeight);
+ mExitAnimation.initialize(mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels,
+ mOriginalWidth, mOriginalHeight);
+ mStarted = false;
+
+ mExitAnimation.restrictDuration(maxAnimationDuration);
+ mExitAnimation.scaleCurrentDuration(animationScale);
+ mEnterAnimation.restrictDuration(maxAnimationDuration);
+ mEnterAnimation.scaleCurrentDuration(animationScale);
+
+ return true;
+ }
+
+ public void kill() {
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ if (mExitAnimation != null) {
+ mExitAnimation.cancel();
+ mExitAnimation = null;
+ }
+ if (mEnterAnimation != null) {
+ mEnterAnimation.cancel();
+ mEnterAnimation = null;
+ }
+ }
+
+ public boolean isAnimating() {
+ return mEnterAnimation != null || mExitAnimation != null;
+ }
+
+ public boolean stepAnimation(long now) {
+ if (mEnterAnimation == null && mExitAnimation == null) {
+ return false;
+ }
+
+ if (!mStarted) {
+ mEnterAnimation.setStartTime(now);
+ mExitAnimation.setStartTime(now);
+ mStarted = true;
+ }
+
+ mExitTransformation.clear();
+ boolean moreExit = false;
+ if (mExitAnimation != null) {
+ moreExit = mExitAnimation.getTransformation(now, mExitTransformation);
+ if (DEBUG) Slog.v(TAG, "Stepped exit: " + mExitTransformation);
+ if (!moreExit) {
+ if (DEBUG) Slog.v(TAG, "Exit animation done!");
+ mExitAnimation.cancel();
+ mExitAnimation = null;
+ mExitTransformation.clear();
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ }
+ }
+
+ mEnterTransformation.clear();
+ boolean moreEnter = false;
+ if (mEnterAnimation != null) {
+ moreEnter = mEnterAnimation.getTransformation(now, mEnterTransformation);
+ if (!moreEnter) {
+ mEnterAnimation.cancel();
+ mEnterAnimation = null;
+ mEnterTransformation.clear();
+ }
+ }
+
+ if (mSurface != null) {
+ mSnapshotFinalMatrix.setConcat(mExitTransformation.getMatrix(), mSnapshotInitialMatrix);
+ setSnapshotTransform(mSnapshotFinalMatrix, mExitTransformation.getAlpha());
+ }
+
+ return moreEnter || moreExit;
+ }
+
+ public Transformation getEnterTransformation() {
+ return mEnterTransformation;
+ }
+}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 31266ee..86b2b70 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -84,7 +84,20 @@ class ServerThread extends Thread {
boolean enableAdb = (Settings.Secure.getInt(mContentResolver,
Settings.Secure.ADB_ENABLED, 0) > 0);
// setting this secure property will start or stop adbd
- SystemProperties.set("persist.service.adb.enable", enableAdb ? "1" : "0");
+ SystemProperties.set("persist.service.adb.enable", enableAdb ? "1" : "0");
+ }
+ }
+
+ private class AdbPortObserver extends ContentObserver {
+ public AdbPortObserver() {
+ super(null);
+ }
+ @Override
+ public void onChange(boolean selfChange) {
+ int adbPort = Settings.Secure.getInt(mContentResolver,
+ Settings.Secure.ADB_PORT, 0);
+ // setting this will control whether ADB runs on TCP/IP or USB
+ SystemProperties.set("service.adb.tcp.port", Integer.toString(adbPort));
}
}
@@ -548,10 +561,16 @@ class ServerThread extends Thread {
}
// make sure the ADB_ENABLED setting value matches the secure property value
+ Settings.Secure.putInt(mContentResolver, Settings.Secure.ADB_PORT,
+ Integer.parseInt(SystemProperties.get("service.adb.tcp.port", "-1")));
+
Settings.Secure.putInt(mContentResolver, Settings.Secure.ADB_ENABLED,
"1".equals(SystemProperties.get("persist.service.adb.enable")) ? 1 : 0);
// register observer to listen for settings changes
+ mContentResolver.registerContentObserver(Settings.Secure.getUriFor(Settings.Secure.ADB_PORT),
+ false, new AdbPortObserver());
+
mContentResolver.registerContentObserver(Settings.Secure.getUriFor(Settings.Secure.ADB_ENABLED),
false, new AdbSettingsObserver());
diff --git a/services/java/com/android/server/UiModeManagerService.java b/services/java/com/android/server/UiModeManagerService.java
index 431cc39..759b686 100644
--- a/services/java/com/android/server/UiModeManagerService.java
+++ b/services/java/com/android/server/UiModeManagerService.java
@@ -546,9 +546,10 @@ class UiModeManagerService extends IUiModeManager.Stub {
updateConfigurationLocked(true);
// keep screen on when charging and in car mode
+ // or when on a desk dock
boolean keepScreenOn = mCharging &&
((mCarModeEnabled && mCarModeKeepsScreenOn) ||
- (mCurUiMode == Configuration.UI_MODE_TYPE_DESK && mDeskModeKeepsScreenOn));
+ ((mCurUiMode&Configuration.UI_MODE_TYPE_DESK)!=0 && mDeskModeKeepsScreenOn));
if (keepScreenOn != mWakeLock.isHeld()) {
if (keepScreenOn) {
mWakeLock.acquire();
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index c463dea..e136b72 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -205,6 +205,13 @@ public class WindowManagerService extends IWindowManager.Stub
/** Adjustment to time to perform a dim, to make it more dramatic.
*/
static final int DIM_DURATION_MULTIPLIER = 6;
+
+ /**
+ * If true, the window manager will do its own custom freezing and general
+ * management of the screen during rotation.
+ * @hide
+ */
+ static final boolean CUSTOM_SCREEN_ROTATION = SystemProperties.getBoolean("persist.sys.rotationanimation",true);
// Maximum number of milliseconds to wait for input event injection.
// FIXME is this value reasonable?
@@ -378,6 +385,7 @@ public class WindowManagerService extends IWindowManager.Stub
Surface mBlurSurface;
boolean mBlurShown;
Watermark mWatermark;
+ ScreenRotationAnimation mScreenRotationAnimation;
int mTransactionSequence = 0;
@@ -2013,7 +2021,7 @@ public class WindowManagerService extends IWindowManager.Stub
TAG, "New client " + client.asBinder()
+ ": window=" + win);
- if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked()) {
+ if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked(false)) {
reportNewConfig = true;
}
}
@@ -2104,7 +2112,7 @@ public class WindowManagerService extends IWindowManager.Stub
// So just update orientation if needed.
if (wasVisible && computeForcedAppOrientationLocked()
!= mForcedAppOrientation
- && updateOrientationFromAppTokensLocked()) {
+ && updateOrientationFromAppTokensLocked(false)) {
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
}
updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL);
@@ -2210,15 +2218,17 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mWindowMap) {
WindowState w = windowForClientLocked(session, client, false);
if ((w != null) && (w.mSurface != null)) {
- if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG,
+ ">>> OPEN TRANSACTION setTransparentRegion");
Surface.openTransaction();
try {
if (SHOW_TRANSACTIONS) logSurface(w,
"transparentRegionHint=" + region, null);
w.mSurface.setTransparentRegionHint(region);
} finally {
- if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION");
Surface.closeTransaction();
+ if (SHOW_TRANSACTIONS) Slog.i(TAG,
+ "<<< CLOSE TRANSACTION setTransparentRegion");
}
}
}
@@ -2553,7 +2563,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (assignLayers) {
assignLayersLocked();
}
- configChanged = updateOrientationFromAppTokensLocked();
+ configChanged = updateOrientationFromAppTokensLocked(false);
performLayoutAndPlaceSurfacesLocked();
if (displayed && win.mIsWallpaper) {
updateWallpaperOffsetLocked(win, mDisplay.getWidth(),
@@ -3122,7 +3132,7 @@ public class WindowManagerService extends IWindowManager.Stub
long ident = Binder.clearCallingIdentity();
synchronized(mWindowMap) {
- if (updateOrientationFromAppTokensLocked()) {
+ if (updateOrientationFromAppTokensLocked(false)) {
if (freezeThisOneIfNeeded != null) {
AppWindowToken wtoken = findAppWindowToken(
freezeThisOneIfNeeded);
@@ -3144,7 +3154,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (currentConfig.diff(mTempConfiguration) != 0) {
mWaitingForConfig = true;
mLayoutNeeded = true;
- startFreezingDisplayLocked();
+ startFreezingDisplayLocked(false);
config = new Configuration(mTempConfiguration);
}
}
@@ -3169,7 +3179,7 @@ public class WindowManagerService extends IWindowManager.Stub
* @see android.view.IWindowManager#updateOrientationFromAppTokens(
* android.os.IBinder)
*/
- boolean updateOrientationFromAppTokensLocked() {
+ boolean updateOrientationFromAppTokensLocked(boolean inTransaction) {
if (mDisplayFrozen) {
// If the display is frozen, some activities may be in the middle
// of restarting, and thus have removed their old window. If the
@@ -3190,7 +3200,8 @@ public class WindowManagerService extends IWindowManager.Stub
//action like disabling/enabling sensors etc.,
mPolicy.setCurrentOrientationLw(req);
if (setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION,
- mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE)) {
+ mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE,
+ inTransaction)) {
changed = true;
}
}
@@ -3726,6 +3737,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (w.mAppFreezing) {
w.mAppFreezing = false;
if (w.mSurface != null && !w.mOrientationChanging) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "set mOrientationChanging of " + w);
w.mOrientationChanging = true;
}
unfrozeWindows = true;
@@ -3763,7 +3775,7 @@ public class WindowManagerService extends IWindowManager.Stub
wtoken.freezingScreen = true;
mAppsFreezingScreen++;
if (mAppsFreezingScreen == 1) {
- startFreezingDisplayLocked();
+ startFreezingDisplayLocked(false);
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
mH.sendMessageDelayed(mH.obtainMessage(H.APP_FREEZE_TIMEOUT),
5000);
@@ -4531,7 +4543,7 @@ public class WindowManagerService extends IWindowManager.Stub
long origId = Binder.clearCallingIdentity();
boolean changed;
synchronized(mWindowMap) {
- changed = setRotationUncheckedLocked(rotation, animFlags);
+ changed = setRotationUncheckedLocked(rotation, animFlags, false);
}
if (changed || alwaysSendConfiguration) {
@@ -4549,7 +4561,7 @@ public class WindowManagerService extends IWindowManager.Stub
* Returns null if the rotation has been changed. In this case YOU
* MUST CALL setNewConfiguration() TO UNFREEZE THE SCREEN.
*/
- public boolean setRotationUncheckedLocked(int rotation, int animFlags) {
+ public boolean setRotationUncheckedLocked(int rotation, int animFlags, boolean inTransaction) {
boolean changed;
if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) {
rotation = mRequestedRotation;
@@ -4576,15 +4588,38 @@ public class WindowManagerService extends IWindowManager.Stub
2000);
mWaitingForConfig = true;
mLayoutNeeded = true;
- startFreezingDisplayLocked();
+ startFreezingDisplayLocked(inTransaction);
Slog.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags);
mInputManager.setDisplayOrientation(0, rotation);
if (mDisplayEnabled) {
- Surface.setOrientation(0, rotation, animFlags);
+ if (CUSTOM_SCREEN_ROTATION && mPolicy.isScreenOn()) {
+ Surface.freezeDisplay(0);
+ if (!inTransaction) {
+ if (SHOW_TRANSACTIONS) Slog.i(TAG,
+ ">>> OPEN TRANSACTION setRotationUnchecked");
+ Surface.openTransaction();
+ }
+ try {
+ if (mScreenRotationAnimation != null) {
+ mScreenRotationAnimation.setRotation(rotation);
+ }
+ } finally {
+ if (!inTransaction) {
+ Surface.closeTransaction();
+ if (SHOW_TRANSACTIONS) Slog.i(TAG,
+ "<<< CLOSE TRANSACTION setRotationUnchecked");
+ }
+ }
+ Surface.setOrientation(0, rotation, animFlags);
+ Surface.unfreezeDisplay(0);
+ } else {
+ Surface.setOrientation(0, rotation, animFlags);
+ }
}
for (int i=mWindows.size()-1; i>=0; i--) {
WindowState w = mWindows.get(i);
if (w.mSurface != null) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Set mOrientationChanging of " + w);
w.mOrientationChanging = true;
}
}
@@ -5030,7 +5065,13 @@ public class WindowManagerService extends IWindowManager.Stub
public Configuration computeNewConfiguration() {
synchronized (mWindowMap) {
- return computeNewConfigurationLocked();
+ Configuration config = computeNewConfigurationLocked();
+ if (config == null && mWaitingForConfig) {
+ // Nothing changed but we are waiting for something... stop that!
+ mWaitingForConfig = false;
+ performLayoutAndPlaceSurfacesLocked();
+ }
+ return config;
}
}
@@ -6340,6 +6381,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (mSurface == null) {
mReportDestroySurface = false;
mSurfacePendingDestroy = false;
+ if (DEBUG_ORIENTATION) Slog.i(WindowManagerService.TAG,
+ "createSurface " + this + ": DRAW NOW PENDING");
mDrawPending = true;
mCommitDrawPending = false;
mReadyToShow = false;
@@ -6347,6 +6390,8 @@ public class WindowManagerService extends IWindowManager.Stub
mAppToken.allDrawn = false;
}
+ makeWindowFreezingScreenIfNeededLocked(this);
+
int flags = 0;
if (mAttrs.memoryType == MEMORY_TYPE_PUSH_BUFFERS) {
flags |= Surface.PUSH_BUFFERS;
@@ -6409,9 +6454,8 @@ public class WindowManagerService extends IWindowManager.Stub
+ ", set left=" + mFrame.left + " top=" + mFrame.top
+ ", animLayer=" + mAnimLayer);
if (SHOW_TRANSACTIONS) {
- Slog.i(TAG, ">>> OPEN TRANSACTION");
- if (SHOW_TRANSACTIONS) logSurface(this,
- "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" +
+ Slog.i(TAG, ">>> OPEN TRANSACTION createSurfaceLocked");
+ logSurface(this, "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" +
mFrame.width() + "x" + mFrame.height() + "), layer=" +
mAnimLayer + " HIDE", null);
}
@@ -6436,8 +6480,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
mLastHidden = true;
} finally {
- if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION");
Surface.closeTransaction();
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION createSurfaceLocked");
}
if (localLOGV) Slog.v(
TAG, "Created surface " + this);
@@ -6506,7 +6550,7 @@ public class WindowManagerService extends IWindowManager.Stub
boolean finishDrawingLocked() {
if (mDrawPending) {
if (SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(
- TAG, "finishDrawingLocked: " + mSurface);
+ TAG, "finishDrawingLocked: " + this + " in " + mSurface);
mCommitDrawPending = true;
mDrawPending = false;
return true;
@@ -6815,8 +6859,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ final boolean screenAnimation = mScreenRotationAnimation != null
+ && mScreenRotationAnimation.isAnimating();
if (selfTransformation || attachedTransformation != null
- || appTransformation != null) {
+ || appTransformation != null || screenAnimation) {
// cache often used attributes locally
final Rect frame = mFrame;
final float tmpFloats[] = mTmpFloats;
@@ -6834,6 +6880,10 @@ public class WindowManagerService extends IWindowManager.Stub
if (appTransformation != null) {
tmpMatrix.postConcat(appTransformation.getMatrix());
}
+ if (screenAnimation) {
+ tmpMatrix.postConcat(
+ mScreenRotationAnimation.getEnterTransformation().getMatrix());
+ }
// "convert" it into SurfaceFlinger's format
// (a 2x2 matrix + an offset)
@@ -6843,8 +6893,8 @@ public class WindowManagerService extends IWindowManager.Stub
tmpMatrix.getValues(tmpFloats);
mDsDx = tmpFloats[Matrix.MSCALE_X];
- mDtDx = tmpFloats[Matrix.MSKEW_X];
- mDsDy = tmpFloats[Matrix.MSKEW_Y];
+ mDtDx = tmpFloats[Matrix.MSKEW_Y];
+ mDsDy = tmpFloats[Matrix.MSKEW_X];
mDtDy = tmpFloats[Matrix.MSCALE_Y];
int x = (int)tmpFloats[Matrix.MTRANS_X] + mXOffset;
int y = (int)tmpFloats[Matrix.MTRANS_Y] + mYOffset;
@@ -6872,6 +6922,10 @@ public class WindowManagerService extends IWindowManager.Stub
if (appTransformation != null) {
mShownAlpha *= appTransformation.getAlpha();
}
+ if (screenAnimation) {
+ mShownAlpha *=
+ mScreenRotationAnimation.getEnterTransformation().getAlpha();
+ }
} else {
//Slog.i(TAG, "Not applying alpha transform");
}
@@ -8534,6 +8588,25 @@ public class WindowManagerService extends IWindowManager.Stub
return mPolicy.finishLayoutLw();
}
+ void makeWindowFreezingScreenIfNeededLocked(WindowState w) {
+ // If the screen is currently frozen, then keep
+ // it frozen until this window draws at its new
+ // orientation.
+ if (mDisplayFrozen) {
+ if (DEBUG_ORIENTATION) Slog.v(TAG,
+ "Resizing while display frozen: " + w);
+ w.mOrientationChanging = true;
+ if (!mWindowsFreezingScreen) {
+ mWindowsFreezingScreen = true;
+ // XXX should probably keep timeout from
+ // when we first froze the display.
+ mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
+ mH.sendMessageDelayed(mH.obtainMessage(
+ H.WINDOW_FREEZE_TIMEOUT), 2000);
+ }
+ }
+ }
+
private final void performLayoutAndPlaceSurfacesLockedInner(
boolean recoveringMemory) {
final long currentTime = SystemClock.uptimeMillis();
@@ -8570,7 +8643,7 @@ public class WindowManagerService extends IWindowManager.Stub
createWatermark = true;
}
- if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces");
Surface.openTransaction();
@@ -8605,7 +8678,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG) != 0) {
if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout");
- if (updateOrientationFromAppTokensLocked()) {
+ if (updateOrientationFromAppTokensLocked(true)) {
mLayoutNeeded = true;
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
}
@@ -8652,6 +8725,16 @@ public class WindowManagerService extends IWindowManager.Stub
animating = tokensAnimating;
+ if (mScreenRotationAnimation != null) {
+ if (mScreenRotationAnimation.isAnimating()) {
+ if (mScreenRotationAnimation.stepAnimation(currentTime)) {
+ animating = true;
+ } else {
+ mScreenRotationAnimation = null;
+ }
+ }
+ }
+
boolean tokenMayBeDrawn = false;
boolean wallpaperMayChange = false;
boolean forceHiding = false;
@@ -8800,6 +8883,10 @@ public class WindowManagerService extends IWindowManager.Stub
+ " drawn=" + wtoken.numDrawnWindows);
wtoken.showAllWindowsLocked();
unsetAppFreezingScreenLocked(wtoken, false, true);
+ if (DEBUG_ORIENTATION) Slog.i(TAG,
+ "Setting orientationChangeComplete=true because wtoken "
+ + wtoken + " numInteresting=" + numInteresting
+ + " numDrawn=" + wtoken.numDrawnWindows);
orientationChangeComplete = true;
}
} else if (!wtoken.allDrawn) {
@@ -9025,7 +9112,8 @@ public class WindowManagerService extends IWindowManager.Stub
// This has changed the visibility of windows, so perform
// a new layout to get them all up-to-date.
- changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
+ changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT
+ | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
mLayoutNeeded = true;
if (!moveInputMethodWindowsIfNeededLocked(true)) {
assignLayersLocked();
@@ -9243,7 +9331,7 @@ public class WindowManagerService extends IWindowManager.Stub
// as running out of memory), don't take down the
// entire system.
Slog.e(TAG, "Failure updating surface of " + w
- + "size=(" + width + "x" + height
+ + " size=(" + width + "x" + height
+ "), pos=(" + w.mShownFrame.left
+ "," + w.mShownFrame.top + ")", e);
if (!recoveringMemory) {
@@ -9276,22 +9364,7 @@ public class WindowManagerService extends IWindowManager.Stub
w.mLastFrame.set(w.mFrame);
w.mLastContentInsets.set(w.mContentInsets);
w.mLastVisibleInsets.set(w.mVisibleInsets);
- // If the screen is currently frozen, then keep
- // it frozen until this window draws at its new
- // orientation.
- if (mDisplayFrozen) {
- if (DEBUG_ORIENTATION) Slog.v(TAG,
- "Resizing while display frozen: " + w);
- w.mOrientationChanging = true;
- if (!mWindowsFreezingScreen) {
- mWindowsFreezingScreen = true;
- // XXX should probably keep timeout from
- // when we first froze the display.
- mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT);
- mH.sendMessageDelayed(mH.obtainMessage(
- H.WINDOW_FREEZE_TIMEOUT), 2000);
- }
- }
+ makeWindowFreezingScreenIfNeededLocked(w);
// If the orientation is changing, then we need to
// hold off on unfreezing the display until this
// window has been redrawn; to do that, we need
@@ -9607,8 +9680,6 @@ public class WindowManagerService extends IWindowManager.Stub
mPointerSurface.hide();
}
}
-
- if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION");
} catch (RuntimeException e) {
Slog.e(TAG, "Unhandled exception in Window Manager", e);
}
@@ -9617,6 +9688,8 @@ public class WindowManagerService extends IWindowManager.Stub
Surface.closeTransaction();
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces");
+
if (mWatermark != null) {
mWatermark.drawIfNeeded();
}
@@ -9653,6 +9726,8 @@ public class WindowManagerService extends IWindowManager.Stub
+ Integer.toHexString(diff));
}
win.mConfiguration = mCurConfiguration;
+ if (DEBUG_ORIENTATION && win.mDrawPending) Slog.i(
+ TAG, "Resizing " + win + " WITH DRAW PENDING");
win.mClient.resized(win.mFrame.width(),
win.mFrame.height(), win.mLastContentInsets,
win.mLastVisibleInsets, win.mDrawPending,
@@ -9825,7 +9900,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
return true;
} catch (RuntimeException e) {
- Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win);
+ Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win, e);
}
reclaimSomeSurfaceMemoryLocked(win, "show");
@@ -9860,6 +9935,7 @@ public class WindowManagerService extends IWindowManager.Stub
+ " token=" + win.mToken
+ " pid=" + ws.mSession.mPid
+ " uid=" + ws.mSession.mUid);
+ if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null);
ws.mSurface.destroy();
ws.mSurfaceShown = false;
ws.mSurface = null;
@@ -9867,10 +9943,11 @@ public class WindowManagerService extends IWindowManager.Stub
i--;
N--;
leakedSurface = true;
- } else if (win.mAppToken != null && win.mAppToken.clientHidden) {
+ } else if (ws.mAppToken != null && ws.mAppToken.clientHidden) {
Slog.w(TAG, "LEAKED SURFACE (app token hidden): "
+ ws + " surface=" + ws.mSurface
+ " token=" + win.mAppToken);
+ if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null);
ws.mSurface.destroy();
ws.mSurfaceShown = false;
ws.mSurface = null;
@@ -9908,6 +9985,7 @@ public class WindowManagerService extends IWindowManager.Stub
// surface and ask the app to request another one.
Slog.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry.");
if (surface != null) {
+ if (SHOW_TRANSACTIONS) logSurface(win, "RECOVER DESTROY", null);
surface.destroy();
win.mSurfaceShown = false;
win.mSurface = null;
@@ -10035,11 +10113,18 @@ public class WindowManagerService extends IWindowManager.Stub
return result;
}
- private void startFreezingDisplayLocked() {
+ private void startFreezingDisplayLocked(boolean inTransaction) {
if (mDisplayFrozen) {
return;
}
+ /* We might have a null mFxSession here if the user has
+ the lock-screen disabled.*/
+ if (mFxSession == null) {
+ mFxSession = new SurfaceSession();
+ }
+
+
mScreenFrozenLock.acquire();
long now = SystemClock.uptimeMillis();
@@ -10071,7 +10156,19 @@ public class WindowManagerService extends IWindowManager.Stub
File file = new File("/data/system/frozen");
Debug.startMethodTracing(file.toString(), 8 * 1024 * 1024);
}
- Surface.freezeDisplay(0);
+
+ if (mScreenRotationAnimation != null && mScreenRotationAnimation.isAnimating()) {
+ mScreenRotationAnimation.kill();
+ mScreenRotationAnimation = null;
+ }
+ if (CUSTOM_SCREEN_ROTATION && mPolicy.isScreenOn()) {
+ if (mScreenRotationAnimation == null) {
+ mScreenRotationAnimation = new ScreenRotationAnimation(mContext,
+ mDisplay, mFxSession, inTransaction);
+ }
+ } else {
+ Surface.freezeDisplay(0);
+ }
}
private void stopFreezingDisplayLocked() {
@@ -10090,6 +10187,16 @@ public class WindowManagerService extends IWindowManager.Stub
if (PROFILE_ORIENTATION) {
Debug.stopMethodTracing();
}
+
+ if (mScreenRotationAnimation != null) {
+ if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation");
+ if (mScreenRotationAnimation.dismiss(MAX_ANIMATION_DURATION,
+ mTransitionAnimationScale)) {
+ requestAnimationLocked(0);
+ } else {
+ mScreenRotationAnimation = null;
+ }
+ }
Surface.unfreezeDisplay(0);
mInputMonitor.thawInputDispatchingLw();
@@ -10098,7 +10205,7 @@ public class WindowManagerService extends IWindowManager.Stub
// to avoid inconsistent states. However, something interesting
// could have actually changed during that time so re-evaluate it
// now to catch that.
- if (updateOrientationFromAppTokensLocked()) {
+ if (updateOrientationFromAppTokensLocked(false)) {
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
}
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index a165ebb..17f9214 100755
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -2596,6 +2596,7 @@ public final class ActivityManagerService extends ActivityManagerNative
if (localLOGV) Slog.v(
TAG, "Removing this entry! frozen=" + r.haveState
+ " finishing=" + r.finishing);
+ r.makeFinishing();
mMainStack.mHistory.remove(i);
r.inHistory = false;
@@ -6450,7 +6451,7 @@ public final class ActivityManagerService extends ActivityManagerNative
if (r.state == ActivityState.RESUMED
|| r.state == ActivityState.PAUSING
|| r.state == ActivityState.PAUSED) {
- if (!r.isHomeActivity) {
+ if (!r.isHomeActivity || mHomeProcess != r.app) {
Slog.w(TAG, " Force finishing activity "
+ r.intent.getComponent().flattenToShortString());
r.stack.finishActivityLocked(r, index,
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java
index 4d773e4..f0818d6 100644
--- a/services/java/com/android/server/am/ActivityRecord.java
+++ b/services/java/com/android/server/am/ActivityRecord.java
@@ -303,6 +303,15 @@ class ActivityRecord extends IApplicationToken.Stub {
}
}
+ void makeFinishing() {
+ if (!finishing) {
+ finishing = true;
+ if (task != null) {
+ task.numActivities--;
+ }
+ }
+ }
+
UriPermissionOwner getUriPermissionsLocked() {
if (uriPermissions == null) {
uriPermissions = new UriPermissionOwner(service, this);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 95ef2ed..d1958f3 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -2891,7 +2891,7 @@ public class ActivityStack {
return false;
}
- r.finishing = true;
+ r.makeFinishing();
EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY,
System.identityHashCode(r),
r.task.taskId, r.shortComponentName, reason);
@@ -3100,6 +3100,7 @@ public class ActivityStack {
private final void removeActivityFromHistoryLocked(ActivityRecord r) {
if (r.state != ActivityState.DESTROYED) {
+ r.makeFinishing();
mHistory.remove(r);
r.inHistory = false;
r.resultTo = null;
diff --git a/services/java/com/android/server/location/BTGPSService.java b/services/java/com/android/server/location/BTGPSService.java
new file mode 100644
index 0000000..49aa20d
--- /dev/null
+++ b/services/java/com/android/server/location/BTGPSService.java
@@ -0,0 +1,465 @@
+/*
+ * Copyright (C) 2011 Cuong Bui
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.location;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.UUID;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothSocket;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+
+public class BTGPSService {
+ private static final boolean D = true;
+ private static final String TAG = "BTGPSService";
+ private static final UUID BT_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
+ private final BluetoothAdapter mAdapter;
+ private final Handler mHandler;
+ private WatchdogThread mWatchdogThread = null;
+ private ConnectThread mConnectThread = null;
+ private ConnectedThread mConnectedThread = null;
+ private final int mMaxNMEABuffer=4096;
+ private final char[] buffer = new char[mMaxNMEABuffer];
+ int bytes;
+ private long refreshRate = 1000;
+ private long lastActivity = 0;
+ // MAX_ACTIVITY_TIMEOUT * refresh time window should have at least one activity.
+ private int MAX_ACTIVITY_TIMEOUT = 5;
+ // Maximum connect retry attempt
+ private int MAX_RECONNECT_RETRIES = 5;
+ // time window for one single connection (ms). socket connect timeout is around 12 sec
+ private int MAX_CONNECT_TIMEOUT = 13000;
+ // last connected device. is used to auto reconnect.
+ private BluetoothDevice lastConnectedDevice=null;
+
+ private int mState = 0;
+ // Constants that indicate the current connection state
+ public static final int STATE_NONE = 0; // we're doing nothing
+ public static final int STATE_LISTEN = 1; // now listening for incoming connections
+ public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection
+ public static final int STATE_CONNECTED = 3; // now connected to a remote device
+
+ public synchronized void setRefreshRate(long r) {
+ refreshRate = r;
+ }
+
+ public synchronized long getRefreshRate() {
+ return refreshRate;
+ }
+
+ public BTGPSService(Handler h) {
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
+ mHandler = h;
+ }
+
+ private void sendMessage(int message, int arg, Object obj) {
+ Message m = Message.obtain(mHandler, message);
+ m.arg1 = arg;
+ m.obj = obj;
+ mHandler.sendMessage(m);
+ }
+
+ private void handleFailedConnection() {
+ if (getServiceState() != STATE_NONE) {
+ if (D) Log.d(TAG, "Connection failed with status != 0. try to reconnect");
+ connect(lastConnectedDevice);
+ } else {
+ if (D) Log.d(TAG, "Connection stopped with status = 0.");
+ }
+ }
+
+ /**
+ * Set the current state of the chat connection
+ * @param state An integer defining the current connection state
+ */
+ private synchronized void setState(int state) {
+ if (D) Log.d(TAG, "setState() " + mState + " -> " + state);
+ mState = state;
+ if (mState == STATE_NONE) {
+ sendMessage(BTGpsLocationProvider.GPS_STATUS_UPDATE, 0, null);
+ } else if (mState == STATE_CONNECTED) {
+ sendMessage(BTGpsLocationProvider.GPS_STATUS_UPDATE, 1, null);
+ }
+ }
+
+ /**
+ * Return the current connection state. */
+ public synchronized int getServiceState() {
+ return mState;
+ }
+
+ /**
+ * Start the chat service. Specifically start AcceptThread to begin a
+ * session in listening (server) mode. Called by the Activity onResume() */
+ public synchronized void start() {
+
+ if (D) Log.d(TAG, "start");
+ if (!mAdapter.isEnabled()) {
+ setState(STATE_NONE);
+ return;
+ }
+ // Cancel any thread attempting to make a connection
+ if (mConnectThread != null) {
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+ setState(STATE_LISTEN);
+ }
+
+ /**
+ * Start the ConnectThread to initiate a connection to a remote device.
+ * @param device The BluetoothDevice to connect
+ */
+ public synchronized boolean connect(BluetoothDevice device) {
+ lastConnectedDevice = device;
+ if (D) Log.d(TAG, "connect to: " + device);
+ // Cancel any thread attempting to make a connection
+ if (mConnectThread != null) {
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+ if (mWatchdogThread != null) {
+ mWatchdogThread.cancel();
+ mWatchdogThread = null;
+ }
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+ // Helper thread that monitors and retries to connect after time out
+ mWatchdogThread = new WatchdogThread(device);
+ mWatchdogThread.start();
+ return true;
+ }
+
+ /**
+ * Start the ConnectedThread to begin managing a Bluetooth connection
+ * @param socket The BluetoothSocket on which the connection was made
+ * @param device The BluetoothDevice that has been connected
+ */
+ public synchronized void connected(BluetoothSocket socket) {
+ // reset connect thread
+ if (mConnectThread != null) mConnectThread = null;
+
+ // kill watchdog, since we are connected
+ if (mWatchdogThread != null) {
+ mWatchdogThread.cancel();
+ mWatchdogThread = null;
+ }
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+
+ // Start the thread to manage the connection and perform transmissions
+ mConnectedThread = new ConnectedThread(socket);
+ mConnectedThread.start();
+ setState(STATE_CONNECTED);
+ }
+
+ /**
+ * Stop all threads
+ */
+ public synchronized void stop() {
+ if (D) Log.d(TAG, "Stopping btsvc, Set state to None");
+ setState(STATE_NONE);
+
+ if (mWatchdogThread != null) {
+ if (D) Log.d(TAG, "Cancelling watchdog thread");
+ mWatchdogThread.cancel();
+ mWatchdogThread = null;
+ }
+
+ if (mConnectThread != null) {
+ if (D) Log.d(TAG, "Cancelling connect thread");
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+ if (mConnectedThread != null) {
+ if (D) Log.d(TAG, "Cancelling connected thread");
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+ }
+
+ /**
+ * Write to the ConnectedThread in an unsynchronized manner
+ * @param out The bytes to write
+ * @see ConnectedThread#write(byte[])
+ */
+ public void write(byte[] out) {
+ // Create temporary object
+ ConnectedThread r;
+ // Synchronize a copy of the ConnectedThread
+ synchronized (this) {
+ if (mState != STATE_CONNECTED) return;
+ r = mConnectedThread;
+ }
+ r.write(out);
+ }
+
+ /**
+ * This thread runs while attempting to make an outgoing connection
+ * with a device. It runs straight through; the connection either
+ * succeeds or fails.
+ */
+ private class ConnectThread extends Thread {
+ private BluetoothSocket mmSocket;
+ private final BluetoothDevice mmDevice;
+ private String mSocketType;
+
+ public ConnectThread(BluetoothDevice device) {
+ mmDevice = device;
+ }
+
+ private void closeSocket() {
+ if (D) Log.d(TAG, getId()+":close socket");
+ if (mmSocket == null) {
+ Log.e(TAG, getId()+":Socket not ready. Aborting Close");
+ return;
+ }
+
+ try {
+ mmSocket.close();
+ mmSocket = null;
+ } catch (IOException e) {
+ Log.e(TAG, getId()+":close() of connect " + mSocketType + " socket failed", e);
+ }
+ }
+
+ public void run() {
+ Log.i(TAG, getId() + ":begin mConnectThread");
+ BluetoothSocket tmp = null;
+ // Always cancel discovery because it will slow down a connection
+
+ try {
+ tmp = mmDevice.createRfcommSocketToServiceRecord(BT_UUID);
+ } catch (IOException e) {
+ Log.e(TAG, "Socket create() failed", e);
+ return;
+ }
+ mmSocket = tmp;
+ // Make a connection to the BluetoothSocket
+ if (mAdapter.isEnabled()) mAdapter.cancelDiscovery();
+ try {
+ // This is a blocking call and will only return on a
+ // successful connection or an exception
+ if (D) Log.d(TAG, getId() + ":Connecting to socket...");
+ mmSocket.connect();
+ if (D) Log.d(TAG, "connected with remote device: "
+ + mmDevice.getName() + " at address " + mmDevice.getAddress());
+ connected(mmSocket);
+ } catch (IOException e) {
+ Log.w(TAG, getId() + ":connect failed.", e);
+ return;
+ }
+ }
+
+ public synchronized void cancel() {
+ closeSocket();
+ }
+ }
+
+ /**
+ * This thread runs during a connection with a remote device.
+ * It handles all incoming and outgoing transmissions.
+ */
+ private class ConnectedThread extends Thread {
+ private BluetoothSocket mmSocket;
+ private InputStream mmInStream;
+ private OutputStream mmOutStream;
+ private boolean cancelled = false;
+
+ private void closeSocket() {
+ if (D) Log.d(TAG, getId()+":close socket");
+ if (mmSocket == null) {
+ Log.e(TAG, getId()+":Socket not ready. Aborting Close");
+ return;
+ }
+ try {
+ mmSocket.close();
+ mmSocket = null;
+ } catch (IOException e) {
+ Log.e(TAG, getId()+": close() of connect socket failed", e);
+ }
+ }
+
+ public ConnectedThread(BluetoothSocket socket) {
+ Log.d(TAG, getId() + ":begin ConnectedThread");
+ mmSocket = socket;
+ InputStream tmpIn = null;
+ OutputStream tmpOut = null;
+
+ // Get the BluetoothSocket input and output streams
+ try {
+ tmpIn = socket.getInputStream();
+ tmpOut = socket.getOutputStream();
+ } catch (IOException e) {
+ Log.e(TAG, "temp sockets not created", e);
+ }
+ mmInStream = tmpIn;
+ mmOutStream = tmpOut;
+ }
+
+ public void run() {
+ if (mmSocket == null || mmInStream == null) {
+ Log.e(TAG, "Input stream or socket is null. Aborting thread");
+ return;
+ }
+ if (D) Log.d(TAG, getId() + ":BEGIN mConnectedThread");
+ java.util.Arrays.fill(buffer, (char) ' ');
+ // reset refresh rate to 1000
+ refreshRate = 1000;
+ lastActivity = 0;
+ BufferedReader reader = new BufferedReader(new InputStreamReader(mmInStream));
+ // Keep listening to the InputStream while connected
+ while (true) {
+ try {
+ if (reader.ready()) {
+ bytes = reader.read(buffer, 0, mMaxNMEABuffer);
+ Message msg = mHandler.obtainMessage(
+ BTGpsLocationProvider.GPS_DATA_AVAILABLE,buffer);
+ lastActivity = System.currentTimeMillis();
+ msg.arg1 = bytes;
+ mHandler.sendMessage(msg);
+ }
+ if (lastActivity != 0 && (System.currentTimeMillis() - lastActivity) >
+ MAX_ACTIVITY_TIMEOUT*refreshRate) {
+ Log.w(TAG, getId() + ":BT activity timeout.");
+ closeSocket();
+ handleFailedConnection();
+ return;
+ }
+ try {
+ // get default sleep time
+ Thread.sleep(getRefreshRate());
+ } catch (InterruptedException e) {
+ if (cancelled) {
+ closeSocket();
+ return;
+ }
+ }
+ } catch (IOException e) {
+ Log.w(TAG, getId() + ":disconnected.", e);
+ closeSocket();
+ handleFailedConnection();
+ return;
+ }
+ }
+ }
+
+ /**
+ * Write to the connected OutStream.
+ * @param buffer The bytes to write
+ */
+ public void write(byte[] buffer) {
+ try {
+ mmOutStream.write(buffer);
+ mmOutStream.flush();
+ } catch (IOException e) {
+ Log.e(TAG, "Exception during write", e);
+ }
+ }
+
+ public void cancel() {
+ try {
+ if (mmSocket == null) {
+ Log.e(TAG, "Input stream null. Aborting Cacnel");
+ return;
+ }
+ mmSocket.close();
+ } catch (IOException e) {
+ Log.e(TAG, "close() of connect socket failed", e);
+ } finally {
+ cancelled = true;
+ interrupt();
+ }
+ }
+ }
+ /*
+ * Thread that starts the connection thread an monitors it.
+ * Thread will be cancelled if timeot occurs
+ */
+ private class WatchdogThread extends Thread {
+ private final BluetoothDevice btdevice;
+ private int retries = 0;
+ private boolean sleep = false;
+ private boolean cancelled = false;
+
+ public WatchdogThread(BluetoothDevice dev) {
+ btdevice = dev;
+ }
+
+ public void run() {
+ while(retries < MAX_RECONNECT_RETRIES) {
+ if (mConnectThread != null) {
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+
+ mConnectThread = new ConnectThread(btdevice);
+ mConnectThread.start();
+ setState(STATE_CONNECTING);
+ // monitor connection and cancel if timeout
+ if (D) Log.d(TAG, getId() + ":Waiting " + MAX_CONNECT_TIMEOUT
+ + " (ms) for service to connect...");
+ try {
+ sleep = true;
+ Thread.sleep(MAX_CONNECT_TIMEOUT);
+ sleep = false;
+ if (D) Log.d(TAG, getId() + ":Connecting timeout.");
+ } catch (InterruptedException e) {
+ if (D) Log.d(TAG, getId() + ":Watchdog interrupted. probably by cancel.");
+ }
+ if (getServiceState() == STATE_CONNECTED) {
+ if (D) Log.d(TAG, getId() + ":Connected. aborting watchdog");
+ return;
+ }
+ if (cancelled) {
+ if (D) Log.d(TAG, getId() + ":Cancelled. aborting watchdog");
+ return;
+ }
+ retries++;
+ }
+ // max timeout, so stopping service
+ if (D) Log.d(TAG, getId() + ":Max connection retries exceeded. stopping services.");
+ BTGPSService.this.stop();
+ }
+
+ public void cancel() {
+ cancelled = true;
+ if (sleep) interrupt();
+ }
+ }
+}
diff --git a/services/java/com/android/server/location/BTGpsLocationProvider.java b/services/java/com/android/server/location/BTGpsLocationProvider.java
new file mode 100644
index 0000000..8f2bbab
--- /dev/null
+++ b/services/java/com/android/server/location/BTGpsLocationProvider.java
@@ -0,0 +1,858 @@
+/*
+ * Copyright (C) 2011 Cuong Bui
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.location;
+
+
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.location.Criteria;
+import android.location.IGpsStatusListener;
+import android.location.IGpsStatusProvider;
+import android.location.ILocationManager;
+import android.location.Location;
+import android.location.LocationManager;
+import android.location.LocationProvider;
+import android.net.NetworkInfo;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.PowerManager;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.SystemClock;
+import android.os.WorkSource;
+import android.provider.Settings;
+import android.text.TextUtils;
+import android.util.Log;
+import android.util.SparseIntArray;
+
+import com.android.internal.app.IBatteryStats;
+
+
+public class BTGpsLocationProvider implements LocationProviderInterface {
+ private static final boolean D = true;
+ private final String PROVIDER = "External Bleutooth Location Provider";
+ private final String TAG = "BTGpsLocationProvider";
+ private final NMEAParser nmeaparser = new NMEAParser(PROVIDER);
+
+ private final BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter();
+
+ // GPS update codes
+ public static final int GPS_DATA_AVAILABLE = 1000;
+ public static final int GPS_STATUS_UPDATE = 1001;
+ public static final int GPS_CUSTOM_COMMAND = 1002;
+
+
+ // Wakelocks
+ private final static String WAKELOCK_KEY = "GpsLocationProvider";
+ private final PowerManager.WakeLock mWakeLock;
+ // bitfield of pending messages to our Handler
+ // used only for messages that cannot have multiple instances queued
+ private int mPendingMessageBits;
+ // separate counter for ADD_LISTENER and REMOVE_LISTENER messages,
+ // which might have multiple instances queued
+ private int mPendingListenerMessages;
+
+ private final IBatteryStats mBatteryStats;
+ private final SparseIntArray mClientUids = new SparseIntArray();
+ // Handler messages
+ private static final int CHECK_LOCATION = 1;
+ private static final int ENABLE = 2;
+ private static final int ENABLE_TRACKING = 3;
+ private static final int UPDATE_NETWORK_STATE = 4;
+ private static final int INJECT_NTP_TIME = 5;
+ private static final int DOWNLOAD_XTRA_DATA = 6;
+ private static final int UPDATE_LOCATION = 7;
+ private static final int ADD_LISTENER = 8;
+ private static final int REMOVE_LISTENER = 9;
+ private static final int REQUEST_SINGLE_SHOT = 10;
+
+ // for calculating time to first fix
+ private long mFixRequestTime = 0;
+ // time to first fix for most recent session
+ private int mTTFF = 0;
+ // time we received our last fix
+ private long mLastFixTime;
+
+ // time for last status update
+ private long mStatusUpdateTime = SystemClock.elapsedRealtime();
+
+ // true if we are enabled
+ private volatile boolean mEnabled;
+
+ // true if GPS is navigating
+ private boolean mNavigating;
+
+ private int mSvCount;
+ // current status
+ private int mStatus = LocationProvider.TEMPORARILY_UNAVAILABLE;
+
+ private Bundle mLocationExtras = new Bundle();
+ private Location mLocation = new Location(PROVIDER);
+
+ private final Context mContext;
+ private final ILocationManager mLocationManager;
+
+ private final IntentFilter mIntentBTFilter;
+
+ private final Thread mMessageLoopThread = new BTGPSMessageThread();
+ private final CountDownLatch mInitializedLatch = new CountDownLatch(1);
+
+ /**
+ *Listen for BT changes. If BT is turned off, disable GPS services
+ */
+ private final BroadcastReceiver mReceiver;
+
+ /**
+ * Message handler
+ * Receives nmea sentences
+ * receives connection lost signals
+ * enabling/disabling gps signals
+ * adding/removing listeners
+ */
+ private Handler mHandler;
+
+ // BT gps service. This class handles the actual BT connection and data xfer
+ private final BTGPSService btsvc;
+
+ // BT Location provider , uses the same method signature as the org GPS location provider
+ public BTGpsLocationProvider(Context context, ILocationManager locationManager) {
+
+ mContext = context;
+ mLocationManager = locationManager;
+ // innit message handler
+ mMessageLoopThread.start();
+ // wait for message handler to be ready
+ while (true) {
+ try {
+ mInitializedLatch.await();
+ break;
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+ // instantiate BTGPSService
+ btsvc = new BTGPSService(mHandler);
+
+ // Create a wake lock.
+ PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
+ mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_KEY);
+ mWakeLock.setReferenceCounted(false);
+
+ // Battery statistics service to be notified when GPS turns on or off
+ mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"));
+
+ // receive BT state changes
+ mReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) {
+ int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,
+ BluetoothAdapter.ERROR);
+ switch (state) {
+ case BluetoothAdapter.STATE_ON:
+ if (D) Log.i(TAG, "BT turned on -> notify services?");
+ break;
+ case BluetoothAdapter.STATE_TURNING_OFF:
+ if (btsvc.getServiceState() != BTGPSService.STATE_NONE) {
+ if (D) Log.i(TAG, "BT turned off -> stopping services");
+ btsvc.stop();
+ }
+ break;
+ }
+ }
+ }
+ };
+ mIntentBTFilter = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED);
+ mContext.registerReceiver(mReceiver, mIntentBTFilter);
+ }
+
+ private final class BTGPSMessageThread extends Thread {
+
+ public void run() {
+ try {
+ Looper.prepare();
+ } catch (RuntimeException e) {
+ // ignored: Looper already prepared
+ }
+ mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ int message = msg.what;
+ switch (message) {
+ case GPS_DATA_AVAILABLE:
+ char[] writeBuf = (char[]) msg.obj;
+ int bytes = msg.arg1;
+ if ((writeBuf != null) && (mEnabled && bytes > 0)) {
+ String writeMessage = new String(writeBuf, 0, bytes);
+ handleNMEAMessages(writeMessage);
+ java.util.Arrays.fill(writeBuf, (char) ' ');
+ }
+ break;
+ case GPS_STATUS_UPDATE:
+ notifyEnableDisableGPS(msg.arg1 == 1);
+ break;
+ case GPS_CUSTOM_COMMAND:
+ if (mEnabled && btsvc.getServiceState() == BTGPSService.STATE_CONNECTED) {
+ // sends custom commands
+ byte[] cmds = (byte[]) msg.obj;
+ btsvc.write(cmds);
+ }
+ break;
+ case ENABLE:
+ if (msg.arg1 == 1) {
+ handleEnable();
+ } else {
+ handleDisable();
+ }
+ break;
+ case REQUEST_SINGLE_SHOT:
+ case ENABLE_TRACKING:
+ case UPDATE_NETWORK_STATE:
+ case INJECT_NTP_TIME:
+ case DOWNLOAD_XTRA_DATA:
+ break;
+ case UPDATE_LOCATION:
+ handleUpdateLocation((Location)msg.obj);
+ break;
+ case ADD_LISTENER:
+ handleAddListener(msg.arg1);
+ break;
+ case REMOVE_LISTENER:
+ handleRemoveListener(msg.arg1);
+ break;
+ }
+ // release wake lock if no messages are pending
+ synchronized (mWakeLock) {
+ mPendingMessageBits &= ~(1 << message);
+ if (message == ADD_LISTENER || message == REMOVE_LISTENER) {
+ mPendingListenerMessages--;
+ }
+ if (mPendingMessageBits == 0 && mPendingListenerMessages == 0) {
+ mWakeLock.release();
+ }
+ }
+ }
+ };
+ mInitializedLatch.countDown();
+ Looper.loop();
+ }
+ }
+
+ @Override
+ public void enable() {
+ synchronized (mHandler) {
+ sendMessage(ENABLE, 1, null);
+ }
+ }
+
+ /**
+ * Enables BT GPS provider
+ */
+ private synchronized void handleEnable() {
+ if (D) Log.d(TAG, "handleEnable");
+ if (mEnabled) return;
+ // check if BT is enabled
+ if (!mAdapter.isEnabled()) {
+ int state = mAdapter.getState();
+ if (state == BluetoothAdapter.STATE_OFF) {
+ if (D) Log.d(TAG, "BT not available. Enable and wait for it...");
+ mAdapter.enable();
+ }
+ // wait for adapter to be ready
+ while (true) {
+ try {
+ state = mAdapter.getState();
+ if (state == BluetoothAdapter.STATE_ON) {
+ break;
+ } else if (state == BluetoothAdapter.STATE_TURNING_ON) {
+ if (D) Log.d(TAG, "BT not available yet. waiting for another 400ms");
+ Thread.sleep(400);
+ } else {
+ if (D) Log.d(TAG, "BT got disabled or interrupted by other source");
+ return;
+ }
+
+ } catch (InterruptedException e) {
+ Log.w(TAG, e.getMessage());
+ }
+ }
+ }
+ if (D) Log.d(TAG, "mEnabled -> true");
+ mEnabled = true;
+ if (D) Log.d(TAG, "mStatus -> temp unavailable");
+ mStatus = LocationProvider.TEMPORARILY_UNAVAILABLE;
+ if (D) Log.d(TAG, "btservice start");
+ btsvc.start();
+ mFixRequestTime = System.currentTimeMillis();
+ mTTFF = 0;
+ String btDevice = Settings.System.getString(mContext.getContentResolver(),
+ Settings.Secure.EXTERNAL_GPS_BT_DEVICE);
+ if (D) Log.d(TAG, "Connecting to saved pref: " + btDevice);
+ if ((btDevice != null) && !"0".equals(btDevice)) {
+ if ((mAdapter != null) && (mAdapter.isEnabled())) {
+ for (BluetoothDevice d: mAdapter.getBondedDevices()) {
+ if (btDevice.equals(d.getAddress())) {
+ if (D) Log.d(TAG, "Connecting...");
+ btsvc.connect(d);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Disables this provider.
+ */
+ @Override
+ public void disable() {
+ synchronized (mHandler) {
+ sendMessage(ENABLE, 0, null);
+ }
+ }
+
+ private synchronized void handleDisable() {
+ if (D) Log.d(TAG, "handleDisable");
+ if (!mEnabled) return;
+ if (D) Log.d(TAG, "mEnabled -> false");
+ mEnabled = false;
+ if (D) Log.d(TAG, "reportstatus notify listeners and system");
+ notifyEnableDisableGPS(false);
+ if (D) Log.d(TAG, "update to out of service");
+ updateStatus(LocationProvider.OUT_OF_SERVICE, mSvCount);
+ if (D) Log.d(TAG, "btservice Stop");
+ btsvc.stop();
+ }
+
+ /* We do not need to implement scheduled tracking. With internal gps providers it makes sence
+ * to hibernate and resume periodically. With BT GPS providers it doesn't make sense
+ * @see com.android.server.location.LocationProviderInterface#enableLocationTracking(boolean)
+ */
+ @Override
+ public void enableLocationTracking(boolean enable) {
+ }
+
+ @Override
+ public int getAccuracy() {
+ return Criteria.ACCURACY_FINE;
+ }
+
+ /* Debug native state used by normal GPS provider only
+ * @see com.android.server.location.LocationProviderInterface#getInternalState()
+ */
+ @Override
+ public String getInternalState() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return LocationManager.GPS_PROVIDER;
+ }
+
+ /**
+ * Returns the power requirement for this provider.
+ *
+ * @return the power requirement for this provider, as one of the
+ * constants Criteria.POWER_REQUIREMENT_*.
+ */
+ public int getPowerRequirement() {
+ return Criteria.POWER_MEDIUM;
+ }
+
+ /**
+ * Returns true if this provider meets the given criteria,
+ * false otherwise.
+ */
+ public boolean meetsCriteria(Criteria criteria) {
+ return (criteria.getPowerRequirement() != Criteria.POWER_LOW);
+ }
+
+ @Override
+ public int getStatus(Bundle extras) {
+ if (extras != null) {
+ extras.putInt("satellites", mSvCount);
+ }
+ return mStatus;
+ }
+
+ @Override
+ public long getStatusUpdateTime() {
+ return mStatusUpdateTime;
+ }
+
+ @Override
+ public boolean hasMonetaryCost() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return mEnabled;
+ }
+
+
+ @Override
+ public boolean requestSingleShotFix() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresCell() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresNetwork() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresSatellite() {
+ return true;
+ }
+
+ @Override
+ public boolean sendExtraCommand(String command, Bundle extras) {
+ if (TextUtils.isEmpty(command)) return false;
+ synchronized (mHandler) {
+ String customCommand = command + "\r\n";
+ sendMessage(GPS_CUSTOM_COMMAND, customCommand.length(), customCommand.getBytes());
+ }
+ return true;
+ }
+
+ /* GPS scheduling stuff, not needed
+ * @see com.android.server.location.LocationProviderInterface#setMinTime(long, android.os.WorkSource)
+ */
+ @Override
+ public void setMinTime(long minTime, WorkSource ws) {
+
+ }
+
+ @Override
+ public boolean supportsAltitude() {
+ return mLocation.hasAltitude();
+ }
+
+ @Override
+ public boolean supportsBearing() {
+ return mLocation.hasBearing();
+ }
+
+ @Override
+ public boolean supportsSpeed() {
+ return mLocation.hasSpeed();
+ }
+
+ @Override
+ /**
+ * This is called to inform us when another location provider returns a location.
+ * Someday we might use this for network location injection to aid the GPS
+ */
+ public void updateLocation(Location location) {
+ sendMessage(UPDATE_LOCATION, 0, location);
+ }
+
+ private void handleUpdateLocation(Location location) {
+ if (location.hasAccuracy()) {
+ // Allow other provider GPS data ? discard for now
+ }
+ }
+
+ /* unneeded by BT GPS provider
+ * @see com.android.server.location.LocationProviderInterface#updateNetworkState(int, android.net.NetworkInfo)
+ */
+ @Override
+ public void updateNetworkState(int state, NetworkInfo info) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * @param loc Location object representing the fix
+ * @param isValid true if fix was valid
+ */
+ private void reportLocation(Location loc, boolean isValid) {
+
+ if (!isValid) {
+ if (mStatus == LocationProvider.AVAILABLE && mTTFF > 0) {
+ if (D) Log.d(TAG, "Invalid sat fix -> sending notification to system");
+ // send an intent to notify that the GPS is no longer receiving fixes.
+ Intent intent = new Intent(LocationManager.GPS_FIX_CHANGE_ACTION);
+ intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, false);
+ mContext.sendBroadcast(intent);
+ updateStatus(LocationProvider.TEMPORARILY_UNAVAILABLE, mSvCount);
+ }
+ return;
+ }
+
+ synchronized (mLocation) {
+ mLocation.set(loc);
+ mLocation.setProvider(this.getName());
+ if (D) {
+ Log.d(TAG, "reportLocation lat: " + mLocation.getLatitude() +
+ " long: " + mLocation.getLongitude() + " alt: " + mLocation.getAltitude() +
+ " accuracy: " + mLocation.getAccuracy() + " timestamp: " + mLocation.getTime());
+ }
+ try {
+ mLocationManager.reportLocation(mLocation, false);
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException calling reportLocation");
+ }
+ }
+
+ mLastFixTime = System.currentTimeMillis();
+ // report time to first fix
+ if ((mTTFF == 0) && (isValid)) {
+ mTTFF = (int)(mLastFixTime - mFixRequestTime);
+ if (D) Log.d(TAG, "TTFF: " + mTTFF);
+
+ // notify status listeners
+ synchronized(mListeners) {
+ int size = mListeners.size();
+ for (int i = 0; i < size; i++) {
+ Listener listener = mListeners.get(i);
+ try {
+ listener.mListener.onFirstFix(mTTFF);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in first fix notification");
+ mListeners.remove(listener);
+ // adjust for size of list changing
+ size--;
+ }
+ }
+ }
+ }
+
+ if (mStatus != LocationProvider.AVAILABLE) {
+ if (D) Log.d(TAG,"Notify that we're receiving fixes");
+ // send an intent to notify that the GPS is receiving fixes.
+ Intent intent = new Intent(LocationManager.GPS_FIX_CHANGE_ACTION);
+ intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, true);
+ mContext.sendBroadcast(intent);
+ updateStatus(LocationProvider.AVAILABLE, mSvCount);
+ }
+
+ }
+
+ /* report sats status
+ */
+ private void reportSvStatus(int svCount, int mSvs[], float mSnrs[],
+ float mSvElevations[], float mSvAzimuths[], int mSvMasks[]) {
+
+ if (D) Log.d(TAG,"About to report sat status svcount: " + svCount);
+ synchronized(mListeners) {
+ int size = mListeners.size();
+ for (int i = 0; i < size; i++) {
+ Listener listener = mListeners.get(i);
+ try {
+ listener.mListener.onSvStatusChanged(svCount, mSvs, mSnrs, mSvElevations,
+ mSvAzimuths, mSvMasks[NMEAParser.EPHEMERIS_MASK],
+ mSvMasks[NMEAParser.ALMANAC_MASK],
+ mSvMasks[NMEAParser.USED_FOR_FIX_MASK]);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in reportSvInfo");
+ mListeners.remove(listener);
+ // adjust for size of list changing
+ size--;
+ }
+ }
+ }
+
+ // return number of sets used in fix instead of total
+ updateStatus(mStatus, Integer.bitCount(mSvMasks[NMEAParser.USED_FOR_FIX_MASK]));
+ }
+
+ /**
+ * Handles GPS status.
+ * will also inform listeners when GPS started/stopped
+ * @param status new GPS status
+ */
+ private void notifyEnableDisableGPS(boolean status) {
+ if (D) Log.v(TAG, "notifyEnableDisableGPS status: " + status);
+
+ synchronized(mListeners) {
+ mNavigating = status;
+ int size = mListeners.size();
+ for (int i = 0; i < size; i++) {
+ Listener listener = mListeners.get(i);
+ try {
+ if (status) {
+ listener.mListener.onGpsStarted();
+ } else {
+ listener.mListener.onGpsStopped();
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in reportStatus");
+ mListeners.remove(listener);
+ // adjust for size of list changing
+ size--;
+ }
+ }
+ try {
+ // update battery stats
+ for (int i=mClientUids.size() - 1; i >= 0; i--) {
+ int uid = mClientUids.keyAt(i);
+ if (mNavigating) {
+ mBatteryStats.noteStartGps(uid);
+ } else {
+ mBatteryStats.noteStopGps(uid);
+ }
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in reportStatus");
+ }
+ // send an intent to notify that the GPS has been enabled or disabled.
+ Intent intent = new Intent(LocationManager.GPS_ENABLED_CHANGE_ACTION);
+ intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, status);
+ mContext.sendBroadcast(intent);
+ }
+ try {
+ if (D) Log.d(TAG, "Setting System GPS status to " + status);
+ Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(),
+ LocationManager.GPS_PROVIDER, status);
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+
+ /**
+ * sends nmea sentences to NMEA parsers. Some apps use raw nmea data
+ * @param nmeaString nmea string
+ * @param timestamp time stamp
+ */
+ private void reportNmea(String nmeaString, long timestamp) {
+ synchronized(mListeners) {
+ int size = mListeners.size();
+ if (size > 0) {
+ // don't bother creating the String if we have no listeners
+ for (int i = 0; i < size; i++) {
+ Listener listener = mListeners.get(i);
+ try {
+ listener.mListener.onNmeaReceived(timestamp, nmeaString);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in reportNmea");
+ mListeners.remove(listener);
+ // adjust for size of list changing
+ size--;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This methods parses the nmea sentences and sends the location updates
+ * and sats updates to listeners.
+ * @param sentences raw nmea sentences received by BT GPS Mouse
+ */
+ private void handleNMEAMessages(String sentences) {
+ String sentenceArray[] = sentences.split("\r\n");
+ nmeaparser.reset();
+ for (int i = 0; i < sentenceArray.length; i++) {
+ if (D) Log.d(TAG, "About to parse: " + sentenceArray[i]);
+ if ((sentenceArray[i] != null) && ("".equals(sentenceArray[i]))) continue;
+ boolean parsed = nmeaparser.parseNMEALine(sentenceArray[i]);
+ // handle nmea message. Also report messages that we could not parse as these
+ // might be propriatery messages that other listeners could support.
+ reportNmea(sentenceArray[i], System.currentTimeMillis());
+ }
+ Location loc = nmeaparser.getLocation();
+ // handle location update if valid
+ reportLocation(loc , nmeaparser.isValid());
+ if (nmeaparser.isSatdataReady()) {
+ reportSvStatus(nmeaparser.getmSvCount(), nmeaparser.getmSvs(), nmeaparser.getmSnrs(),
+ nmeaparser.getmSvElevations(), nmeaparser.getmSvAzimuths(),
+ nmeaparser.getmSvMasks());
+ }
+
+ // adjust refresh rate based on received timestamp of mouse
+ // min 1hz and max 10 hz
+ long newRate = nmeaparser.getApproximatedRefreshRate();
+ if (btsvc.getRefreshRate() != newRate) {
+ if (D) Log.d(TAG, "Setting refresh rate to: " + newRate
+ + " was: " + btsvc.getRefreshRate());
+ btsvc.setRefreshRate(newRate);
+ }
+ }
+
+
+ /*
+ * Stuff below is taken from the android GPS location provider.
+ * Does handling of messages/listeners and so on.
+ */
+
+ private void sendMessage(int message, int arg, Object obj) {
+ // hold a wake lock while messages are pending
+ synchronized (mWakeLock) {
+ mPendingMessageBits |= (1 << message);
+ mWakeLock.acquire();
+ mHandler.removeMessages(message);
+ Message m = Message.obtain(mHandler, message);
+ m.arg1 = arg;
+ m.obj = obj;
+ mHandler.sendMessage(m);
+ }
+ }
+
+
+ private void updateStatus(int status, int svCount) {
+ if (status != mStatus || svCount != mSvCount) {
+ mStatus = status;
+ mSvCount = svCount;
+ mLocationExtras.putInt("satellites", svCount);
+ mStatusUpdateTime = SystemClock.elapsedRealtime();
+ }
+ }
+ private ArrayList<Listener> mListeners = new ArrayList<Listener>();
+
+ private final class Listener implements IBinder.DeathRecipient {
+ final IGpsStatusListener mListener;
+
+ Listener(IGpsStatusListener listener) {
+ mListener = listener;
+ }
+
+ public void binderDied() {
+ if (D) Log.d(TAG, "GPS status listener died");
+
+ synchronized(mListeners) {
+ mListeners.remove(this);
+ }
+ if (mListener != null) {
+ mListener.asBinder().unlinkToDeath(this, 0);
+ }
+ }
+ }
+
+
+ private final IGpsStatusProvider mGpsStatusProvider = new IGpsStatusProvider.Stub() {
+ public void addGpsStatusListener(IGpsStatusListener listener) throws RemoteException {
+ if (listener == null) {
+ throw new NullPointerException("listener is null in addGpsStatusListener");
+ }
+ synchronized(mListeners) {
+ IBinder binder = listener.asBinder();
+ int size = mListeners.size();
+ for (int i = 0; i < size; i++) {
+ Listener test = mListeners.get(i);
+ if (binder.equals(test.mListener.asBinder())) {
+ // listener already added
+ return;
+ }
+ }
+ Listener l = new Listener(listener);
+ binder.linkToDeath(l, 0);
+ mListeners.add(l);
+ }
+ }
+
+ public void removeGpsStatusListener(IGpsStatusListener listener) {
+ if (listener == null) {
+ throw new NullPointerException("listener is null in addGpsStatusListener");
+ }
+
+ synchronized(mListeners) {
+ IBinder binder = listener.asBinder();
+ Listener l = null;
+ int size = mListeners.size();
+ for (int i = 0; i < size && l == null; i++) {
+ Listener test = mListeners.get(i);
+ if (binder.equals(test.mListener.asBinder())) {
+ l = test;
+ }
+ }
+
+ if (l != null) {
+ mListeners.remove(l);
+ binder.unlinkToDeath(l, 0);
+ }
+ }
+ }
+ };
+
+ public IGpsStatusProvider getGpsStatusProvider() {
+ return mGpsStatusProvider;
+ }
+
+ public void addListener(int uid) {
+ synchronized (mWakeLock) {
+ mPendingListenerMessages++;
+ mWakeLock.acquire();
+ Message m = Message.obtain(mHandler, ADD_LISTENER);
+ m.arg1 = uid;
+ mHandler.sendMessage(m);
+ }
+ }
+
+ private void handleAddListener(int uid) {
+ synchronized(mListeners) {
+ if (mClientUids.indexOfKey(uid) >= 0) {
+ // Shouldn't be here -- already have this uid.
+ Log.w(TAG, "Duplicate add listener for uid " + uid);
+ return;
+ }
+ mClientUids.put(uid, 0);
+ if (mNavigating) {
+ try {
+ mBatteryStats.noteStartGps(uid);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in addListener");
+ }
+ }
+ }
+ }
+
+ public void removeListener(int uid) {
+ synchronized (mWakeLock) {
+ mPendingListenerMessages++;
+ mWakeLock.acquire();
+ Message m = Message.obtain(mHandler, REMOVE_LISTENER);
+ m.arg1 = uid;
+ mHandler.sendMessage(m);
+ }
+ }
+
+ private void handleRemoveListener(int uid) {
+ synchronized(mListeners) {
+ if (mClientUids.indexOfKey(uid) < 0) {
+ // Shouldn't be here -- don't have this uid.
+ Log.w(TAG, "Unneeded remove listener for uid " + uid);
+ return;
+ }
+ mClientUids.delete(uid);
+ if (mNavigating) {
+ try {
+ mBatteryStats.noteStopGps(uid);
+ } catch (RemoteException e) {
+ Log.w(TAG, "RemoteException in removeListener");
+ }
+ }
+ }
+ }
+}
diff --git a/services/java/com/android/server/location/NMEAParser.java b/services/java/com/android/server/location/NMEAParser.java
new file mode 100644
index 0000000..90bbe84
--- /dev/null
+++ b/services/java/com/android/server/location/NMEAParser.java
@@ -0,0 +1,544 @@
+/*
+ * Copyright (C) 2011 Cuong Bui
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import android.location.Location;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+
+public class NMEAParser {
+ private static final String TAG = "NMEAParser";
+ private static final String delim = ",";
+ // NMEA sentence pattern
+ private final Pattern sentencePattern = Pattern.compile("\\$([^*$]{5,})(\\*\\w{2})?");
+ private final SimpleDateFormat timeFormatter = new SimpleDateFormat("HHmmss.S");
+ private final TimeZone mLocalTZ = TimeZone.getDefault();
+
+ private HashMap<String,ParseInterface> parseMap = new HashMap<String,ParseInterface>();
+ private String provider;
+
+ private static final String BUNDLE_SATS = "satellites";
+ // for GPS SV statistics
+ private static final int MAX_SVS = 32;
+ public static final int EPHEMERIS_MASK = 0;
+ public static final int ALMANAC_MASK = 1;
+ public static final int USED_FOR_FIX_MASK = 2;
+
+ // preallocated arrays, to avoid memory allocation in reportStatus()
+ private int mSvs[] = new int[MAX_SVS];
+ private float mSnrs[] = new float[MAX_SVS];
+ private float mSvElevations[] = new float[MAX_SVS];
+ private float mSvAzimuths[] = new float[MAX_SVS];
+ private int mSvMasks[] = new int[3];
+ private int mSvCount;
+
+ private float PDOP = 0f;
+ private float HDOP = 0f;
+ private float VDOP = 0f;
+
+ private boolean isValid = false;
+ private long mFixDateTimeStamp = 0;
+ private double mFixLongitude = 0.0;
+ private double mFixLatitude = 0.0;
+ private float mFixAltitude = 0f;
+ private float mFixSpeed = 0f;
+ private float mFixBearing = 0f;
+ private float mFixAccuracy = 0f;
+ private int mFixSatsTracked=0;
+ private int mFixQuality = 0;
+
+ //horizontal estimated position error
+ private float HEPE_FACTOR = 4f;
+
+ // last fix timestamp. Is used to approximate and adjust gps mouse refresh rate.
+ private long mFixTimestampDelta=500;
+
+ private boolean mSatsReady = true;
+ private Location loc = new Location(provider);
+ private GregorianCalendar currCalendar = new GregorianCalendar();
+
+ /**
+ * @param prov Location provider name
+ */
+ public NMEAParser(String prov) {
+ // init parser map with all known parsers
+ parseMap.put("GPRMC", new GPRMCParser());
+ parseMap.put("GPGGA", new GPGGAParser());
+ parseMap.put("GPGSA", new GPGSAParser());
+ parseMap.put("GPGSV", new GPGSVParser());
+
+ provider = prov;
+ timeFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ }
+
+ private void updateTimeStamp(long in) {
+ if (mFixDateTimeStamp != 0 && in != mFixDateTimeStamp) {
+ mFixTimestampDelta = in - mFixDateTimeStamp;
+ if (mFixTimestampDelta < 100) mFixTimestampDelta = 100;
+ if (mFixTimestampDelta > 1000) mFixTimestampDelta = 1000;
+ }
+ mFixDateTimeStamp = in;
+ }
+
+ public long getApproximatedRefreshRate() {
+ return mFixTimestampDelta;
+ }
+ /**
+ * @return if nmea sentence are valid then true
+ */
+ public boolean isValid() {
+ return isValid;
+ }
+
+ /**
+ * resets fix variables
+ */
+ public void reset() {
+ mFixLongitude = 0.0;
+ mFixLatitude = 0.0;
+ mFixAltitude = 0f;
+ mFixSpeed = 0f;
+ mFixAccuracy = 0f;
+ mFixQuality = 0;
+ mFixSatsTracked = 0;
+ }
+
+ private void resetSats() {
+ mSvCount = 0;
+ java.util.Arrays.fill(mSvs, 0);
+ java.util.Arrays.fill(mSnrs, 0f);
+ java.util.Arrays.fill(mSvElevations, 0f);
+ java.util.Arrays.fill(mSvAzimuths, 0f);
+ }
+
+
+ /**
+ * @return a Location object if valid null otherwise
+ */
+ public Location getLocation() {
+ loc.reset();
+ if (mFixDateTimeStamp != 0) loc.setTime(mFixDateTimeStamp);
+ loc.setLatitude(mFixLatitude);
+ loc.setLongitude(mFixLongitude);
+ Bundle extras = new Bundle();
+ extras.putInt(BUNDLE_SATS, mFixSatsTracked);
+ loc.setExtras(extras);
+ loc.setAccuracy(mFixAccuracy);
+ loc.setAltitude(mFixAltitude);
+ loc.setSpeed(mFixSpeed);
+ loc.setBearing(mFixBearing);
+ return loc;
+ }
+
+ /**
+ * @param time UTC time
+ * @return nr seconds since 1970
+ */
+ private long parseTimeToDate(String time) {
+ try {
+ Date btTime = timeFormatter.parse(time);
+ //System.currentTimeMillis()
+ GregorianCalendar cc = new GregorianCalendar();
+ cc.setTimeInMillis(System.currentTimeMillis());
+ currCalendar.setTimeInMillis(btTime.getTime() + mLocalTZ.getRawOffset());
+ currCalendar.set(cc.get(Calendar.YEAR), cc.get(Calendar.MONTH),
+ cc.get(Calendar.DAY_OF_WEEK));
+ return currCalendar.getTimeInMillis();
+ } catch (ParseException e) {
+ Log.e(TAG, "Could not parse: " + time);
+ return 0;
+ }
+ }
+
+ private int parseStringToInt(String str) {
+ if (TextUtils.isEmpty(str))
+ return 0;
+ int res = 0;
+ try {
+ res = Integer.parseInt(str);
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage());
+ }
+ return res;
+ }
+
+ private float parseStringToFloat(String str) {
+ if (TextUtils.isEmpty(str))
+ return 0.0f;
+
+ float res = 0.0f;
+ try {
+ res = Float.parseFloat(str);
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage());
+ }
+ return res;
+ }
+
+ /**
+ * @param in Longitude/Latitude
+ * @param orientation N,W,S,E
+ * @return The double representation of a Longitude/Latitude
+ */
+ private double parseCoordinate(String in, String orientation) {
+ // dec = deg + mins.sec/60
+ double c = Double.parseDouble(in);
+ int deg = (int) (c/100);
+ double res = deg + (c - deg*100.0)*0.016666666666667;
+ if ("S".equalsIgnoreCase(orientation) || "W".equalsIgnoreCase(orientation)) return -res;
+ return res;
+ }
+
+ private float parseSpeedInKnots(String str) {
+ float res = 0.0f;
+ res = Float.parseFloat(str) * 0.514444444f;
+ return res;
+ }
+
+ private float parseSpeedInKMH(String str) {
+ float res = 0.0f;
+ res = Float.parseFloat(str) * 0.277777778f;
+ return res;
+ }
+
+ /**
+ * Interface that all sentence parsers have to implement.
+ *
+ *Every sentence is implemented as a seperate class. The Nmea
+ *parser will select the correct parser based on the sentence identifier.
+ *It will get or instantiate a parser to do the job.
+ */
+ private interface ParseInterface {
+ public void parse(String sentence);
+ }
+
+ public class GPRMCParser implements ParseInterface {
+ /*
+ * $GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
+
+Where:
+ RMC Recommended Minimum sentence C
+ 123519 Fix taken at 12:35:19 UTC
+ A Status A=active or V=Void.
+ 4807.038,N Latitude 48 deg 07.038' N
+ 01131.000,E Longitude 11 deg 31.000' E
+ 022.4 Speed over the ground in knots
+ 084.4 Track angle in degrees True
+ 230394 Date - 23rd of March 1994
+ 003.1,W Magnetic Variation
+ *6A The checksum data, always begins with *
+
+ */
+ @Override
+ public void parse(String sentence) {
+ String[] tmp = sentence.split(delim);
+ if (tmp.length > 3) {
+ updateTimeStamp(parseTimeToDate(tmp[1]));
+ if (!"A".equals(tmp[2])) {
+ return;
+ }
+ mFixLatitude = parseCoordinate(tmp[3], tmp[4]);
+ mFixLongitude = parseCoordinate(tmp[5], tmp[6]);
+ mFixSpeed = parseSpeedInKnots(tmp[7]);
+ mFixBearing = parseStringToFloat(tmp[8]);
+ }
+ }
+ }
+
+ public class GPGGAParser implements ParseInterface {
+ /*
+ $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
+Where:
+ GGA Global Positioning System Fix Data
+ 123519 Fix taken at 12:35:19 UTC
+ 4807.038,N Latitude 48 deg 07.038' N
+ 01131.000,E Longitude 11 deg 31.000' E
+ 1 Fix quality: 0 = invalid
+ 1 = GPS fix (SPS)
+ 2 = DGPS fix
+ 3 = PPS fix
+ 4 = Real Time Kinematic
+ 5 = Float RTK
+ 6 = estimated (dead reckoning) (2.3 feature)
+ 7 = Manual input mode
+ 8 = Simulation mode
+ 08 Number of satellites being tracked
+ 0.9 Horizontal dilution of position
+ 545.4,M Altitude, Meters, above mean sea level
+ 46.9,M Height of geoid (mean sea level) above WGS84
+ ellipsoid
+ (empty field) time in seconds since last DGPS update
+ (empty field) DGPS station ID number
+ *47 the checksum data, always begins with * */
+ @Override
+ public void parse(String sentence) {
+ String[] tmp = sentence.split(delim);
+ if (tmp.length > 7) {
+ // always parse timestamp
+ updateTimeStamp(parseTimeToDate(tmp[1]));
+ mFixQuality = Integer.parseInt(tmp[6]);
+ if (mFixQuality == 0) {
+ // return invalid location
+ isValid = false;
+ return;
+ }
+ mFixLatitude = parseCoordinate(tmp[2], tmp[3]);
+ mFixLongitude = parseCoordinate(tmp[4], tmp[5]);
+ mFixSatsTracked = parseStringToInt(tmp[7]);
+ mFixAccuracy = parseStringToFloat(tmp[8]) * HEPE_FACTOR;
+ mFixAltitude = parseStringToFloat(tmp[9]);
+ isValid = true;
+ }
+ }
+ }
+
+ public class GPGSAParser implements ParseInterface {
+ /*
+ $GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39
+
+Where:
+ GSA Satellite status
+ A Auto selection of 2D or 3D fix (M = manual)
+ 3 3D fix - values include: 1 = no fix
+ 2 = 2D fix
+ 3 = 3D fix
+ 04,05... PRNs of satellites used for fix (space for 12)
+ 2.5 PDOP (dilution of precision)
+ 1.3 Horizontal dilution of precision (HDOP)
+ 2.1 Vertical dilution of precision (VDOP)
+ *39 the checksum data, always begins with *
+ * */
+ @Override
+ public void parse(String sentence) {
+ String[] tmp = sentence.split(delim);
+ if (tmp.length >= 16) {
+ if ("1".equals(tmp[2])) {
+ // return invalid location or invalid sentence
+ return;
+ }
+ for (int i=3; i < 15; i++) {
+ // tag sats used for fix
+ int sat = parseStringToInt(tmp[i]);
+ if (sat > 0) mSvMasks[USED_FOR_FIX_MASK] |= (1 << (sat - 1));
+ }
+ if (tmp.length > 15)
+ PDOP = parseStringToFloat(tmp[15]);
+ if (tmp.length > 16)
+ HDOP = parseStringToFloat(tmp[16]);
+ if (tmp.length > 17)
+ VDOP = parseStringToFloat(tmp[17]);
+ }
+ }
+ }
+
+ /**
+ * Parse sats information. Use same structure as internal GPS provider
+ *
+ */
+ public class GPGSVParser implements ParseInterface {
+ /*
+ $GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75
+
+Where:
+ GSV Satellites in view
+ 2 Number of sentences for full data
+ 1 sentence 1 of 2
+ 08 Number of satellites in view
+
+ 01 Satellite PRN number
+ 40 Elevation, degrees
+ 083 Azimuth, degrees
+ 46 SNR - higher is better
+ for up to 4 satellites per sentence
+ *75 the checksum data, always begins with *
+ */
+ @Override
+ public void parse(String sentence) {
+ String[] tmp = sentence.split(delim);
+ if (tmp.length > 4) {
+ mSvCount = parseStringToInt(tmp[3]);
+ if (mSvCount == 0) {
+ return;
+ }
+ int totalSentences = parseStringToInt(tmp[1]);
+ int currSentence = parseStringToInt(tmp[2]);
+
+ if (mSatsReady) {
+ resetSats();
+ mSatsReady = false;
+ } else if ((currSentence == totalSentences) && !mSatsReady) {
+ // tag data as dirty when we have parsed the last part
+ mSatsReady = true;
+ }
+ int idx = 0;
+ while ((currSentence <= totalSentences) && (idx < 4)) {
+ int offset = idx<<2;
+ int base_offset = (currSentence-1)<<2;
+ if (offset+4 < tmp.length)
+ mSvs[base_offset + idx] = parseStringToInt(tmp[4 + offset]);
+ if (offset+5 < tmp.length)
+ mSvElevations[base_offset + idx] = parseStringToInt(tmp[5 + offset]);
+ if (offset+6 < tmp.length)
+ mSvAzimuths[base_offset + idx] = parseStringToInt(tmp[6 + offset]);
+ if (offset+7 < tmp.length)
+ mSnrs[base_offset + idx] = parseStringToInt(tmp[7 + offset]);
+ idx++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Using non static dynamic innerclass instantiation.
+ * @param sid sentence identifier
+ * @return parser associated with the sid
+ */
+ private ParseInterface getParser(String sid) {
+ if (parseMap.containsKey(sid)) {
+ return parseMap.get(sid);
+ } else {
+ Log.d(TAG, "Could not instantiate " + sid + "parser");
+ }
+ return null;
+ }
+
+ /**
+ * @param in nmea sentence
+ * @return String representing checksum of the input
+ */
+ private String computeChecksum(String in) {
+ byte result = 0;
+ char[] chars = in.toCharArray();
+ for (int i=0; i < chars.length; i++)
+ result ^= (byte) chars[i];
+ return String.format("%02X", result);
+ }
+
+ public boolean parseNMEALine(String sentence) {
+ Matcher m = sentencePattern.matcher(sentence);
+ if (m.matches()) {
+ String nmeaSentence = m.group(1);
+ String command = nmeaSentence.substring(0, 5);
+ String checksum = m.group(2);
+ if (checksum != null) {
+ // checksums are optional
+ // strip off *, checksum always have length 3 here. else the regex will not match
+ checksum = checksum.substring(1, 3);
+ if (!computeChecksum(nmeaSentence).equals(checksum)) {
+ Log.w(TAG, "skipping sentence: " + sentence + " due to checksum error "
+ + checksum + " - " + computeChecksum(nmeaSentence));
+ return false;
+ }
+ }
+ ParseInterface parser = getParser(command);
+ if (parser != null) {
+ try {
+ parser.parse(nmeaSentence);
+ } catch (Exception e) {
+ // catch exception thrown by parsers
+ // mostly bad input causing out of bounds
+ Log.e(TAG,nmeaSentence, e);
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public int getmSvCount() {
+ return mSvCount;
+ }
+
+ public float getPDOP() {
+ return PDOP;
+ }
+
+ public float getHDOP() {
+ return HDOP;
+ }
+
+ public float getVDOP() {
+ return VDOP;
+ }
+
+ public long getmFixDate() {
+ return mFixDateTimeStamp;
+ }
+
+ public double getmFixLongitude() {
+ return mFixLongitude;
+ }
+
+ public double getmFixLatitude() {
+ return mFixLatitude;
+ }
+
+ public float getmFixAltitude() {
+ return mFixAltitude;
+ }
+
+ public float getmFixSpeed() {
+ return mFixSpeed;
+ }
+
+ public float getmFixAccuracy() {
+ return mFixAccuracy;
+ }
+
+ public int getmFixQuality() {
+ return mFixQuality;
+ }
+ public int[] getmSvs() {
+ return mSvs;
+ }
+
+ public float[] getmSnrs() {
+ return mSnrs;
+ }
+
+ public float[] getmSvElevations() {
+ return mSvElevations;
+ }
+
+ public float[] getmSvAzimuths() {
+ return mSvAzimuths;
+ }
+
+ public int[] getmSvMasks() {
+ return mSvMasks;
+ }
+
+ public int getmFixSatsTracked() {
+ return mFixSatsTracked;
+ }
+
+ public boolean isSatdataReady() {
+ return mSatsReady;
+ }
+}
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index b8a59c1..83a764b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -24,6 +24,7 @@
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <linux/fb.h>
#include <sys/ioctl.h>
#include <cutils/log.h>
@@ -1676,7 +1677,7 @@ status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,
GLuint* textureName, GLfloat* uOut, GLfloat* vOut)
{
if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
+ return directRenderScreenToTextureLocked(dpy, textureName, uOut, vOut);
// get screen geometry
const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
@@ -1731,6 +1732,144 @@ status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,
// ---------------------------------------------------------------------------
+status_t SurfaceFlinger::directRenderScreenToTextureLocked(DisplayID dpy,
+ GLuint* textureName, GLfloat* uOut, GLfloat* vOut)
+{
+ status_t result;
+ const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
+
+ // use device framebuffer in /dev/graphics/fb0
+ size_t offset;
+ uint32_t bytespp, format, gl_format, gl_type;
+ size_t size = 0;
+ struct fb_var_screeninfo vinfo;
+ const char* fbpath = "/dev/graphics/fb0";
+ int fb = open(fbpath, O_RDONLY);
+ void const* mapbase = MAP_FAILED;
+ ssize_t mapsize = -1;
+
+ if (fb < 0) {
+ LOGE("Failed to open framebuffer");
+ return INVALID_OPERATION;
+ }
+
+ if (ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0) {
+ LOGE("Failed to get framebuffer info");
+ close(fb);
+ return INVALID_OPERATION;
+ }
+
+ bytespp = vinfo.bits_per_pixel / 8;
+ const uint32_t hw_w = vinfo.xres;
+ const uint32_t hw_h = vinfo.yres;
+
+ switch (bytespp) {
+ case 2:
+ format = PIXEL_FORMAT_RGB_565;
+ gl_format = GL_RGB;
+ gl_type = GL_UNSIGNED_SHORT_5_6_5;
+ break;
+ case 4:
+ format = PIXEL_FORMAT_RGBX_8888;
+ gl_format = GL_RGBA;
+ gl_type = GL_UNSIGNED_BYTE;
+ break;
+ default:
+ close(fb);
+ LOGE("Failed to detect framebuffer bytespp");
+ return INVALID_OPERATION;
+ break;
+ }
+
+ offset = (vinfo.xoffset + vinfo.yoffset * vinfo.xres) * bytespp;
+ size = vinfo.xres * vinfo.yres * bytespp;
+
+ mapsize = offset + size;
+ mapbase = mmap(0, mapsize, PROT_READ, MAP_PRIVATE, fb, 0);
+ close(fb);
+ if (mapbase == MAP_FAILED) {
+ return INVALID_OPERATION;
+ }
+
+ void const* fbbase = (void *)((char const *)mapbase + offset);
+ GLfloat u = 1;
+ GLfloat v = 1;
+
+ // build texture
+ GLuint tname;
+ glGenTextures(1, &tname);
+ glBindTexture(GL_TEXTURE_2D, tname);
+ glTexImage2D(GL_TEXTURE_2D, 0, gl_format,
+ hw_w, hw_h, 0, gl_format, GL_UNSIGNED_BYTE, 0);
+ if (glGetError() != GL_NO_ERROR) {
+ while ( glGetError() != GL_NO_ERROR ) ;
+ GLint tw = (2 << (31 - clz(hw_w)));
+ GLint th = (2 << (31 - clz(hw_h)));
+ glTexImage2D(GL_TEXTURE_2D, 0, gl_format,
+ tw, th, 0, gl_format, GL_UNSIGNED_BYTE, 0);
+ u = GLfloat(hw_w) / tw;
+ v = GLfloat(hw_h) / th;
+ }
+
+ // write fb data to image buffer texture (reverse order)
+ GLubyte* imageData = (GLubyte*)malloc(size);
+ if (imageData) {
+ void *ptr = imageData;
+ uint32_t rowlen = hw_w * bytespp;
+ offset = size;
+ for (uint32_t j = hw_h; j > 0; j--) {
+ offset -= rowlen;
+ memcpy(ptr, fbbase + offset, rowlen);
+ ptr += rowlen;
+ }
+
+ // write image buffer to the texture
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ // copy imageData to the texture
+ glTexImage2D(GL_TEXTURE_2D, 0, gl_format, hw_w, hw_h, 0,
+ gl_format, gl_type, imageData);
+
+ LOGI("direct Framebuffer texture for gl_format=%d gl_type=%d", gl_format, gl_type);
+ result = NO_ERROR;
+ } else {
+ result = NO_MEMORY;
+ }
+
+ // redraw the screen entirely...
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_SCISSOR_TEST);
+ glClearColor(0,0,0,1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEnable(GL_SCISSOR_TEST);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
+ const size_t count = layers.size();
+ for (size_t i=0 ; i<count ; ++i) {
+ const sp<LayerBase>& layer(layers[i]);
+ layer->drawForSreenShot();
+ }
+
+ hw.compositionComplete();
+
+ // done
+ munmap((void *)mapbase, mapsize);
+
+ *textureName = tname;
+ *uOut = u;
+ *vOut = v;
+
+ // free buffer memory
+ if (imageData) {
+ free(imageData);
+ }
+
+ return result;
+}
+
+
#ifndef ELECTRONBEAM_FRAMES
#define ELECTRONBEAM_FRAMES 12
#endif
@@ -2134,6 +2273,118 @@ status_t SurfaceFlinger::turnElectronBeamOn(int32_t mode)
// ---------------------------------------------------------------------------
+status_t SurfaceFlinger::directCaptureScreenImplLocked(DisplayID dpy,
+ sp<IMemoryHeap>* heap,
+ uint32_t* w, uint32_t* h, PixelFormat* f,
+ uint32_t sw, uint32_t sh)
+{
+ status_t result = PERMISSION_DENIED;
+
+ uint32_t width, height, format;
+ uint32_t bytespp;
+ void const* mapbase = MAP_FAILED;
+ ssize_t mapsize = -1;
+
+ struct fb_var_screeninfo vinfo;
+ const char* fbpath = "/dev/graphics/fb0";
+
+ // only one display supported for now
+ if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
+ return BAD_VALUE;
+
+ // get screen geometry
+ const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
+ const uint32_t hw_w = hw.getWidth();
+ const uint32_t hw_h = hw.getHeight();
+
+ if ((sw > hw_w) || (sh > hw_h))
+ return BAD_VALUE;
+
+ sw = (!sw) ? hw_w : sw;
+ sh = (!sh) ? hw_h : sh;
+
+ int fb = open(fbpath, O_RDONLY);
+ if (fb < 0) {
+ LOGE("Failed to open framebuffer");
+ return INVALID_OPERATION;
+ }
+
+ if (ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0) {
+ LOGE("Failed to get framebuffer info");
+ close(fb);
+ return INVALID_OPERATION;
+ }
+
+ bytespp = vinfo.bits_per_pixel / 8;
+ switch (bytespp) {
+ case 2:
+ format = PIXEL_FORMAT_RGB_565;
+ break;
+ case 4:
+ format = PIXEL_FORMAT_RGBX_8888;
+ break;
+ default:
+ close(fb);
+ LOGE("Failed to detect framebuffer bytespp");
+ return INVALID_OPERATION;
+ break;
+ }
+
+ size_t offset = (vinfo.xoffset + vinfo.yoffset * vinfo.xres) * bytespp;
+ size_t size = vinfo.xres * vinfo.yres * bytespp;
+ mapsize = offset + size;
+ mapbase = mmap(0, mapsize, PROT_READ, MAP_PRIVATE, fb, 0);
+ close(fb);
+ if (mapbase == MAP_FAILED) {
+ return INVALID_OPERATION;
+ }
+
+ width = vinfo.xres;
+ height = vinfo.yres;
+ void const* fbbase = (void *)((char const *)mapbase + offset);
+
+ const LayerVector& layers(mDrawingState.layersSortedByZ);
+ const size_t count = layers.size();
+ for (size_t i=0 ; i<count ; ++i) {
+ const sp<LayerBase>& layer(layers[i]);
+ const uint32_t flags = layer->drawingState().flags;
+ }
+
+ // allocate shared memory large enough to hold the
+ // screen capture
+ size = sw * sh * bytespp;
+ sp<MemoryHeapBase> heapBase(
+ new MemoryHeapBase(size, 0, "screen-capture") );
+ void* ptr = heapBase->getBase();
+
+ if (ptr) {
+ if ((sw == hw_w) && (sh == hw_h)) {
+ memcpy(ptr, fbbase, size);
+ } else {
+ uint32_t rowlen = hw_w * bytespp;
+ uint32_t collen = sw * bytespp;
+ size_t offset = 0;
+ for (uint32_t j = 0; j < sh; j++) {
+ memcpy(ptr, fbbase + offset, collen);
+ ptr += collen;
+ offset += rowlen;
+ }
+ }
+ *heap = heapBase;
+ *w = sw;
+ *h = sh;
+ *f = format;
+ result = NO_ERROR;
+ } else {
+ result = NO_MEMORY;
+ }
+ munmap((void *)mapbase, mapsize);
+
+ hw.compositionComplete();
+
+ return result;
+}
+
status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
sp<IMemoryHeap>* heap,
uint32_t* w, uint32_t* h, PixelFormat* f,
@@ -2146,7 +2397,8 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
return BAD_VALUE;
if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
+ return directCaptureScreenImplLocked(dpy,
+ heap, w, h, f, sw, sh);
// get screen geometry
const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
@@ -2254,9 +2506,6 @@ status_t SurfaceFlinger::captureScreen(DisplayID dpy,
if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
return BAD_VALUE;
- if (!GLExtensions::getInstance().haveFramebufferObject())
- return INVALID_OPERATION;
-
class MessageCaptureScreen : public MessageBase {
SurfaceFlinger* flinger;
DisplayID dpy;
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index afa9a21..2fc26e8 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -345,6 +345,14 @@ private:
uint32_t* width, uint32_t* height, PixelFormat* format,
uint32_t reqWidth = 0, uint32_t reqHeight = 0);
+ status_t directCaptureScreenImplLocked(DisplayID dpy,
+ sp<IMemoryHeap>* heap,
+ uint32_t* width, uint32_t* height, PixelFormat* format,
+ uint32_t reqWidth, uint32_t reqHeight);
+
+ status_t directRenderScreenToTextureLocked(DisplayID dpy,
+ GLuint* textureName, GLfloat* uOut, GLfloat* vOut);
+
status_t turnElectronBeamOffImplLocked(int32_t mode);
status_t turnElectronBeamOnImplLocked(int32_t mode);
status_t electronBeamOffAnimationImplLocked();
diff --git a/telephony/java/com/android/internal/telephony/IccFileHandler.java b/telephony/java/com/android/internal/telephony/IccFileHandler.java
index 92ddd2c..40d6983 100644
--- a/telephony/java/com/android/internal/telephony/IccFileHandler.java
+++ b/telephony/java/com/android/internal/telephony/IccFileHandler.java
@@ -104,7 +104,7 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
LoadLinearFixedContext(int efid, int recordNum, Message onLoaded) {
this.efid = efid;
- this.recordNum = recordNum;
+ this.recordNum = java.lang.Math.max(recordNum, 1); // Clamp to 1 since the index is 1 based, just in case
this.onLoaded = onLoaded;
this.loadAll = false;
}
@@ -283,6 +283,125 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
response.sendToTarget();
}
+ /**
+ * Fills a 3 integer array. This is necessary for many canadian carriers for which
+ * UICC contains commands in TLV format (Refer 11.1.1.3 of ETSI TS 102 221)
+ *
+ * @param data
+ * @param arrayToReturn : [0] = Record Size; [1] = File Size; [2] = Number of Records
+ */
+ private void ParseUICCTLVData(byte[] data, int[] arrayToReturn) throws IccFileTypeMismatch {
+ int curByte = 0;
+ int curTag;
+ int curSectionLen;
+ if (((short)data[curByte++] & 0xFF) == 0x62) {
+ logd("TLV format detected");
+ curSectionLen = data[curByte++];
+ int dataLenLeft = data.length-2;
+ if (curSectionLen != dataLenLeft) {
+ logd("Unexpected TLV length of " + curSectionLen + "; we have " + dataLenLeft + "bytes of data left");
+ // ... It sometimes happens, even if mandatory parts are missing and length > than the actual size. Data is truncated?
+ // throw new IccFileTypeMismatch();
+ }
+
+ // File Descriptor '0x82' (mandatory)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag != 0x82) {
+ logd("Unexpected TLV data, expecting file descriptor tag, but got " + curTag);
+ throw new IccFileTypeMismatch();
+ }
+ curSectionLen = data[curByte++];
+ if (curSectionLen != 5) {
+ // TODO : Currently, a length of 2 is not handled
+ logd("TLV File Description length of " + curSectionLen + " is not handled yet");
+ throw new IccFileTypeMismatch();
+ }
+ arrayToReturn[0] = ((data[curByte+2] & 0xff) << 8) +
+ (data[curByte+3] & 0xff); // Length of 1 record
+ arrayToReturn[2] = data[curByte+4]; // Number of records
+
+ // File size is normally set later, but for some reason, sometimes the data
+ // is missing mandatory section. For this reason, set the information here
+ // it should match anyway... (honestly, I'm not sure)
+ arrayToReturn[1] = arrayToReturn[0] * arrayToReturn[2];
+ curByte += curSectionLen;
+
+ // File Identifier '0x83' (mandatory)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag != 0x83) {
+ logd("Unexpected TLV data, expecting file identifier tag, but got " + curTag);
+ throw new IccFileTypeMismatch();
+ }
+ curSectionLen = data[curByte++];
+ curByte += curSectionLen;
+
+ // Proprietary info '0xA5' (optional)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag == 0xA5) {
+ // Not needed, just skip it...
+ curSectionLen = data[curByte++];
+ curByte += curSectionLen;
+ }
+
+ // Data is sometimes truncated!? Mandatory parts are sometimes missing and TLV length > than the actual data size.
+ // Do not throw exception, try to do our best
+ if (data.length > curByte) {
+ // Life Cycle Status Integer '0x8A' (mandatory)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag != 0x8A) {
+ logd("Unexpected TLV data, expecting Life Cycle Status Integer tag, but got " + curTag);
+ throw new IccFileTypeMismatch();
+ }
+ // Not needed, just skip it...
+ curSectionLen = data[curByte++];
+ curByte += curSectionLen;
+ }
+
+ // Data is sometimes truncated!? Mandatory parts are sometimes missing and TLV length > than the actual data size.
+ // Do not throw exception, try to do our best
+ if (data.length > curByte) {
+ // Security Attributes '0x8B' / '0x8C' / '0xAB' (exactly one of them is mandatory)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag != 0x8B &&
+ curTag != 0x8C &&
+ curTag != 0xAB) {
+ logd("Unexpected TLV data, expecting Security Attributes tag, but got " + curTag);
+ throw new IccFileTypeMismatch();
+ }
+ // Not needed, just skip it...
+ curSectionLen = data[curByte++];
+ curByte += curSectionLen;
+ }
+
+ // Data is sometimes truncated!? Mandatory parts are sometimes missing and TLV length > than the actual data size.
+ // Do not throw exception, try to do our best
+ if (data.length > curByte) {
+ // File Size '0x80' (mandatory)
+ curTag = ((int)data[curByte++]) & 0xFF;
+ if (curTag != 0x80) {
+ logd("Unexpected TLV data, expecting File Size tag, but got " + curTag);
+ throw new IccFileTypeMismatch();
+ }
+ curSectionLen = data[curByte++];
+ arrayToReturn[1] = 0;
+ for (int i = 0; i < curSectionLen; i++) {
+ arrayToReturn[1] += ((data[i] & 0xff) << (8*i)); // File size
+ }
+ curByte += curSectionLen;
+ }
+
+ logd("ParseUICCTLVData result: Record Size = " + arrayToReturn[0] + "; File Size = " + arrayToReturn[1] + "; Number of Records = " + arrayToReturn[2]);
+
+ // Total File Size '0x81' (optional)
+ // Short File Identifier '0x88' (optional)
+ // --> not used...
+ }
+ else {
+ logd("Throwing exception : Expecting a TLV tag!");
+ throw new IccFileTypeMismatch();
+ }
+ }
+
//***** Overridden from Handler
public void handleMessage(Message msg) {
@@ -297,7 +416,7 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
int size;
int fileid;
int recordNum;
- int recordSize[];
+ int recordSize[] = new int[3];
try {
switch (msg.what) {
@@ -341,16 +460,21 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
data = result.payload;
- if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE] ||
- EF_TYPE_LINEAR_FIXED != data[RESPONSE_DATA_STRUCTURE]) {
- throw new IccFileTypeMismatch();
+ if (data[0] == 0x62) {
+ ParseUICCTLVData(data, recordSize);
}
+ else {
+ if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE] ||
+ EF_TYPE_LINEAR_FIXED != data[RESPONSE_DATA_STRUCTURE]) {
+ logd("Exception in EVENT_GET_EF_LINEAR_RECORD_SIZE_DONE");
+ throw new IccFileTypeMismatch();
+ }
- recordSize = new int[3];
- recordSize[0] = data[RESPONSE_DATA_RECORD_LENGTH] & 0xFF;
- recordSize[1] = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
- + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
- recordSize[2] = recordSize[1] / recordSize[0];
+ recordSize[0] = data[RESPONSE_DATA_RECORD_LENGTH] & 0xFF;
+ recordSize[1] = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
+ + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
+ recordSize[2] = recordSize[1] / recordSize[0];
+ }
sendResult(response, recordSize, null);
break;
@@ -376,31 +500,41 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
fileid = lc.efid;
recordNum = lc.recordNum;
- if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE]) {
- throw new IccFileTypeMismatch();
+ if (data[0] == 0x62) {
+ ParseUICCTLVData(data, recordSize);
+ lc.recordSize = recordSize[0];
+ size = recordSize[1];
+ lc.countRecords = recordSize[2];
}
+ else {
+ if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE]) {
+ logd("Exception in EVENT_GET_RECORD_SIZE_DONE");
+ throw new IccFileTypeMismatch();
+ }
- if (EF_TYPE_LINEAR_FIXED != data[RESPONSE_DATA_STRUCTURE]) {
- throw new IccFileTypeMismatch();
- }
+ if (EF_TYPE_LINEAR_FIXED != data[RESPONSE_DATA_STRUCTURE]) {
+ logd("Exception in EVENT_GET_RECORD_SIZE_DONE");
+ throw new IccFileTypeMismatch();
+ }
- lc.recordSize = data[RESPONSE_DATA_RECORD_LENGTH] & 0xFF;
+ lc.recordSize = data[RESPONSE_DATA_RECORD_LENGTH] & 0xFF;
- size = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
- + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
+ size = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
+ + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
+ lc.countRecords = size / lc.recordSize;
+ }
- lc.countRecords = size / lc.recordSize;
- if (lc.loadAll) {
- lc.results = new ArrayList<byte[]>(lc.countRecords);
- }
+ if (lc.loadAll) {
+ lc.results = new ArrayList<byte[]>(lc.countRecords);
+ }
- phone.mCM.iccIO(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
- lc.recordNum,
- READ_RECORD_MODE_ABSOLUTE,
- lc.recordSize, null, null,
- obtainMessage(EVENT_READ_RECORD_DONE, lc));
- break;
+ phone.mCM.iccIO(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
+ lc.recordNum,
+ READ_RECORD_MODE_ABSOLUTE,
+ lc.recordSize, null, null,
+ obtainMessage(EVENT_READ_RECORD_DONE, lc));
+ break;
case EVENT_GET_BINARY_SIZE_DONE:
ar = (AsyncResult)msg.obj;
response = (Message) ar.userObj;
@@ -422,16 +556,24 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
fileid = msg.arg1;
- if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE]) {
- throw new IccFileTypeMismatch();
+ if (data[0] == 0x62) {
+ ParseUICCTLVData(data, recordSize);
+ size = recordSize[1];
}
+ else {
+ if (TYPE_EF != data[RESPONSE_DATA_FILE_TYPE]) {
+ logd("Exception in EVENT_GET_BINARY_SIZE_DONE");
+ throw new IccFileTypeMismatch();
+ }
- if (EF_TYPE_TRANSPARENT != data[RESPONSE_DATA_STRUCTURE]) {
- throw new IccFileTypeMismatch();
- }
+ if (EF_TYPE_TRANSPARENT != data[RESPONSE_DATA_STRUCTURE]) {
+ logd("Exception in EVENT_GET_BINARY_SIZE_DONE");
+ throw new IccFileTypeMismatch();
+ }
- size = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
- + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
+ size = ((data[RESPONSE_DATA_FILE_SIZE_1] & 0xff) << 8)
+ + (data[RESPONSE_DATA_FILE_SIZE_2] & 0xff);
+ }
phone.mCM.iccIO(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
0, 0, size, null, null,
diff --git a/telephony/java/com/android/internal/telephony/LGEStarRIL.java b/telephony/java/com/android/internal/telephony/LGEStarRIL.java
index 4941078..4b84f57 100644
--- a/telephony/java/com/android/internal/telephony/LGEStarRIL.java
+++ b/telephony/java/com/android/internal/telephony/LGEStarRIL.java
@@ -94,7 +94,7 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
super(context, networkMode, cdmaSubscription);
/* The star needs to ignore SCREEN_X states, in order to keep the
* batt updates running. The others don't need this */
- if (SystemProperties.get("ro.build.product").indexOf("p99") == 0) {
+ if (SystemProperties.get("ro.cm.device").indexOf("p99") == 0) {
context.unregisterReceiver(mIntentReceiver);
BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
@Override
@@ -151,7 +151,7 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
public void
setRadioPower(boolean on, Message result) {
if(mPrepSetupPending) {
- if (SystemProperties.get("ro.build.product").equals("p999")) {
+ if (SystemProperties.get("ro.cm.device").equals("p999")) {
/* Set radio access tech */
RILRequest rrSPR = RILRequest.obtain(
296, null);
@@ -219,7 +219,7 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
/* Set "ready" */
RILRequest rrSc = RILRequest.obtain(
- (SystemProperties.get("ro.build.product").equals("p999") ? 304 : 298), null);
+ (SystemProperties.get("ro.cm.device").equals("p999") ? 304 : 298), null);
rrSc.mp.writeInt(1);
rrSc.mp.writeInt(0);
if (RILJ_LOGD) riljLog(rrSc.serialString() + "> "
@@ -411,7 +411,7 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
/* Request service line */
RILRequest rrSL = RILRequest.obtain(
- (SystemProperties.get("ro.build.product").equals("p999") ? 294 : 286), null);
+ (SystemProperties.get("ro.cm.device").equals("p999") ? 294 : 286), null);
rrSL.mp.writeInt(0);
if (RILJ_LOGD) riljLog(rrSL.serialString() + "> "
+ requestToString(rrSL.mRequest));
@@ -999,7 +999,8 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
String response;
SimpleDateFormat dateFormatter;
SimpleDateFormat dateParser;
- boolean isIfx = !SystemProperties.get("ro.build.product").equals("p999");
+ boolean isIfx = !SystemProperties.get("ro.cm.device").equals("p999");
+ boolean usesLocalTime = isIfx && !SystemProperties.get("ro.cm.device").equals("p920");
num = p.readInt(); // TZ diff in quarter-hours
@@ -1008,22 +1009,21 @@ public class LGEStarRIL extends RIL implements CommandsInterface {
/* Infineon modems need some additional hax... */
if (isIfx) {
- /* Store DST before cropping */
- parcelextra = parceldata.substring(parceldata.lastIndexOf(",")+1);
- if (parcelextra != null) dst = Integer.parseInt(parcelextra);
- parceldata = parceldata.substring(0,(parceldata.lastIndexOf(",")));
+ String [] parcelitem = parceldata.split(",");
+ parceldata = parcelitem[0] + "," + parcelitem[1]; // assuming there is always one comma at least
+ parcelextra = (parcelitem.length > 2 ? parcelitem[2] : "0");
+ dst = Integer.parseInt(parcelextra);
}
- int offset = num*15*60*1000; // DST corrected
-
/* WTH... Date may come with 4 digits in the year, reduce to 2 */
try {
dateFormatter = new SimpleDateFormat("yy/MM/dd,HH:mm:ss");
dateParser = new SimpleDateFormat("yy/MM/dd,HH:mm:ss");
/* Ifx delivers localtime, convert to UTC */
- if (isIfx) {
+ if (usesLocalTime) {
/* Directly calculate UTC time using DST Offset */
+ int offset = num*15*60*1000; // DST corrected
long when = dateParser.parse(parceldata).getTime() - offset;
Date d = new Date(when);
response = dateFormatter.format(d);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 4edb268..3eb0a9a 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -1204,6 +1204,17 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
}
private TimeZone findTimeZone(int offset, boolean dst, long when) {
+ /**
+ * http://wtogami.blogspot.com/2012/01/hawaii-android-automatic-time-zone-bug.html
+ * NITZ UTC-10 without DST can only be Hawaii
+ * Impossible to differentiate America/Adak from Honolulu/Pacific
+ * from NITZ alone.
+ **/
+ if (offset == -36000000 && dst == false) {
+ Log.d(LOG_TAG, "findTimeZone() Forcing Hawaii Timezone for UTC-10");
+ return TimeZone.getTimeZone("Pacific/Honolulu");
+ }
+
int rawOffset = offset;
if (dst) {
rawOffset -= 3600000;
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
index d63738b..9f55fb7b 100755
--- a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
@@ -880,7 +880,7 @@ public final class BearerData {
bData.messageType = inStream.read(4);
// Samsung Fascinate parses messageId differently than other devices
// fix it here so that incoming sms works correctly
- if ("fascinatemtd".equals(SystemProperties.get("ro.product.device"))) {
+ if ("fascinatemtd".equals(SystemProperties.get("ro.cm.device"))) {
inStream.skip(4);
bData.messageId = inStream.read(8) << 8;
bData.messageId |= inStream.read(8);
diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
index 039acaa..d0003a6 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
@@ -968,7 +968,9 @@ public class GSMPhone extends PhoneBase {
}
public void getCallWaiting(Message onComplete) {
- mCM.queryCallWaiting(CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
+ // As per 3GPP TS 24.083, section 1.6 UE doesn't need to send service
+ // class parameter in call waiting interrogation to network
+ mCM.queryCallWaiting(CommandsInterface.SERVICE_CLASS_NONE, onComplete);
}
public void setCallWaiting(boolean enable, Message onComplete) {
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 131343b..1792e80 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -951,8 +951,6 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
if (hasChanged) {
String operatorNumeric;
- updateSpnDisplay();
-
phone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_ALPHA,
ss.getOperatorAlphaLong());
@@ -1018,6 +1016,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
phone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_ISROAMING,
ss.getRoaming() ? "true" : "false");
+ updateSpnDisplay();
+
phone.notifyServiceStateChanged(ss);
} else if (hasDeregistered) {
@@ -1093,6 +1093,17 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
}
private TimeZone findTimeZone(int offset, boolean dst, long when) {
+ /**
+ * http://wtogami.blogspot.com/2012/01/hawaii-android-automatic-time-zone-bug.html
+ * NITZ UTC-10 without DST can only be Hawaii
+ * Impossible to differentiate America/Adak from Honolulu/Pacific
+ * from NITZ alone.
+ **/
+ if (offset == -36000000 && dst == false) {
+ Log.d(LOG_TAG, "findTimeZone() Forcing Hawaii Timezone for UTC-10");
+ return TimeZone.getTimeZone("Pacific/Honolulu");
+ }
+
int rawOffset = offset;
if (dst) {
rawOffset -= 3600000;
diff --git a/telephony/java/com/android/internal/telephony/gsm/SuppServiceNotification.java b/telephony/java/com/android/internal/telephony/gsm/SuppServiceNotification.java
index e68655e..200f0b1 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SuppServiceNotification.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SuppServiceNotification.java
@@ -35,6 +35,9 @@ public class SuppServiceNotification {
/** TS 27.007 7.17 "number" (MT only) */
public String number;
+ static public final int NOTIFICATION_TYPE_MO = 0;
+ static public final int NOTIFICATION_TYPE_MT = 1;
+
static public final int MO_CODE_UNCONDITIONAL_CF_ACTIVE = 0;
static public final int MO_CODE_SOME_CF_ACTIVE = 1;
static public final int MO_CODE_CALL_FORWARDED = 2;
diff --git a/vpn/java/android/net/vpn/OpenvpnProfile.java b/vpn/java/android/net/vpn/OpenvpnProfile.java
index f1fd2f6..c847285 100644
--- a/vpn/java/android/net/vpn/OpenvpnProfile.java
+++ b/vpn/java/android/net/vpn/OpenvpnProfile.java
@@ -63,6 +63,12 @@ public class OpenvpnProfile extends VpnProfile {
private String mExtra;
+ private boolean mUseTlsAuth;
+
+ private String mTlsAuthKey;
+
+ private String mTlsAuthKeyDirection;
+
@Override
public VpnType getType() {
return VpnType.OPENVPN;
@@ -203,6 +209,30 @@ public class OpenvpnProfile extends VpnProfile {
return Integer.toString(mKeySize);
}
+ public void setUseTlsAuth(boolean t) {
+ mUseTlsAuth = t;
+ }
+
+ public boolean getUseTlsAuth() {
+ return mUseTlsAuth;
+ }
+
+ public void setTlsAuthKey(String k) {
+ mTlsAuthKey = k;
+ }
+
+ public String getTlsAuthKey() {
+ return mTlsAuthKey;
+ }
+
+ public void setTlsAuthKeyDirection(String d) {
+ mTlsAuthKeyDirection = d;
+ }
+
+ public String getTlsAuthKeyDirection() {
+ return mTlsAuthKeyDirection;
+ }
+
public void setExtra(String extra) {
mExtra = extra;
}
@@ -228,6 +258,9 @@ public class OpenvpnProfile extends VpnProfile {
mCipher = in.readString();
mKeySize = in.readInt();
mExtra = in.readString();
+ mUseTlsAuth = in.readInt() == 1;
+ mTlsAuthKey = in.readString();
+ mTlsAuthKeyDirection = in.readString();
}
@Override
@@ -247,5 +280,8 @@ public class OpenvpnProfile extends VpnProfile {
parcel.writeString(mCipher);
parcel.writeInt(mKeySize);
parcel.writeString(mExtra);
+ parcel.writeInt(mUseTlsAuth ? 1 : 0);
+ parcel.writeString(mTlsAuthKey);
+ parcel.writeString(mTlsAuthKeyDirection);
}
}