summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/11.xml11
-rw-r--r--api/current.xml11
-rw-r--r--core/java/android/app/DownloadManager.java9
-rw-r--r--core/java/android/provider/Downloads.java6
-rw-r--r--core/java/android/view/VolumePanel.java504
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.pngbin4975 -> 5087 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.pngbin5083 -> 3955 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_dark.9.pngbin7891 -> 9343 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_full_holo_light.9.pngbin6865 -> 7111 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.pngbin354 -> 353 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_middle_holo_light.9.pngbin352 -> 339 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_dark.9.pngbin4888 -> 5152 bytes
-rw-r--r--core/res/res/drawable-hdpi/dialog_top_holo_light.9.pngbin5053 -> 4053 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_bt.pngbin0 -> 1009 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_bt_mute.pngbin0 -> 1191 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_phone.pngbin0 -> 938 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_vol.pngbin1144 -> 1226 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_vol_mute.pngbin1168 -> 1360 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_sysbar_quicksettings.pngbin0 -> 773 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_control_disabled_holo.pngbin1815 -> 3733 bytes
-rw-r--r--core/res/res/drawable-hdpi/scrubber_control_holo.pngbin3082 -> 3966 bytes
-rw-r--r--core/res/res/drawable-hdpi/stat_notify_chat.pngbin921 -> 957 bytes
-rw-r--r--core/res/res/drawable-hdpi/toast_frame.9.pngbin2461 -> 9342 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.pngbin2998 -> 2742 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.pngbin2888 -> 2254 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_dark.9.pngbin4557 -> 4862 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_full_holo_light.9.pngbin4032 -> 3984 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.pngbin309 -> 304 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_middle_holo_light.9.pngbin307 -> 297 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_dark.9.pngbin2913 -> 2771 bytes
-rw-r--r--core/res/res/drawable-mdpi/dialog_top_holo_light.9.pngbin2838 -> 2337 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_bt.pngbin0 -> 740 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_bt_mute.pngbin0 -> 851 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_phone.pngbin0 -> 729 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_vol.pngbin841 -> 849 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_vol_mute.pngbin809 -> 904 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_sysbar_quicksettings.pngbin0 -> 653 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_control_disabled_holo.pngbin1183 -> 2800 bytes
-rw-r--r--core/res/res/drawable-mdpi/scrubber_control_holo.pngbin1951 -> 2949 bytes
-rw-r--r--core/res/res/drawable-mdpi/stat_notify_chat.pngbin657 -> 660 bytes
-rwxr-xr-xcore/res/res/drawable-mdpi/toast_frame.9.pngbin4328 -> 4855 bytes
-rw-r--r--core/res/res/drawable-xlarge-nodpi/default_wallpaper.jpgbin815422 -> 518510 bytes
-rw-r--r--core/res/res/layout/volume_adjust.xml68
-rw-r--r--core/res/res/layout/volume_adjust_item.xml45
-rw-r--r--core/res/res/values/styles.xml5
-rw-r--r--core/res/res/values/themes.xml5
-rw-r--r--data/sounds/Alarm_Beep_01.oggbin0 -> 16130 bytes
-rw-r--r--data/sounds/Alarm_Beep_02.oggbin0 -> 5898 bytes
-rw-r--r--data/sounds/Alarm_Beep_03.oggbin0 -> 21153 bytes
-rw-r--r--data/sounds/Alarm_Buzzer.oggbin0 -> 11368 bytes
-rw-r--r--data/sounds/Alarm_Rooster_01.oggbin0 -> 10316 bytes
-rw-r--r--data/sounds/Alarm_Rooster_02.oggbin0 -> 11160 bytes
-rw-r--r--data/sounds/alarms/Cesium.oggbin0 -> 27025 bytes
-rw-r--r--data/sounds/alarms/ogg/Analysis.oggbin0 -> 51938 bytes
-rw-r--r--data/sounds/alarms/ogg/Departure.oggbin0 -> 27986 bytes
-rw-r--r--data/sounds/alarms/ogg/FireDrill.oggbin0 -> 102973 bytes
-rw-r--r--data/sounds/alarms/ogg/Timing.oggbin0 -> 47948 bytes
-rw-r--r--data/sounds/effects/Dock.aifbin0 -> 44154 bytes
-rw-r--r--data/sounds/effects/Dock.oggbin0 -> 6019 bytes
-rw-r--r--data/sounds/effects/Effect_Tick.oggbin0 -> 3994 bytes
-rw-r--r--data/sounds/effects/KeypressDelete.oggbin0 -> 6193 bytes
-rw-r--r--data/sounds/effects/KeypressDelete.wavbin0 -> 29892 bytes
-rw-r--r--data/sounds/effects/KeypressReturn.oggbin0 -> 7972 bytes
-rw-r--r--data/sounds/effects/KeypressReturn.wavbin0 -> 64320 bytes
-rw-r--r--data/sounds/effects/KeypressSpacebar.oggbin0 -> 7392 bytes
-rw-r--r--data/sounds/effects/KeypressSpacebar.wavbin0 -> 49400 bytes
-rw-r--r--data/sounds/effects/KeypressStandard.oggbin0 -> 5194 bytes
-rw-r--r--data/sounds/effects/KeypressStandard.wavbin0 -> 17992 bytes
-rw-r--r--data/sounds/effects/Lock.oggbin0 -> 4661 bytes
-rw-r--r--data/sounds/effects/Lock.wavbin0 -> 11352 bytes
-rw-r--r--data/sounds/effects/LowBattery.aifbin0 -> 88902 bytes
-rw-r--r--data/sounds/effects/LowBattery.oggbin0 -> 6585 bytes
-rw-r--r--data/sounds/effects/Undock.aifbin0 -> 44154 bytes
-rw-r--r--data/sounds/effects/Undock.oggbin0 -> 6016 bytes
-rw-r--r--data/sounds/effects/Unlock.oggbin0 -> 4666 bytes
-rw-r--r--data/sounds/effects/Unlock.wavbin0 -> 11352 bytes
-rw-r--r--data/sounds/effects/VideoRecord.oggbin0 -> 5582 bytes
-rw-r--r--data/sounds/effects/VideoRecord.wavbin0 -> 33728 bytes
-rw-r--r--data/sounds/effects/camera_click.oggbin0 -> 4851 bytes
-rw-r--r--data/sounds/effects/camera_click.wavbin0 -> 13030 bytes
-rw-r--r--data/sounds/effects/ogg/Effect_Tick.oggbin4348 -> 4825 bytes
-rw-r--r--data/sounds/effects/ogg/LowBattery.oggbin15763 -> 42865 bytes
-rwxr-xr-xdata/sounds/notifications/aidos.oggbin0 -> 14038 bytes
-rwxr-xr-xdata/sounds/notifications/circios.oggbin0 -> 39179 bytes
-rwxr-xr-xdata/sounds/notifications/horkos.oggbin0 -> 18211 bytes
-rwxr-xr-xdata/sounds/notifications/hypnos1.oggbin0 -> 16391 bytes
-rwxr-xr-xdata/sounds/notifications/kratos1.oggbin0 -> 25158 bytes
-rwxr-xr-xdata/sounds/notifications/kratos2.oggbin0 -> 32305 bytes
-rwxr-xr-xdata/sounds/notifications/nomos1.oggbin0 -> 14620 bytes
-rwxr-xr-xdata/sounds/notifications/nomos2.oggbin0 -> 19885 bytes
-rwxr-xr-xdata/sounds/notifications/ouranos.oggbin0 -> 21168 bytes
-rwxr-xr-xdata/sounds/notifications/phantasos.oggbin0 -> 27842 bytes
-rwxr-xr-xdata/sounds/notifications/poros.oggbin0 -> 24934 bytes
-rwxr-xr-xdata/sounds/notifications/thrasos1.oggbin0 -> 15737 bytes
-rw-r--r--data/sounds/ringtones/ANDROMEDA.oggbin0 -> 25014 bytes
-rw-r--r--data/sounds/ringtones/Aquila.oggbin0 -> 21509 bytes
-rw-r--r--data/sounds/ringtones/ArgoNavis.oggbin0 -> 89534 bytes
-rw-r--r--data/sounds/ringtones/BOOTES.oggbin0 -> 26310 bytes
-rw-r--r--data/sounds/ringtones/CANISMAJOR.oggbin0 -> 31170 bytes
-rw-r--r--data/sounds/ringtones/CASSIOPEIA.oggbin0 -> 31941 bytes
-rw-r--r--data/sounds/ringtones/Carina.oggbin0 -> 15462 bytes
-rwxr-xr-xdata/sounds/ringtones/Carina.wavbin0 -> 264848 bytes
-rw-r--r--data/sounds/ringtones/Centaurus.oggbin0 -> 27681 bytes
-rw-r--r--data/sounds/ringtones/Cygnus.oggbin0 -> 29844 bytes
-rw-r--r--data/sounds/ringtones/Draco.oggbin0 -> 31819 bytes
-rw-r--r--data/sounds/ringtones/Eridani.oggbin0 -> 36585 bytes
-rw-r--r--data/sounds/ringtones/FreeFlight.oggbin0 -> 113055 bytes
-rw-r--r--data/sounds/ringtones/FreeFlight.wavbin0 -> 2229120 bytes
-rw-r--r--data/sounds/ringtones/Lyra.oggbin0 -> 42540 bytes
-rw-r--r--data/sounds/ringtones/Machina.oggbin0 -> 38077 bytes
-rw-r--r--data/sounds/ringtones/Orion.oggbin0 -> 54456 bytes
-rw-r--r--data/sounds/ringtones/PERSEUS.oggbin0 -> 112981 bytes
-rw-r--r--data/sounds/ringtones/Pegasus.oggbin0 -> 86731 bytes
-rw-r--r--data/sounds/ringtones/Pyxis.oggbin0 -> 16653 bytes
-rw-r--r--data/sounds/ringtones/Rigel.oggbin0 -> 32129 bytes
-rw-r--r--data/sounds/ringtones/Scarabaeus.oggbin0 -> 108968 bytes
-rw-r--r--data/sounds/ringtones/Sceptrum.oggbin0 -> 294019 bytes
-rw-r--r--data/sounds/ringtones/Solarium.oggbin0 -> 60201 bytes
-rw-r--r--data/sounds/ringtones/Testudo.oggbin0 -> 72078 bytes
-rw-r--r--data/sounds/ringtones/URSAMINOR.oggbin0 -> 144112 bytes
-rw-r--r--data/sounds/ringtones/Vespa.oggbin0 -> 18043 bytes
-rw-r--r--data/sounds/ringtones/hydra.oggbin0 -> 22962 bytes
-rw-r--r--data/sounds/ringtones/ringtone18.oggbin0 -> 214887 bytes
-rw-r--r--data/sounds/ringtones/ringtone19.oggbin0 -> 118444 bytes
-rw-r--r--data/sounds/ringtones/ringtone20.oggbin0 -> 53191 bytes
-rw-r--r--data/sounds/ringtones/ringtone21.oggbin0 -> 75013 bytes
-rw-r--r--data/sounds/ringtones/ringtone22.oggbin0 -> 102024 bytes
-rw-r--r--data/sounds/ringtones/ringtone23.oggbin0 -> 80588 bytes
-rw-r--r--data/sounds/ringtones/ringtone24.oggbin0 -> 104820 bytes
-rw-r--r--data/sounds/ringtones/ringtone25.oggbin0 -> 131029 bytes
-rw-r--r--data/sounds/ringtones/ringtone26.oggbin0 -> 97565 bytes
-rw-r--r--data/sounds/ringtones/ringtone27.oggbin0 -> 88468 bytes
-rw-r--r--data/sounds/ringtones/ringtone28.oggbin0 -> 121949 bytes
-rw-r--r--data/sounds/ringtones/ringtone29.oggbin0 -> 110062 bytes
-rw-r--r--data/sounds/ringtones/ringtone30.oggbin0 -> 113368 bytes
-rw-r--r--data/sounds/ringtones/ringtone31.oggbin0 -> 97936 bytes
-rw-r--r--data/sounds/ringtones/ringtone32.oggbin0 -> 175983 bytes
-rw-r--r--data/sounds/ringtones/ringtone33.oggbin0 -> 63250 bytes
-rw-r--r--data/sounds/ringtones/ringtone34.oggbin0 -> 60727 bytes
-rw-r--r--data/sounds/ringtones/ringtone35.oggbin0 -> 163844 bytes
-rw-r--r--data/sounds/ringtones/ringtone36.oggbin0 -> 40589 bytes
-rw-r--r--data/sounds/ringtones/ringtone37.oggbin0 -> 145806 bytes
-rw-r--r--data/sounds/ringtones/ringtone38.oggbin0 -> 126162 bytes
-rw-r--r--graphics/java/android/graphics/Canvas.java2
-rw-r--r--libs/hwui/Caches.cpp11
-rw-r--r--libs/hwui/DisplayListRenderer.cpp113
-rw-r--r--libs/hwui/DisplayListRenderer.h72
-rw-r--r--libs/hwui/PathCache.cpp1
-rw-r--r--libs/hwui/TextDropShadowCache.h30
-rw-r--r--packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.pngbin944 -> 909 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.pngbin1448 -> 1453 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.pngbin677 -> 696 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.pngbin988 -> 1002 bytes
-rw-r--r--packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml2
-rw-r--r--services/sensorservice/SensorService.cpp13
-rw-r--r--services/sensorservice/SensorService.h2
156 files changed, 562 insertions, 348 deletions
diff --git a/api/11.xml b/api/11.xml
index 291d8dbdbcfd..4a40c3670b0e 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -29418,17 +29418,6 @@
<parameter name="uri" type="android.net.Uri">
</parameter>
</method>
-<method name="setDownloadToBeOtaUpdate"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</method>
<method name="setMimeType"
return="android.app.DownloadManager.Request"
abstract="false"
diff --git a/api/current.xml b/api/current.xml
index 291d8dbdbcfd..4a40c3670b0e 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -29418,17 +29418,6 @@
<parameter name="uri" type="android.net.Uri">
</parameter>
</method>
-<method name="setDownloadToBeOtaUpdate"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</method>
<method name="setMimeType"
return="android.app.DownloadManager.Request"
abstract="false"
diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java
index d37983f3feb9..297d24604d00 100644
--- a/core/java/android/app/DownloadManager.java
+++ b/core/java/android/app/DownloadManager.java
@@ -339,7 +339,6 @@ public class DownloadManager {
private boolean mIsVisibleInDownloadsUi = true;
private boolean mScannable = false;
private boolean mUseSystemCache = false;
- private boolean mOtaUpdate = false;
/** if a file is designated as a MediaScanner scannable file, the following value is
* stored in the database column {@link Downloads.Impl#COLUMN_MEDIA_SCANNED}.
*/
@@ -606,13 +605,6 @@ public class DownloadManager {
}
/**
- * Set whether the download request is OTA Update. By default, it is set to false.
- */
- public void setDownloadToBeOtaUpdate() {
- mOtaUpdate = true;
- }
-
- /**
* Set whether this download should be displayed in the system's Downloads UI. True by
* default.
* @param isVisible whether to display this download in the Downloads UI
@@ -658,7 +650,6 @@ public class DownloadManager {
values.put(Downloads.Impl.COLUMN_ALLOWED_NETWORK_TYPES, mAllowedNetworkTypes);
values.put(Downloads.Impl.COLUMN_ALLOW_ROAMING, mRoamingAllowed);
values.put(Downloads.Impl.COLUMN_IS_VISIBLE_IN_DOWNLOADS_UI, mIsVisibleInDownloadsUi);
- values.put(Downloads.Impl.COLUMN_IGNORE_SIZE_LIMITS, mOtaUpdate);
return values;
}
diff --git a/core/java/android/provider/Downloads.java b/core/java/android/provider/Downloads.java
index ad0140bd57d2..013edd395ae7 100644
--- a/core/java/android/provider/Downloads.java
+++ b/core/java/android/provider/Downloads.java
@@ -397,12 +397,6 @@ public final class Downloads {
*/
public static final String COLUMN_LAST_UPDATESRC = "lastUpdateSrc";
- /** Set this column to true if the given download should ignore the mobile network
- * download limits.
- * <P>Type: Boolean</P>
- */
- public static final String COLUMN_IGNORE_SIZE_LIMITS = "otaupdate";
-
/**
* default value for {@link #COLUMN_LAST_UPDATESRC}.
* This value is used when this column's value is not relevant.
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index e447dbb8a5f2..bb5774f31417 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -16,10 +16,17 @@
package android.view;
-import android.bluetooth.HeadsetBase;
+import com.android.internal.R;
+
+import android.app.Dialog;
+import android.content.DialogInterface.OnDismissListener;
+import android.content.BroadcastReceiver;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.AudioService;
import android.media.AudioSystem;
@@ -29,12 +36,16 @@ import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
-import android.util.Config;
+import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.ImageView;
import android.widget.ProgressBar;
+import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+
+import java.util.HashMap;
/**
* Handle the volume up and down keys.
@@ -43,7 +54,7 @@ import android.widget.Toast;
*
* @hide
*/
-public class VolumePanel extends Handler
+public class VolumePanel extends Handler implements OnSeekBarChangeListener, View.OnClickListener
{
private static final String TAG = "VolumePanel";
private static boolean LOGD = false;
@@ -68,62 +79,255 @@ public class VolumePanel extends Handler
private static final int BEEP_DURATION = 150;
private static final int MAX_VOLUME = 100;
private static final int FREE_DELAY = 10000;
+ private static final int TIMEOUT_DELAY = 3000;
private static final int MSG_VOLUME_CHANGED = 0;
private static final int MSG_FREE_RESOURCES = 1;
private static final int MSG_PLAY_SOUND = 2;
private static final int MSG_STOP_SOUNDS = 3;
private static final int MSG_VIBRATE = 4;
-
- private static final int RINGTONE_VOLUME_TEXT = com.android.internal.R.string.volume_ringtone;
- private static final int MUSIC_VOLUME_TEXT = com.android.internal.R.string.volume_music;
- private static final int INCALL_VOLUME_TEXT = com.android.internal.R.string.volume_call;
- private static final int ALARM_VOLUME_TEXT = com.android.internal.R.string.volume_alarm;
- private static final int UNKNOWN_VOLUME_TEXT = com.android.internal.R.string.volume_unknown;
- private static final int NOTIFICATION_VOLUME_TEXT =
- com.android.internal.R.string.volume_notification;
- private static final int BLUETOOTH_INCALL_VOLUME_TEXT =
- com.android.internal.R.string.volume_bluetooth_call;
+ private static final int MSG_TIMEOUT = 5;
+ private static final int MSG_RINGER_MODE_CHANGED = 6;
+
+// private static final int RINGTONE_VOLUME_TEXT = com.android.internal.R.string.volume_ringtone;
+// private static final int MUSIC_VOLUME_TEXT = com.android.internal.R.string.volume_music;
+// private static final int INCALL_VOLUME_TEXT = com.android.internal.R.string.volume_call;
+// private static final int ALARM_VOLUME_TEXT = com.android.internal.R.string.volume_alarm;
+// private static final int UNKNOWN_VOLUME_TEXT = com.android.internal.R.string.volume_unknown;
+// private static final int NOTIFICATION_VOLUME_TEXT =
+// com.android.internal.R.string.volume_notification;
+// private static final int BLUETOOTH_INCALL_VOLUME_TEXT =
+// com.android.internal.R.string.volume_bluetooth_call;
protected Context mContext;
private AudioManager mAudioManager;
protected AudioService mAudioService;
private boolean mRingIsSilent;
- private final Toast mToast;
+ /** Dialog containing all the sliders */
+ private final Dialog mDialog;
+ /** Dialog's content view */
private final View mView;
- private final TextView mMessage;
- private final TextView mAdditionalMessage;
- private final ImageView mSmallStreamIcon;
- private final ImageView mLargeStreamIcon;
- private final ProgressBar mLevel;
+// private final TextView mMessage;
+// private final TextView mAdditionalMessage;
+// private final ImageView mSmallStreamIcon;
+// private final ImageView mLargeStreamIcon;
+// private final ProgressBar mLevel;
+
+ /** Contains the sliders and their touchable icons */
+ private final ViewGroup mSliderGroup;
+ /** The button that expands the dialog to show all sliders */
+ private final View mMoreButton;
+ /** Dummy divider icon that needs to vanish with the more button */
+ private final View mDivider;
+
+ /** Currently active stream that shows up at the top of the list of sliders */
+ private int mActiveStreamType = -1;
+ /** All the slider controls mapped by stream type */
+ private HashMap<Integer,StreamControl> mStreamControls;
+
+ // List of stream types and their order
+ // RING and VOICE_CALL are hidden unless explicitly requested
+ private static final int [] STREAM_TYPES = {
+ AudioManager.STREAM_RING,
+ AudioManager.STREAM_VOICE_CALL,
+ AudioManager.STREAM_MUSIC,
+ AudioManager.STREAM_NOTIFICATION
+ };
+
+ // These icons need to correspond to the ones above.
+ private static final int [] STREAM_ICONS_NORMAL = {
+ R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_vol,
+ R.drawable.ic_audio_notification,
+ };
+
+ // These icons need to correspond to the ones above.
+ private static final int [] STREAM_ICONS_MUTED = {
+ R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_vol_mute,
+ R.drawable.ic_audio_notification_mute,
+ };
+
+ /** Object that contains data for each slider */
+ private class StreamControl {
+ int streamType;
+ ViewGroup group;
+ ImageView icon;
+ SeekBar seekbarView;
+ int iconRes;
+ int iconMuteRes;
+ }
// Synchronize when accessing this
private ToneGenerator mToneGenerators[];
private Vibrator mVibrator;
- public VolumePanel(Context context, AudioService volumeService) {
+ public VolumePanel(final Context context, AudioService volumeService) {
mContext = context;
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
mAudioService = volumeService;
- mToast = new Toast(context);
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = mView = inflater.inflate(com.android.internal.R.layout.volume_adjust, null);
- mMessage = (TextView) view.findViewById(com.android.internal.R.id.message);
- mAdditionalMessage =
- (TextView) view.findViewById(com.android.internal.R.id.additional_message);
- mSmallStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.other_stream_icon);
- mLargeStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.ringer_stream_icon);
- mLevel = (ProgressBar) view.findViewById(com.android.internal.R.id.level);
+ View view = mView = inflater.inflate(R.layout.volume_adjust, null);
+ mView.setOnTouchListener(new View.OnTouchListener() {
+ public boolean onTouch(View v, MotionEvent event) {
+ resetTimeout();
+ return true;
+ }
+ });
+ mSliderGroup = (ViewGroup) mView.findViewById(R.id.slider_group);
+ mMoreButton = (ImageView) mView.findViewById(R.id.expand_button);
+ mMoreButton.setOnClickListener(this);
+ mDivider = (ImageView) mView.findViewById(R.id.expand_button_divider);
+
+ mDialog = new Dialog(context, R.style.Theme_Panel_Volume);
+ mDialog.setTitle("Volume control"); // No need to localize
+ mDialog.setContentView(mView);
+ mDialog.setOnDismissListener(new OnDismissListener() {
+ public void onDismiss(DialogInterface dialog) {
+ mActiveStreamType = -1;
+ }
+ });
+ // Change some window properties
+ Window window = mDialog.getWindow();
+ window.setGravity(Gravity.TOP);
+ WindowManager.LayoutParams lp = window.getAttributes();
+ lp.token = null;
+ lp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
+ window.setAttributes(lp);
+ window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
+
+// mMessage = (TextView) view.findViewById(com.android.internal.R.id.message);
+// mAdditionalMessage =
+// (TextView) view.findViewById(com.android.internal.R.id.additional_message);
+// mSmallStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.other_stream_icon);
+// mLargeStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.ringer_stream_icon);
+// mLevel = (ProgressBar) view.findViewById(com.android.internal.R.id.level);
mToneGenerators = new ToneGenerator[AudioSystem.getNumStreamTypes()];
mVibrator = new Vibrator();
+
+ listenToRingerMode();
+ }
+
+ private void listenToRingerMode() {
+ final IntentFilter filter = new IntentFilter();
+ filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
+ mContext.registerReceiver(new BroadcastReceiver() {
+
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+
+ if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
+ removeMessages(MSG_RINGER_MODE_CHANGED);
+ sendMessage(obtainMessage(MSG_RINGER_MODE_CHANGED));
+ }
+ }
+ }, filter);
+ }
+
+ private boolean isMuted(int streamType) {
+ return mAudioManager.isStreamMute(streamType);
+ }
+
+ private void createSliders() {
+ LayoutInflater inflater = (LayoutInflater) mContext
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ mStreamControls = new HashMap<Integer,StreamControl>(STREAM_TYPES.length);
+ for (int i = 0; i < STREAM_TYPES.length; i++) {
+ StreamControl sc = new StreamControl();
+ sc.streamType = STREAM_TYPES[i];
+ sc.group = (ViewGroup) inflater.inflate(R.layout.volume_adjust_item, null);
+ sc.group.setTag(sc);
+ sc.icon = (ImageView) sc.group.findViewById(R.id.stream_icon);
+ sc.icon.setOnClickListener(this);
+ sc.icon.setTag(sc);
+ sc.iconRes = STREAM_ICONS_NORMAL[i];
+ sc.iconMuteRes = STREAM_ICONS_MUTED[i];
+ sc.icon.setImageResource(sc.iconRes);
+ sc.seekbarView = (SeekBar) sc.group.findViewById(R.id.seekbar);
+ sc.seekbarView.setMax(mAudioManager.getStreamMaxVolume(STREAM_TYPES[i]));
+ sc.seekbarView.setOnSeekBarChangeListener(this);
+ sc.seekbarView.setTag(sc);
+ mStreamControls.put(STREAM_TYPES[i], sc);
+ }
+ }
+
+ private void reorderSliders(int activeStreamType) {
+ mSliderGroup.removeAllViews();
+
+ StreamControl active = mStreamControls.get(activeStreamType);
+ if (active == null) {
+ Log.e("VolumePanel", "Missing stream type! - " + activeStreamType);
+ mActiveStreamType = -1;
+ } else {
+ mSliderGroup.addView(active.group);
+ mActiveStreamType = activeStreamType;
+ active.group.setVisibility(View.VISIBLE);
+ updateSlider(active);
+ }
+
+ for (int i = 0; i < STREAM_TYPES.length; i++) {
+ // Skip the phone specific ones and the active one
+ final int streamType = STREAM_TYPES[i];
+ if (streamType == AudioManager.STREAM_RING
+ || streamType == AudioManager.STREAM_VOICE_CALL
+ || streamType == activeStreamType) {
+ continue;
+ }
+ StreamControl sc = mStreamControls.get(streamType);
+ mSliderGroup.addView(sc.group);
+ updateSlider(sc);
+ }
+ }
+
+ /** Update the mute and progress state of a slider */
+ private void updateSlider(StreamControl sc) {
+ sc.seekbarView.setProgress(mAudioManager.getLastAudibleStreamVolume(sc.streamType));
+ final boolean muted = isMuted(sc.streamType);
+ sc.icon.setImageResource(muted ? sc.iconMuteRes : sc.iconRes);
+ sc.seekbarView.setEnabled(!muted);
+ }
+
+ private boolean isExpanded() {
+ return mMoreButton.getVisibility() != View.VISIBLE;
+ }
+
+ private void expand() {
+ final int count = mSliderGroup.getChildCount();
+ for (int i = 0; i < count; i++) {
+ mSliderGroup.getChildAt(i).setVisibility(View.VISIBLE);
+ }
+ mMoreButton.setVisibility(View.INVISIBLE);
+ mDivider.setVisibility(View.INVISIBLE);
+ }
+
+ private void collapse() {
+ mMoreButton.setVisibility(View.VISIBLE);
+ mDivider.setVisibility(View.VISIBLE);
+ final int count = mSliderGroup.getChildCount();
+ for (int i = 1; i < count; i++) {
+ mSliderGroup.getChildAt(i).setVisibility(View.GONE);
+ }
+ }
+
+ private void updateStates() {
+ final int count = mSliderGroup.getChildCount();
+ for (int i = 0; i < count; i++) {
+ StreamControl sc = (StreamControl) mSliderGroup.getChildAt(i).getTag();
+ updateSlider(sc);
+ }
}
public void postVolumeChanged(int streamType, int flags) {
if (hasMessages(MSG_VOLUME_CHANGED)) return;
+ if (mStreamControls == null) {
+ createSliders();
+ }
removeMessages(MSG_FREE_RESOURCES);
obtainMessage(MSG_VOLUME_CHANGED, streamType, flags).sendToTarget();
}
@@ -137,6 +341,10 @@ public class VolumePanel extends Handler
if (LOGD) Log.d(TAG, "onVolumeChanged(streamType: " + streamType + ", flags: " + flags + ")");
+ if (mActiveStreamType == -1) {
+ reorderSliders(streamType);
+ }
+
if ((flags & AudioManager.FLAG_SHOW_UI) != 0) {
onShowVolumeChanged(streamType, flags);
}
@@ -154,12 +362,14 @@ public class VolumePanel extends Handler
removeMessages(MSG_FREE_RESOURCES);
sendMessageDelayed(obtainMessage(MSG_FREE_RESOURCES), FREE_DELAY);
+
+ resetTimeout();
}
protected void onShowVolumeChanged(int streamType, int flags) {
int index = mAudioService.getStreamVolume(streamType);
- int message = UNKNOWN_VOLUME_TEXT;
- int additionalMessage = 0;
+// int message = UNKNOWN_VOLUME_TEXT;
+// int additionalMessage = 0;
mRingIsSilent = false;
if (LOGD) {
@@ -168,31 +378,35 @@ public class VolumePanel extends Handler
}
// get max volume for progress bar
+
int max = mAudioService.getStreamMaxVolume(streamType);
switch (streamType) {
case AudioManager.STREAM_RING: {
- setRingerIcon();
- message = RINGTONE_VOLUME_TEXT;
+// setRingerIcon();
+// message = RINGTONE_VOLUME_TEXT;
Uri ringuri = RingtoneManager.getActualDefaultRingtoneUri(
mContext, RingtoneManager.TYPE_RINGTONE);
if (ringuri == null) {
- additionalMessage =
- com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
+// additionalMessage =
+// com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
mRingIsSilent = true;
}
break;
}
case AudioManager.STREAM_MUSIC: {
- message = MUSIC_VOLUME_TEXT;
+// message = MUSIC_VOLUME_TEXT;
+ // Special case for when Bluetooth is active for music
if (mAudioManager.isBluetoothA2dpOn()) {
- additionalMessage =
- com.android.internal.R.string.volume_music_hint_playing_through_bluetooth;
- setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_ad2p);
+// additionalMessage =
+// com.android.internal.R.string.volume_music_hint_playing_through_bluetooth;
+// setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_ad2p);
+ setMusicIcon(R.drawable.ic_audio_bt, R.drawable.ic_audio_bt_mute);
} else {
- setSmallIcon(index);
+ setMusicIcon(R.drawable.ic_audio_vol, R.drawable.ic_audio_vol_mute);
+// setSmallIcon(index);
}
break;
}
@@ -205,25 +419,25 @@ public class VolumePanel extends Handler
*/
index++;
max++;
- message = INCALL_VOLUME_TEXT;
- setSmallIcon(index);
+// message = INCALL_VOLUME_TEXT;
+// setSmallIcon(index);
break;
}
case AudioManager.STREAM_ALARM: {
- message = ALARM_VOLUME_TEXT;
- setSmallIcon(index);
+// message = ALARM_VOLUME_TEXT;
+// setSmallIcon(index);
break;
}
case AudioManager.STREAM_NOTIFICATION: {
- message = NOTIFICATION_VOLUME_TEXT;
- setSmallIcon(index);
+// message = NOTIFICATION_VOLUME_TEXT;
+// setSmallIcon(index);
Uri ringuri = RingtoneManager.getActualDefaultRingtoneUri(
mContext, RingtoneManager.TYPE_NOTIFICATION);
if (ringuri == null) {
- additionalMessage =
- com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
+// additionalMessage =
+// com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
mRingIsSilent = true;
}
break;
@@ -237,33 +451,40 @@ public class VolumePanel extends Handler
*/
index++;
max++;
- message = BLUETOOTH_INCALL_VOLUME_TEXT;
- setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_in_call);
+// message = BLUETOOTH_INCALL_VOLUME_TEXT;
+// setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_in_call);
break;
}
}
- String messageString = Resources.getSystem().getString(message);
- if (!mMessage.getText().equals(messageString)) {
- mMessage.setText(messageString);
+// String messageString = Resources.getSystem().getString(message);
+// if (!mMessage.getText().equals(messageString)) {
+// mMessage.setText(messageString);
+// }
+//
+// if (additionalMessage == 0) {
+// mAdditionalMessage.setVisibility(View.GONE);
+// } else {
+// mAdditionalMessage.setVisibility(View.VISIBLE);
+// mAdditionalMessage.setText(Resources.getSystem().getString(additionalMessage));
+// }
+
+// if (max != mLevel.getMax()) {
+// mLevel.setMax(max);
+// }
+// mLevel.setProgress(index);
+
+ StreamControl sc = mStreamControls.get(streamType);
+ if (sc != null) {
+ sc.seekbarView.setProgress(index);
}
- if (additionalMessage == 0) {
- mAdditionalMessage.setVisibility(View.GONE);
- } else {
- mAdditionalMessage.setVisibility(View.VISIBLE);
- mAdditionalMessage.setText(Resources.getSystem().getString(additionalMessage));
- }
-
- if (max != mLevel.getMax()) {
- mLevel.setMax(max);
+ if (!mDialog.isShowing()) {
+ mDialog.setContentView(mView);
+ // Showing dialog - use collapsed state
+ collapse();
+ mDialog.show();
}
- mLevel.setProgress(index);
-
- mToast.setView(mView);
- mToast.setDuration(Toast.LENGTH_SHORT);
- mToast.setGravity(Gravity.TOP, 0, 0);
- mToast.show();
// Do a little vibrate if applicable (only when going into vibrate mode)
if ((flags & AudioManager.FLAG_VIBRATE) != 0 &&
@@ -333,59 +554,72 @@ public class VolumePanel extends Handler
}
}
- /**
- * Makes the small icon visible, and hides the large icon.
- *
- * @param index The volume index, where 0 means muted.
- */
- private void setSmallIcon(int index) {
- mLargeStreamIcon.setVisibility(View.GONE);
- mSmallStreamIcon.setVisibility(View.VISIBLE);
-
- mSmallStreamIcon.setImageResource(index == 0
- ? com.android.internal.R.drawable.ic_volume_off_small
- : com.android.internal.R.drawable.ic_volume_small);
- }
-
- /**
- * Makes the large image view visible with the given icon.
- *
- * @param resId The icon to display.
- */
- private void setLargeIcon(int resId) {
- mSmallStreamIcon.setVisibility(View.GONE);
- mLargeStreamIcon.setVisibility(View.VISIBLE);
- mLargeStreamIcon.setImageResource(resId);
- }
+// /**
+// * Makes the small icon visible, and hides the large icon.
+// *
+// * @param index The volume index, where 0 means muted.
+// */
+// private void setSmallIcon(int index) {
+// mLargeStreamIcon.setVisibility(View.GONE);
+// mSmallStreamIcon.setVisibility(View.VISIBLE);
+//
+// mSmallStreamIcon.setImageResource(index == 0
+// ? com.android.internal.R.drawable.ic_volume_off_small
+// : com.android.internal.R.drawable.ic_volume_small);
+// }
+//
+// /**
+// * Makes the large image view visible with the given icon.
+// *
+// * @param resId The icon to display.
+// */
+// private void setLargeIcon(int resId) {
+// mSmallStreamIcon.setVisibility(View.GONE);
+// mLargeStreamIcon.setVisibility(View.VISIBLE);
+// mLargeStreamIcon.setImageResource(resId);
+// }
+//
+// /**
+// * Makes the ringer icon visible with an icon that is chosen
+// * based on the current ringer mode.
+// */
+// private void setRingerIcon() {
+// mSmallStreamIcon.setVisibility(View.GONE);
+// mLargeStreamIcon.setVisibility(View.VISIBLE);
+//
+// int ringerMode = mAudioService.getRingerMode();
+// int icon;
+//
+// if (LOGD) Log.d(TAG, "setRingerIcon(), ringerMode: " + ringerMode);
+//
+// if (ringerMode == AudioManager.RINGER_MODE_SILENT) {
+// icon = com.android.internal.R.drawable.ic_volume_off;
+// } else if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
+// icon = com.android.internal.R.drawable.ic_vibrate;
+// } else {
+// icon = com.android.internal.R.drawable.ic_volume;
+// }
+// mLargeStreamIcon.setImageResource(icon);
+// }
/**
- * Makes the ringer icon visible with an icon that is chosen
- * based on the current ringer mode.
+ * Switch between icons because Bluetooth music is same as music volume, but with
+ * different icons.
*/
- private void setRingerIcon() {
- mSmallStreamIcon.setVisibility(View.GONE);
- mLargeStreamIcon.setVisibility(View.VISIBLE);
-
- int ringerMode = mAudioService.getRingerMode();
- int icon;
-
- if (LOGD) Log.d(TAG, "setRingerIcon(), ringerMode: " + ringerMode);
-
- if (ringerMode == AudioManager.RINGER_MODE_SILENT) {
- icon = com.android.internal.R.drawable.ic_volume_off;
- } else if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
- icon = com.android.internal.R.drawable.ic_vibrate;
- } else {
- icon = com.android.internal.R.drawable.ic_volume;
+ private void setMusicIcon(int resId, int resMuteId) {
+ StreamControl sc = mStreamControls.get(AudioManager.STREAM_MUSIC);
+ if (sc != null) {
+ sc.iconRes = resId;
+ sc.iconMuteRes = resMuteId;
+ sc.icon.setImageResource(isMuted(sc.streamType) ? sc.iconMuteRes : sc.iconRes);
}
- mLargeStreamIcon.setImageResource(icon);
}
protected void onFreeResources() {
// We'll keep the views, just ditch the cached drawable and hence
// bitmaps
- mSmallStreamIcon.setImageDrawable(null);
- mLargeStreamIcon.setImageDrawable(null);
+// mSmallStreamIcon.setImageDrawable(null);
+// mLargeStreamIcon.setImageDrawable(null);
synchronized (this) {
for (int i = mToneGenerators.length - 1; i >= 0; i--) {
@@ -426,7 +660,55 @@ public class VolumePanel extends Handler
break;
}
+ case MSG_TIMEOUT: {
+ if (mDialog.isShowing()) {
+ mDialog.dismiss();
+ mActiveStreamType = -1;
+ }
+ break;
+ }
+ case MSG_RINGER_MODE_CHANGED: {
+ if (mDialog.isShowing()) {
+ updateStates();
+ }
+ break;
+ }
}
}
+ private void resetTimeout() {
+ removeMessages(MSG_TIMEOUT);
+ sendMessageDelayed(obtainMessage(MSG_TIMEOUT), TIMEOUT_DELAY);
+ }
+
+ public void onProgressChanged(SeekBar seekBar, int progress,
+ boolean fromUser) {
+ final Object tag = seekBar.getTag();
+ if (fromUser && tag instanceof StreamControl) {
+ StreamControl sc = (StreamControl) tag;
+ if (mAudioManager.getStreamVolume(sc.streamType) != progress) {
+ mAudioManager.setStreamVolume(sc.streamType, progress, 0);
+ }
+ }
+ resetTimeout();
+ }
+
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
+
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ }
+
+ public void onClick(View v) {
+ if (v == mMoreButton) {
+ expand();
+ } else if (v.getTag() instanceof StreamControl) {
+ StreamControl sc = (StreamControl) v.getTag();
+ mAudioManager.setRingerMode(mAudioManager.isSilentMode()
+ ? AudioManager.RINGER_MODE_NORMAL : AudioManager.RINGER_MODE_SILENT);
+ // Expand the dialog if it hasn't been expanded yet.
+ if (!isExpanded()) expand();
+ }
+ resetTimeout();
+ }
}
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
index 065cc9cb65e6..6c6252e07481 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
index 94deceeab32f..175c750cf766 100644
--- a/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
index 3b9e0cfd2090..6e9abe658b79 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
index 0665b08feba7..f96d09e4cc99 100644
--- a/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
index dc62ab26ac3f..1f11f4406c82 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
index e78e13415c62..2e376cdc5bc7 100644
--- a/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
index ae223c8775ce..73d56b71d713 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
index 7baced0ecd6e..869decfe7cd4 100644
--- a/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_bt.png b/core/res/res/drawable-hdpi/ic_audio_bt.png
new file mode 100644
index 000000000000..597c384cb7af
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_bt.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_bt_mute.png b/core/res/res/drawable-hdpi/ic_audio_bt_mute.png
new file mode 100644
index 000000000000..14542eb5e283
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_bt_mute.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_phone.png b/core/res/res/drawable-hdpi/ic_audio_phone.png
new file mode 100644
index 000000000000..2fff2040a955
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_phone.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_vol.png b/core/res/res/drawable-hdpi/ic_audio_vol.png
index cf3f3f54c514..6ea269330dd5 100644
--- a/core/res/res/drawable-hdpi/ic_audio_vol.png
+++ b/core/res/res/drawable-hdpi/ic_audio_vol.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_vol_mute.png b/core/res/res/drawable-hdpi/ic_audio_vol_mute.png
index c4ac4ef56618..f7428c7f1ba1 100644
--- a/core/res/res/drawable-hdpi/ic_audio_vol_mute.png
+++ b/core/res/res/drawable-hdpi/ic_audio_vol_mute.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_sysbar_quicksettings.png b/core/res/res/drawable-hdpi/ic_sysbar_quicksettings.png
new file mode 100644
index 000000000000..47b4ba23f7a5
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_sysbar_quicksettings.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png b/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png
index 401e90495524..d428e5a96f39 100644
--- a/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png
+++ b/core/res/res/drawable-hdpi/scrubber_control_disabled_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/scrubber_control_holo.png b/core/res/res/drawable-hdpi/scrubber_control_holo.png
index 175917ea327e..a5fb73c104af 100644
--- a/core/res/res/drawable-hdpi/scrubber_control_holo.png
+++ b/core/res/res/drawable-hdpi/scrubber_control_holo.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/stat_notify_chat.png b/core/res/res/drawable-hdpi/stat_notify_chat.png
index 9c713c8f2738..d7c154526b68 100644
--- a/core/res/res/drawable-hdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-hdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/toast_frame.9.png b/core/res/res/drawable-hdpi/toast_frame.9.png
index 8f5d8119c12a..736683ef28a0 100644
--- a/core/res/res/drawable-hdpi/toast_frame.9.png
+++ b/core/res/res/drawable-hdpi/toast_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
index 43e652811ad5..94716158b849 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
index 09a1cd85e183..0502b938b26b 100644
--- a/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_bottom_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
index bd5f9e0d281f..f364b2e3e9ea 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
index 45e97120dc13..91c207646d8e 100644
--- a/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_full_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
index 8082ddd97d66..92788c97263e 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
index ccdcd1d19047..74b66f8a9003 100644
--- a/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_middle_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
index 79aaffbd3c4d..f25cfb692977 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
index 074005112a97..ff3ff06bf440 100644
--- a/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/dialog_top_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_bt.png b/core/res/res/drawable-mdpi/ic_audio_bt.png
new file mode 100644
index 000000000000..282c643ddcf9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_bt.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_bt_mute.png b/core/res/res/drawable-mdpi/ic_audio_bt_mute.png
new file mode 100644
index 000000000000..017338e765eb
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_bt_mute.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_phone.png b/core/res/res/drawable-mdpi/ic_audio_phone.png
new file mode 100644
index 000000000000..00ec59e6fb0a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_phone.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_vol.png b/core/res/res/drawable-mdpi/ic_audio_vol.png
index 049e92ab4126..c32fdbc0d70c 100644
--- a/core/res/res/drawable-mdpi/ic_audio_vol.png
+++ b/core/res/res/drawable-mdpi/ic_audio_vol.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_vol_mute.png b/core/res/res/drawable-mdpi/ic_audio_vol_mute.png
index be71492984b3..52611b6c3b91 100644
--- a/core/res/res/drawable-mdpi/ic_audio_vol_mute.png
+++ b/core/res/res/drawable-mdpi/ic_audio_vol_mute.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_sysbar_quicksettings.png b/core/res/res/drawable-mdpi/ic_sysbar_quicksettings.png
new file mode 100644
index 000000000000..792810427f92
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_sysbar_quicksettings.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png b/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png
index 26f018f28cd8..66dc00151e33 100644
--- a/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png
+++ b/core/res/res/drawable-mdpi/scrubber_control_disabled_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/scrubber_control_holo.png b/core/res/res/drawable-mdpi/scrubber_control_holo.png
index 242c16dffccb..6e0e85a265a3 100644
--- a/core/res/res/drawable-mdpi/scrubber_control_holo.png
+++ b/core/res/res/drawable-mdpi/scrubber_control_holo.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_notify_chat.png b/core/res/res/drawable-mdpi/stat_notify_chat.png
index 91b429008ef6..36ac850e7582 100644
--- a/core/res/res/drawable-mdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-mdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/toast_frame.9.png b/core/res/res/drawable-mdpi/toast_frame.9.png
index 08c4f869e019..1b06b7c85ad6 100755
--- a/core/res/res/drawable-mdpi/toast_frame.9.png
+++ b/core/res/res/drawable-mdpi/toast_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-nodpi/default_wallpaper.jpg b/core/res/res/drawable-xlarge-nodpi/default_wallpaper.jpg
index 8729fe1678a2..72beb6b3cd5c 100644
--- a/core/res/res/drawable-xlarge-nodpi/default_wallpaper.jpg
+++ b/core/res/res/drawable-xlarge-nodpi/default_wallpaper.jpg
Binary files differ
diff --git a/core/res/res/layout/volume_adjust.xml b/core/res/res/layout/volume_adjust.xml
index 18da85f93d9a..b0ca3e8e71ff 100644
--- a/core/res/res/layout/volume_adjust.xml
+++ b/core/res/res/layout/volume_adjust.xml
@@ -17,56 +17,48 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@android:drawable/dialog_full_holo_dark"
android:gravity="left">
<LinearLayout
- android:layout_width="416dip"
- android:layout_height="wrap_content"
- android:paddingLeft="16dip"
- android:paddingTop="16dip"
- android:paddingRight="16dip"
- android:paddingBottom="8dip"
- android:orientation="vertical">
-
- <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dip"
- android:gravity="left">
-
- <ImageView
- android:id="@+id/other_stream_icon"
+ android:layout_marginTop="80dip"
+ android:background="@android:drawable/dialog_full_holo_dark"
+ android:orientation="horizontal"
+ >
+
+ <LinearLayout
+ android:id="@+id/slider_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="16dip" />
+ android:orientation="vertical"
+ >
+ <!-- Sliders go here -->
+ </LinearLayout>
- <TextView
+ <ImageView
+ android:id="@+id/expand_button_divider"
+ android:src="?attr/dividerVertical"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/message"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:layout_height="32dip"
+ android:scaleType="fitXY"
+ android:layout_gravity="top"
+ android:layout_marginTop="16dip"
+ android:layout_marginBottom="16dip"
+ />
+ <ImageView
+ android:id="@+id/expand_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:padding="16dip"
+ android:background="?attr/selectableItemBackground"
+ android:src="@drawable/ic_sysbar_quicksettings"
+ />
+
</LinearLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/additional_message"
- android:textAppearance="?android:attr/textAppearanceSmall" />
-
- <ImageView
- android:id="@+id/ringer_stream_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="14dip" />
-
- <ProgressBar
- style="?android:attr/progressBarStyleHorizontal"
- android:id="@+id/level"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
</FrameLayout>
diff --git a/core/res/res/layout/volume_adjust_item.xml b/core/res/res/layout/volume_adjust_item.xml
new file mode 100644
index 000000000000..e841d878af0c
--- /dev/null
+++ b/core/res/res/layout/volume_adjust_item.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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="wrap_content"
+ android:layout_height="80dip"
+ android:orientation="horizontal"
+ android:layout_marginTop="8dip"
+ android:layout_marginBottom="8dip"
+ android:gravity="left|center_vertical">
+
+ <ImageView
+ android:id="@+id/stream_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="16dip"
+ android:layout_marginLeft="8dip"
+ android:background="?attr/selectableItemBackground"
+ />
+
+ <SeekBar
+ style="?android:attr/seekBarStyle"
+ android:id="@+id/seekbar"
+ android:layout_width="300dip"
+ android:layout_height="wrap_content"
+ android:padding="16dip"
+ android:layout_marginLeft="8dip"
+ android:layout_marginRight="8dip" />
+
+</LinearLayout>
+
+
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index e2751bd59029..5700641f3986 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -208,6 +208,11 @@
<item name="windowExitAnimation">@anim/fade_out</item>
</style>
+ <!-- Window animations used for volume panel. -->
+ <style name="Animation.VolumePanel">
+ <item name="windowEnterAnimation">@null</item>
+ <item name="windowExitAnimation">@anim/fade_out</item>
+ </style>
<!-- Status Bar Styles -->
<style name="TextAppearance.StatusBar">
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 38b068e25c95..6d5b4822b1dc 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -730,6 +730,11 @@
<item name="android:windowCloseOnTouchOutside">false</item>
</style>
+ <style name="Theme.Panel.Volume">
+ <item name="android:windowAnimationStyle">@android:style/Animation.VolumePanel</item>
+ <item name="android:windowCloseOnTouchOutside">true</item>
+ </style>
+
<!-- Default theme with an Action Bar. -->
<style name="Theme.WithActionBar">
<item name="android:windowActionBar">true</item>
diff --git a/data/sounds/Alarm_Beep_01.ogg b/data/sounds/Alarm_Beep_01.ogg
new file mode 100644
index 000000000000..b7de5af7813c
--- /dev/null
+++ b/data/sounds/Alarm_Beep_01.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Beep_02.ogg b/data/sounds/Alarm_Beep_02.ogg
new file mode 100644
index 000000000000..43ea34e1de4c
--- /dev/null
+++ b/data/sounds/Alarm_Beep_02.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Beep_03.ogg b/data/sounds/Alarm_Beep_03.ogg
new file mode 100644
index 000000000000..9d800377621c
--- /dev/null
+++ b/data/sounds/Alarm_Beep_03.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Buzzer.ogg b/data/sounds/Alarm_Buzzer.ogg
new file mode 100644
index 000000000000..4234f37a44f0
--- /dev/null
+++ b/data/sounds/Alarm_Buzzer.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Rooster_01.ogg b/data/sounds/Alarm_Rooster_01.ogg
new file mode 100644
index 000000000000..36b57b717b0d
--- /dev/null
+++ b/data/sounds/Alarm_Rooster_01.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Rooster_02.ogg b/data/sounds/Alarm_Rooster_02.ogg
new file mode 100644
index 000000000000..d20bd1dba800
--- /dev/null
+++ b/data/sounds/Alarm_Rooster_02.ogg
Binary files differ
diff --git a/data/sounds/alarms/Cesium.ogg b/data/sounds/alarms/Cesium.ogg
new file mode 100644
index 000000000000..a8c379ab04a8
--- /dev/null
+++ b/data/sounds/alarms/Cesium.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Analysis.ogg b/data/sounds/alarms/ogg/Analysis.ogg
new file mode 100644
index 000000000000..cef9bd82b94e
--- /dev/null
+++ b/data/sounds/alarms/ogg/Analysis.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Departure.ogg b/data/sounds/alarms/ogg/Departure.ogg
new file mode 100644
index 000000000000..fe83899f092d
--- /dev/null
+++ b/data/sounds/alarms/ogg/Departure.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/FireDrill.ogg b/data/sounds/alarms/ogg/FireDrill.ogg
new file mode 100644
index 000000000000..038353cb5a79
--- /dev/null
+++ b/data/sounds/alarms/ogg/FireDrill.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Timing.ogg b/data/sounds/alarms/ogg/Timing.ogg
new file mode 100644
index 000000000000..45a213bb2137
--- /dev/null
+++ b/data/sounds/alarms/ogg/Timing.ogg
Binary files differ
diff --git a/data/sounds/effects/Dock.aif b/data/sounds/effects/Dock.aif
new file mode 100644
index 000000000000..9f408cc3e27c
--- /dev/null
+++ b/data/sounds/effects/Dock.aif
Binary files differ
diff --git a/data/sounds/effects/Dock.ogg b/data/sounds/effects/Dock.ogg
new file mode 100644
index 000000000000..1462813d4561
--- /dev/null
+++ b/data/sounds/effects/Dock.ogg
Binary files differ
diff --git a/data/sounds/effects/Effect_Tick.ogg b/data/sounds/effects/Effect_Tick.ogg
new file mode 100644
index 000000000000..c899a7de2e3d
--- /dev/null
+++ b/data/sounds/effects/Effect_Tick.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressDelete.ogg b/data/sounds/effects/KeypressDelete.ogg
new file mode 100644
index 000000000000..738f6aea72f7
--- /dev/null
+++ b/data/sounds/effects/KeypressDelete.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressDelete.wav b/data/sounds/effects/KeypressDelete.wav
new file mode 100644
index 000000000000..0a2f3cc5ec0b
--- /dev/null
+++ b/data/sounds/effects/KeypressDelete.wav
Binary files differ
diff --git a/data/sounds/effects/KeypressReturn.ogg b/data/sounds/effects/KeypressReturn.ogg
new file mode 100644
index 000000000000..6c807b0114ff
--- /dev/null
+++ b/data/sounds/effects/KeypressReturn.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressReturn.wav b/data/sounds/effects/KeypressReturn.wav
new file mode 100644
index 000000000000..59ff13af4df4
--- /dev/null
+++ b/data/sounds/effects/KeypressReturn.wav
Binary files differ
diff --git a/data/sounds/effects/KeypressSpacebar.ogg b/data/sounds/effects/KeypressSpacebar.ogg
new file mode 100644
index 000000000000..b59c8ce4904d
--- /dev/null
+++ b/data/sounds/effects/KeypressSpacebar.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressSpacebar.wav b/data/sounds/effects/KeypressSpacebar.wav
new file mode 100644
index 000000000000..1f819c9dbbdb
--- /dev/null
+++ b/data/sounds/effects/KeypressSpacebar.wav
Binary files differ
diff --git a/data/sounds/effects/KeypressStandard.ogg b/data/sounds/effects/KeypressStandard.ogg
new file mode 100644
index 000000000000..a465cf8f9aa7
--- /dev/null
+++ b/data/sounds/effects/KeypressStandard.ogg
Binary files differ
diff --git a/data/sounds/effects/KeypressStandard.wav b/data/sounds/effects/KeypressStandard.wav
new file mode 100644
index 000000000000..56a791155a39
--- /dev/null
+++ b/data/sounds/effects/KeypressStandard.wav
Binary files differ
diff --git a/data/sounds/effects/Lock.ogg b/data/sounds/effects/Lock.ogg
new file mode 100644
index 000000000000..e7928e493f40
--- /dev/null
+++ b/data/sounds/effects/Lock.ogg
Binary files differ
diff --git a/data/sounds/effects/Lock.wav b/data/sounds/effects/Lock.wav
new file mode 100644
index 000000000000..b8076369a3e9
--- /dev/null
+++ b/data/sounds/effects/Lock.wav
Binary files differ
diff --git a/data/sounds/effects/LowBattery.aif b/data/sounds/effects/LowBattery.aif
new file mode 100644
index 000000000000..9216583ee24f
--- /dev/null
+++ b/data/sounds/effects/LowBattery.aif
Binary files differ
diff --git a/data/sounds/effects/LowBattery.ogg b/data/sounds/effects/LowBattery.ogg
new file mode 100644
index 000000000000..68eb2c319488
--- /dev/null
+++ b/data/sounds/effects/LowBattery.ogg
Binary files differ
diff --git a/data/sounds/effects/Undock.aif b/data/sounds/effects/Undock.aif
new file mode 100644
index 000000000000..fe9d0b05db06
--- /dev/null
+++ b/data/sounds/effects/Undock.aif
Binary files differ
diff --git a/data/sounds/effects/Undock.ogg b/data/sounds/effects/Undock.ogg
new file mode 100644
index 000000000000..005306674e30
--- /dev/null
+++ b/data/sounds/effects/Undock.ogg
Binary files differ
diff --git a/data/sounds/effects/Unlock.ogg b/data/sounds/effects/Unlock.ogg
new file mode 100644
index 000000000000..cca95940d950
--- /dev/null
+++ b/data/sounds/effects/Unlock.ogg
Binary files differ
diff --git a/data/sounds/effects/Unlock.wav b/data/sounds/effects/Unlock.wav
new file mode 100644
index 000000000000..e1d475ed84dd
--- /dev/null
+++ b/data/sounds/effects/Unlock.wav
Binary files differ
diff --git a/data/sounds/effects/VideoRecord.ogg b/data/sounds/effects/VideoRecord.ogg
new file mode 100644
index 000000000000..1450522f6d93
--- /dev/null
+++ b/data/sounds/effects/VideoRecord.ogg
Binary files differ
diff --git a/data/sounds/effects/VideoRecord.wav b/data/sounds/effects/VideoRecord.wav
new file mode 100644
index 000000000000..5809d93c011d
--- /dev/null
+++ b/data/sounds/effects/VideoRecord.wav
Binary files differ
diff --git a/data/sounds/effects/camera_click.ogg b/data/sounds/effects/camera_click.ogg
new file mode 100644
index 000000000000..52512ac0a054
--- /dev/null
+++ b/data/sounds/effects/camera_click.ogg
Binary files differ
diff --git a/data/sounds/effects/camera_click.wav b/data/sounds/effects/camera_click.wav
new file mode 100644
index 000000000000..7043bc7b21a9
--- /dev/null
+++ b/data/sounds/effects/camera_click.wav
Binary files differ
diff --git a/data/sounds/effects/ogg/Effect_Tick.ogg b/data/sounds/effects/ogg/Effect_Tick.ogg
index a997fe164ee4..b3790199b8b1 100644
--- a/data/sounds/effects/ogg/Effect_Tick.ogg
+++ b/data/sounds/effects/ogg/Effect_Tick.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/LowBattery.ogg b/data/sounds/effects/ogg/LowBattery.ogg
index dfb5d889713e..c21218cdfd3f 100644
--- a/data/sounds/effects/ogg/LowBattery.ogg
+++ b/data/sounds/effects/ogg/LowBattery.ogg
Binary files differ
diff --git a/data/sounds/notifications/aidos.ogg b/data/sounds/notifications/aidos.ogg
new file mode 100755
index 000000000000..d2aec756ccfe
--- /dev/null
+++ b/data/sounds/notifications/aidos.ogg
Binary files differ
diff --git a/data/sounds/notifications/circios.ogg b/data/sounds/notifications/circios.ogg
new file mode 100755
index 000000000000..68a187120b30
--- /dev/null
+++ b/data/sounds/notifications/circios.ogg
Binary files differ
diff --git a/data/sounds/notifications/horkos.ogg b/data/sounds/notifications/horkos.ogg
new file mode 100755
index 000000000000..171b3cb7c9ae
--- /dev/null
+++ b/data/sounds/notifications/horkos.ogg
Binary files differ
diff --git a/data/sounds/notifications/hypnos1.ogg b/data/sounds/notifications/hypnos1.ogg
new file mode 100755
index 000000000000..4a7fc260835b
--- /dev/null
+++ b/data/sounds/notifications/hypnos1.ogg
Binary files differ
diff --git a/data/sounds/notifications/kratos1.ogg b/data/sounds/notifications/kratos1.ogg
new file mode 100755
index 000000000000..3e1fe6404045
--- /dev/null
+++ b/data/sounds/notifications/kratos1.ogg
Binary files differ
diff --git a/data/sounds/notifications/kratos2.ogg b/data/sounds/notifications/kratos2.ogg
new file mode 100755
index 000000000000..93d3149e852b
--- /dev/null
+++ b/data/sounds/notifications/kratos2.ogg
Binary files differ
diff --git a/data/sounds/notifications/nomos1.ogg b/data/sounds/notifications/nomos1.ogg
new file mode 100755
index 000000000000..5eb719a94dbd
--- /dev/null
+++ b/data/sounds/notifications/nomos1.ogg
Binary files differ
diff --git a/data/sounds/notifications/nomos2.ogg b/data/sounds/notifications/nomos2.ogg
new file mode 100755
index 000000000000..544cb4c53715
--- /dev/null
+++ b/data/sounds/notifications/nomos2.ogg
Binary files differ
diff --git a/data/sounds/notifications/ouranos.ogg b/data/sounds/notifications/ouranos.ogg
new file mode 100755
index 000000000000..d0efc3a2bd13
--- /dev/null
+++ b/data/sounds/notifications/ouranos.ogg
Binary files differ
diff --git a/data/sounds/notifications/phantasos.ogg b/data/sounds/notifications/phantasos.ogg
new file mode 100755
index 000000000000..ea198821c250
--- /dev/null
+++ b/data/sounds/notifications/phantasos.ogg
Binary files differ
diff --git a/data/sounds/notifications/poros.ogg b/data/sounds/notifications/poros.ogg
new file mode 100755
index 000000000000..0a50a12e2dfe
--- /dev/null
+++ b/data/sounds/notifications/poros.ogg
Binary files differ
diff --git a/data/sounds/notifications/thrasos1.ogg b/data/sounds/notifications/thrasos1.ogg
new file mode 100755
index 000000000000..9b7e62111a92
--- /dev/null
+++ b/data/sounds/notifications/thrasos1.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ANDROMEDA.ogg b/data/sounds/ringtones/ANDROMEDA.ogg
new file mode 100644
index 000000000000..8f6bd3e95d11
--- /dev/null
+++ b/data/sounds/ringtones/ANDROMEDA.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Aquila.ogg b/data/sounds/ringtones/Aquila.ogg
new file mode 100644
index 000000000000..b391be978a80
--- /dev/null
+++ b/data/sounds/ringtones/Aquila.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ArgoNavis.ogg b/data/sounds/ringtones/ArgoNavis.ogg
new file mode 100644
index 000000000000..b4202ac993e7
--- /dev/null
+++ b/data/sounds/ringtones/ArgoNavis.ogg
Binary files differ
diff --git a/data/sounds/ringtones/BOOTES.ogg b/data/sounds/ringtones/BOOTES.ogg
new file mode 100644
index 000000000000..0716a4f881a7
--- /dev/null
+++ b/data/sounds/ringtones/BOOTES.ogg
Binary files differ
diff --git a/data/sounds/ringtones/CANISMAJOR.ogg b/data/sounds/ringtones/CANISMAJOR.ogg
new file mode 100644
index 000000000000..177d3dea250b
--- /dev/null
+++ b/data/sounds/ringtones/CANISMAJOR.ogg
Binary files differ
diff --git a/data/sounds/ringtones/CASSIOPEIA.ogg b/data/sounds/ringtones/CASSIOPEIA.ogg
new file mode 100644
index 000000000000..c4a7948364b2
--- /dev/null
+++ b/data/sounds/ringtones/CASSIOPEIA.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Carina.ogg b/data/sounds/ringtones/Carina.ogg
new file mode 100644
index 000000000000..aeb9b36bb6cd
--- /dev/null
+++ b/data/sounds/ringtones/Carina.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Carina.wav b/data/sounds/ringtones/Carina.wav
new file mode 100755
index 000000000000..ecaeb58651cf
--- /dev/null
+++ b/data/sounds/ringtones/Carina.wav
Binary files differ
diff --git a/data/sounds/ringtones/Centaurus.ogg b/data/sounds/ringtones/Centaurus.ogg
new file mode 100644
index 000000000000..404bdbc69c14
--- /dev/null
+++ b/data/sounds/ringtones/Centaurus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Cygnus.ogg b/data/sounds/ringtones/Cygnus.ogg
new file mode 100644
index 000000000000..b2e1e6561620
--- /dev/null
+++ b/data/sounds/ringtones/Cygnus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Draco.ogg b/data/sounds/ringtones/Draco.ogg
new file mode 100644
index 000000000000..88d5a04330ba
--- /dev/null
+++ b/data/sounds/ringtones/Draco.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Eridani.ogg b/data/sounds/ringtones/Eridani.ogg
new file mode 100644
index 000000000000..b665a29fd4a2
--- /dev/null
+++ b/data/sounds/ringtones/Eridani.ogg
Binary files differ
diff --git a/data/sounds/ringtones/FreeFlight.ogg b/data/sounds/ringtones/FreeFlight.ogg
new file mode 100644
index 000000000000..76dfabe619ed
--- /dev/null
+++ b/data/sounds/ringtones/FreeFlight.ogg
Binary files differ
diff --git a/data/sounds/ringtones/FreeFlight.wav b/data/sounds/ringtones/FreeFlight.wav
new file mode 100644
index 000000000000..a4e14aacc7bd
--- /dev/null
+++ b/data/sounds/ringtones/FreeFlight.wav
Binary files differ
diff --git a/data/sounds/ringtones/Lyra.ogg b/data/sounds/ringtones/Lyra.ogg
new file mode 100644
index 000000000000..696f278b62de
--- /dev/null
+++ b/data/sounds/ringtones/Lyra.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Machina.ogg b/data/sounds/ringtones/Machina.ogg
new file mode 100644
index 000000000000..ac16f7ef3fcc
--- /dev/null
+++ b/data/sounds/ringtones/Machina.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Orion.ogg b/data/sounds/ringtones/Orion.ogg
new file mode 100644
index 000000000000..807f10749775
--- /dev/null
+++ b/data/sounds/ringtones/Orion.ogg
Binary files differ
diff --git a/data/sounds/ringtones/PERSEUS.ogg b/data/sounds/ringtones/PERSEUS.ogg
new file mode 100644
index 000000000000..ad060215a0ad
--- /dev/null
+++ b/data/sounds/ringtones/PERSEUS.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Pegasus.ogg b/data/sounds/ringtones/Pegasus.ogg
new file mode 100644
index 000000000000..66c497073b5b
--- /dev/null
+++ b/data/sounds/ringtones/Pegasus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Pyxis.ogg b/data/sounds/ringtones/Pyxis.ogg
new file mode 100644
index 000000000000..2d3adce61910
--- /dev/null
+++ b/data/sounds/ringtones/Pyxis.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Rigel.ogg b/data/sounds/ringtones/Rigel.ogg
new file mode 100644
index 000000000000..af2c176df942
--- /dev/null
+++ b/data/sounds/ringtones/Rigel.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Scarabaeus.ogg b/data/sounds/ringtones/Scarabaeus.ogg
new file mode 100644
index 000000000000..e70fc6967ac6
--- /dev/null
+++ b/data/sounds/ringtones/Scarabaeus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Sceptrum.ogg b/data/sounds/ringtones/Sceptrum.ogg
new file mode 100644
index 000000000000..fc50aef575e4
--- /dev/null
+++ b/data/sounds/ringtones/Sceptrum.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Solarium.ogg b/data/sounds/ringtones/Solarium.ogg
new file mode 100644
index 000000000000..d27f141dd930
--- /dev/null
+++ b/data/sounds/ringtones/Solarium.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Testudo.ogg b/data/sounds/ringtones/Testudo.ogg
new file mode 100644
index 000000000000..0ca8d6b1299d
--- /dev/null
+++ b/data/sounds/ringtones/Testudo.ogg
Binary files differ
diff --git a/data/sounds/ringtones/URSAMINOR.ogg b/data/sounds/ringtones/URSAMINOR.ogg
new file mode 100644
index 000000000000..c0010e821fe9
--- /dev/null
+++ b/data/sounds/ringtones/URSAMINOR.ogg
Binary files differ
diff --git a/data/sounds/ringtones/Vespa.ogg b/data/sounds/ringtones/Vespa.ogg
new file mode 100644
index 000000000000..4423bbb6a5ac
--- /dev/null
+++ b/data/sounds/ringtones/Vespa.ogg
Binary files differ
diff --git a/data/sounds/ringtones/hydra.ogg b/data/sounds/ringtones/hydra.ogg
new file mode 100644
index 000000000000..edde14fde5db
--- /dev/null
+++ b/data/sounds/ringtones/hydra.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone18.ogg b/data/sounds/ringtones/ringtone18.ogg
new file mode 100644
index 000000000000..00cd28f4b0e5
--- /dev/null
+++ b/data/sounds/ringtones/ringtone18.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone19.ogg b/data/sounds/ringtones/ringtone19.ogg
new file mode 100644
index 000000000000..02acaa78a26a
--- /dev/null
+++ b/data/sounds/ringtones/ringtone19.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone20.ogg b/data/sounds/ringtones/ringtone20.ogg
new file mode 100644
index 000000000000..e6d1051edb5e
--- /dev/null
+++ b/data/sounds/ringtones/ringtone20.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone21.ogg b/data/sounds/ringtones/ringtone21.ogg
new file mode 100644
index 000000000000..f8ef5414121a
--- /dev/null
+++ b/data/sounds/ringtones/ringtone21.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone22.ogg b/data/sounds/ringtones/ringtone22.ogg
new file mode 100644
index 000000000000..cd349f5a8017
--- /dev/null
+++ b/data/sounds/ringtones/ringtone22.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone23.ogg b/data/sounds/ringtones/ringtone23.ogg
new file mode 100644
index 000000000000..3b4f000b25b2
--- /dev/null
+++ b/data/sounds/ringtones/ringtone23.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone24.ogg b/data/sounds/ringtones/ringtone24.ogg
new file mode 100644
index 000000000000..e1c5c3b31d46
--- /dev/null
+++ b/data/sounds/ringtones/ringtone24.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone25.ogg b/data/sounds/ringtones/ringtone25.ogg
new file mode 100644
index 000000000000..0f66463e31d7
--- /dev/null
+++ b/data/sounds/ringtones/ringtone25.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone26.ogg b/data/sounds/ringtones/ringtone26.ogg
new file mode 100644
index 000000000000..8cd4648f55f9
--- /dev/null
+++ b/data/sounds/ringtones/ringtone26.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone27.ogg b/data/sounds/ringtones/ringtone27.ogg
new file mode 100644
index 000000000000..9671d6e5f343
--- /dev/null
+++ b/data/sounds/ringtones/ringtone27.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone28.ogg b/data/sounds/ringtones/ringtone28.ogg
new file mode 100644
index 000000000000..6139667c572d
--- /dev/null
+++ b/data/sounds/ringtones/ringtone28.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone29.ogg b/data/sounds/ringtones/ringtone29.ogg
new file mode 100644
index 000000000000..042c82a48f08
--- /dev/null
+++ b/data/sounds/ringtones/ringtone29.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone30.ogg b/data/sounds/ringtones/ringtone30.ogg
new file mode 100644
index 000000000000..eec8ebc0f0db
--- /dev/null
+++ b/data/sounds/ringtones/ringtone30.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone31.ogg b/data/sounds/ringtones/ringtone31.ogg
new file mode 100644
index 000000000000..0140a806677c
--- /dev/null
+++ b/data/sounds/ringtones/ringtone31.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone32.ogg b/data/sounds/ringtones/ringtone32.ogg
new file mode 100644
index 000000000000..4e12f5a8f781
--- /dev/null
+++ b/data/sounds/ringtones/ringtone32.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone33.ogg b/data/sounds/ringtones/ringtone33.ogg
new file mode 100644
index 000000000000..1342066dcee4
--- /dev/null
+++ b/data/sounds/ringtones/ringtone33.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone34.ogg b/data/sounds/ringtones/ringtone34.ogg
new file mode 100644
index 000000000000..a16737b1abc8
--- /dev/null
+++ b/data/sounds/ringtones/ringtone34.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone35.ogg b/data/sounds/ringtones/ringtone35.ogg
new file mode 100644
index 000000000000..3407857a5744
--- /dev/null
+++ b/data/sounds/ringtones/ringtone35.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone36.ogg b/data/sounds/ringtones/ringtone36.ogg
new file mode 100644
index 000000000000..bbd526340fa2
--- /dev/null
+++ b/data/sounds/ringtones/ringtone36.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone37.ogg b/data/sounds/ringtones/ringtone37.ogg
new file mode 100644
index 000000000000..ae7b57ee3e0f
--- /dev/null
+++ b/data/sounds/ringtones/ringtone37.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ringtone38.ogg b/data/sounds/ringtones/ringtone38.ogg
new file mode 100644
index 000000000000..fae20cde3bdb
--- /dev/null
+++ b/data/sounds/ringtones/ringtone38.ogg
Binary files differ
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index c1deed38ae95..136e9b4cf74b 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -104,7 +104,7 @@ public class Canvas {
public Canvas() {
// 0 means no native bitmap
mNativeCanvas = initRaster(0);
- mFinalizer = new CanvasFinalizer(0);
+ mFinalizer = new CanvasFinalizer(mNativeCanvas);
}
/**
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index ebf7aa0a3d04..4f5edd575926 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -76,8 +76,14 @@ void Caches::dumpMemoryUsage() {
LOGD(" PathCache %8d / %8d", pathCache.getSize(), pathCache.getMaxSize());
LOGD(" CircleShapeCache %8d / %8d",
circleShapeCache.getSize(), circleShapeCache.getMaxSize());
+ LOGD(" OvalShapeCache %8d / %8d",
+ ovalShapeCache.getSize(), ovalShapeCache.getMaxSize());
LOGD(" RoundRectShapeCache %8d / %8d",
roundRectShapeCache.getSize(), roundRectShapeCache.getMaxSize());
+ LOGD(" RectShapeCache %8d / %8d",
+ rectShapeCache.getSize(), rectShapeCache.getMaxSize());
+ LOGD(" ArcShapeCache %8d / %8d",
+ arcShapeCache.getSize(), arcShapeCache.getMaxSize());
LOGD(" TextDropShadowCache %8d / %8d", dropShadowCache.getSize(),
dropShadowCache.getMaxSize());
for (uint32_t i = 0; i < fontRenderer.getFontRendererCount(); i++) {
@@ -94,6 +100,11 @@ void Caches::dumpMemoryUsage() {
total += gradientCache.getSize();
total += pathCache.getSize();
total += dropShadowCache.getSize();
+ total += roundRectShapeCache.getSize();
+ total += circleShapeCache.getSize();
+ total += ovalShapeCache.getSize();
+ total += rectShapeCache.getSize();
+ total += arcShapeCache.getSize();
for (uint32_t i = 0; i < fontRenderer.getFontRendererCount(); i++) {
total += fontRenderer.getFontRendererSize(i);
}
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index cfc853cc048b..2df52ae65e12 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -22,62 +22,6 @@ namespace android {
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
-// Defines
-///////////////////////////////////////////////////////////////////////////////
-
-#define PATH_HEAP_SIZE 64
-
-///////////////////////////////////////////////////////////////////////////////
-// Helpers
-///////////////////////////////////////////////////////////////////////////////
-
-PathHeap::PathHeap(): mHeap(PATH_HEAP_SIZE * sizeof(SkPath)) {
-}
-
-PathHeap::PathHeap(SkFlattenableReadBuffer& buffer): mHeap(PATH_HEAP_SIZE * sizeof(SkPath)) {
- int count = buffer.readS32();
-
- mPaths.setCount(count);
- SkPath** ptr = mPaths.begin();
- SkPath* p = (SkPath*) mHeap.allocThrow(count * sizeof(SkPath));
-
- for (int i = 0; i < count; i++) {
- new (p) SkPath;
- p->unflatten(buffer);
- *ptr++ = p;
- p++;
- }
-}
-
-PathHeap::~PathHeap() {
- SkPath** iter = mPaths.begin();
- SkPath** stop = mPaths.end();
- while (iter < stop) {
- (*iter)->~SkPath();
- iter++;
- }
-}
-
-int PathHeap::append(const SkPath& path) {
- SkPath* p = (SkPath*) mHeap.allocThrow(sizeof(SkPath));
- new (p) SkPath(path);
- *mPaths.append() = p;
- return mPaths.count();
-}
-
-void PathHeap::flatten(SkFlattenableWriteBuffer& buffer) const {
- int count = mPaths.count();
-
- buffer.write32(count);
- SkPath** iter = mPaths.begin();
- SkPath** stop = mPaths.end();
- while (iter < stop) {
- (*iter)->flatten(buffer);
- iter++;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////////
@@ -124,6 +68,10 @@ DisplayList::DisplayList(const DisplayListRenderer& recorder) {
}
DisplayList::~DisplayList() {
+ clearResources();
+}
+
+void DisplayList::clearResources() {
sk_free((void*) mReader.base());
Caches& caches = Caches::getInstance();
@@ -143,20 +91,18 @@ DisplayList::~DisplayList() {
}
mPaints.clear();
+ for (size_t i = 0; i < mPaths.size(); i++) {
+ delete mPaths.itemAt(i);
+ }
+ mPaths.clear();
+
for (size_t i = 0; i < mMatrices.size(); i++) {
delete mMatrices.itemAt(i);
}
mMatrices.clear();
-
- if (mPathHeap) {
- for (int i = 0; i < mPathHeap->count(); i++) {
- caches.pathCache.removeDeferred(&(*mPathHeap)[i]);
- }
- mPathHeap->safeUnref();
- }
}
-void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorder) {
+void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorder, bool reusing) {
const SkWriter32& writer = recorder.writeStream();
init();
@@ -164,17 +110,16 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde
return;
}
+ if (reusing) {
+ // re-using display list - clear out previous allocations
+ clearResources();
+ }
+
size_t size = writer.size();
void* buffer = sk_malloc_throw(size);
writer.flatten(buffer);
mReader.setMemory(buffer, size);
- mRCPlayback.reset(&recorder.mRCRecorder);
- mRCPlayback.setupBuffer(mReader);
-
- mTFPlayback.reset(&recorder.mTFRecorder);
- mTFPlayback.setupBuffer(mReader);
-
Caches& caches = Caches::getInstance();
const Vector<SkBitmap*> &bitmapResources = recorder.getBitmapResources();
@@ -196,19 +141,18 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde
mPaints.add(paints.itemAt(i));
}
+ const Vector<SkPath*> &paths = recorder.getPaths();
+ for (size_t i = 0; i < paths.size(); i++) {
+ mPaths.add(paths.itemAt(i));
+ }
+
const Vector<SkMatrix*> &matrices = recorder.getMatrices();
for (size_t i = 0; i < matrices.size(); i++) {
mMatrices.add(matrices.itemAt(i));
}
-
- mPathHeap = recorder.mPathHeap;
- if (mPathHeap) {
- mPathHeap->safeRef();
- }
}
void DisplayList::init() {
- mPathHeap = NULL;
}
bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) {
@@ -557,9 +501,7 @@ bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) {
// Base structure
///////////////////////////////////////////////////////////////////////////////
-DisplayListRenderer::DisplayListRenderer():
- mHeap(HEAP_BLOCK_SIZE), mWriter(MIN_WRITER_SIZE) {
- mPathHeap = NULL;
+DisplayListRenderer::DisplayListRenderer(): mWriter(MIN_WRITER_SIZE) {
mDisplayList = NULL;
}
@@ -568,16 +510,7 @@ DisplayListRenderer::~DisplayListRenderer() {
}
void DisplayListRenderer::reset() {
- if (mPathHeap) {
- mPathHeap->unref();
- mPathHeap = NULL;
- }
-
mWriter.reset();
- mHeap.reset();
-
- mRCRecorder.reset();
- mTFRecorder.reset();
Caches& caches = Caches::getInstance();
for (size_t i = 0; i < mBitmapResources.size(); i++) {
@@ -594,6 +527,8 @@ void DisplayListRenderer::reset() {
mPaints.clear();
mPaintMap.clear();
+ mPaths.clear();
+ mPathMap.clear();
mMatrices.clear();
}
@@ -605,7 +540,7 @@ DisplayList* DisplayListRenderer::getDisplayList() {
if (mDisplayList == NULL) {
mDisplayList = new DisplayList(*this);
} else {
- mDisplayList->initFromDisplayListRenderer(*this);
+ mDisplayList->initFromDisplayListRenderer(*this, true);
}
return mDisplayList;
}
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index a6d2bfe2b1bb..2d0e30a48e05 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -38,7 +38,6 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
#define MIN_WRITER_SIZE 16384
-#define HEAP_BLOCK_SIZE 4096
// Debug
#if DEBUG_DISPLAY_LIST
@@ -48,31 +47,6 @@ namespace uirenderer {
#endif
///////////////////////////////////////////////////////////////////////////////
-// Helpers
-///////////////////////////////////////////////////////////////////////////////
-
-class PathHeap: public SkRefCnt {
-public:
- PathHeap();
- PathHeap(SkFlattenableReadBuffer& buffer);
- ~PathHeap();
-
- int append(const SkPath& path);
-
- int count() const { return mPaths.count(); }
-
- SkPath& operator[](int index) const {
- return *mPaths[index];
- }
-
- void flatten(SkFlattenableWriteBuffer& buffer) const;
-
-private:
- SkChunkAlloc mHeap;
- SkTDArray<SkPath*> mPaths;
-};
-
-///////////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////////
@@ -128,13 +102,15 @@ public:
static const char* OP_NAMES[];
- void initFromDisplayListRenderer(const DisplayListRenderer& recorder);
+ void initFromDisplayListRenderer(const DisplayListRenderer& recorder, bool reusing = false);
bool replay(OpenGLRenderer& renderer, uint32_t level = 0);
private:
void init();
+ void clearResources();
+
class TextContainer {
public:
size_t length() const {
@@ -174,7 +150,7 @@ private:
}
SkPath* getPath() {
- return &(*mPathHeap)[getInt() - 1];
+ return (SkPath*) getInt();
}
SkPaint* getPaint() {
@@ -209,19 +185,15 @@ private:
text->mText = (const char*) mReader.skip(length);
}
- PathHeap* mPathHeap;
-
Vector<SkBitmap*> mBitmapResources;
Vector<SkiaColorFilter*> mFilterResources;
Vector<SkPaint*> mPaints;
+ Vector<SkPath*> mPaths;
Vector<SkMatrix*> mMatrices;
Vector<SkiaShader*> mShaders;
mutable SkFlattenableReadBuffer mReader;
-
- SkRefCntPlayback mRCPlayback;
- SkTypefacePlayback mTFPlayback;
};
///////////////////////////////////////////////////////////////////////////////
@@ -317,6 +289,10 @@ public:
return mPaints;
}
+ const Vector<SkPath*>& getPaths() const {
+ return mPaths;
+ }
+
const Vector<SkMatrix*>& getMatrices() const {
return mMatrices;
}
@@ -385,11 +361,24 @@ private:
mWriter.writePad(text, byteLength);
}
- inline void addPath(const SkPath* path) {
- if (mPathHeap == NULL) {
- mPathHeap = new PathHeap();
+ inline void addPath(SkPath* path) {
+ if (!path) {
+ addInt((int) NULL);
+ return;
}
- addInt(mPathHeap->append(*path));
+
+ SkPath* pathCopy = mPathMap.valueFor(path);
+ if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) {
+ if (pathCopy == NULL) {
+ pathCopy = path;
+ } else {
+ pathCopy = new SkPath(*path);
+ mPaths.add(pathCopy);
+ }
+ mPathMap.add(path, pathCopy);
+ }
+
+ addInt((int) pathCopy);
}
inline void addPaint(SkPaint* paint) {
@@ -457,25 +446,22 @@ private:
caches.resourceCache.incrementRefcount(colorFilter);
}
- SkChunkAlloc mHeap;
-
Vector<SkBitmap*> mBitmapResources;
Vector<SkiaColorFilter*> mFilterResources;
Vector<SkPaint*> mPaints;
DefaultKeyedVector<SkPaint*, SkPaint*> mPaintMap;
+ Vector<SkPath*> mPaths;
+ DefaultKeyedVector<SkPath*, SkPath*> mPathMap;
+
Vector<SkiaShader*> mShaders;
DefaultKeyedVector<SkiaShader*, SkiaShader*> mShaderMap;
Vector<SkMatrix*> mMatrices;
- PathHeap* mPathHeap;
SkWriter32 mWriter;
- SkRefCntRecorder mRCRecorder;
- SkRefCntRecorder mTFRecorder;
-
DisplayList *mDisplayList;
int mRestoreSaveCount;
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 28c302e68de8..0f22bea48009 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -65,7 +65,6 @@ void PathCache::clearGarbage() {
PathTexture* PathCache::get(SkPath* path, SkPaint* paint) {
PathCacheEntry entry(path, paint);
-
PathTexture* texture = mCache.get(entry);
if (!texture) {
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index 8cefc8c6d541..ffccfa257324 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -32,7 +32,7 @@ namespace android {
namespace uirenderer {
struct ShadowText {
- ShadowText(): radius(0), len(0), hash(0), textSize(0.0f), typeface(NULL) {
+ ShadowText(): radius(0), len(0), textSize(0.0f), typeface(NULL) {
}
ShadowText(SkPaint* paint, uint32_t radius, uint32_t len, const char* srcText):
@@ -42,20 +42,11 @@ struct ShadowText {
textSize = paint->getTextSize();
typeface = paint->getTypeface();
-
- hash = 0;
- uint32_t multiplier = 1;
- const char* text = str.string();
- for (uint32_t i = 0; i < len; i++) {
- hash += text[i] * multiplier;
- uint32_t shifted = multiplier << 5;
- multiplier = shifted - multiplier;
- }
}
ShadowText(const ShadowText& shadow):
- radius(shadow.radius), len(shadow.len), hash(shadow.hash),
- textSize(shadow.textSize), typeface(shadow.typeface), str(shadow.str) {
+ radius(shadow.radius), len(shadow.len), textSize(shadow.textSize),
+ typeface(shadow.typeface), str(shadow.str) {
}
~ShadowText() {
@@ -63,20 +54,17 @@ struct ShadowText {
uint32_t radius;
uint32_t len;
- uint32_t hash;
float textSize;
SkTypeface* typeface;
String8 str;
bool operator<(const ShadowText& rhs) const {
- LTE_INT(hash) {
- LTE_INT(len) {
- LTE_INT(radius) {
- LTE_FLOAT(textSize) {
- if (typeface < rhs.typeface) return true;
- else if (typeface == rhs.typeface) {
- return str.compare(rhs.str) < 0;
- }
+ LTE_INT(len) {
+ LTE_INT(radius) {
+ LTE_FLOAT(textSize) {
+ if (typeface < rhs.typeface) return true;
+ else if (typeface == rhs.typeface) {
+ return str.compare(rhs.str) < 0;
}
}
}
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
index fe9be2ca1179..c9704fce57e5 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png
index f9b39666ec55..b37dd9f0c85a 100644
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
index 45a97fd233ac..f61583538a8b 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png
index 306afd09804f..f784e7e1b169 100644
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png
Binary files differ
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
index a892cd91c1b4..6e3b0d7cc949 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
@@ -75,7 +75,7 @@
android:id="@+id/clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="2dip"
+ android:layout_marginBottom="3dip"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
>
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index ea5e5ccd8e25..697e879207ec 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -293,18 +293,21 @@ sp<ISensorEventConnection> SensorService::createSensorEventConnection()
return result;
}
-void SensorService::cleanupConnection(const wp<SensorEventConnection>& connection)
+void SensorService::cleanupConnection(SensorEventConnection* c)
{
Mutex::Autolock _l(mLock);
+ const wp<SensorEventConnection> connection(c);
size_t size = mActiveSensors.size();
for (size_t i=0 ; i<size ; ) {
- SensorRecord* rec = mActiveSensors.valueAt(i);
- if (rec && rec->removeConnection(connection)) {
- int handle = mActiveSensors.keyAt(i);
+ int handle = mActiveSensors.keyAt(i);
+ if (c->hasSensor(handle)) {
SensorInterface* sensor = mSensorMap.valueFor( handle );
if (sensor) {
- sensor->activate(connection.unsafe_get(), false);
+ sensor->activate(c, false);
}
+ }
+ SensorRecord* rec = mActiveSensors.valueAt(i);
+ if (rec && rec->removeConnection(connection)) {
mActiveSensors.removeItemsAt(i, 1);
mActiveVirtualSensors.removeItem(handle);
delete rec;
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index 540c7e2a5fe8..21f12bdbcf42 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -129,7 +129,7 @@ class SensorService :
public:
static char const* getServiceName() { return "sensorservice"; }
- void cleanupConnection(const wp<SensorEventConnection>& connection);
+ void cleanupConnection(SensorEventConnection* connection);
status_t enable(const sp<SensorEventConnection>& connection, int handle);
status_t disable(const sp<SensorEventConnection>& connection, int handle);
status_t setEventRate(const sp<SensorEventConnection>& connection, int handle, nsecs_t ns);