Merge "Proper fix for bug 3407633"
diff --git a/api/10.xml b/api/10.xml
index ad54650..e10b357 100644
--- a/api/10.xml
+++ b/api/10.xml
@@ -100906,7 +100906,7 @@
visibility="public"
>
</field>
-<field name="ACTION_TECHNOLOGY_DISCOVERED"
+<field name="ACTION_TECH_DISCOVERED"
type="java.lang.String"
transient="false"
volatile="false"
@@ -100975,29 +100975,12 @@
extends="java.lang.Object"
abstract="false"
static="false"
- final="false"
+ final="true"
deprecated="not deprecated"
visibility="public"
>
<implements name="android.os.Parcelable">
</implements>
-<method name="createMockTag"
- return="android.nfc.Tag"
- abstract="false"
- native="false"
- synchronized="false"
- static="true"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="id" type="byte[]">
-</parameter>
-<parameter name="techList" type="int[]">
-</parameter>
-<parameter name="techListExtras" type="android.os.Bundle[]">
-</parameter>
-</method>
<method name="describeContents"
return="int"
abstract="false"
@@ -101145,19 +101128,6 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<exception name="IOException" type="java.io.IOException">
-</exception>
-</method>
</class>
<class name="IsoDep"
extends="android.nfc.tech.BasicTagTechnology"
@@ -101745,7 +101715,7 @@
deprecated="not deprecated"
visibility="public"
>
-<method name="canMakeReadonly"
+<method name="canMakeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -101807,7 +101777,7 @@
</exception>
</method>
<method name="getType"
- return="int"
+ return="java.lang.String"
abstract="false"
native="false"
synchronized="false"
@@ -101828,7 +101798,7 @@
visibility="public"
>
</method>
-<method name="makeReadonly"
+<method name="makeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -101859,10 +101829,10 @@
</exception>
</method>
<field name="MIFARE_CLASSIC"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="101"
+ value=""com.nxp.ndef.mifareclassic""
static="true"
final="true"
deprecated="not deprecated"
@@ -101870,10 +101840,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_1"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="1"
+ value=""org.nfcforum.ndef.type1""
static="true"
final="true"
deprecated="not deprecated"
@@ -101881,10 +101851,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_2"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="2"
+ value=""org.nfcforum.ndef.type2""
static="true"
final="true"
deprecated="not deprecated"
@@ -101892,10 +101862,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_3"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="3"
+ value=""org.nfcforum.ndef.type3""
static="true"
final="true"
deprecated="not deprecated"
@@ -101903,21 +101873,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_4"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="4"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OTHER"
- type="int"
- transient="false"
- volatile="false"
- value="-1"
+ value=""org.nfcforum.ndef.type4""
static="true"
final="true"
deprecated="not deprecated"
@@ -101950,6 +101909,23 @@
<exception name="IOException" type="java.io.IOException">
</exception>
</method>
+<method name="formatReadOnly"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="firstMessage" type="android.nfc.NdefMessage">
+</parameter>
+<exception name="FormatException" type="android.nfc.FormatException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
<method name="get"
return="android.nfc.tech.NdefFormatable"
abstract="false"
@@ -102246,8 +102222,8 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
+<method name="isConnected"
+ return="boolean"
abstract="true"
native="false"
synchronized="false"
@@ -102256,8 +102232,6 @@
deprecated="not deprecated"
visibility="public"
>
-<exception name="IOException" type="java.io.IOException">
-</exception>
</method>
</interface>
</package>
diff --git a/api/11.xml b/api/11.xml
index 16984b5..4a40c36 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -118639,7 +118639,7 @@
visibility="public"
>
</field>
-<field name="ACTION_TECHNOLOGY_DISCOVERED"
+<field name="ACTION_TECH_DISCOVERED"
type="java.lang.String"
transient="false"
volatile="false"
@@ -118708,29 +118708,12 @@
extends="java.lang.Object"
abstract="false"
static="false"
- final="false"
+ final="true"
deprecated="not deprecated"
visibility="public"
>
<implements name="android.os.Parcelable">
</implements>
-<method name="createMockTag"
- return="android.nfc.Tag"
- abstract="false"
- native="false"
- synchronized="false"
- static="true"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="id" type="byte[]">
-</parameter>
-<parameter name="techList" type="int[]">
-</parameter>
-<parameter name="techListExtras" type="android.os.Bundle[]">
-</parameter>
-</method>
<method name="describeContents"
return="int"
abstract="false"
@@ -118878,19 +118861,6 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<exception name="IOException" type="java.io.IOException">
-</exception>
-</method>
</class>
<class name="IsoDep"
extends="android.nfc.tech.BasicTagTechnology"
@@ -119478,7 +119448,7 @@
deprecated="not deprecated"
visibility="public"
>
-<method name="canMakeReadonly"
+<method name="canMakeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -119540,7 +119510,7 @@
</exception>
</method>
<method name="getType"
- return="int"
+ return="java.lang.String"
abstract="false"
native="false"
synchronized="false"
@@ -119561,7 +119531,7 @@
visibility="public"
>
</method>
-<method name="makeReadonly"
+<method name="makeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -119592,10 +119562,10 @@
</exception>
</method>
<field name="MIFARE_CLASSIC"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="101"
+ value=""com.nxp.ndef.mifareclassic""
static="true"
final="true"
deprecated="not deprecated"
@@ -119603,10 +119573,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_1"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="1"
+ value=""org.nfcforum.ndef.type1""
static="true"
final="true"
deprecated="not deprecated"
@@ -119614,10 +119584,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_2"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="2"
+ value=""org.nfcforum.ndef.type2""
static="true"
final="true"
deprecated="not deprecated"
@@ -119625,10 +119595,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_3"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="3"
+ value=""org.nfcforum.ndef.type3""
static="true"
final="true"
deprecated="not deprecated"
@@ -119636,21 +119606,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_4"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="4"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OTHER"
- type="int"
- transient="false"
- volatile="false"
- value="-1"
+ value=""org.nfcforum.ndef.type4""
static="true"
final="true"
deprecated="not deprecated"
@@ -119683,6 +119642,23 @@
<exception name="IOException" type="java.io.IOException">
</exception>
</method>
+<method name="formatReadOnly"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="firstMessage" type="android.nfc.NdefMessage">
+</parameter>
+<exception name="FormatException" type="android.nfc.FormatException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
<method name="get"
return="android.nfc.tech.NdefFormatable"
abstract="false"
@@ -119979,8 +119955,8 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
+<method name="isConnected"
+ return="boolean"
abstract="true"
native="false"
synchronized="false"
@@ -119989,8 +119965,6 @@
deprecated="not deprecated"
visibility="public"
>
-<exception name="IOException" type="java.io.IOException">
-</exception>
</method>
</interface>
</package>
diff --git a/api/current.xml b/api/current.xml
index bf5fb5a..f4d9a2d8 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -120167,7 +120167,7 @@
visibility="public"
>
</field>
-<field name="ACTION_TECHNOLOGY_DISCOVERED"
+<field name="ACTION_TECH_DISCOVERED"
type="java.lang.String"
transient="false"
volatile="false"
@@ -120236,29 +120236,12 @@
extends="java.lang.Object"
abstract="false"
static="false"
- final="false"
+ final="true"
deprecated="not deprecated"
visibility="public"
>
<implements name="android.os.Parcelable">
</implements>
-<method name="createMockTag"
- return="android.nfc.Tag"
- abstract="false"
- native="false"
- synchronized="false"
- static="true"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="id" type="byte[]">
-</parameter>
-<parameter name="techList" type="int[]">
-</parameter>
-<parameter name="techListExtras" type="android.os.Bundle[]">
-</parameter>
-</method>
<method name="describeContents"
return="int"
abstract="false"
@@ -120406,19 +120389,6 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<exception name="IOException" type="java.io.IOException">
-</exception>
-</method>
</class>
<class name="IsoDep"
extends="android.nfc.tech.BasicTagTechnology"
@@ -121006,7 +120976,7 @@
deprecated="not deprecated"
visibility="public"
>
-<method name="canMakeReadonly"
+<method name="canMakeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -121068,7 +121038,7 @@
</exception>
</method>
<method name="getType"
- return="int"
+ return="java.lang.String"
abstract="false"
native="false"
synchronized="false"
@@ -121089,7 +121059,7 @@
visibility="public"
>
</method>
-<method name="makeReadonly"
+<method name="makeReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -121120,10 +121090,10 @@
</exception>
</method>
<field name="MIFARE_CLASSIC"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="101"
+ value=""com.nxp.ndef.mifareclassic""
static="true"
final="true"
deprecated="not deprecated"
@@ -121131,10 +121101,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_1"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="1"
+ value=""org.nfcforum.ndef.type1""
static="true"
final="true"
deprecated="not deprecated"
@@ -121142,10 +121112,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_2"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="2"
+ value=""org.nfcforum.ndef.type2""
static="true"
final="true"
deprecated="not deprecated"
@@ -121153,10 +121123,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_3"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="3"
+ value=""org.nfcforum.ndef.type3""
static="true"
final="true"
deprecated="not deprecated"
@@ -121164,21 +121134,10 @@
>
</field>
<field name="NFC_FORUM_TYPE_4"
- type="int"
+ type="java.lang.String"
transient="false"
volatile="false"
- value="4"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="OTHER"
- type="int"
- transient="false"
- volatile="false"
- value="-1"
+ value=""org.nfcforum.ndef.type4""
static="true"
final="true"
deprecated="not deprecated"
@@ -121211,6 +121170,23 @@
<exception name="IOException" type="java.io.IOException">
</exception>
</method>
+<method name="formatReadOnly"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="firstMessage" type="android.nfc.NdefMessage">
+</parameter>
+<exception name="FormatException" type="android.nfc.FormatException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
<method name="get"
return="android.nfc.tech.NdefFormatable"
abstract="false"
@@ -121507,8 +121483,8 @@
visibility="public"
>
</method>
-<method name="reconnect"
- return="void"
+<method name="isConnected"
+ return="boolean"
abstract="true"
native="false"
synchronized="false"
@@ -121517,8 +121493,6 @@
deprecated="not deprecated"
visibility="public"
>
-<exception name="IOException" type="java.io.IOException">
-</exception>
</method>
</interface>
</package>
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 6650a71..e07495d 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -23,6 +23,8 @@
#include <utils/misc.h>
#include <signal.h>
+#include <cutils/properties.h>
+
#include <binder/IPCThreadState.h>
#include <utils/threads.h>
#include <utils/Atomic.h>
@@ -51,6 +53,7 @@
#define USER_BOOTANIMATION_FILE "/data/local/bootanimation.zip"
#define SYSTEM_BOOTANIMATION_FILE "/system/media/bootanimation.zip"
+#define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE "/system/media/bootanimation-encrypted.zip"
namespace android {
@@ -248,11 +251,25 @@
mFlingerSurface = s;
mAndroidAnimation = true;
- if ((access(USER_BOOTANIMATION_FILE, R_OK) == 0) &&
- (mZip.open(USER_BOOTANIMATION_FILE) == NO_ERROR) ||
- (access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0) &&
- (mZip.open(SYSTEM_BOOTANIMATION_FILE) == NO_ERROR))
+
+ // If the device has encryption turned on or is in process
+ // of being encrypted we show the encrypted boot animation.
+ char decrypt[PROPERTY_VALUE_MAX];
+ property_get("vold.decrypt", decrypt, "");
+
+ bool encryptedAnimation = atoi(decrypt) != 0 || !strcmp("trigger_restart_min_framework", decrypt);
+
+ if ((encryptedAnimation &&
+ (access(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE, R_OK) == 0) &&
+ (mZip.open(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE) == NO_ERROR)) ||
+
+ ((access(USER_BOOTANIMATION_FILE, R_OK) == 0) &&
+ (mZip.open(USER_BOOTANIMATION_FILE) == NO_ERROR)) ||
+
+ ((access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0) &&
+ (mZip.open(SYSTEM_BOOTANIMATION_FILE) == NO_ERROR))) {
mAndroidAnimation = false;
+ }
return NO_ERROR;
}
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index fb16609..2e70a56 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -1781,7 +1781,7 @@
// will return a different value, but we *don't* erase the
// passwords. We only erase them if it has a different
// subscriber ID once it's provisioned.
- if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
+ if (telephonyManager.getCurrentPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
IBinder service = ServiceManager.checkService(Context.TELEPHONY_SERVICE);
if (service == null) {
Log.w(TAG, "call to checkService(TELEPHONY_SERVICE) failed");
diff --git a/core/java/android/app/TimePickerDialog.java b/core/java/android/app/TimePickerDialog.java
index f9920c7..a990ee9 100644
--- a/core/java/android/app/TimePickerDialog.java
+++ b/core/java/android/app/TimePickerDialog.java
@@ -107,9 +107,9 @@
mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
// initialize state
+ mTimePicker.setIs24HourView(mIs24HourView);
mTimePicker.setCurrentHour(mInitialHourOfDay);
mTimePicker.setCurrentMinute(mInitialMinute);
- mTimePicker.setIs24HourView(mIs24HourView);
mTimePicker.setOnTimeChangedListener(this);
}
@@ -144,8 +144,8 @@
super.onRestoreInstanceState(savedInstanceState);
int hour = savedInstanceState.getInt(HOUR);
int minute = savedInstanceState.getInt(MINUTE);
+ mTimePicker.setIs24HourView(savedInstanceState.getBoolean(IS_24_HOUR));
mTimePicker.setCurrentHour(hour);
mTimePicker.setCurrentMinute(minute);
- mTimePicker.setIs24HourView(savedInstanceState.getBoolean(IS_24_HOUR));
}
}
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index fb3744d..4656e15 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -296,12 +296,12 @@
* can use this intent.
*
* <p>This intent will have 3 extras:
- * {@link #EXTRA_STATE} - The current state.
- * {@link #EXTRA_PREVIOUS_STATE}- The previous.
+ * {@link #EXTRA_CONNECTION_STATE} - The current connection state.
+ * {@link #EXTRA_PREVIOUS_CONNECTION_STATE}- The previous connection state.
* {@link BluetoothDevice#EXTRA_DEVICE} - The remote device.
*
- * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of
- * {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTING},
+ * {@link #EXTRA_CONNECTION_STATE} or {@link #EXTRA_PREVIOUS_CONNECTION_STATE}
+ * can be any of {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTING},
* {@link #STATE_CONNECTED}, {@link #STATE_DISCONNECTING}.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index 4808032..d30a0c6 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -44,10 +44,10 @@
/**
* Intent to start an activity when a tag with NDEF payload is discovered.
* If the tag has and NDEF payload this intent is started before
- * {@link #ACTION_TECHNOLOGY_DISCOVERED}.
+ * {@link #ACTION_TECH_DISCOVERED}.
*
* If any activities respond to this intent neither
- * {@link #ACTION_TECHNOLOGY_DISCOVERED} or {@link #ACTION_TAG_DISCOVERED} will be started.
+ * {@link #ACTION_TECH_DISCOVERED} or {@link #ACTION_TAG_DISCOVERED} will be started.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED";
@@ -63,7 +63,7 @@
* If any activities respond to this intent {@link #ACTION_TAG_DISCOVERED} will not be started.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_TECHNOLOGY_DISCOVERED = "android.nfc.action.TECH_DISCOVERED";
+ public static final String ACTION_TECH_DISCOVERED = "android.nfc.action.TECH_DISCOVERED";
/**
* Intent to start an activity when a tag is discovered.
diff --git a/core/java/android/nfc/Tag.java b/core/java/android/nfc/Tag.java
index aae75c9..45a3447 100644
--- a/core/java/android/nfc/Tag.java
+++ b/core/java/android/nfc/Tag.java
@@ -55,7 +55,7 @@
* not cause any further RF activity or block. Note however that arrays passed to and
* returned by this class are *not* cloned, so be careful not to modify them.
*/
-public class Tag implements Parcelable {
+public final class Tag implements Parcelable {
/*package*/ final byte[] mId;
/*package*/ final int[] mTechList;
/*package*/ final String[] mTechStringList;
@@ -93,6 +93,7 @@
* @param id The tag identifier, can be null
* @param techList must not be null
* @return freshly constructed tag
+ * @hide
*/
public static Tag createMockTag(byte[] id, int[] techList, Bundle[] techListExtras) {
// set serviceHandle to 0 to indicate mock tag
diff --git a/core/java/android/nfc/tech/BasicTagTechnology.java b/core/java/android/nfc/tech/BasicTagTechnology.java
index 32a850d..7ec807a 100644
--- a/core/java/android/nfc/tech/BasicTagTechnology.java
+++ b/core/java/android/nfc/tech/BasicTagTechnology.java
@@ -53,15 +53,7 @@
}
}
- /**
- * Helper to indicate if {@link #connect} has succeeded.
- * <p>
- * Does not cause RF activity, and does not block.
- * @return true if {@link #connect} has completed successfully and the {@link Tag} is believed
- * to be within range. Applications must still handle {@link java.io.IOException}
- * while using methods that require a connection in case the connection is lost after this
- * method returns.
- */
+ @Override
public boolean isConnected() {
if (!mIsConnected) {
return false;
@@ -94,6 +86,7 @@
}
}
+ /** @hide */
@Override
public void reconnect() throws IOException {
if (!mIsConnected) {
diff --git a/core/java/android/nfc/tech/Ndef.java b/core/java/android/nfc/tech/Ndef.java
index c6804f9..39ff282 100644
--- a/core/java/android/nfc/tech/Ndef.java
+++ b/core/java/android/nfc/tech/Ndef.java
@@ -61,12 +61,31 @@
/** @hide */
public static final String EXTRA_NDEF_TYPE = "ndeftype";
- public static final int OTHER = -1;
- public static final int NFC_FORUM_TYPE_1 = 1;
- public static final int NFC_FORUM_TYPE_2 = 2;
- public static final int NFC_FORUM_TYPE_3 = 3;
- public static final int NFC_FORUM_TYPE_4 = 4;
- public static final int MIFARE_CLASSIC = 101;
+ /** @hide */
+ public static final int TYPE_OTHER = -1;
+ /** @hide */
+ public static final int TYPE_1 = 1;
+ /** @hide */
+ public static final int TYPE_2 = 2;
+ /** @hide */
+ public static final int TYPE_3 = 3;
+ /** @hide */
+ public static final int TYPE_4 = 4;
+ /** @hide */
+ public static final int TYPE_MIFARE_CLASSIC = 101;
+
+ /** @hide */
+ public static final String UNKNOWN = "android.ndef.unknown";
+
+ public static final String NFC_FORUM_TYPE_1 = "org.nfcforum.ndef.type1";
+
+ public static final String NFC_FORUM_TYPE_2 = "org.nfcforum.ndef.type2";
+
+ public static final String NFC_FORUM_TYPE_3 = "org.nfcforum.ndef.type3";
+
+ public static final String NFC_FORUM_TYPE_4 = "org.nfcforum.ndef.type4";
+
+ public static final String MIFARE_CLASSIC = "com.nxp.ndef.mifareclassic";
private final int mMaxNdefSize;
private final int mCardState;
@@ -118,18 +137,27 @@
* Get NDEF tag type.
* <p>Returns one of {@link #NFC_FORUM_TYPE_1}, {@link #NFC_FORUM_TYPE_2},
* {@link #NFC_FORUM_TYPE_3}, {@link #NFC_FORUM_TYPE_4},
- * {@link #MIFARE_CLASSIC} or {@link #OTHER}.
- * <p>Platforms of this API revision will always return one of the above
- * values. Platforms at future API revisions may return other values, which
- * can be treated as {@link #OTHER} by applications targeting this API.
+ * {@link #MIFARE_CLASSIC} or another NDEF tag type that is not yet in the
+ * Android API.
* <p>Android devices with NFC support must always correctly enumerate
* NFC Forum tag types, and may optionally enumerate
* {@link #MIFARE_CLASSIC} since it requires proprietary technology.
- * Devices that cannot enumerate {@link #MIFARE_CLASSIC} will use
- * {@link #OTHER} instead.
*/
- public int getType() {
- return mNdefType;
+ public String getType() {
+ switch (mNdefType) {
+ case TYPE_1:
+ return NFC_FORUM_TYPE_1;
+ case TYPE_2:
+ return NFC_FORUM_TYPE_2;
+ case TYPE_3:
+ return NFC_FORUM_TYPE_3;
+ case TYPE_4:
+ return NFC_FORUM_TYPE_4;
+ case TYPE_MIFARE_CLASSIC:
+ return MIFARE_CLASSIC;
+ default:
+ return UNKNOWN;
+ }
}
/**
@@ -217,10 +245,10 @@
/**
* Indicates whether a tag can be made read-only with
- * {@link #makeReadonly()}
+ * {@link #makeReadOnly()}
*/
- public boolean canMakeReadonly() {
- if (mNdefType == NFC_FORUM_TYPE_1 || mNdefType == NFC_FORUM_TYPE_2) {
+ public boolean canMakeReadOnly() {
+ if (mNdefType == TYPE_1 || mNdefType == TYPE_2) {
return true;
} else {
return false;
@@ -234,7 +262,7 @@
* This is a one-way process and can not be reverted!
* @throws IOException
*/
- public boolean makeReadonly() throws IOException {
+ public boolean makeReadOnly() throws IOException {
checkConnected();
try {
diff --git a/core/java/android/nfc/tech/NdefFormatable.java b/core/java/android/nfc/tech/NdefFormatable.java
index 2919c43..e2828b5 100644
--- a/core/java/android/nfc/tech/NdefFormatable.java
+++ b/core/java/android/nfc/tech/NdefFormatable.java
@@ -65,8 +65,25 @@
/**
* Formats a tag as NDEF, if possible. You may supply a first
* NdefMessage to be written on the tag.
+ * <p>Either all steps succeed, or an IOException is thrown if any one step
+ * fails.
*/
public void format(NdefMessage firstMessage) throws IOException, FormatException {
+ format(firstMessage, false);
+ }
+
+ /**
+ * Formats a tag as NDEF, if possible. You may supply a first
+ * NdefMessage to be written on the tag.
+ * <p>Either all steps succeed, or an IOException is thrown if any one step
+ * fails.
+ */
+ public void formatReadOnly(NdefMessage firstMessage) throws IOException, FormatException {
+ format(firstMessage, true);
+ }
+
+ /*package*/ void format(NdefMessage firstMessage, boolean makeReadOnly) throws IOException,
+ FormatException {
checkConnected();
try {
@@ -101,6 +118,21 @@
} else {
throw new IOException();
}
+ // optionally make read-only
+ if (makeReadOnly) {
+ errorCode = tagService.ndefMakeReadOnly(serviceHandle);
+ switch (errorCode) {
+ case ErrorCodes.SUCCESS:
+ break;
+ case ErrorCodes.ERROR_IO:
+ throw new IOException();
+ case ErrorCodes.ERROR_INVALID_PARAM:
+ throw new IOException();
+ default:
+ // Should not happen
+ throw new IOException();
+ }
+ }
} catch (RemoteException e) {
Log.e(TAG, "NFC service dead", e);
}
diff --git a/core/java/android/nfc/tech/TagTechnology.java b/core/java/android/nfc/tech/TagTechnology.java
index c8ccdcf..50df865 100644
--- a/core/java/android/nfc/tech/TagTechnology.java
+++ b/core/java/android/nfc/tech/TagTechnology.java
@@ -121,6 +121,7 @@
* @see #connect()
* @see #close()
* @throws IOException
+ * @hide
*/
public void reconnect() throws IOException;
@@ -137,4 +138,15 @@
* @see #reconnect()
*/
public void close() throws IOException;
+
+ /**
+ * Helper to indicate if {@link #connect} has succeeded.
+ * <p>
+ * Does not cause RF activity, and does not block.
+ * @return true if {@link #connect} has completed successfully and the {@link Tag} is believed
+ * to be within range. Applications must still handle {@link java.io.IOException}
+ * while using methods that require a connection in case the connection is lost after this
+ * method returns.
+ */
+ public boolean isConnected();
}
diff --git a/core/java/android/preference/VolumePreference.java b/core/java/android/preference/VolumePreference.java
index 66c9ba1..50ca71e 100644
--- a/core/java/android/preference/VolumePreference.java
+++ b/core/java/android/preference/VolumePreference.java
@@ -54,7 +54,7 @@
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.VolumePreference, 0, 0);
mStreamType = a.getInt(android.R.styleable.VolumePreference_streamType, 0);
- a.recycle();
+ a.recycle();
}
public void setStreamType(int streamType) {
@@ -249,15 +249,19 @@
};
public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType) {
+ this(context, seekBar, streamType, null);
+ }
+
+ public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType, Uri defaultUri) {
mContext = context;
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
mStreamType = streamType;
mSeekBar = seekBar;
-
- initSeekBar(seekBar);
+
+ initSeekBar(seekBar, defaultUri);
}
- private void initSeekBar(SeekBar seekBar) {
+ private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
seekBar.setProgress(mOriginalStreamVolume);
@@ -266,22 +270,24 @@
mContext.getContentResolver().registerContentObserver(
System.getUriFor(System.VOLUME_SETTINGS[mStreamType]),
false, mVolumeObserver);
-
- Uri defaultUri = null;
- if (mStreamType == AudioManager.STREAM_RING) {
- defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
- } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
- defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
- } else {
- defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
+
+ if (defaultUri == null) {
+ if (mStreamType == AudioManager.STREAM_RING) {
+ defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
+ } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
+ defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
+ } else {
+ defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
+ }
}
mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
+
if (mRingtone != null) {
mRingtone.setStreamType(mStreamType);
}
}
-
+
public void stop() {
stopSample();
mContext.getContentResolver().unregisterContentObserver(mVolumeObserver);
@@ -312,18 +318,24 @@
}
public void onStopTrackingTouch(SeekBar seekBar) {
- if (mRingtone != null && !mRingtone.isPlaying()) {
- sample();
+ if (!isSamplePlaying()) {
+ startSample();
}
}
public void run() {
mAudioManager.setStreamVolume(mStreamType, mLastProgress, 0);
}
-
- private void sample() {
+
+ public boolean isSamplePlaying() {
+ return mRingtone != null && mRingtone.isPlaying();
+ }
+
+ public void startSample() {
onSampleStarting(this);
- mRingtone.play();
+ if (mRingtone != null) {
+ mRingtone.play();
+ }
}
public void stopSample() {
@@ -338,8 +350,8 @@
public void changeVolumeBy(int amount) {
mSeekBar.incrementProgressBy(amount);
- if (mRingtone != null && !mRingtone.isPlaying()) {
- sample();
+ if (!isSamplePlaying()) {
+ startSample();
}
postSetVolume(mSeekBar.getProgress());
mVolumeBeforeMute = -1;
@@ -348,7 +360,7 @@
public void muteVolume() {
if (mVolumeBeforeMute != -1) {
mSeekBar.setProgress(mVolumeBeforeMute);
- sample();
+ startSample();
postSetVolume(mVolumeBeforeMute);
mVolumeBeforeMute = -1;
} else {
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 943a3ff..ab1e9c6 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -115,8 +115,7 @@
private static final int MESSAGE_FINISH_DISABLE = 1;
private static final int MESSAGE_UUID_INTENT = 2;
- private static final int MESSAGE_DISCOVERABLE_TIMEOUT = 3;
- private static final int MESSAGE_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY = 4;
+ private static final int MESSAGE_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY = 3;
// The time (in millisecs) to delay the pairing attempt after the first
// auto pairing attempt fails. We use an exponential delay with
@@ -535,15 +534,6 @@
makeServiceChannelCallbacks(address);
}
break;
- case MESSAGE_DISCOVERABLE_TIMEOUT:
- int mode = msg.arg1;
- if (isEnabledInternal()) {
- // TODO: Switch back to the previous scan mode
- // This is ok for now, because we only use
- // CONNECTABLE and CONNECTABLE_DISCOVERABLE
- setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE, -1);
- }
- break;
case MESSAGE_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY:
address = (String)msg.obj;
if (address != null) {
@@ -1163,21 +1153,16 @@
switch (mode) {
case BluetoothAdapter.SCAN_MODE_NONE:
- mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT);
pairable = false;
discoverable = false;
break;
case BluetoothAdapter.SCAN_MODE_CONNECTABLE:
- mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT);
pairable = true;
discoverable = false;
break;
case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE:
- mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT);
pairable = true;
discoverable = true;
- Message msg = mHandler.obtainMessage(MESSAGE_DISCOVERABLE_TIMEOUT);
- mHandler.sendMessageDelayed(msg, duration * 1000);
if (DBG) Log.d(TAG, "BT Discoverable for " + duration + " seconds");
break;
default:
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 95d985d..dd39714 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -36,6 +36,7 @@
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
+import android.os.Process;
import android.os.RemoteException;
import android.util.Log;
import android.util.LogPrinter;
@@ -206,8 +207,14 @@
@Override
public void setFixedSize(int width, int height) {
- throw new UnsupportedOperationException(
- "Wallpapers currently only support sizing from layout");
+ if (Process.myUid() != Process.SYSTEM_UID) {
+ // Regular apps can't do this. It can only work for
+ // certain designs of window animations, so you can't
+ // rely on it.
+ throw new UnsupportedOperationException(
+ "Wallpapers currently only support sizing from layout");
+ }
+ super.setFixedSize(width, height);
}
public void setKeepScreenOn(boolean screenOn) {
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index 403f20e..f196b34 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -92,7 +92,7 @@
} else {
mInts = new PackedIntVector(COLUMNS_NORMAL);
mEllipsizedWidth = width;
- mEllipsizeAt = ellipsize;
+ mEllipsizeAt = null;
}
mObjects = new PackedObjectVector<Directions>(1);
@@ -259,10 +259,9 @@
reflowed = new StaticLayout(true);
reflowed.generate(text, where, where + after,
- getPaint(), getWidth(), getAlignment(),
- getSpacingMultiplier(), getSpacingAdd(),
- false, true, mEllipsize,
- mEllipsizedWidth, mEllipsizeAt);
+ getPaint(), getWidth(), getAlignment(),
+ getSpacingMultiplier(), getSpacingAdd(),
+ false, true, mEllipsizedWidth, mEllipsizeAt);
int n = reflowed.getLineCount();
// If the new layout has a blank line at the end, but it is not
@@ -391,9 +390,7 @@
return mEllipsizedWidth;
}
- private static class ChangeWatcher
- implements TextWatcher, SpanWatcher
- {
+ private static class ChangeWatcher implements TextWatcher, SpanWatcher {
public ChangeWatcher(DynamicLayout layout) {
mLayout = new WeakReference<DynamicLayout>(layout);
}
@@ -407,12 +404,10 @@
((Spannable) s).removeSpan(this);
}
- public void beforeTextChanged(CharSequence s,
- int where, int before, int after) {
+ public void beforeTextChanged(CharSequence s, int where, int before, int after) {
}
- public void onTextChanged(CharSequence s,
- int where, int before, int after) {
+ public void onTextChanged(CharSequence s, int where, int before, int after) {
reflow(s, where, before, after);
}
@@ -429,8 +424,7 @@
reflow(s, start, end - start, end - start);
}
- public void onSpanChanged(Spannable s, Object o, int start, int end,
- int nstart, int nend) {
+ public void onSpanChanged(Spannable s, Object o, int start, int end, int nstart, int nend) {
if (o instanceof UpdateLayout) {
reflow(s, start, end - start, end - start);
reflow(s, nstart, nend - nstart, nend - nstart);
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 3fe4f4c..8700af8 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -1764,4 +1764,15 @@
new Directions(new int[] { 0, RUN_LENGTH_MASK });
/* package */ static final Directions DIRS_ALL_RIGHT_TO_LEFT =
new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG });
+
+ /**
+ * Inform this layout that not all of its lines will be displayed, because a maximum number of
+ * lines has been set on the associated TextView.
+ *
+ * A non positive value means that all lines are displayed.
+ *
+ * @param line line number of the last visible line (line numbers start at 1 for the first line)
+ * @hide
+ */
+ public void setMaximumVisibleLineCount(int line) {}
}
diff --git a/core/java/android/text/MeasuredText.java b/core/java/android/text/MeasuredText.java
index d5699f1..761c271 100644
--- a/core/java/android/text/MeasuredText.java
+++ b/core/java/android/text/MeasuredText.java
@@ -28,6 +28,7 @@
* @hide
*/
class MeasuredText {
+ private static final boolean localLOGV = false;
/* package */ CharSequence mText;
/* package */ int mTextStart;
/* package */ float[] mWidths;
@@ -58,7 +59,9 @@
}
}
mt = new MeasuredText();
- Log.e("MEAS", "new: " + mt);
+ if (localLOGV) {
+ Log.v("MEAS", "new: " + mt);
+ }
return mt;
}
@@ -226,4 +229,4 @@
}
return width;
}
-}
\ No newline at end of file
+}
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 43dce53..ac3df79 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -98,7 +98,7 @@
generate(source, bufstart, bufend, paint, outerwidth, align,
spacingmult, spacingadd, includepad, includepad,
- ellipsize != null, ellipsizedWidth, ellipsize);
+ ellipsizedWidth, ellipsize);
mMeasured = MeasuredText.recycle(mMeasured);
mFontMetricsInt = null;
@@ -119,8 +119,7 @@
Alignment align,
float spacingmult, float spacingadd,
boolean includepad, boolean trackpad,
- boolean breakOnlyAtSpaces,
- float ellipsizedWidth, TextUtils.TruncateAt where) {
+ float ellipsizedWidth, TextUtils.TruncateAt ellipsize) {
mLineCount = 0;
int v = 0;
@@ -281,8 +280,7 @@
int emoji = Character.codePointAt(chs, j - paraStart);
if (emoji >= MIN_EMOJI && emoji <= MAX_EMOJI) {
- Bitmap bm = EMOJI_FACTORY.
- getBitmapFromAndroidPua(emoji);
+ Bitmap bm = EMOJI_FACTORY.getBitmapFromAndroidPua(emoji);
if (bm != null) {
Paint whichPaint;
@@ -362,7 +360,8 @@
okbottom = fitbottom;
}
} else {
- if (breakOnlyAtSpaces) {
+ if (ellipsize != null) {
+ // Break only at spaces using ok indexes.
if (ok != here) {
// Log.e("text", "output ok " + here + " to " +ok);
@@ -379,7 +378,7 @@
needMultiply, paraStart, chdirs, dir, easy,
ok == bufend, includepad, trackpad,
chs, widths, here - paraStart,
- where, ellipsizedWidth, okwidth,
+ ellipsize, ellipsizedWidth, okwidth,
paint);
here = ok;
@@ -415,7 +414,7 @@
needMultiply, paraStart, chdirs, dir, easy,
ok == bufend, includepad, trackpad,
chs, widths, here - paraStart,
- where, ellipsizedWidth, okwidth,
+ ellipsize, ellipsizedWidth, okwidth,
paint);
here = ok;
@@ -431,7 +430,7 @@
needMultiply, paraStart, chdirs, dir, easy,
fit == bufend, includepad, trackpad,
chs, widths, here - paraStart,
- where, ellipsizedWidth, fitwidth,
+ ellipsize, ellipsizedWidth, fitwidth,
paint);
here = fit;
@@ -453,7 +452,7 @@
here + 1 == bufend, includepad,
trackpad,
chs, widths, here - paraStart,
- where, ellipsizedWidth,
+ ellipsize, ellipsizedWidth,
widths[here - paraStart], paint);
here = here + 1;
@@ -502,7 +501,7 @@
needMultiply, paraStart, chdirs, dir, easy,
paraEnd == bufend, includepad, trackpad,
chs, widths, here - paraStart,
- where, ellipsizedWidth, w, paint);
+ ellipsize, ellipsizedWidth, w, paint);
}
paraStart = paraEnd;
@@ -525,7 +524,7 @@
needMultiply, bufend, null, DEFAULT_DIR, true,
true, includepad, trackpad,
null, null, bufstart,
- where, ellipsizedWidth, 0, paint);
+ ellipsize, ellipsizedWidth, 0, paint);
}
}
@@ -738,13 +737,13 @@
} else {
mLineDirections[j] = AndroidBidi.directions(dir, chdirs, widstart, chs,
widstart, end - start);
+ }
- // If ellipsize is in marquee mode, do not apply ellipsis on the first line
- if (ellipsize != null && (ellipsize != TextUtils.TruncateAt.MARQUEE || j != 0)) {
- calculateEllipsis(start, end, widths, widstart,
- ellipsiswidth, ellipsize, j,
- textwidth, paint);
- }
+ // If ellipsize is in marquee mode, do not apply ellipsis on the first line
+ if (ellipsize != null && (ellipsize != TextUtils.TruncateAt.MARQUEE || j != 0)) {
+ calculateEllipsis(start, end, widths, widstart,
+ ellipsiswidth, ellipsize, j,
+ textwidth, paint);
}
mLineCount++;
@@ -755,7 +754,6 @@
float[] widths, int widstart,
float avail, TextUtils.TruncateAt where,
int line, float textwidth, TextPaint paint) {
- int len = lineend - linestart;
if (textwidth <= avail) {
// Everything fits!
@@ -766,6 +764,7 @@
float ellipsiswid = paint.measureText("\u2026");
int ellipsisStart, ellipsisCount;
+ int len = lineend - linestart;
if (where == TextUtils.TruncateAt.START) {
float sum = 0;
@@ -865,12 +864,22 @@
@Override
public int getLineTop(int line) {
- return mLines[mColumns * line + TOP];
+ int top = mLines[mColumns * line + TOP];
+ if (mMaximumVisibleLineCount > 0 && line >= mMaximumVisibleLineCount &&
+ line != mLineCount) {
+ top += getBottomPadding();
+ }
+ return top;
}
@Override
public int getLineDescent(int line) {
- return mLines[mColumns * line + DESCENT];
+ int descent = mLines[mColumns * line + DESCENT];
+ if (mMaximumVisibleLineCount > 0 && line >= mMaximumVisibleLineCount - 1 &&
+ line != mLineCount) {
+ descent += getBottomPadding();
+ }
+ return descent;
}
@Override
@@ -926,6 +935,14 @@
return mEllipsizedWidth;
}
+ /**
+ * @hide
+ */
+ @Override
+ public void setMaximumVisibleLineCount(int line) {
+ mMaximumVisibleLineCount = line;
+ }
+
private int mLineCount;
private int mTopPadding, mBottomPadding;
private int mColumns;
@@ -943,6 +960,7 @@
private int[] mLines;
private Directions[] mLineDirections;
+ private int mMaximumVisibleLineCount = 0;
private static final int START_MASK = 0x1FFFFFFF;
private static final int DIR_SHIFT = 30;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 4fc9d806..6e60b20 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -73,7 +73,6 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
import java.util.WeakHashMap;
/**
@@ -2377,6 +2376,7 @@
})
int mLayerType = LAYER_TYPE_NONE;
Paint mLayerPaint;
+ Rect mLocalDirtyRect;
/**
* Simple constructor to use when creating a view from code.
@@ -6953,7 +6953,7 @@
* well. This is usually true for a full invalidate, but may be set to false if the
* View's contents or dimensions have not changed.
*/
- private void invalidate(boolean invalidateCache) {
+ void invalidate(boolean invalidateCache) {
if (ViewDebug.TRACE_HIERARCHY) {
ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE);
}
@@ -8216,7 +8216,9 @@
}
mLayerType = layerType;
- mLayerPaint = mLayerType == LAYER_TYPE_NONE ? null : (paint == null ? new Paint() : paint);
+ final boolean layerDisabled = mLayerType == LAYER_TYPE_NONE;
+ mLayerPaint = layerDisabled ? null : (paint == null ? new Paint() : paint);
+ mLocalDirtyRect = layerDisabled ? null : new Rect();
invalidateParentCaches();
invalidate(true);
@@ -8271,8 +8273,7 @@
mAttachInfo.mHardwareCanvas = canvas;
try {
canvas.setViewport(width, height);
- // TODO: We should pass the dirty rect
- canvas.onPreDraw(null);
+ canvas.onPreDraw(mLocalDirtyRect);
final int restoreCount = canvas.save();
@@ -8294,6 +8295,7 @@
canvas.onPostDraw();
mHardwareLayer.end(currentCanvas);
mAttachInfo.mHardwareCanvas = currentCanvas;
+ mLocalDirtyRect.setEmpty();
}
}
@@ -9375,6 +9377,9 @@
// the DRAWN bit.
mPrivateFlags |= DRAWN;
invalidate(true);
+ // parent display list may need to be recreated based on a change in the bounds
+ // of any child
+ invalidateParentCaches();
}
// Reset drawn bit to original value (invalidate turns it off)
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 58d4f49..6795b52 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -347,6 +347,10 @@
// views during a transition when they otherwise would have become gone/invisible
private ArrayList<View> mVisibilityChangingChildren;
+ // Indicates whether this container will use its children layers to draw
+ @ViewDebug.ExportedProperty(category = "drawing")
+ private boolean mDrawLayers = true;
+
public ViewGroup(Context context) {
super(context);
initViewGroup();
@@ -2160,7 +2164,7 @@
flags = mGroupFlags;
if ((flags & FLAG_INVALIDATE_REQUIRED) == FLAG_INVALIDATE_REQUIRED) {
- invalidate();
+ invalidate(true);
}
if ((flags & FLAG_ANIMATION_DONE) == 0 && (flags & FLAG_NOTIFY_ANIMATION_LISTENER) == 0 &&
@@ -2216,7 +2220,7 @@
}
}
- invalidate();
+ invalidate(true);
}
/**
@@ -2275,7 +2279,7 @@
boolean scalingRequired = false;
boolean caching;
- int layerType = child.getLayerType();
+ int layerType = mDrawLayers ? child.getLayerType() : LAYER_TYPE_NONE;
final boolean hardwareAccelerated = canvas.isHardwareAccelerated();
if ((flags & FLAG_CHILDREN_DRAWN_WITH_CACHE) == FLAG_CHILDREN_DRAWN_WITH_CACHE ||
@@ -2457,17 +2461,12 @@
layerType != LAYER_TYPE_NONE) {
layerFlags |= Canvas.CLIP_TO_LAYER_SAVE_FLAG;
}
- if (layerType != LAYER_TYPE_NONE) {
- child.mLayerPaint.setAlpha(multipliedAlpha);
- } else {
+ if (layerType == LAYER_TYPE_NONE) {
canvas.saveLayerAlpha(sx, sy, sx + cr - cl, sy + cb - ct,
multipliedAlpha, layerFlags);
}
} else {
// Alpha is handled by the child directly, clobber the layer's alpha
- if (layerType != LAYER_TYPE_NONE) {
- child.mLayerPaint.setAlpha(255);
- }
child.mPrivateFlags |= ALPHA_SET;
}
}
@@ -2498,6 +2497,7 @@
if (layerType == LAYER_TYPE_HARDWARE) {
final HardwareLayer layer = child.getHardwareLayer();
if (layer != null && layer.isValid()) {
+ child.mLayerPaint.setAlpha((int) (alpha * 255));
((HardwareCanvas) canvas).drawHardwareLayer(layer, 0, 0, child.mLayerPaint);
layerRendered = true;
} else {
@@ -2556,10 +2556,10 @@
// invalidation is the trigger to recreate display lists, so if we're using
// display lists to render, force an invalidate to allow the animation to
// continue drawing another frame
- invalidate();
+ invalidate(true);
if (a instanceof AlphaAnimation) {
// alpha animations should cause the child to recreate its display list
- child.invalidate();
+ child.invalidate(true);
}
}
@@ -2569,6 +2569,17 @@
}
/**
+ *
+ * @param enabled True if children should be drawn with layers, false otherwise.
+ *
+ * @hide
+ */
+ public void setChildrenLayersEnabled(boolean enabled) {
+ mDrawLayers = enabled;
+ invalidate(true);
+ }
+
+ /**
* By default, children are clipped to their bounds before drawing. This
* allows view groups to override this behavior for animations, etc.
*
@@ -2600,7 +2611,6 @@
final View[] children = mChildren;
final int count = mChildrenCount;
for (int i = 0; i < count; i++) {
-
children[i].setSelected(selected);
}
}
@@ -2613,7 +2623,6 @@
final View[] children = mChildren;
final int count = mChildrenCount;
for (int i = 0; i < count; i++) {
-
children[i].setActivated(activated);
}
}
@@ -2806,7 +2815,7 @@
// therefore, we call requestLayout() on ourselves before, so that the child's request
// will be blocked at our level
requestLayout();
- invalidate();
+ invalidate(true);
addViewInner(child, index, params, false);
}
@@ -3088,7 +3097,7 @@
public void removeView(View view) {
removeViewInternal(view);
requestLayout();
- invalidate();
+ invalidate(true);
}
/**
@@ -3120,7 +3129,7 @@
public void removeViewAt(int index) {
removeViewInternal(index, getChildAt(index));
requestLayout();
- invalidate();
+ invalidate(true);
}
/**
@@ -3132,7 +3141,7 @@
public void removeViews(int start, int count) {
removeViewsInternal(start, count);
requestLayout();
- invalidate();
+ invalidate(true);
}
private void removeViewInternal(View view) {
@@ -3257,7 +3266,7 @@
public void removeAllViews() {
removeAllViewsInLayout();
requestLayout();
- invalidate();
+ invalidate(true);
}
/**
@@ -3491,16 +3500,19 @@
if (child.mLayerType != LAYER_TYPE_NONE) {
mPrivateFlags |= INVALIDATED;
mPrivateFlags &= ~DRAWING_CACHE_VALID;
+ child.mLocalDirtyRect.setEmpty();
}
do {
View view = null;
if (parent instanceof View) {
view = (View) parent;
- if (view.mLayerType != LAYER_TYPE_NONE &&
- view.getParent() instanceof View) {
- final View grandParent = (View) view.getParent();
- grandParent.mPrivateFlags |= INVALIDATED;
- grandParent.mPrivateFlags &= ~DRAWING_CACHE_VALID;
+ if (view.mLayerType != LAYER_TYPE_NONE) {
+ view.mLocalDirtyRect.setEmpty();
+ if (view.getParent() instanceof View) {
+ final View grandParent = (View) view.getParent();
+ grandParent.mPrivateFlags |= INVALIDATED;
+ grandParent.mPrivateFlags &= ~DRAWING_CACHE_VALID;
+ }
}
if ((view.mPrivateFlags & DIRTY_MASK) != 0) {
// already marked dirty - we're done
@@ -3538,6 +3550,12 @@
// Make sure we do not set both flags at the same time
int opaqueFlag = isOpaque ? DIRTY_OPAQUE : DIRTY;
+ if (child.mLayerType != LAYER_TYPE_NONE) {
+ mPrivateFlags |= INVALIDATED;
+ mPrivateFlags &= ~DRAWING_CACHE_VALID;
+ child.mLocalDirtyRect.union(dirty);
+ }
+
final int[] location = attachInfo.mInvalidateChildLocation;
location[CHILD_LEFT_INDEX] = child.mLeft;
location[CHILD_TOP_INDEX] = child.mTop;
@@ -3551,10 +3569,6 @@
(int) (boundingRect.bottom + 0.5f));
}
- if (child.mLayerType != LAYER_TYPE_NONE) {
- mPrivateFlags |= INVALIDATED;
- mPrivateFlags &= ~DRAWING_CACHE_VALID;
- }
do {
View view = null;
if (parent instanceof View) {
@@ -3635,6 +3649,10 @@
location[CHILD_LEFT_INDEX] = left;
location[CHILD_TOP_INDEX] = top;
+ if (mLayerType != LAYER_TYPE_NONE) {
+ mLocalDirtyRect.union(dirty);
+ }
+
return mParent;
}
} else {
@@ -3643,8 +3661,11 @@
location[CHILD_LEFT_INDEX] = mLeft;
location[CHILD_TOP_INDEX] = mTop;
- dirty.set(0, 0, mRight - location[CHILD_LEFT_INDEX],
- mBottom - location[CHILD_TOP_INDEX]);
+ dirty.set(0, 0, mRight - mLeft, mBottom - mTop);
+
+ if (mLayerType != LAYER_TYPE_NONE) {
+ mLocalDirtyRect.union(dirty);
+ }
return mParent;
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index fcfcc03..fa99eae 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -7144,6 +7144,16 @@
setContentScrollTo(msg.arg1, msg.arg2);
break;
case SCROLL_TO_MSG_ID:
+ if (((Boolean) msg.obj).booleanValue()) {
+ // This scroll is intended to bring the textfield into
+ // view, but is only necessary if the IME is showing
+ InputMethodManager imm = InputMethodManager.peekInstance();
+ if (imm == null || !imm.isAcceptingText()
+ || (!imm.isActive(WebView.this) && (!inEditingMode()
+ || !imm.isActive(mWebTextView)))) {
+ break;
+ }
+ }
if (setContentScrollTo(msg.arg1, msg.arg2)) {
// if we can't scroll to the exact position due to pin,
// send a message to WebCore to re-scroll when we get a
@@ -8146,6 +8156,15 @@
}
/**
+ * Enable expanded tiles bound for smoother scrolling.
+ *
+ * @hide only used by the Browser
+ */
+ public void setExpandedTileBounds(boolean enabled) {
+ nativeSetExpandedTileBounds(enabled);
+ }
+
+ /**
* Set the time to wait between passing touches to WebCore. See also the
* TOUCH_SENT_INTERVAL member for further discussion.
*
@@ -8301,6 +8320,8 @@
static final int NO_LEFTEDGE = -1;
native int nativeGetBlockLeftEdge(int x, int y, float scale);
+ private native void nativeSetExpandedTileBounds(boolean enabled);
+
// Returns a pointer to the scrollable LayerAndroid at the given point.
private native int nativeScrollableLayer(int x, int y, Rect scrollRect,
Rect scrollBounds);
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index b949a41..b410699 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -56,7 +56,11 @@
// Load libwebcore during static initialization. This happens in the
// zygote process so it will be shared read-only across all app
// processes.
- System.loadLibrary("webcore");
+ try {
+ System.loadLibrary("webcore");
+ } catch (UnsatisfiedLinkError e) {
+ Log.e(LOGTAG, "Unable to load webcore library");
+ }
}
/*
@@ -2120,7 +2124,7 @@
}
// called by JNI
- private void contentScrollTo(int x, int y) {
+ private void contentScrollTo(int x, int y, boolean onlyIfImeIsShowing) {
if (!mBrowserFrame.firstLayoutDone()) {
/*
* WebKit restore state will be called before didFirstLayout(),
@@ -2133,7 +2137,8 @@
}
if (mWebView != null) {
Message msg = Message.obtain(mWebView.mPrivateHandler,
- WebView.SCROLL_TO_MSG_ID, x, y);
+ WebView.SCROLL_TO_MSG_ID, x, y,
+ Boolean.valueOf(onlyIfImeIsShowing));
if (mDrawIsScheduled) {
mEventHub.sendMessage(Message.obtain(null,
EventHub.MESSAGE_RELAY, msg));
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 8cb725a..772eefd 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -5861,6 +5861,7 @@
}
desired += pad;
+ layout.setMaximumVisibleLineCount(0);
if (mMaxMode == LINES) {
/*
@@ -5869,8 +5870,8 @@
*/
if (cap) {
if (linecount > mMaximum) {
- desired = layout.getLineTop(mMaximum) +
- layout.getBottomPadding();
+ layout.setMaximumVisibleLineCount(mMaximum);
+ desired = layout.getLineTop(mMaximum);
if (dr != null) {
desired = Math.max(desired, dr.mDrawableHeightLeft);
@@ -6438,7 +6439,6 @@
if (applyTransformation) {
setTransformationMethod(SingleLineTransformationMethod.getInstance());
}
- // TODO setState
} else {
if (changeMaxLines) {
setMaxLines(Integer.MAX_VALUE);
@@ -6447,7 +6447,6 @@
if (applyTransformation) {
setTransformationMethod(null);
}
- // TODO setState
}
}
diff --git a/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java b/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
index 595c634..8fde247 100644
--- a/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
+++ b/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
@@ -117,7 +117,11 @@
synchronized (mLock) {
updateWallpaperLocked();
}
- surfaceHolder.setSizeFromLayout();
+ surfaceHolder.setFixedSize(getDesiredMinimumWidth(), getDesiredMinimumHeight());
+ // Used a fixed size surface, because we are special. We can do
+ // this because we know the current design of window animations doesn't
+ // cause this to break.
+ //surfaceHolder.setSizeFromLayout();
}
@Override
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_dark.png
new file mode 100644
index 0000000..c9a1cd4
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_light.png
new file mode 100644
index 0000000..0cbf2c1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_dark.png
new file mode 100644
index 0000000..dcd2909
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_light.png
new file mode 100644
index 0000000..0d79fc9
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_disabled_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_dark.png
new file mode 100644
index 0000000..2d9d068
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_light.png
new file mode 100644
index 0000000..f6bc11b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_dark.png
new file mode 100644
index 0000000..8f944d1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_light.png
new file mode 100644
index 0000000..5b594ae
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_dark.png
new file mode 100644
index 0000000..4ed2826
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_light.png
new file mode 100644
index 0000000..c346c3f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_off_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_dark.png
new file mode 100644
index 0000000..dd88350
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_light.png
new file mode 100644
index 0000000..764c0cc
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_dark.png
new file mode 100644
index 0000000..a4538bd
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_light.png
new file mode 100644
index 0000000..99c16fa
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_disabled_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_dark.png
new file mode 100644
index 0000000..5bd72f2
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_light.png
new file mode 100644
index 0000000..4a81dbe
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_dark.png
new file mode 100644
index 0000000..0285e6d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_light.png
new file mode 100644
index 0000000..0291924
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_dark.png b/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_dark.png
new file mode 100644
index 0000000..0c0639e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_light.png b/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_light.png
new file mode 100644
index 0000000..5d30149
--- /dev/null
+++ b/core/res/res/drawable-hdpi/btn_rating_star_on_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png b/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png
index 60301d9..778c7f0 100644
--- a/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png
+++ b/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_menu_find.png b/core/res/res/drawable-hdpi/ic_menu_find.png
index 17ac694..b888202 100644
--- a/core/res/res/drawable-hdpi/ic_menu_find.png
+++ b/core/res/res/drawable-hdpi/ic_menu_find.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_menu_help.png b/core/res/res/drawable-hdpi/ic_menu_help.png
index a39eff3..473b372 100644
--- a/core/res/res/drawable-hdpi/ic_menu_help.png
+++ b/core/res/res/drawable-hdpi/ic_menu_help.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png b/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png
index 0f351a7..74e6b83 100644
--- a/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png
+++ b/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_half_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_big_half_holo_dark.png
new file mode 100644
index 0000000..c89d83a
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_half_holo_light.png b/core/res/res/drawable-hdpi/rate_star_big_half_holo_light.png
new file mode 100644
index 0000000..f75d40c
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_off_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_big_off_holo_dark.png
new file mode 100644
index 0000000..1f1aeca
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_off_holo_light.png b/core/res/res/drawable-hdpi/rate_star_big_off_holo_light.png
new file mode 100644
index 0000000..5c475f9
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_on_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_big_on_holo_dark.png
new file mode 100644
index 0000000..3ad8c31
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_big_on_holo_light.png b/core/res/res/drawable-hdpi/rate_star_big_on_holo_light.png
new file mode 100644
index 0000000..9d87160
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_big_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_half_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_med_half_holo_dark.png
new file mode 100644
index 0000000..acd67d8
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_half_holo_light.png b/core/res/res/drawable-hdpi/rate_star_med_half_holo_light.png
new file mode 100644
index 0000000..19018a3
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_off_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_med_off_holo_dark.png
new file mode 100644
index 0000000..7e4fd9e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_off_holo_light.png b/core/res/res/drawable-hdpi/rate_star_med_off_holo_light.png
new file mode 100644
index 0000000..942459e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_on_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_med_on_holo_dark.png
new file mode 100644
index 0000000..4dd198d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_med_on_holo_light.png b/core/res/res/drawable-hdpi/rate_star_med_on_holo_light.png
new file mode 100644
index 0000000..7ad064f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_med_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_half_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_small_half_holo_dark.png
new file mode 100644
index 0000000..24bac81
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_half_holo_light.png b/core/res/res/drawable-hdpi/rate_star_small_half_holo_light.png
new file mode 100644
index 0000000..356b097
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_off_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_small_off_holo_dark.png
new file mode 100644
index 0000000..da32776
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_off_holo_light.png b/core/res/res/drawable-hdpi/rate_star_small_off_holo_light.png
new file mode 100644
index 0000000..e68dda9
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_on_holo_dark.png b/core/res/res/drawable-hdpi/rate_star_small_on_holo_dark.png
new file mode 100644
index 0000000..3be67cd
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/rate_star_small_on_holo_light.png b/core/res/res/drawable-hdpi/rate_star_small_on_holo_light.png
new file mode 100644
index 0000000..3a6bdb2
--- /dev/null
+++ b/core/res/res/drawable-hdpi/rate_star_small_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_dark.png
new file mode 100644
index 0000000..f32a54e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_light.png
new file mode 100644
index 0000000..0392b65
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_dark.png
new file mode 100644
index 0000000..6b3cf3c
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_light.png
new file mode 100644
index 0000000..20209d2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_disabled_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_dark.png
new file mode 100644
index 0000000..3e48e85
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_light.png
new file mode 100644
index 0000000..43f615d
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_dark.png
new file mode 100644
index 0000000..e989725
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_light.png
new file mode 100644
index 0000000..0c06bf8
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_dark.png
new file mode 100644
index 0000000..c248014
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_light.png
new file mode 100644
index 0000000..c36ca56
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_off_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_dark.png
new file mode 100644
index 0000000..2c669c7
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_light.png
new file mode 100644
index 0000000..6c9be49
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_dark.png
new file mode 100644
index 0000000..e3f963b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_light.png
new file mode 100644
index 0000000..585694b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_disabled_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_dark.png
new file mode 100644
index 0000000..2a378dd
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_light.png
new file mode 100644
index 0000000..c1bbaa3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_focused_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_dark.png
new file mode 100644
index 0000000..1cca1ec
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_light.png
new file mode 100644
index 0000000..cc79c48
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_normal_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_dark.png b/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_dark.png
new file mode 100644
index 0000000..7ce98fc
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_light.png b/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_light.png
new file mode 100644
index 0000000..0be83ab
--- /dev/null
+++ b/core/res/res/drawable-mdpi/btn_rating_star_on_pressed_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png b/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png
index 5b385aa..1161a7c 100644
--- a/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png
+++ b/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_menu_find.png b/core/res/res/drawable-mdpi/ic_menu_find.png
index 4d96348..82dcba7 100644
--- a/core/res/res/drawable-mdpi/ic_menu_find.png
+++ b/core/res/res/drawable-mdpi/ic_menu_find.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_menu_help.png b/core/res/res/drawable-mdpi/ic_menu_help.png
index 010577f..dd24845 100644
--- a/core/res/res/drawable-mdpi/ic_menu_help.png
+++ b/core/res/res/drawable-mdpi/ic_menu_help.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png b/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png
old mode 100755
new mode 100644
index 452de5d..0c5ffad
--- a/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png
+++ b/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_half_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_big_half_holo_dark.png
new file mode 100644
index 0000000..12089b2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_half_holo_light.png b/core/res/res/drawable-mdpi/rate_star_big_half_holo_light.png
new file mode 100644
index 0000000..d0c3e01
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_off_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_big_off_holo_dark.png
new file mode 100644
index 0000000..0dfa9cf
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_off_holo_light.png b/core/res/res/drawable-mdpi/rate_star_big_off_holo_light.png
new file mode 100644
index 0000000..6fc6c4f
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_on_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_big_on_holo_dark.png
new file mode 100644
index 0000000..c943b53
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_big_on_holo_light.png b/core/res/res/drawable-mdpi/rate_star_big_on_holo_light.png
new file mode 100644
index 0000000..50eb8e1
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_big_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_half_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_med_half_holo_dark.png
new file mode 100644
index 0000000..1c866ee
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_half_holo_light.png b/core/res/res/drawable-mdpi/rate_star_med_half_holo_light.png
new file mode 100644
index 0000000..10badd2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_off_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_med_off_holo_dark.png
new file mode 100644
index 0000000..93d9c87
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_off_holo_light.png b/core/res/res/drawable-mdpi/rate_star_med_off_holo_light.png
new file mode 100644
index 0000000..a39970d
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_on_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_med_on_holo_dark.png
new file mode 100644
index 0000000..e1d1a3c
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_med_on_holo_light.png b/core/res/res/drawable-mdpi/rate_star_med_on_holo_light.png
new file mode 100644
index 0000000..ee4264f
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_med_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_half_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_small_half_holo_dark.png
new file mode 100644
index 0000000..a4460b3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_half_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_half_holo_light.png b/core/res/res/drawable-mdpi/rate_star_small_half_holo_light.png
new file mode 100644
index 0000000..8276be1
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_half_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_off_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_small_off_holo_dark.png
new file mode 100644
index 0000000..c4e6e4c
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_off_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_off_holo_light.png b/core/res/res/drawable-mdpi/rate_star_small_off_holo_light.png
new file mode 100644
index 0000000..96a7042
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_off_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_on_holo_dark.png b/core/res/res/drawable-mdpi/rate_star_small_on_holo_dark.png
new file mode 100644
index 0000000..f55bb14
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_on_holo_dark.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/rate_star_small_on_holo_light.png b/core/res/res/drawable-mdpi/rate_star_small_on_holo_light.png
new file mode 100644
index 0000000..f12f630
--- /dev/null
+++ b/core/res/res/drawable-mdpi/rate_star_small_on_holo_light.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_sys_download_anim0.png b/core/res/res/drawable-mdpi/stat_sys_download_anim0.png
index 39e4ccb..c6f2f4e 100644
--- a/core/res/res/drawable-mdpi/stat_sys_download_anim0.png
+++ b/core/res/res/drawable-mdpi/stat_sys_download_anim0.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_sys_upload_anim0.png b/core/res/res/drawable-mdpi/stat_sys_upload_anim0.png
index 5620cc8..f804e5e 100644
--- a/core/res/res/drawable-mdpi/stat_sys_upload_anim0.png
+++ b/core/res/res/drawable-mdpi/stat_sys_upload_anim0.png
Binary files differ
diff --git a/core/res/res/drawable/ratingbar_full_empty_holo_dark.xml b/core/res/res/drawable/ratingbar_full_empty_holo_dark.xml
new file mode 100644
index 0000000..8b43e9b
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_empty_holo_dark.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<!-- This is the rating bar drawable that is used to a show a filled star. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_pressed_holo_dark" />
+
+ <item android:state_focused="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_focused_holo_dark" />
+
+ <item android:state_selected="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_focused_holo_dark" />
+
+ <item android:drawable="@drawable/btn_rating_star_off_normal_holo_dark" />
+
+</selector>
diff --git a/core/res/res/drawable/ratingbar_full_empty_holo_light.xml b/core/res/res/drawable/ratingbar_full_empty_holo_light.xml
new file mode 100644
index 0000000..324ed34
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_empty_holo_light.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<!-- This is the rating bar drawable that is used to a show a filled star. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_pressed_holo_light" />
+
+ <item android:state_focused="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_focused_holo_light" />
+
+ <item android:state_selected="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_off_focused_holo_light" />
+
+ <item android:drawable="@drawable/btn_rating_star_off_normal_holo_light" />
+
+</selector>
diff --git a/core/res/res/drawable/ratingbar_full_filled_holo_dark.xml b/core/res/res/drawable/ratingbar_full_filled_holo_dark.xml
new file mode 100644
index 0000000..dc4e40f
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_filled_holo_dark.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<!-- This is the rating bar drawable that is used to a show a filled star. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_pressed_holo_dark" />
+
+ <item android:state_focused="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_focused_holo_dark" />
+
+ <item android:state_selected="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_focused_holo_dark" />
+
+ <item android:drawable="@drawable/btn_rating_star_on_normal_holo_dark" />
+
+</selector>
diff --git a/core/res/res/drawable/ratingbar_full_filled_holo_light.xml b/core/res/res/drawable/ratingbar_full_filled_holo_light.xml
new file mode 100644
index 0000000..831f594
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_filled_holo_light.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<!-- This is the rating bar drawable that is used to a show a filled star. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_pressed_holo_light" />
+
+ <item android:state_focused="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_focused_holo_light" />
+
+ <item android:state_selected="true"
+ android:state_window_focused="true"
+ android:drawable="@drawable/btn_rating_star_on_focused_holo_light" />
+
+ <item android:drawable="@drawable/btn_rating_star_on_normal_holo_light" />
+
+</selector>
diff --git a/core/res/res/drawable/ratingbar_full_holo_dark.xml b/core/res/res/drawable/ratingbar_full_holo_dark.xml
new file mode 100644
index 0000000..4eccd36
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_holo_dark.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/ratingbar_full_empty_holo_dark" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/ratingbar_full_empty_holo_dark" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/ratingbar_full_filled_holo_dark" />
+</layer-list>
+
diff --git a/core/res/res/drawable/ratingbar_full_holo_light.xml b/core/res/res/drawable/ratingbar_full_holo_light.xml
new file mode 100644
index 0000000..fa5d288
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_full_holo_light.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/ratingbar_full_empty_holo_light" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/ratingbar_full_empty_holo_light" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/ratingbar_full_filled_holo_light" />
+</layer-list>
+
diff --git a/core/res/res/drawable/ratingbar_holo_dark.xml b/core/res/res/drawable/ratingbar_holo_dark.xml
new file mode 100644
index 0000000..6d9774b
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_holo_dark.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/rate_star_big_off_holo_dark" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/rate_star_big_half_holo_dark" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/rate_star_big_on_holo_dark" />
+</layer-list>
+
diff --git a/core/res/res/drawable/ratingbar_holo_light.xml b/core/res/res/drawable/ratingbar_holo_light.xml
new file mode 100644
index 0000000..67c3240
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_holo_light.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/rate_star_big_off_holo_light" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/rate_star_big_half_holo_light" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/rate_star_big_on_holo_light" />
+</layer-list>
+
diff --git a/core/res/res/drawable/ratingbar_small_holo_dark.xml b/core/res/res/drawable/ratingbar_small_holo_dark.xml
new file mode 100644
index 0000000..0e85c61
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_small_holo_dark.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/rate_star_small_off_holo_dark" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/rate_star_small_half_holo_dark" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/rate_star_small_on_holo_dark" />
+</layer-list>
+
diff --git a/core/res/res/drawable/ratingbar_small_holo_light.xml b/core/res/res/drawable/ratingbar_small_holo_light.xml
new file mode 100644
index 0000000..60b00b0
--- /dev/null
+++ b/core/res/res/drawable/ratingbar_small_holo_light.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+android:id/background" android:drawable="@android:drawable/rate_star_small_off_holo_light" />
+ <item android:id="@+android:id/secondaryProgress" android:drawable="@android:drawable/rate_star_small_half_holo_light" />
+ <item android:id="@+android:id/progress" android:drawable="@android:drawable/rate_star_small_on_holo_light" />
+</layer-list>
+
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index f54f8cc..e2751bd 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1608,12 +1608,22 @@
</style>
<style name="Widget.Holo.RatingBar" parent="Widget.RatingBar">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_full_holo_dark</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_full_holo_dark</item>
</style>
<style name="Widget.Holo.RatingBar.Indicator" parent="Widget.RatingBar.Indicator">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_holo_dark</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_holo_dark</item>
+ <item name="android:minHeight">35dip</item>
+ <item name="android:maxHeight">35dip</item>
</style>
<style name="Widget.Holo.RatingBar.Small" parent="Widget.RatingBar.Small">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_small_holo_dark</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_small_holo_dark</item>
+ <item name="android:minHeight">16dip</item>
+ <item name="android:maxHeight">16dip</item>
</style>
<style name="Widget.Holo.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton">
@@ -1956,12 +1966,22 @@
</style>
<style name="Widget.Holo.Light.RatingBar" parent="Widget.RatingBar">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_full_holo_light</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_full_holo_light</item>
</style>
<style name="Widget.Holo.Light.RatingBar.Indicator" parent="Widget.RatingBar.Indicator">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_holo_light</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_holo_light</item>
+ <item name="android:minHeight">35dip</item>
+ <item name="android:maxHeight">35dip</item>
</style>
<style name="Widget.Holo.Light.RatingBar.Small" parent="Widget.RatingBar.Small">
+ <item name="android:progressDrawable">@android:drawable/ratingbar_small_holo_light</item>
+ <item name="android:indeterminateDrawable">@android:drawable/ratingbar_small_holo_light</item>
+ <item name="android:minHeight">16dip</item>
+ <item name="android:maxHeight">16dip</item>
</style>
<style name="Widget.Holo.Light.CompoundButton.RadioButton" parent="Widget.CompoundButton.RadioButton">
diff --git a/core/tests/coretests/res/raw/install_uses_feature b/core/tests/coretests/res/raw/install_uses_feature
index 769a246..eeeb309 100644
--- a/core/tests/coretests/res/raw/install_uses_feature
+++ b/core/tests/coretests/res/raw/install_uses_feature
Binary files differ
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 0e65df5..7af64e4 100755
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -3098,10 +3098,19 @@
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
+ /**
+ * Unknown features should be allowed to install. This prevents older phones
+ * from rejecting new packages that specify features that didn't exist when
+ * an older phone existed. All older phones are assumed to have those
+ * features.
+ * <p>
+ * Right now we allow all packages to be installed regardless of their
+ * features.
+ */
@LargeTest
- public void testUsesFeatureMissingFeature() {
- int retCode = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
- installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, true, retCode,
+ public void testUsesFeatureUnknownFeature() {
+ int retCode = PackageManager.INSTALL_SUCCEEDED;
+ installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, false, retCode,
PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
diff --git a/data/sounds/Alarm_Classic.ogg b/data/sounds/Alarm_Classic.ogg
index 651cdcf..695434f 100644
--- a/data/sounds/Alarm_Classic.ogg
+++ b/data/sounds/Alarm_Classic.ogg
Binary files differ
diff --git a/data/sounds/Alarm_Classic.wav b/data/sounds/Alarm_Classic.wav
new file mode 100644
index 0000000..bd41869
--- /dev/null
+++ b/data/sounds/Alarm_Classic.wav
Binary files differ
diff --git a/data/sounds/AudioPackage6.mk b/data/sounds/AudioPackage6.mk
index 92bf416..6717417 100755
--- a/data/sounds/AudioPackage6.mk
+++ b/data/sounds/AudioPackage6.mk
@@ -8,10 +8,10 @@
LOCAL_PATH:= frameworks/base/data/sounds
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/alarms/ogg/Analysis.ogg:system/media/audio/alarms/Analysis.ogg \
- $(LOCAL_PATH)/alarms/ogg/Departure.ogg:system/media/audio/alarms/Departure.ogg \
- $(LOCAL_PATH)/alarms/ogg/FireDrill.ogg:system/media/audio/alarms/FireDrill.ogg \
- $(LOCAL_PATH)/alarms/ogg/Timing.ogg:system/media/audio/alarms/Timing.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Barium.ogg:system/media/audio/alarms/Barium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Cesium.ogg:system/media/audio/alarms/Cesium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Plutonium.ogg:system/media/audio/alarms/Plutonium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Scandium.ogg:system/media/audio/alarms/Scandium.ogg \
$(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg \
$(LOCAL_PATH)/effects/ogg/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg \
$(LOCAL_PATH)/effects/ogg/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \
@@ -41,28 +41,28 @@
$(LOCAL_PATH)/notifications/ogg/Thallium.ogg:system/media/audio/notifications/Thallium.ogg \
$(LOCAL_PATH)/notifications/ogg/Xenon.ogg:system/media/audio/notifications/Xenon.ogg \
$(LOCAL_PATH)/notifications/ogg/Zirconium.ogg:system/media/audio/notifications/Zirconium.ogg \
- $(LOCAL_PATH)/ringtones/ANDROMEDA.ogg:system/media/audio/ringtones/ANDROMEDA.ogg \
- $(LOCAL_PATH)/ringtones/Aquila.ogg:system/media/audio/ringtones/Aquila.ogg \
- $(LOCAL_PATH)/ringtones/ArgoNavis.ogg:system/media/audio/ringtones/ArgoNavis.ogg \
- $(LOCAL_PATH)/ringtones/BOOTES.ogg:system/media/audio/ringtones/BOOTES.ogg \
- $(LOCAL_PATH)/ringtones/CANISMAJOR.ogg:system/media/audio/ringtones/CANISMAJOR.ogg \
- $(LOCAL_PATH)/ringtones/Carina.ogg:system/media/audio/ringtones/Carina.ogg \
- $(LOCAL_PATH)/ringtones/CASSIOPEIA.ogg:system/media/audio/ringtones/CASSIOPEIA.ogg \
- $(LOCAL_PATH)/ringtones/Centaurus.ogg:system/media/audio/ringtones/Centaurus.ogg \
- $(LOCAL_PATH)/ringtones/Cygnus.ogg:system/media/audio/ringtones/Cygnus.ogg \
- $(LOCAL_PATH)/ringtones/Draco.ogg:system/media/audio/ringtones/Draco.ogg \
- $(LOCAL_PATH)/ringtones/Eridani.ogg:system/media/audio/ringtones/Eridani.ogg \
- $(LOCAL_PATH)/ringtones/hydra.ogg:system/media/audio/ringtones/hydra.ogg \
- $(LOCAL_PATH)/ringtones/Lyra.ogg:system/media/audio/ringtones/Lyra.ogg \
- $(LOCAL_PATH)/ringtones/Machina.ogg:system/media/audio/ringtones/Machina.ogg \
- $(LOCAL_PATH)/ringtones/Orion.ogg:system/media/audio/ringtones/Orion.ogg \
- $(LOCAL_PATH)/ringtones/Pegasus.ogg:system/media/audio/ringtones/Pegasus.ogg \
- $(LOCAL_PATH)/ringtones/PERSEUS.ogg:system/media/audio/ringtones/PERSEUS.ogg \
- $(LOCAL_PATH)/ringtones/Pyxis.ogg:system/media/audio/ringtones/Pyxis.ogg \
- $(LOCAL_PATH)/ringtones/Rigel.ogg:system/media/audio/ringtones/Rigel.ogg \
- $(LOCAL_PATH)/ringtones/Scarabaeus.ogg:system/media/audio/ringtones/Scarabaeus.ogg \
- $(LOCAL_PATH)/ringtones/Sceptrum.ogg:system/media/audio/ringtones/Sceptrum.ogg \
- $(LOCAL_PATH)/ringtones/Solarium.ogg:system/media/audio/ringtones/Solarium.ogg \
- $(LOCAL_PATH)/ringtones/Testudo.ogg:system/media/audio/ringtones/Testudo.ogg \
- $(LOCAL_PATH)/ringtones/URSAMINOR.ogg:system/media/audio/ringtones/URSAMINOR.ogg \
- $(LOCAL_PATH)/ringtones/Vespa.ogg:system/media/audio/ringtones/Vespa.ogg
+ $(LOCAL_PATH)/ringtones/ogg/Andromeda.ogg:system/media/audio/ringtones/Andromeda.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Aquila.ogg:system/media/audio/ringtones/Aquila.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/ArgoNavis.ogg:system/media/audio/ringtones/ArgoNavis.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Bootes.ogg:system/media/audio/ringtones/Bootes.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/CanisMajor.ogg:system/media/audio/ringtones/CanisMajor.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Carina.ogg:system/media/audio/ringtones/Carina.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Cassiopeia.ogg:system/media/audio/ringtones/Cassiopeia.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Centaurus.ogg:system/media/audio/ringtones/Centaurus.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Cygnus.ogg:system/media/audio/ringtones/Cygnus.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Draco.ogg:system/media/audio/ringtones/Draco.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Eridani.ogg:system/media/audio/ringtones/Eridani.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Hydra.ogg:system/media/audio/ringtones/hydra.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Lyra.ogg:system/media/audio/ringtones/Lyra.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Machina.ogg:system/media/audio/ringtones/Machina.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Orion.ogg:system/media/audio/ringtones/Orion.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Pegasus.ogg:system/media/audio/ringtones/Pegasus.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Perseus.ogg:system/media/audio/ringtones/Perseus.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Pyxis.ogg:system/media/audio/ringtones/Pyxis.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Rigel.ogg:system/media/audio/ringtones/Rigel.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Scarabaeus.ogg:system/media/audio/ringtones/Scarabaeus.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Sceptrum.ogg:system/media/audio/ringtones/Sceptrum.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Solarium.ogg:system/media/audio/ringtones/Solarium.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Testudo.ogg:system/media/audio/ringtones/Testudo.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/UrsaMinor.ogg:system/media/audio/ringtones/UrsaMinor.ogg \
+ $(LOCAL_PATH)/ringtones/ogg/Vespa.ogg:system/media/audio/ringtones/Vespa.ogg
diff --git a/data/sounds/alarms/Cesium.ogg b/data/sounds/alarms/Cesium.ogg
new file mode 100644
index 0000000..a8c379a
--- /dev/null
+++ b/data/sounds/alarms/Cesium.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Barium.ogg b/data/sounds/alarms/ogg/Barium.ogg
new file mode 100644
index 0000000..2a91185
--- /dev/null
+++ b/data/sounds/alarms/ogg/Barium.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Cesium.ogg b/data/sounds/alarms/ogg/Cesium.ogg
new file mode 100644
index 0000000..76eca08
--- /dev/null
+++ b/data/sounds/alarms/ogg/Cesium.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Plutonium.ogg b/data/sounds/alarms/ogg/Plutonium.ogg
new file mode 100644
index 0000000..5e9a750
--- /dev/null
+++ b/data/sounds/alarms/ogg/Plutonium.ogg
Binary files differ
diff --git a/data/sounds/alarms/ogg/Scandium.ogg b/data/sounds/alarms/ogg/Scandium.ogg
new file mode 100644
index 0000000..86ffbf8
--- /dev/null
+++ b/data/sounds/alarms/ogg/Scandium.ogg
Binary files differ
diff --git a/data/sounds/alarms/wav/Barium.wav b/data/sounds/alarms/wav/Barium.wav
new file mode 100644
index 0000000..2f4c894
--- /dev/null
+++ b/data/sounds/alarms/wav/Barium.wav
Binary files differ
diff --git a/data/sounds/alarms/wav/Cesium.wav b/data/sounds/alarms/wav/Cesium.wav
new file mode 100644
index 0000000..bd41869
--- /dev/null
+++ b/data/sounds/alarms/wav/Cesium.wav
Binary files differ
diff --git a/data/sounds/alarms/wav/Plutonium.wav b/data/sounds/alarms/wav/Plutonium.wav
new file mode 100644
index 0000000..9095e30
--- /dev/null
+++ b/data/sounds/alarms/wav/Plutonium.wav
Binary files differ
diff --git a/data/sounds/alarms/wav/Scandium.wav b/data/sounds/alarms/wav/Scandium.wav
new file mode 100644
index 0000000..a30d329
--- /dev/null
+++ b/data/sounds/alarms/wav/Scandium.wav
Binary files differ
diff --git a/data/sounds/effects/ogg/Dock.ogg b/data/sounds/effects/ogg/Dock.ogg
index 1462813d..626d695 100644
--- a/data/sounds/effects/ogg/Dock.ogg
+++ b/data/sounds/effects/ogg/Dock.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/Effect_Tick.ogg b/data/sounds/effects/ogg/Effect_Tick.ogg
index 27fe79f..b379019 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/KeypressDelete.ogg b/data/sounds/effects/ogg/KeypressDelete.ogg
index 5cc7f3c..d5ba9fa 100644
--- a/data/sounds/effects/ogg/KeypressDelete.ogg
+++ b/data/sounds/effects/ogg/KeypressDelete.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressReturn.ogg b/data/sounds/effects/ogg/KeypressReturn.ogg
index 260cbf5..0111365 100644
--- a/data/sounds/effects/ogg/KeypressReturn.ogg
+++ b/data/sounds/effects/ogg/KeypressReturn.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressSpacebar.ogg b/data/sounds/effects/ogg/KeypressSpacebar.ogg
index 6229330..1776762 100644
--- a/data/sounds/effects/ogg/KeypressSpacebar.ogg
+++ b/data/sounds/effects/ogg/KeypressSpacebar.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/KeypressStandard.ogg b/data/sounds/effects/ogg/KeypressStandard.ogg
index 947b169..a261975 100644
--- a/data/sounds/effects/ogg/KeypressStandard.ogg
+++ b/data/sounds/effects/ogg/KeypressStandard.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/Lock.ogg b/data/sounds/effects/ogg/Lock.ogg
index cf70d01..a24df3d 100644
--- a/data/sounds/effects/ogg/Lock.ogg
+++ b/data/sounds/effects/ogg/Lock.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/LowBattery.ogg b/data/sounds/effects/ogg/LowBattery.ogg
index f1cf1996..c21218c 100644
--- a/data/sounds/effects/ogg/LowBattery.ogg
+++ b/data/sounds/effects/ogg/LowBattery.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/Media_Volume.ogg b/data/sounds/effects/ogg/Media_Volume.ogg
new file mode 100644
index 0000000..88db9d9
--- /dev/null
+++ b/data/sounds/effects/ogg/Media_Volume.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/Undock.ogg b/data/sounds/effects/ogg/Undock.ogg
index 0053066..dd132c4 100644
--- a/data/sounds/effects/ogg/Undock.ogg
+++ b/data/sounds/effects/ogg/Undock.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/Unlock.ogg b/data/sounds/effects/ogg/Unlock.ogg
index 3639dba..114df93 100644
--- a/data/sounds/effects/ogg/Unlock.ogg
+++ b/data/sounds/effects/ogg/Unlock.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/VideoRecord.ogg b/data/sounds/effects/ogg/VideoRecord.ogg
index a6f3d34..7afe9e6 100644
--- a/data/sounds/effects/ogg/VideoRecord.ogg
+++ b/data/sounds/effects/ogg/VideoRecord.ogg
Binary files differ
diff --git a/data/sounds/effects/ogg/camera_click.ogg b/data/sounds/effects/ogg/camera_click.ogg
index 1b0ee9e..eee590f 100644
--- a/data/sounds/effects/ogg/camera_click.ogg
+++ b/data/sounds/effects/ogg/camera_click.ogg
Binary files differ
diff --git a/data/sounds/effects/wav/Dock.wav b/data/sounds/effects/wav/Dock.wav
new file mode 100644
index 0000000..7fa6a7e
--- /dev/null
+++ b/data/sounds/effects/wav/Dock.wav
Binary files differ
diff --git a/data/sounds/effects/wav/Effect_Tick.wav b/data/sounds/effects/wav/Effect_Tick.wav
new file mode 100644
index 0000000..6af2dc1
--- /dev/null
+++ b/data/sounds/effects/wav/Effect_Tick.wav
Binary files differ
diff --git a/data/sounds/effects/wav/KeypressDelete.wav b/data/sounds/effects/wav/KeypressDelete.wav
new file mode 100644
index 0000000..e4a4af7
--- /dev/null
+++ b/data/sounds/effects/wav/KeypressDelete.wav
Binary files differ
diff --git a/data/sounds/effects/wav/KeypressReturn.wav b/data/sounds/effects/wav/KeypressReturn.wav
new file mode 100644
index 0000000..8b666ce
--- /dev/null
+++ b/data/sounds/effects/wav/KeypressReturn.wav
Binary files differ
diff --git a/data/sounds/effects/wav/KeypressSpacebar.wav b/data/sounds/effects/wav/KeypressSpacebar.wav
new file mode 100644
index 0000000..84743a0
--- /dev/null
+++ b/data/sounds/effects/wav/KeypressSpacebar.wav
Binary files differ
diff --git a/data/sounds/effects/wav/KeypressStandard.wav b/data/sounds/effects/wav/KeypressStandard.wav
new file mode 100644
index 0000000..42dcef5a08
--- /dev/null
+++ b/data/sounds/effects/wav/KeypressStandard.wav
Binary files differ
diff --git a/data/sounds/effects/wav/Lock.wav b/data/sounds/effects/wav/Lock.wav
new file mode 100644
index 0000000..88be052
--- /dev/null
+++ b/data/sounds/effects/wav/Lock.wav
Binary files differ
diff --git a/data/sounds/effects/wav/LowBattery.wav b/data/sounds/effects/wav/LowBattery.wav
new file mode 100644
index 0000000..8905534
--- /dev/null
+++ b/data/sounds/effects/wav/LowBattery.wav
Binary files differ
diff --git a/data/sounds/effects/wav/Undock.wav b/data/sounds/effects/wav/Undock.wav
new file mode 100644
index 0000000..358eb18
--- /dev/null
+++ b/data/sounds/effects/wav/Undock.wav
Binary files differ
diff --git a/data/sounds/effects/wav/Unlock.wav b/data/sounds/effects/wav/Unlock.wav
new file mode 100644
index 0000000..4b39c5c
--- /dev/null
+++ b/data/sounds/effects/wav/Unlock.wav
Binary files differ
diff --git a/data/sounds/effects/wav/VideoRecord.wav b/data/sounds/effects/wav/VideoRecord.wav
new file mode 100644
index 0000000..6880b29
--- /dev/null
+++ b/data/sounds/effects/wav/VideoRecord.wav
Binary files differ
diff --git a/data/sounds/effects/wav/camera_click.wav b/data/sounds/effects/wav/camera_click.wav
new file mode 100644
index 0000000..420da7c
--- /dev/null
+++ b/data/sounds/effects/wav/camera_click.wav
Binary files differ
diff --git a/data/sounds/notifications/ogg/Gallium.ogg b/data/sounds/notifications/ogg/Gallium.ogg
index 61dd85c..b0446b2 100755
--- a/data/sounds/notifications/ogg/Gallium.ogg
+++ b/data/sounds/notifications/ogg/Gallium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Helium.ogg b/data/sounds/notifications/ogg/Helium.ogg
index 33b4702..8c4db67 100755
--- a/data/sounds/notifications/ogg/Helium.ogg
+++ b/data/sounds/notifications/ogg/Helium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Palladium.ogg b/data/sounds/notifications/ogg/Palladium.ogg
index 2fd2b76..ee68158 100755
--- a/data/sounds/notifications/ogg/Palladium.ogg
+++ b/data/sounds/notifications/ogg/Palladium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Radon.ogg b/data/sounds/notifications/ogg/Radon.ogg
index 246403d..1d70c11 100755
--- a/data/sounds/notifications/ogg/Radon.ogg
+++ b/data/sounds/notifications/ogg/Radon.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Rubidium.ogg b/data/sounds/notifications/ogg/Rubidium.ogg
index 18f8d7d..edc27cd 100755
--- a/data/sounds/notifications/ogg/Rubidium.ogg
+++ b/data/sounds/notifications/ogg/Rubidium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Selenium.ogg b/data/sounds/notifications/ogg/Selenium.ogg
index 7918ba8..7624eff 100755
--- a/data/sounds/notifications/ogg/Selenium.ogg
+++ b/data/sounds/notifications/ogg/Selenium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Strontium.ogg b/data/sounds/notifications/ogg/Strontium.ogg
index daf4826..ac0bacb 100755
--- a/data/sounds/notifications/ogg/Strontium.ogg
+++ b/data/sounds/notifications/ogg/Strontium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Thallium.ogg b/data/sounds/notifications/ogg/Thallium.ogg
index 721915c..d4841d4 100755
--- a/data/sounds/notifications/ogg/Thallium.ogg
+++ b/data/sounds/notifications/ogg/Thallium.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Xenon.ogg b/data/sounds/notifications/ogg/Xenon.ogg
index 22fae9f..255a1a96 100755
--- a/data/sounds/notifications/ogg/Xenon.ogg
+++ b/data/sounds/notifications/ogg/Xenon.ogg
Binary files differ
diff --git a/data/sounds/notifications/ogg/Zirconium.ogg b/data/sounds/notifications/ogg/Zirconium.ogg
index afbd8d7..31e40c1 100755
--- a/data/sounds/notifications/ogg/Zirconium.ogg
+++ b/data/sounds/notifications/ogg/Zirconium.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Andromeda.ogg b/data/sounds/ringtones/ogg/Andromeda.ogg
new file mode 100644
index 0000000..8f6bd3e
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Andromeda.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Aquila.ogg b/data/sounds/ringtones/ogg/Aquila.ogg
new file mode 100644
index 0000000..b391be9
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Aquila.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/ArgoNavis.ogg b/data/sounds/ringtones/ogg/ArgoNavis.ogg
new file mode 100644
index 0000000..b4202ac
--- /dev/null
+++ b/data/sounds/ringtones/ogg/ArgoNavis.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Bootes.ogg b/data/sounds/ringtones/ogg/Bootes.ogg
new file mode 100644
index 0000000..0716a4f
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Bootes.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/CanisMajor.ogg b/data/sounds/ringtones/ogg/CanisMajor.ogg
new file mode 100644
index 0000000..177d3de
--- /dev/null
+++ b/data/sounds/ringtones/ogg/CanisMajor.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Carina.ogg b/data/sounds/ringtones/ogg/Carina.ogg
new file mode 100644
index 0000000..aeb9b36
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Carina.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Cassiopeia.ogg b/data/sounds/ringtones/ogg/Cassiopeia.ogg
new file mode 100644
index 0000000..c4a7948
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Cassiopeia.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Centaurus.ogg b/data/sounds/ringtones/ogg/Centaurus.ogg
new file mode 100644
index 0000000..404bdbc
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Centaurus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Cygnus.ogg b/data/sounds/ringtones/ogg/Cygnus.ogg
new file mode 100644
index 0000000..b2e1e65
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Cygnus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Draco.ogg b/data/sounds/ringtones/ogg/Draco.ogg
new file mode 100644
index 0000000..88d5a04
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Draco.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Eridani.ogg b/data/sounds/ringtones/ogg/Eridani.ogg
new file mode 100644
index 0000000..b665a29
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Eridani.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Hydra.ogg b/data/sounds/ringtones/ogg/Hydra.ogg
new file mode 100644
index 0000000..edde14f
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Hydra.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Lyra.ogg b/data/sounds/ringtones/ogg/Lyra.ogg
new file mode 100644
index 0000000..696f278
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Lyra.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Machina.ogg b/data/sounds/ringtones/ogg/Machina.ogg
new file mode 100644
index 0000000..ac16f7e
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Machina.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Orion.ogg b/data/sounds/ringtones/ogg/Orion.ogg
new file mode 100644
index 0000000..807f107
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Orion.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Pegasus.ogg b/data/sounds/ringtones/ogg/Pegasus.ogg
new file mode 100644
index 0000000..66c4970
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Pegasus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Perseus.ogg b/data/sounds/ringtones/ogg/Perseus.ogg
new file mode 100644
index 0000000..ad06021
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Perseus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Pyxis.ogg b/data/sounds/ringtones/ogg/Pyxis.ogg
new file mode 100644
index 0000000..2d3adce
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Pyxis.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Rigel.ogg b/data/sounds/ringtones/ogg/Rigel.ogg
new file mode 100644
index 0000000..af2c176
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Rigel.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Scarabaeus.ogg b/data/sounds/ringtones/ogg/Scarabaeus.ogg
new file mode 100644
index 0000000..e70fc69
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Scarabaeus.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Sceptrum.ogg b/data/sounds/ringtones/ogg/Sceptrum.ogg
new file mode 100644
index 0000000..fc50aef
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Sceptrum.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Solarium.ogg b/data/sounds/ringtones/ogg/Solarium.ogg
new file mode 100644
index 0000000..d27f141
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Solarium.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Testudo.ogg b/data/sounds/ringtones/ogg/Testudo.ogg
new file mode 100644
index 0000000..0ca8d6b
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Testudo.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/UrsaMinor.ogg b/data/sounds/ringtones/ogg/UrsaMinor.ogg
new file mode 100644
index 0000000..c0010e82
--- /dev/null
+++ b/data/sounds/ringtones/ogg/UrsaMinor.ogg
Binary files differ
diff --git a/data/sounds/ringtones/ogg/Vespa.ogg b/data/sounds/ringtones/ogg/Vespa.ogg
new file mode 100644
index 0000000..4423bbb
--- /dev/null
+++ b/data/sounds/ringtones/ogg/Vespa.ogg
Binary files differ
diff --git a/data/sounds/ringtones/wav/Carina.wav b/data/sounds/ringtones/wav/Carina.wav
new file mode 100755
index 0000000..ecaeb58
--- /dev/null
+++ b/data/sounds/ringtones/wav/Carina.wav
Binary files differ
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 2b4a410..c7ae2cf 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -464,8 +464,24 @@
Rect srcR = new Rect(x, y, x + width, y + height);
RectF dstR = new RectF(0, 0, width, height);
- final Config newConfig = source.getConfig() == Config.ARGB_8888 ?
- Config.ARGB_8888 : Config.RGB_565;
+ Config newConfig = Config.ARGB_8888;
+ final Config config = source.getConfig();
+ // GIF files generate null configs, assume ARGB_8888
+ if (config != null) {
+ switch (config) {
+ case RGB_565:
+ newConfig = Config.RGB_565;
+ break;
+ case ALPHA_8:
+ newConfig = Config.ALPHA_8;
+ break;
+ case ARGB_4444:
+ case ARGB_8888:
+ default:
+ newConfig = Config.ARGB_8888;
+ break;
+ }
+ }
if (m == null || m.isIdentity()) {
bitmap = createBitmap(neww, newh, newConfig, source.hasAlpha());
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index 691f649..7379b63 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -16,8 +16,11 @@
#define LOG_TAG "OpenGLRenderer"
+#include <ui/Rect.h>
+
#include "LayerRenderer.h"
#include "Properties.h"
+#include "Rect.h"
namespace android {
namespace uirenderer {
@@ -30,12 +33,25 @@
LAYER_RENDERER_LOGD("Rendering into layer, fbo = %d", mLayer->fbo);
#if RENDER_LAYERS_AS_REGIONS
- mLayer->region.clear();
+ Rect dirty(left, top, right, bottom);
+ if (dirty.isEmpty() || (dirty.left <= 0 && dirty.top <= 0 &&
+ dirty.right >= mLayer->width && dirty.bottom >= mLayer->height)) {
+ mLayer->region.clear();
+ dirty.set(0.0f, 0.0f, mLayer->width, mLayer->height);
+ } else {
+ dirty.intersect(0.0f, 0.0f, mLayer->width, mLayer->height);
+ android::Rect r(dirty.left, dirty.top, dirty.right, dirty.bottom);
+ mLayer->region.subtractSelf(r);
+ }
#endif
glBindFramebuffer(GL_FRAMEBUFFER, mLayer->fbo);
+#if RENDER_LAYERS_AS_REGIONS
+ OpenGLRenderer::prepareDirty(dirty.left, dirty.top, dirty.right, dirty.bottom, opaque);
+#else
OpenGLRenderer::prepareDirty(0.0f, 0.0f, mLayer->width, mLayer->height, opaque);
+#endif
}
void LayerRenderer::finish() {
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2960395..90d6ea1 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -671,25 +671,7 @@
finishDrawTexture();
#if DEBUG_LAYERS_AS_REGIONS
- uint32_t colors[] = {
- 0x7fff0000, 0x7f00ff00,
- 0x7f0000ff, 0x7fff00ff,
- };
-
- int offset = 0;
- int32_t top = rects[0].top;
- int i = 0;
-
- for (size_t i = 0; i < count; i++) {
- if (top != rects[i].top) {
- offset ^= 0x2;
- top = rects[i].top;
- }
-
- Rect r(rects[i].left, rects[i].top, rects[i].right, rects[i].bottom);
- drawColorRect(r.left, r.top, r.right, r.bottom, colors[offset + (i & 0x1)],
- SkXfermode::kSrcOver_Mode);
- }
+ drawRegionRects(layer->region);
#endif
layer->region.clear();
@@ -699,6 +681,32 @@
#endif
}
+void OpenGLRenderer::drawRegionRects(const Region& region) {
+#if DEBUG_LAYERS_AS_REGIONS
+ size_t count;
+ const android::Rect* rects = region.getArray(&count);
+
+ uint32_t colors[] = {
+ 0x7fff0000, 0x7f00ff00,
+ 0x7f0000ff, 0x7fff00ff,
+ };
+
+ int offset = 0;
+ int32_t top = rects[0].top;
+
+ for (size_t i = 0; i < count; i++) {
+ if (top != rects[i].top) {
+ offset ^= 0x2;
+ top = rects[i].top;
+ }
+
+ Rect r(rects[i].left, rects[i].top, rects[i].right, rects[i].bottom);
+ drawColorRect(r.left, r.top, r.right, r.bottom, colors[offset + (i & 0x1)],
+ SkXfermode::kSrcOver_Mode);
+ }
+#endif
+}
+
void OpenGLRenderer::dirtyLayer(const float left, const float top,
const float right, const float bottom, const mat4 transform) {
#if RENDER_LAYERS_AS_REGIONS
@@ -1626,6 +1634,10 @@
GL_UNSIGNED_SHORT, layer->meshIndices);
finishDrawTexture();
+
+#if DEBUG_LAYERS_AS_REGIONS
+ drawRegionRects(layer->region);
+#endif
}
}
#else
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 64def03..7bbf034 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -455,6 +455,8 @@
void setupDrawMesh(GLvoid* vertices, GLvoid* texCoords = NULL, GLuint vbo = 0);
void finishDrawTexture();
+ void drawRegionRects(const Region& region);
+
/**
* Should be invoked every time the glScissor is modified.
*/
diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk
index 2d0b6c4..25c8beb 100644
--- a/libs/rs/Android.mk
+++ b/libs/rs/Android.mk
@@ -132,7 +132,7 @@
# Now build a host version for serialization
include $(CLEAR_VARS)
-LOCAL_CFLAGS += -DANDROID_RS_BUILD_FOR_HOST
+LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE
LOCAL_SRC_FILES:= \
rsAllocation.cpp \
diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h
index 882a0b0..bb5e4aa 100644
--- a/libs/rs/RenderScript.h
+++ b/libs/rs/RenderScript.h
@@ -365,7 +365,7 @@
RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype,
RsAllocationMipmapControl mips,
const void *data, uint32_t usages);
-#ifdef ANDROID_RS_BUILD_FOR_HOST
+#ifdef ANDROID_RS_SERIALIZE
#define NO_RS_FUNCS
#endif
diff --git a/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp
index 8d363fd..6e8ca70 100644
--- a/libs/rs/rsAdapter.cpp
+++ b/libs/rs/rsAdapter.cpp
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 2839b76c..54dcbcb 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -13,15 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
-#include "rsContext.h"
+#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
static void rsaAllocationGenerateScriptMips(RsContext con, RsAllocation va);
@@ -78,7 +76,7 @@
mPtr = NULL;
}
freeScriptMemory();
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (mBufferID) {
// Causes a SW crash....
//LOGV(" mBufferID %i", mBufferID);
@@ -89,7 +87,7 @@
glDeleteTextures(1, &mTextureID);
mTextureID = 0;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::setCpuWritable(bool) {
@@ -114,7 +112,7 @@
}
uint32_t Allocation::getGLTarget() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (getIsTexture()) {
if (mType->getDimFaces()) {
return GL_TEXTURE_CUBE_MAP;
@@ -125,7 +123,7 @@
if (getIsBufferObject()) {
return GL_ARRAY_BUFFER;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
@@ -156,7 +154,7 @@
}
void Allocation::uploadToTexture(const Context *rsc) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mUsageFlags |= RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE;
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
@@ -193,10 +191,10 @@
}
rsc->checkError("Allocation::uploadToTexture");
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
const static GLenum gFaceOrder[] = {
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
@@ -205,12 +203,12 @@
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
uint32_t lod, RsAllocationCubemapFace face,
uint32_t w, uint32_t h) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
GLenum target = (GLenum)getGLTarget();
@@ -222,11 +220,11 @@
t = gFaceOrder[face];
}
glTexSubImage2D(t, lod, xoff, yoff, w, h, format, type, ptr);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::upload2DTexture(bool isFirstUpload) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
@@ -264,7 +262,7 @@
if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) {
glGenerateMipmap(target);
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::deferedUploadToBufferObject(const Context *rsc) {
@@ -273,7 +271,7 @@
}
void Allocation::uploadToBufferObject(const Context *rsc) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
rsAssert(!mType->getDimY());
rsAssert(!mType->getDimZ());
@@ -292,7 +290,7 @@
glBufferData(target, mType->getSizeBytes(), getPtr(), GL_DYNAMIC_DRAW);
glBindBuffer(target, 0);
rsc->checkError("Allocation::uploadToBufferObject");
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::uploadCheck(Context *rsc) {
@@ -450,13 +448,13 @@
}
void Allocation::addProgramToDirty(const Program *p) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mToDirtyList.push(p);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::removeProgramToDirty(const Program *p) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
if (mToDirtyList[ct] == p) {
mToDirtyList.removeAt(ct);
@@ -464,7 +462,7 @@
}
}
rsAssert(0);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::dumpLOGV(const char *prefix) const {
@@ -539,11 +537,11 @@
}
void Allocation::sendDirty() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
mToDirtyList[ct]->forceDirty();
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
@@ -602,7 +600,7 @@
/////////////////
//
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
namespace android {
namespace renderscript {
@@ -848,4 +846,4 @@
return texAlloc;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
diff --git a/libs/rs/rsAnimation.cpp b/libs/rs/rsAnimation.cpp
index 6abda3c..48b4f02 100644
--- a/libs/rs/rsAnimation.cpp
+++ b/libs/rs/rsAnimation.cpp
@@ -14,12 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif //ANDROID_RS_BUILD_FOR_HOST
-
#include "rsAnimation.h"
diff --git a/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp
index cb3caf8..4c4987a 100644
--- a/libs/rs/rsComponent.cpp
+++ b/libs/rs/rsComponent.cpp
@@ -16,7 +16,7 @@
#include "rsComponent.h"
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#endif
@@ -181,7 +181,7 @@
}
uint32_t Component::getGLType() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
switch (mType) {
case RS_TYPE_UNSIGNED_5_6_5: return GL_UNSIGNED_SHORT_5_6_5;
case RS_TYPE_UNSIGNED_5_5_5_1: return GL_UNSIGNED_SHORT_5_5_5_1;
@@ -195,12 +195,12 @@
case RS_TYPE_SIGNED_16: return GL_SHORT;
default: break;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
uint32_t Component::getGLFormat() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
switch (mKind) {
case RS_KIND_PIXEL_L: return GL_LUMINANCE;
case RS_KIND_PIXEL_A: return GL_ALPHA;
@@ -209,7 +209,7 @@
case RS_KIND_PIXEL_RGBA: return GL_RGBA;
default: break;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h
index 9f94f26..c5e32a6 100644
--- a/libs/rs/rsContext.h
+++ b/libs/rs/rsContext.h
@@ -18,16 +18,16 @@
#define ANDROID_RS_CONTEXT_H
#include "rsUtils.h"
-#include "rsMutex.h"
-
-#include "rsThreadIO.h"
#include "rsType.h"
-#include "rsMatrix.h"
#include "rsAllocation.h"
#include "rsMesh.h"
+
+#ifndef ANDROID_RS_SERIALIZE
+#include "rsMutex.h"
+#include "rsThreadIO.h"
+#include "rsMatrix.h"
#include "rsDevice.h"
#include "rsScriptC.h"
-#include "rsAllocation.h"
#include "rsAdapter.h"
#include "rsSampler.h"
#include "rsFont.h"
@@ -42,6 +42,7 @@
#include "rsLocklessFifo.h"
#include <ui/egl/android_natives.h>
+#endif // ANDROID_RS_SERIALIZE
// ---------------------------------------------------------------------------
namespace android {
@@ -66,6 +67,8 @@
#define CHECK_OBJ_OR_NULL(o)
#endif
+#ifndef ANDROID_RS_SERIALIZE
+
class Context {
public:
static Context * createContext(Device *, const RsSurfaceConfig *sc);
@@ -321,6 +324,39 @@
uint32_t mAverageFPS;
};
-}
-}
+#else
+
+class Context {
+public:
+ Context() {
+ mObjHead = NULL;
+ }
+ ~Context() {
+ ObjectBase::zeroAllUserRef(this);
+ }
+
+ ElementState mStateElement;
+ TypeState mStateType;
+
+ struct {
+ bool mLogTimes;
+ bool mLogScripts;
+ bool mLogObjects;
+ bool mLogShaders;
+ bool mLogShadersAttr;
+ bool mLogShadersUniforms;
+ bool mLogVisual;
+ } props;
+
+ void setError(RsError e, const char *msg = NULL) { }
+
+ mutable const ObjectBase * mObjHead;
+
+protected:
+
+};
+#endif //ANDROID_RS_SERIALIZE
+
+} // renderscript
+} // android
#endif
diff --git a/libs/rs/rsContextHostStub.h b/libs/rs/rsContextHostStub.h
deleted file mode 100644
index 7e8ec39..0000000
--- a/libs/rs/rsContextHostStub.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef ANDROID_RS_CONTEXT_HOST_STUB_H
-#define ANDROID_RS_CONTEXT_HOST_STUB_H
-
-#include "rsUtils.h"
-#include "rsType.h"
-#include "rsAllocation.h"
-#include "rsMesh.h"
-#include "rsAllocation.h"
-
-// ---------------------------------------------------------------------------
-namespace android {
-namespace renderscript {
-
-#define CHECK_OBJ(o)
-#define CHECK_OBJ_OR_NULL(o)
-
-class Device;
-
-class Context {
-public:
- Context(Device *, bool isGraphics, bool useDepth) {
- mObjHead = NULL;
- }
- ~Context() {
- }
-
- //StructuredAllocationContext mStateAllocation;
- ElementState mStateElement;
- TypeState mStateType;
- RsSurfaceConfig mUserSurfaceConfig;
-
- //bool setupCheck();
-
-
- uint32_t getWidth() const {return 0;}
- uint32_t getHeight() const {return 0;}
-
- // Timers
- enum Timers {
- RS_TIMER_IDLE,
- RS_TIMER_INTERNAL,
- RS_TIMER_SCRIPT,
- RS_TIMER_CLEAR_SWAP,
- _RS_TIMER_TOTAL
- };
-
- void timerSet(Timers) { }
-
- bool checkVersion1_1() const {return false; }
- bool checkVersion2_0() const {return false; }
-
- struct {
- bool mLogTimes;
- bool mLogScripts;
- bool mLogObjects;
- bool mLogShaders;
- bool mLogShadersAttr;
- bool mLogShadersUniforms;
- bool mLogVisual;
- } props;
-
- void dumpDebug() const { }
- void checkError(const char *) const { };
- void setError(RsError e, const char *msg = NULL) { }
-
- mutable const ObjectBase * mObjHead;
-
- bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
- bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;}
- float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; }
- uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;}
- uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;}
- uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;}
- uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;}
-
-protected:
-
- struct {
- const uint8_t * mVendor;
- const uint8_t * mRenderer;
- const uint8_t * mVersion;
- const uint8_t * mExtensions;
-
- uint32_t mMajorVersion;
- uint32_t mMinorVersion;
-
- int32_t mMaxVaryingVectors;
- int32_t mMaxTextureImageUnits;
-
- int32_t mMaxFragmentTextureImageUnits;
- int32_t mMaxFragmentUniformVectors;
-
- int32_t mMaxVertexAttribs;
- int32_t mMaxVertexUniformVectors;
- int32_t mMaxVertexTextureUnits;
-
- bool OES_texture_npot;
- bool GL_NV_texture_npot_2D_mipmap;
- float EXT_texture_max_aniso;
- } mGL;
-
-};
-
-}
-}
-#endif
-
diff --git a/libs/rs/rsDevice.cpp b/libs/rs/rsDevice.cpp
index dd96445..d7d03f6 100644
--- a/libs/rs/rsDevice.cpp
+++ b/libs/rs/rsDevice.cpp
@@ -15,11 +15,7 @@
*/
#include "rsDevice.h"
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp
index 7c3b9e8..477cb61 100644
--- a/libs/rs/rsElement.cpp
+++ b/libs/rs/rsElement.cpp
@@ -15,11 +15,7 @@
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp
index 97ce8c8..cd02c24 100644
--- a/libs/rs/rsFileA3D.cpp
+++ b/libs/rs/rsFileA3D.cpp
@@ -15,12 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
#include "rsFileA3D.h"
#include "rsMesh.h"
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp
index 7fdfbe0..8a5ab99 100644
--- a/libs/rs/rsFont.cpp
+++ b/libs/rs/rsFont.cpp
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
#include "rsFont.h"
#include "rsProgramFragment.h"
diff --git a/libs/rs/rsMesh.cpp b/libs/rs/rsMesh.cpp
index 8cf76e5..76fe62d 100644
--- a/libs/rs/rsMesh.cpp
+++ b/libs/rs/rsMesh.cpp
@@ -14,14 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
#endif
using namespace android;
@@ -33,7 +30,7 @@
mVertexBuffers = NULL;
mVertexBufferCount = 0;
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mAttribs = NULL;
mAttribAllocationIndex = NULL;
@@ -53,7 +50,7 @@
delete[] mPrimitives;
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (mAttribs) {
delete[] mAttribs;
delete[] mAttribAllocationIndex;
@@ -134,7 +131,7 @@
}
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mesh->updateGLPrimitives();
mesh->initVertexAttribs();
mesh->uploadAll(rsc);
@@ -142,7 +139,7 @@
return mesh;
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
bool Mesh::isValidGLComponent(const Element *elem, uint32_t fieldIdx) {
// Do not create attribs for padding
diff --git a/libs/rs/rsMesh.h b/libs/rs/rsMesh.h
index e44f90d..3e080e2 100644
--- a/libs/rs/rsMesh.h
+++ b/libs/rs/rsMesh.h
@@ -54,7 +54,7 @@
virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; }
static Mesh *createFromStream(Context *rsc, IStream *stream);
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
void render(Context *) const;
void renderPrimitive(Context *, uint32_t primIndex) const;
void renderPrimitiveRange(Context *, uint32_t primIndex, uint32_t start, uint32_t len) const;
diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp
index aec2f67..f428f94 100644
--- a/libs/rs/rsObjectBase.cpp
+++ b/libs/rs/rsObjectBase.cpp
@@ -15,13 +15,7 @@
*/
#include "rsObjectBase.h"
-
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp
index 39b85e3..4ef05bf 100644
--- a/libs/rs/rsProgram.cpp
+++ b/libs/rs/rsProgram.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgram.h"
diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp
index 22cd5d3..ff314b7 100644
--- a/libs/rs/rsProgramFragment.cpp
+++ b/libs/rs/rsProgramFragment.cpp
@@ -14,17 +14,13 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramFragment.h"
diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp
index f2b5b9a..ace1572 100644
--- a/libs/rs/rsProgramRaster.cpp
+++ b/libs/rs/rsProgramRaster.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGl/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramRaster.h"
diff --git a/libs/rs/rsProgramStore.cpp b/libs/rs/rsProgramStore.cpp
index 72ac574..09b759d 100644
--- a/libs/rs/rsProgramStore.cpp
+++ b/libs/rs/rsProgramStore.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGl/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramStore.h"
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp
index ad2beaf..403c2a6 100644
--- a/libs/rs/rsProgramVertex.cpp
+++ b/libs/rs/rsProgramVertex.cpp
@@ -14,17 +14,13 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramVertex.h"
diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp
index c80aecc..db2383a 100644
--- a/libs/rs/rsSampler.cpp
+++ b/libs/rs/rsSampler.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsSampler.h"
diff --git a/libs/rs/rsShaderCache.cpp b/libs/rs/rsShaderCache.cpp
index b958021..e8d89c2 100644
--- a/libs/rs/rsShaderCache.cpp
+++ b/libs/rs/rsShaderCache.cpp
@@ -14,14 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsStream.cpp b/libs/rs/rsStream.cpp
index 49ed567..b9df0cc 100644
--- a/libs/rs/rsStream.cpp
+++ b/libs/rs/rsStream.cpp
@@ -15,12 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
#include "rsStream.h"
using namespace android;
diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp
index b94c2f8..cd2be94 100644
--- a/libs/rs/rsType.cpp
+++ b/libs/rs/rsType.cpp
@@ -14,11 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/libs/rs/rsUtils.h b/libs/rs/rsUtils.h
index 0699b57..3b60af5 100644
--- a/libs/rs/rsUtils.h
+++ b/libs/rs/rsUtils.h
@@ -32,7 +32,7 @@
#include <time.h>
#include <cutils/atomic.h>
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
#include <EGL/egl.h>
#endif
diff --git a/libs/rs/rsVertexArray.cpp b/libs/rs/rsVertexArray.cpp
index d9393fe..354ee89 100644
--- a/libs/rs/rsVertexArray.cpp
+++ b/libs/rs/rsVertexArray.cpp
@@ -14,13 +14,10 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
#endif
using namespace android;
diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java
index eeace13..b2f547b 100755
--- a/media/java/android/media/videoeditor/AudioTrack.java
+++ b/media/java/android/media/videoeditor/AudioTrack.java
@@ -402,11 +402,11 @@
*/
public void enableLoop() {
if (!mLoop) {
- mLoop = true;
/**
* Force update of preview settings
*/
mMANativeHelper.setGeneratePreview(true);
+ mLoop = true;
}
}
diff --git a/media/java/android/media/videoeditor/Effect.java b/media/java/android/media/videoeditor/Effect.java
index c6b0839..2f7ae03 100755
--- a/media/java/android/media/videoeditor/Effect.java
+++ b/media/java/android/media/videoeditor/Effect.java
@@ -102,6 +102,8 @@
throw new IllegalArgumentException("Duration is too large");
}
+ getMediaItem().getNativeContext().setGeneratePreview(true);
+
final long oldDurationMs = mDurationMs;
mDurationMs = durationMs;
@@ -156,6 +158,7 @@
throw new IllegalArgumentException("Invalid start time or duration");
}
+ getMediaItem().getNativeContext().setGeneratePreview(true);
final long oldStartTimeMs = mStartTimeMs;
final long oldDurationMs = mDurationMs;
diff --git a/media/java/android/media/videoeditor/EffectKenBurns.java b/media/java/android/media/videoeditor/EffectKenBurns.java
index 66c9e86..9ef458b 100755
--- a/media/java/android/media/videoeditor/EffectKenBurns.java
+++ b/media/java/android/media/videoeditor/EffectKenBurns.java
@@ -57,21 +57,6 @@
mEndRect = endRect;
}
- /**
- * Set the start rectangle.
- *
- * @param startRect The start rectangle
- *
- * @throws IllegalArgumentException if start rectangle is incorrectly set.
- */
- public void setStartRect(Rect startRect) {
- if ( (startRect.left == 0) && (startRect.right == 0)
- && (startRect.bottom == 0) && (startRect.top == 0) ) {
- throw new IllegalArgumentException("Invalid Rectangle");
- }
-
- mStartRect = startRect;
- }
/**
* Get the start rectangle.
@@ -82,21 +67,6 @@
return mStartRect;
}
- /**
- * Set the end rectangle.
- *
- * @param endRect The end rectangle
- *
- * @throws IllegalArgumentException if end rectangle is incorrectly set.
- */
- public void setEndRect(Rect endRect) {
- if ( (endRect.left == 0) && (endRect.right == 0)
- && (endRect.bottom == 0) && (endRect.top == 0) ) {
- throw new IllegalArgumentException("Invalid Rectangle");
- }
-
- mEndRect = endRect;
- }
/**
* Get the end rectangle.
diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
index ba9403d..b8d1ca7 100644
--- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
+++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
@@ -2898,28 +2898,43 @@
if (bEffectKbPresent) {
try {
- mClipProperties.clipProperties[previewIndex]
- = getMediaProperties(((MediaImageItem)lMediaItem).getGeneratedImageClip());
- } catch (Exception e) {
+ if(((MediaImageItem)lMediaItem).getGeneratedImageClip() != null) {
+ mClipProperties.clipProperties[previewIndex]
+ = getMediaProperties(((MediaImageItem)lMediaItem).
+ getGeneratedImageClip());
+ }
+ else {
+ mClipProperties.clipProperties[previewIndex]
+ = getMediaProperties(((MediaImageItem)lMediaItem).
+ getScaledImageFileName());
+ mClipProperties.clipProperties[previewIndex].width =
+ ((MediaImageItem)lMediaItem).getScaledWidth();
+ mClipProperties.clipProperties[previewIndex].height =
+ ((MediaImageItem)lMediaItem).getScaledHeight();
+ }
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Unsupported file or file not found");
+ }
+ } else {
+ try {
+ mClipProperties.clipProperties[previewIndex]
+ = getMediaProperties(((MediaImageItem)lMediaItem).
+ getScaledImageFileName());
+ } catch (Exception e) {
throw new IllegalArgumentException("Unsupported file or file not found");
- }
- } else {
- try {
- mClipProperties.clipProperties[previewIndex]
- = getMediaProperties(((MediaImageItem)lMediaItem).getScaledImageFileName());
- } catch (Exception e) {
- throw new IllegalArgumentException("Unsupported file or file not found");
- }
- mClipProperties.clipProperties[previewIndex].width = ((MediaImageItem)lMediaItem).getScaledWidth();
- mClipProperties.clipProperties[previewIndex].height = ((MediaImageItem)lMediaItem).getScaledHeight();
+ }
+ mClipProperties.clipProperties[previewIndex].width =
+ ((MediaImageItem)lMediaItem).getScaledWidth();
+ mClipProperties.clipProperties[previewIndex].height =
+ ((MediaImageItem)lMediaItem).getScaledHeight();
}
} else {
try {
mClipProperties.clipProperties[previewIndex]
= getMediaProperties(lMediaItem.getFilename());
- } catch (Exception e) {
- throw new IllegalArgumentException("Unsupported file or file not found");
- }
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Unsupported file or file not found");
+ }
}
mClipProperties.clipProperties[previewIndex].Id = lMediaItem.getId();
checkOddSizeImage(lMediaItem, mClipProperties, previewIndex);
@@ -3632,6 +3647,7 @@
mPreviewEditSettings.transitionSettingsArray[index].audioTransitionType =
AudioTransition.NONE;
}
+
for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; clipCnt++) {
if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) {
mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath =
diff --git a/media/java/android/media/videoeditor/MediaItem.java b/media/java/android/media/videoeditor/MediaItem.java
index d3ab051..e3ef599 100755
--- a/media/java/android/media/videoeditor/MediaItem.java
+++ b/media/java/android/media/videoeditor/MediaItem.java
@@ -295,6 +295,8 @@
"Effect start time + effect duration > media clip duration");
}
+ mMANativeHelper.setGeneratePreview(true);
+
mEffects.add(effect);
invalidateTransitions(effect.getStartTime(), effect.getDuration());
@@ -302,7 +304,6 @@
if (effect instanceof EffectKenBurns) {
mRegenerateClip = true;
}
- mMANativeHelper.setGeneratePreview(true);
}
/**
@@ -424,8 +425,6 @@
throw new IllegalArgumentException("Overlay bitmap not specified");
}
- ((OverlayFrame)overlay).save(mProjectPath);
-
final int scaledWidth, scaledHeight;
if (this instanceof MediaVideoItem) {
scaledWidth = getWidth();
@@ -443,13 +442,16 @@
throw new IllegalArgumentException(
"Bitmap dimensions must match media item dimensions");
}
+
+ mMANativeHelper.setGeneratePreview(true);
+ ((OverlayFrame)overlay).save(mProjectPath);
+
+ mOverlays.add(overlay);
+ invalidateTransitions(overlay.getStartTime(), overlay.getDuration());
+
} else {
throw new IllegalArgumentException("Overlay not supported");
}
-
- mOverlays.add(overlay);
- invalidateTransitions(overlay.getStartTime(), overlay.getDuration());
- mMANativeHelper.setGeneratePreview(true);
}
/**
diff --git a/media/java/android/media/videoeditor/VideoEditor.java b/media/java/android/media/videoeditor/VideoEditor.java
index 9006613..122dc8d 100755
--- a/media/java/android/media/videoeditor/VideoEditor.java
+++ b/media/java/android/media/videoeditor/VideoEditor.java
@@ -23,6 +23,7 @@
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Canvas;
+import android.graphics.Paint;
import android.graphics.Rect;
import android.view.SurfaceHolder;
@@ -153,6 +154,7 @@
private Bitmap mOverlayBitmap;
private int mRenderingMode;
private boolean mClear;
+ private static final Paint sResizePaint = new Paint(Paint.FILTER_BITMAP_FLAG);
/**
* Default constructor
@@ -290,7 +292,7 @@
}
destBitmap.eraseColor(Color.TRANSPARENT);
- overlayCanvas.drawBitmap(mOverlayBitmap, srcRect, destRect, null);
+ overlayCanvas.drawBitmap(mOverlayBitmap, srcRect, destRect, sResizePaint);
mOverlayBitmap.recycle();
}
diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java
index cc847ef..8bbd8e8 100755
--- a/media/java/android/media/videoeditor/VideoEditorImpl.java
+++ b/media/java/android/media/videoeditor/VideoEditorImpl.java
@@ -103,6 +103,7 @@
private static final String ATTR_DUCK_THRESHOLD = "ducking_threshold";
private static final String ATTR_DUCKED_TRACK_VOLUME = "ducking_volume";
private static final String ATTR_GENERATED_IMAGE_CLIP = "generated_image_clip";
+ private static final String ATTR_IS_IMAGE_CLIP_GENERATED = "is_image_clip_generated";
private static final String ATTR_GENERATED_TRANSITION_CLIP = "generated_transition_clip";
private static final String ATTR_IS_TRANSITION_GENERATED = "is_transition_generated";
private static final String ATTR_OVERLAY_RGB_FILENAME = "overlay_rgb_filename";
@@ -167,6 +168,8 @@
throw new IllegalArgumentException("No more tracks can be added");
}
+ mMANativeHelper.setGeneratePreview(true);
+
/*
* Add the audio track to AudioTrack list
*/
@@ -185,7 +188,6 @@
mMANativeHelper.setAudioflag(false);
}
- mMANativeHelper.setGeneratePreview(true);
}
/*
@@ -205,6 +207,8 @@
throw new IllegalArgumentException("Media item already exists: " + mediaItem.getId());
}
+ mMANativeHelper.setGeneratePreview(true);
+
/*
* Invalidate the end transition if necessary
*/
@@ -219,7 +223,7 @@
mMediaItems.add(mediaItem);
computeTimelineDuration();
- mMANativeHelper.setGeneratePreview(true);
+
/*
* Generate project thumbnail only from first media Item on storyboard
*/
@@ -258,7 +262,9 @@
if (afterMediaItemIndex != (beforeMediaItemIndex - 1) ) {
throw new IllegalArgumentException("MediaItems are not in sequence");
}
- }
+ }
+
+ mMANativeHelper.setGeneratePreview(true);
mTransitions.add(transition);
/*
@@ -289,7 +295,6 @@
}
computeTimelineDuration();
- mMANativeHelper.setGeneratePreview(true);
}
/*
@@ -542,15 +547,15 @@
}
if (afterAudioTrackId == null) {
- mAudioTracks.add(0, audioTrack);
mMANativeHelper.setGeneratePreview(true);
+ mAudioTracks.add(0, audioTrack);
} else {
final int audioTrackCount = mAudioTracks.size();
for (int i = 0; i < audioTrackCount; i++) {
AudioTrack at = mAudioTracks.get(i);
if (at.getId().equals(afterAudioTrackId)) {
- mAudioTracks.add(i + 1, audioTrack);
mMANativeHelper.setGeneratePreview(true);
+ mAudioTracks.add(i + 1, audioTrack);
return;
}
}
@@ -568,6 +573,7 @@
}
if (afterMediaItemId == null) {
+ mMANativeHelper.setGeneratePreview(true);
if (mMediaItems.size() > 0) {
/**
* Invalidate the transition at the beginning of the timeline
@@ -578,12 +584,12 @@
mMediaItems.add(0, mediaItem);
computeTimelineDuration();
generateProjectThumbnail();
- mMANativeHelper.setGeneratePreview(true);
} else {
final int mediaItemCount = mMediaItems.size();
for (int i = 0; i < mediaItemCount; i++) {
final MediaItem mi = mMediaItems.get(i);
if (mi.getId().equals(afterMediaItemId)) {
+ mMANativeHelper.setGeneratePreview(true);
/**
* Invalidate the transition at this position
*/
@@ -593,7 +599,6 @@
*/
mMediaItems.add(i + 1, mediaItem);
computeTimelineDuration();
- mMANativeHelper.setGeneratePreview(true);
return;
}
}
@@ -620,6 +625,8 @@
if (afterMediaItemId == null) {
if (mMediaItems.size() > 0) {
+ mMANativeHelper.setGeneratePreview(true);
+
/**
* Invalidate adjacent transitions at the insertion point
*/
@@ -630,7 +637,6 @@
*/
mMediaItems.add(0, moveMediaItem);
computeTimelineDuration();
- mMANativeHelper.setGeneratePreview(true);
generateProjectThumbnail();
} else {
@@ -641,6 +647,7 @@
for (int i = 0; i < mediaItemCount; i++) {
final MediaItem mi = mMediaItems.get(i);
if (mi.getId().equals(afterMediaItemId)) {
+ mMANativeHelper.setGeneratePreview(true);
/**
* Invalidate adjacent transitions at the insertion point
*/
@@ -650,7 +657,6 @@
*/
mMediaItems.add(i + 1, moveMediaItem);
computeTimelineDuration();
- mMANativeHelper.setGeneratePreview(true);
return;
}
}
@@ -703,11 +709,11 @@
public synchronized AudioTrack removeAudioTrack(String audioTrackId) {
final AudioTrack audioTrack = getAudioTrack(audioTrackId);
if (audioTrack != null) {
+ mMANativeHelper.setGeneratePreview(true);
mAudioTracks.remove(audioTrack);
audioTrack.invalidate();
mMANativeHelper.invalidatePcmFile();
mMANativeHelper.setAudioflag(true);
- mMANativeHelper.setGeneratePreview(true);
} else {
throw new IllegalArgumentException(" No more audio tracks");
}
@@ -840,7 +846,6 @@
} else if (timeMs > mDurationMs) {
throw new IllegalArgumentException("requested time more than duration");
}
-
long result = 0;
boolean semAcquireDone = false;
@@ -862,7 +867,7 @@
mMANativeHelper.unlock();
}
}
-
+Log.i("VE_IMPL","renderPreviewFrame <--");
return result;
}
@@ -973,15 +978,28 @@
currentMediaItem.addEffect(effect);
}
if (effect instanceof EffectKenBurns) {
- String filename = parser.getAttributeValue("", ATTR_GENERATED_IMAGE_CLIP);
-
- if (new File(filename).exists() == true) {
- ((MediaImageItem)currentMediaItem).setGeneratedImageClip(filename);
- ((MediaImageItem)currentMediaItem).setRegenerateClip(false);
- }
- else {
- ((MediaImageItem)currentMediaItem).setGeneratedImageClip(null);
- ((MediaImageItem)currentMediaItem).setRegenerateClip(true);
+ final boolean isImageClipGenerated =
+ Boolean.parseBoolean(parser.getAttributeValue("",
+ ATTR_IS_IMAGE_CLIP_GENERATED));
+ if(isImageClipGenerated) {
+ String filename = parser.getAttributeValue("",
+ ATTR_GENERATED_IMAGE_CLIP);
+ if (new File(filename).exists() == true) {
+ ((MediaImageItem)currentMediaItem).
+ setGeneratedImageClip(filename);
+ ((MediaImageItem)currentMediaItem).
+ setRegenerateClip(false);
+ } else {
+ ((MediaImageItem)currentMediaItem).
+ setGeneratedImageClip(null);
+ ((MediaImageItem)currentMediaItem).
+ setRegenerateClip(true);
+ }
+ } else {
+ ((MediaImageItem)currentMediaItem).
+ setGeneratedImageClip(null);
+ ((MediaImageItem)currentMediaItem).
+ setRegenerateClip(true);
}
}
}
@@ -1386,8 +1404,14 @@
serializer.attribute("", ATTR_END_RECT_BOTTOM,
Integer.toString(endRect.bottom));
final MediaItem mItem = effect.getMediaItem();
- serializer.attribute("", ATTR_GENERATED_IMAGE_CLIP,
- ((MediaImageItem)mItem).getGeneratedImageClip());
+ if(((MediaImageItem)mItem).getGeneratedImageClip() != null) {
+ serializer.attribute("", ATTR_IS_IMAGE_CLIP_GENERATED,Boolean.toString(true));
+ serializer.attribute("", ATTR_GENERATED_IMAGE_CLIP,
+ ((MediaImageItem)mItem).getGeneratedImageClip());
+ } else {
+ serializer.attribute("", ATTR_IS_IMAGE_CLIP_GENERATED,
+ Boolean.toString(false));
+ }
}
serializer.endTag("", TAG_EFFECT);
@@ -1495,6 +1519,8 @@
/**
* Invalidate all transitions
*/
+ mMANativeHelper.setGeneratePreview(true);
+
for (Transition transition : mTransitions) {
transition.invalidate();
}
@@ -1617,8 +1643,8 @@
while (it.hasNext()) {
Transition t = it.next();
if (t.getBeforeMediaItem() == mediaItem) {
- it.remove();
mMANativeHelper.setGeneratePreview(true);
+ it.remove();
t.invalidate();
mediaItem.setBeginTransition(null);
if (index > 0) {
@@ -1640,8 +1666,8 @@
while (it.hasNext()) {
Transition t = it.next();
if (t.getAfterMediaItem() == mediaItem) {
- it.remove();
mMANativeHelper.setGeneratePreview(true);
+ it.remove();
t.invalidate();
mediaItem.setEndTransition(null);
/**
diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp
index 221bfa1..101619c 100755
--- a/media/jni/mediaeditor/VideoEditorMain.cpp
+++ b/media/jni/mediaeditor/VideoEditorMain.cpp
@@ -1485,7 +1485,7 @@
if ( pContext->pEditSettings->nbEffects )
{
pOverlayIndex
- = (int*) M4OSA_malloc(pContext->pEditSettings->nbEffects, 0,
+ = (int*) M4OSA_malloc(pContext->pEditSettings->nbEffects * sizeof(int), 0,
(M4OSA_Char*)"pOverlayIndex");
}
@@ -1528,9 +1528,15 @@
result = M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(pContext->engineContext,
&(pContext->pEditSettings->Effects[j]),aFramingCtx,
pContext->pEditSettings->Effects[j].xVSS.framingScaledSize);
- if (result != M4NO_ERROR)
- {
+ videoEditJava_checkAndThrowRuntimeException(&needToBeLoaded, pEnv,
+ (M4NO_ERROR != result), result);
+ if (needToBeLoaded == false) {
M4OSA_TRACE1_1("M4xVSS_internalConvertARGB888toYUV420_FrammingEffect returned 0x%x", result);
+ if (aFramingCtx != M4OSA_NULL) {
+ M4OSA_free((M4OSA_MemAddr32)aFramingCtx);
+ aFramingCtx = M4OSA_NULL;
+ }
+ return;
}
//framing buffers are resized to fit the output video resolution.
diff --git a/media/libstagefright/AMRExtractor.cpp b/media/libstagefright/AMRExtractor.cpp
index ac87c29..7eca5e4 100644
--- a/media/libstagefright/AMRExtractor.cpp
+++ b/media/libstagefright/AMRExtractor.cpp
@@ -35,8 +35,9 @@
public:
AMRSource(const sp<DataSource> &source,
const sp<MetaData> &meta,
- size_t frameSize,
- bool isWide);
+ bool isWide,
+ const off64_t *offset_table,
+ size_t offset_table_length);
virtual status_t start(MetaData *params = NULL);
virtual status_t stop();
@@ -52,7 +53,6 @@
private:
sp<DataSource> mDataSource;
sp<MetaData> mMeta;
- size_t mFrameSize;
bool mIsWide;
off64_t mOffset;
@@ -60,6 +60,9 @@
bool mStarted;
MediaBufferGroup *mGroup;
+ off64_t mOffsetTable[OFFSET_TABLE_LEN];
+ size_t mOffsetTableLength;
+
AMRSource(const AMRSource &);
AMRSource &operator=(const AMRSource &);
};
@@ -67,13 +70,25 @@
////////////////////////////////////////////////////////////////////////////////
static size_t getFrameSize(bool isWide, unsigned FT) {
- static const size_t kFrameSizeNB[8] = {
- 95, 103, 118, 134, 148, 159, 204, 244
+ static const size_t kFrameSizeNB[16] = {
+ 95, 103, 118, 134, 148, 159, 204, 244,
+ 39, 43, 38, 37, // SID
+ 0, 0, 0, // future use
+ 0 // no data
};
- static const size_t kFrameSizeWB[9] = {
- 132, 177, 253, 285, 317, 365, 397, 461, 477
+ static const size_t kFrameSizeWB[16] = {
+ 132, 177, 253, 285, 317, 365, 397, 461, 477,
+ 40, // SID
+ 0, 0, 0, 0, // future use
+ 0, // speech lost
+ 0 // no data
};
+ if (FT > 15 || (isWide && FT > 9 && FT < 14) || (!isWide && FT > 11 && FT < 15)) {
+ LOGE("illegal AMR frame type %d", FT);
+ return 0;
+ }
+
size_t frameSize = isWide ? kFrameSizeWB[FT] : kFrameSizeNB[FT];
// Round up bits to bytes and add 1 for the header byte.
@@ -82,9 +97,26 @@
return frameSize;
}
+static status_t getFrameSizeByOffset(const sp<DataSource> &source,
+ off64_t offset, bool isWide, size_t *frameSize) {
+ uint8_t header;
+ if (source->readAt(offset, &header, 1) < 1) {
+ return ERROR_IO;
+ }
+
+ unsigned FT = (header >> 3) & 0x0f;
+
+ *frameSize = getFrameSize(isWide, FT);
+ if (*frameSize == 0) {
+ return ERROR_MALFORMED;
+ }
+ return OK;
+}
+
AMRExtractor::AMRExtractor(const sp<DataSource> &source)
: mDataSource(source),
- mInitCheck(NO_INIT) {
+ mInitCheck(NO_INIT),
+ mOffsetTableLength(0) {
String8 mimeType;
float confidence;
if (!SniffAMR(mDataSource, &mimeType, &confidence, NULL)) {
@@ -101,25 +133,29 @@
mMeta->setInt32(kKeyChannelCount, 1);
mMeta->setInt32(kKeySampleRate, mIsWide ? 16000 : 8000);
- size_t offset = mIsWide ? 9 : 6;
- uint8_t header;
- if (mDataSource->readAt(offset, &header, 1) != 1) {
- return;
- }
-
- unsigned FT = (header >> 3) & 0x0f;
-
- if (FT > 8 || (!mIsWide && FT > 7)) {
- return;
- }
-
- mFrameSize = getFrameSize(mIsWide, FT);
-
+ off64_t offset = mIsWide ? 9 : 6;
off64_t streamSize;
- if (mDataSource->getSize(&streamSize) == OK) {
- off64_t numFrames = streamSize / mFrameSize;
+ size_t frameSize, numFrames = 0;
+ int64_t duration = 0;
- mMeta->setInt64(kKeyDuration, 20000ll * numFrames);
+ if (mDataSource->getSize(&streamSize) == OK) {
+ while (offset < streamSize) {
+ if (getFrameSizeByOffset(source, offset, mIsWide, &frameSize) != OK) {
+ return;
+ }
+
+ if ((numFrames % 50 == 0) && (numFrames / 50 < OFFSET_TABLE_LEN)) {
+ CHECK_EQ(mOffsetTableLength, numFrames / 50);
+ mOffsetTable[mOffsetTableLength] = offset - (mIsWide ? 9: 6);
+ mOffsetTableLength ++;
+ }
+
+ offset += frameSize;
+ duration += 20000; // Each frame is 20ms
+ numFrames ++;
+ }
+
+ mMeta->setInt64(kKeyDuration, duration);
}
mInitCheck = OK;
@@ -149,7 +185,8 @@
return NULL;
}
- return new AMRSource(mDataSource, mMeta, mFrameSize, mIsWide);
+ return new AMRSource(mDataSource, mMeta, mIsWide,
+ mOffsetTable, mOffsetTableLength);
}
sp<MetaData> AMRExtractor::getTrackMetaData(size_t index, uint32_t flags) {
@@ -164,15 +201,18 @@
AMRSource::AMRSource(
const sp<DataSource> &source, const sp<MetaData> &meta,
- size_t frameSize, bool isWide)
+ bool isWide, const off64_t *offset_table, size_t offset_table_length)
: mDataSource(source),
mMeta(meta),
- mFrameSize(frameSize),
mIsWide(isWide),
mOffset(mIsWide ? 9 : 6),
mCurrentTimeUs(0),
mStarted(false),
- mGroup(NULL) {
+ mGroup(NULL),
+ mOffsetTableLength(offset_table_length) {
+ if (mOffsetTableLength > 0 && mOffsetTableLength <= OFFSET_TABLE_LEN) {
+ memcpy ((char*)mOffsetTable, (char*)offset_table, sizeof(off64_t) * mOffsetTableLength);
+ }
}
AMRSource::~AMRSource() {
@@ -214,9 +254,25 @@
int64_t seekTimeUs;
ReadOptions::SeekMode mode;
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
+ size_t size;
int64_t seekFrame = seekTimeUs / 20000ll; // 20ms per frame.
mCurrentTimeUs = seekFrame * 20000ll;
- mOffset = seekFrame * mFrameSize + (mIsWide ? 9 : 6);
+
+ int index = seekFrame / 50;
+ if (index >= mOffsetTableLength) {
+ index = mOffsetTableLength - 1;
+ }
+
+ mOffset = mOffsetTable[index] + (mIsWide ? 9 : 6);
+
+ for (int i = 0; i< seekFrame - index * 50; i++) {
+ status_t err;
+ if ((err = getFrameSizeByOffset(mDataSource, mOffset,
+ mIsWide, &size)) != OK) {
+ return err;
+ }
+ mOffset += size;
+ }
}
uint8_t header;
@@ -236,16 +292,11 @@
unsigned FT = (header >> 3) & 0x0f;
- if (FT > 8 || (!mIsWide && FT > 7)) {
-
- LOGE("illegal AMR frame type %d", FT);
-
+ size_t frameSize = getFrameSize(mIsWide, FT);
+ if (frameSize == 0) {
return ERROR_MALFORMED;
}
- size_t frameSize = getFrameSize(mIsWide, FT);
- CHECK_EQ(frameSize, mFrameSize);
-
MediaBuffer *buffer;
status_t err = mGroup->acquire_buffer(&buffer);
if (err != OK) {
diff --git a/media/libstagefright/include/AMRExtractor.h b/media/libstagefright/include/AMRExtractor.h
index 1cdf36d..589d837 100644
--- a/media/libstagefright/include/AMRExtractor.h
+++ b/media/libstagefright/include/AMRExtractor.h
@@ -24,6 +24,7 @@
struct AMessage;
class String8;
+#define OFFSET_TABLE_LEN 300
class AMRExtractor : public MediaExtractor {
public:
@@ -42,9 +43,11 @@
sp<DataSource> mDataSource;
sp<MetaData> mMeta;
status_t mInitCheck;
- size_t mFrameSize;
bool mIsWide;
+ off64_t mOffsetTable[OFFSET_TABLE_LEN]; //5 min
+ size_t mOffsetTableLength;
+
AMRExtractor(const AMRExtractor &);
AMRExtractor &operator=(const AMRExtractor &);
};
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 27c8aea..2df6d68 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -116,4 +116,9 @@
<!-- Default for Settings.System.USER_ROTATION -->
<integer name="def_user_rotation">0</integer>
+
+ <!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
+ <integer name="def_download_manager_max_bytes_over_mobile">-1</integer>
+ <!-- Default for Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
+ <integer name="def_download_manager_recommended_max_bytes_over_mobile">-1</integer>
</resources>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 580113c..49b71e2 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -1295,6 +1295,20 @@
loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS,
R.string.def_accessibility_web_content_key_bindings);
+
+ final int maxBytes = mContext.getResources().getInteger(
+ R.integer.def_download_manager_max_bytes_over_mobile);
+ if (maxBytes > 0) {
+ loadSetting(stmt, Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE,
+ Integer.toString(maxBytes));
+ }
+
+ final int recommendedMaxBytes = mContext.getResources().getInteger(
+ R.integer.def_download_manager_recommended_max_bytes_over_mobile);
+ if (recommendedMaxBytes > 0) {
+ loadSetting(stmt, Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE,
+ Integer.toString(recommendedMaxBytes));
+ }
} finally {
if (stmt != null) stmt.close();
}
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_flowing.png
new file mode 100644
index 0000000..76332c1
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_flowing.png
new file mode 100644
index 0000000..3b8aff4
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_flowing.png
new file mode 100644
index 0000000..54e02b5
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_flowing.png
new file mode 100644
index 0000000..046c9a0
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_flowing.png
new file mode 100644
index 0000000..21f90b0
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_flowing.png
new file mode 100644
index 0000000..1456eea
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_flowing.png
new file mode 100644
index 0000000..a2675e9
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_flowing.png
new file mode 100644
index 0000000..96a205f4
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_flowing.png
new file mode 100644
index 0000000..c6267a4
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully_flowing.png
new file mode 100644
index 0000000..5e42b55
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_flowing.png
new file mode 100644
index 0000000..bd400b5
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully_flowing.png
new file mode 100644
index 0000000..4dab171
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_flowing.png
new file mode 100644
index 0000000..9c868f1
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully_flowing.png
new file mode 100644
index 0000000..e3a3cec
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_flowing.png
new file mode 100644
index 0000000..b9ba6d5
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully_flowing.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully_flowing.png
new file mode 100644
index 0000000..0ad77f1
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_flowing.png
new file mode 100644
index 0000000..0de5760
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_flowing.png
new file mode 100644
index 0000000..e042696
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_flowing.png
new file mode 100644
index 0000000..88b08c8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_flowing.png
new file mode 100644
index 0000000..940adf0
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_flowing.png
new file mode 100644
index 0000000..3f4dedd
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_flowing.png
new file mode 100644
index 0000000..83045ce
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_flowing.png
new file mode 100644
index 0000000..f5c0aa3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_flowing.png
new file mode 100644
index 0000000..429e818
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_flowing.png
new file mode 100644
index 0000000..42a798a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully_flowing.png
new file mode 100644
index 0000000..1643e6e
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_flowing.png
new file mode 100644
index 0000000..06ae2ca
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully_flowing.png
new file mode 100644
index 0000000..8f1831d
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_flowing.png
new file mode 100644
index 0000000..12138d3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully_flowing.png
new file mode 100644
index 0000000..11fd5e9
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_flowing.png
new file mode 100644
index 0000000..8bbc5ba
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully_flowing.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully_flowing.png
new file mode 100644
index 0000000..c817598
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully_flowing.png
Binary files differ
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml
index bb1cf23..efbf359 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml
@@ -22,7 +22,8 @@
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingBottom="28dip"
- android:orientation="vertical">
+ android:orientation="vertical"
+ android:visibility="gone">
<View
android:layout_width="match_parent"
android:layout_height="0dip"
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 0925f77..4e41e53 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml
@@ -84,7 +84,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="40sp"
- android:textColor="#8cffffff" />
+ android:textColor="#8cccdaff" />
</com.android.systemui.statusbar.tablet.HoloClock>
<TextView
diff --git a/packages/SystemUI/res/values-xlarge/colors.xml b/packages/SystemUI/res/values-xlarge/colors.xml
index 43af2c7..7f1e358 100644
--- a/packages/SystemUI/res/values-xlarge/colors.xml
+++ b/packages/SystemUI/res/values-xlarge/colors.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="status_bar_background">#000000</drawable>
- <drawable name="notification_icon_area_smoke">#A0000000</drawable>
+ <drawable name="notification_icon_area_smoke">#D0000000</drawable>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index a4c153f..c94f9ee 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -76,7 +76,9 @@
int mPhoneSignalIconId;
int mDataDirectionIconId;
int mDataSignalIconId;
+ int mDataActiveSignalIconId;
int mDataTypeIconId;
+ boolean mDataActive;
// wifi
final WifiManager mWifiManager;
@@ -365,15 +367,17 @@
if (Settings.System.getInt(mContext.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) == 1) {
mPhoneSignalIconId = R.drawable.stat_sys_signal_flightmode;
- mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
+ mDataActiveSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
} else {
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
- mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
+ // note we use 0 instead of null
+ mDataActiveSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_0;
}
} else {
if (mSignalStrength == null) {
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
- mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
+ // note we use 0 instead of null
+ mDataActiveSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_0;
} else if (isCdma()) {
// If 3G(EV) and 1x network are available than 3G should be
// displayed, displayed RSSI should be from the EV side.
@@ -392,6 +396,8 @@
}
mPhoneSignalIconId = iconList[iconLevel];
mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel];
+ mDataActiveSignalIconId
+ = TelephonyIcons.DATA_SIGNAL_STRENGTH_ACTIVE[mInetCondition][iconLevel];
} else {
int asu = mSignalStrength.getGsmSignalStrength();
@@ -415,6 +421,8 @@
}
mPhoneSignalIconId = iconList[iconLevel];
mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel];
+ mDataActiveSignalIconId
+ = TelephonyIcons.DATA_SIGNAL_STRENGTH_ACTIVE[mInetCondition][iconLevel];
}
}
}
@@ -691,7 +699,16 @@
dataTypeIconId = 0;
} else if (mDataConnected) {
label = mNetworkName;
- combinedSignalIconId = mDataSignalIconId;
+ switch (mDataActivity) {
+ case TelephonyManager.DATA_ACTIVITY_IN:
+ case TelephonyManager.DATA_ACTIVITY_OUT:
+ case TelephonyManager.DATA_ACTIVITY_INOUT:
+ combinedSignalIconId = mDataActiveSignalIconId;
+ break;
+ default:
+ combinedSignalIconId = mDataSignalIconId;
+ break;
+ }
dataTypeIconId = mDataTypeIconId;
} else if (mBluetoothTethered) {
label = mContext.getString(R.string.bluetooth_tethered);
@@ -705,13 +722,16 @@
if (false) {
Slog.d(TAG, "refreshViews combinedSignalIconId=0x"
- + Integer.toHexString(mPhoneSignalIconId)
+ + Integer.toHexString(combinedSignalIconId)
+ + "/" + getResourceName(combinedSignalIconId)
+ + " mDataActivity=" + mDataActivity
+ " mPhoneSignalIconId=0x" + Integer.toHexString(mPhoneSignalIconId)
+ " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId)
+ " mDataSignalIconId=0x" + Integer.toHexString(mDataSignalIconId)
+ + " mDataActiveSignalIconId=0x" + Integer.toHexString(mDataActiveSignalIconId)
+ " mDataTypeIconId=0x" + Integer.toHexString(mDataTypeIconId)
+ " mWifiIconId=0x" + Integer.toHexString(mWifiIconId)
- + "mBluetoothTetherIconId=0x" + Integer.toHexString(mBluetoothTetherIconId));
+ + " mBluetoothTetherIconId=0x" + Integer.toHexString(mBluetoothTetherIconId));
}
// the phone icon on phones
@@ -814,6 +834,10 @@
pw.print(Integer.toHexString(mDataSignalIconId));
pw.print("/");
pw.println(getResourceName(mDataSignalIconId));
+ pw.print(" mDataActiveSignalIconId=");
+ pw.print(Integer.toHexString(mDataActiveSignalIconId));
+ pw.print("/");
+ pw.println(getResourceName(mDataActiveSignalIconId));
pw.print(" mDataTypeIconId=");
pw.print(Integer.toHexString(mDataTypeIconId));
pw.print("/");
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
index 94c68ac..29d35e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
@@ -50,6 +50,19 @@
static final int[][] DATA_SIGNAL_STRENGTH = TELEPHONY_SIGNAL_STRENGTH;
+ static final int[][] DATA_SIGNAL_STRENGTH_ACTIVE = {
+ { R.drawable.stat_sys_signal_0,
+ R.drawable.stat_sys_signal_1_flowing,
+ R.drawable.stat_sys_signal_2_flowing,
+ R.drawable.stat_sys_signal_3_flowing,
+ R.drawable.stat_sys_signal_4_flowing },
+ { R.drawable.stat_sys_signal_0_fully,
+ R.drawable.stat_sys_signal_1_fully_flowing,
+ R.drawable.stat_sys_signal_2_fully_flowing,
+ R.drawable.stat_sys_signal_3_fully_flowing,
+ R.drawable.stat_sys_signal_4_fully_flowing }
+ };
+
//***** Data connection icons
//GSM/UMTS
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
index 0c2909a..b1e74ad 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
@@ -34,7 +34,6 @@
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
-import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
@@ -48,8 +47,8 @@
import java.util.Set;
import java.util.TreeMap;
-public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, View.OnClickListener,
- CompoundButton.OnCheckedChangeListener {
+public class InputMethodsPanel extends LinearLayout implements StatusBarPanel,
+ View.OnClickListener {
private static final boolean DEBUG = TabletStatusBar.DEBUG;
private static final String TAG = "InputMethodsPanel";
@@ -86,6 +85,7 @@
private View mConfigureImeShortcut;
private class InputMethodComparator implements Comparator<InputMethodInfo> {
+ @Override
public int compare(InputMethodInfo imi1, InputMethodInfo imi2) {
if (imi2 == null) return 0;
if (imi1 == null) return 1;
@@ -142,7 +142,6 @@
mInputMethodMenuList = (LinearLayout) findViewById(R.id.input_method_menu_list);
mHardKeyboardSection = (LinearLayout) findViewById(R.id.hard_keyboard_section);
mHardKeyboardSwitch = (Switch) findViewById(R.id.hard_keyboard_switch);
- mHardKeyboardSwitch.setOnCheckedChangeListener(this);
mConfigureImeShortcut = findViewById(R.id.ime_settings_shortcut);
mConfigureImeShortcut.setOnClickListener(this);
// TODO: If configurations for IME are not changed, do not update
@@ -156,33 +155,16 @@
}
@Override
- protected void onVisibilityChanged(View changedView, int visibility) {
- super.onVisibilityChanged(changedView, visibility);
- if (changedView == this) {
- if (visibility == View.VISIBLE) {
- updateUiElements();
- if (mInputMethodSwitchButton != null) {
- mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime_pressed);
- }
- } else {
- if (mInputMethodSwitchButton != null) {
- mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime);
- }
- }
- }
- }
-
- @Override
public void onClick(View view) {
if (view == mConfigureImeShortcut) {
showConfigureInputMethods();
- onFinishPanel(true);
+ closePanel(true);
}
}
- @Override
- public void onCheckedChanged(CompoundButton button, boolean checked) {
- if (button == mHardKeyboardSwitch) {
+ private void updateHardKeyboardEnabled() {
+ if (mHardKeyboardAvailable) {
+ final boolean checked = mHardKeyboardSwitch.isChecked();
if (mHardKeyboardEnabled != checked) {
mHardKeyboardEnabled = checked;
if (mHardKeyboardEnabledChangeListener != null)
@@ -191,11 +173,23 @@
}
}
- private void onFinishPanel(boolean closeKeyboard) {
+ public void openPanel() {
+ setVisibility(View.VISIBLE);
+ updateUiElements();
+ if (mInputMethodSwitchButton != null) {
+ mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime_pressed);
+ }
+ }
+
+ public void closePanel(boolean closeKeyboard) {
setVisibility(View.GONE);
+ if (mInputMethodSwitchButton != null) {
+ mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime);
+ }
if (closeKeyboard) {
mImm.hideSoftInputFromWindow(getWindowToken(), 0);
}
+ updateHardKeyboardEnabled();
}
private void startActivity(Intent intent) {
@@ -241,7 +235,7 @@
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
- onFinishPanel(true);
+ closePanel(true);
}
});
} else {
@@ -256,7 +250,7 @@
public void onClick(View v) {
Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype =
updateRadioButtonsByView(v);
- onFinishPanel(false);
+ closePanel(false);
setInputMethodAndSubtype(imiAndSubtype.first, imiAndSubtype.second);
}
});
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 715bb83..4373dba 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -19,12 +19,9 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Map;
-import java.util.IdentityHashMap;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
-import android.animation.AnimatorSet;
import android.app.ActivityManagerNative;
import android.app.PendingIntent;
import android.app.Notification;
@@ -36,7 +33,6 @@
import android.inputmethodservice.InputMethodService;
import android.graphics.PixelFormat;
import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Handler;
import android.os.IBinder;
@@ -45,8 +41,6 @@
import android.os.ServiceManager;
import android.text.TextUtils;
import android.util.Slog;
-import android.view.animation.Animation;
-import android.view.animation.AnimationUtils;
import android.view.Gravity;
import android.view.IWindowManager;
import android.view.KeyEvent;
@@ -58,12 +52,10 @@
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
-import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.ScrollView;
-import android.widget.TextSwitcher;
import android.widget.TextView;
import com.android.internal.statusbar.StatusBarIcon;
@@ -271,7 +263,6 @@
mInputMethodsPanel = (InputMethodsPanel) View.inflate(context,
R.layout.status_bar_input_methods_panel, null);
mInputMethodsPanel.setHardKeyboardEnabledChangeListener(this);
- mInputMethodsPanel.setVisibility(View.GONE);
mInputMethodsPanel.setOnTouchListener(new TouchOutsideListener(
MSG_CLOSE_INPUT_METHODS_PANEL, mInputMethodsPanel));
mInputMethodsPanel.setImeSwitchButton(mInputMethodSwitchButton);
@@ -565,11 +556,11 @@
break;
case MSG_OPEN_INPUT_METHODS_PANEL:
if (DEBUG) Slog.d(TAG, "opening input methods panel");
- if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.VISIBLE);
+ if (mInputMethodsPanel != null) mInputMethodsPanel.openPanel();
break;
case MSG_CLOSE_INPUT_METHODS_PANEL:
if (DEBUG) Slog.d(TAG, "closing input methods panel");
- if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.GONE);
+ if (mInputMethodsPanel != null) mInputMethodsPanel.closePanel(false);
break;
case MSG_SHOW_CHROME:
if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)");
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 5806de2..9ee71e8 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -2924,26 +2924,6 @@
}
}
- if (pkg.reqFeatures != null) {
- int N = pkg.reqFeatures.size();
- for (int i = 0; i < N; i++) {
- FeatureInfo fi = pkg.reqFeatures.get(i);
- if ((fi.flags & FeatureInfo.FLAG_REQUIRED) == 0) {
- // Don't care.
- continue;
- }
-
- if (fi.name != null) {
- if (mAvailableFeatures.get(fi.name) == null) {
- Slog.e(TAG, "Package " + pkg.packageName
- + " requires unavailable feature " + fi.name + "; failing!");
- mLastScanError = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
- return null;
- }
- }
- }
- }
-
if (pkg.mSharedUserId != null) {
suid = mSettings.getSharedUserLP(pkg.mSharedUserId,
pkg.applicationInfo.flags, true);
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 2806774..17c3154 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -5787,11 +5787,7 @@
}
config.screenLayout = mScreenLayout;
- config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
- config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;
- mPolicy.adjustConfigurationLw(config);
-
- // Adjust the hard keyboard configuration based on whether the hard keyboard is enabled.
+ // Determine whether a hard keyboard is available and enabled.
boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
if (hardKeyboardAvailable != mHardKeyboardAvailable) {
mHardKeyboardAvailable = hardKeyboardAvailable;
@@ -5802,8 +5798,15 @@
}
if (!mHardKeyboardEnabled) {
config.keyboard = Configuration.KEYBOARD_NOKEYS;
- config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;
}
+
+ // Update value of keyboardHidden, hardKeyboardHidden and navigationHidden
+ // based on whether a hard or soft keyboard is present, whether navigation keys
+ // are present and the lid switch state.
+ config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO;
+ config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO;
+ config.navigationHidden = Configuration.NAVIGATIONHIDDEN_NO;
+ mPolicy.adjustConfigurationLw(config);
return true;
}
diff --git a/telephony/java/android/telephony/CellLocation.java b/telephony/java/android/telephony/CellLocation.java
index 2edfc23..5eaa5a0 100644
--- a/telephony/java/android/telephony/CellLocation.java
+++ b/telephony/java/android/telephony/CellLocation.java
@@ -61,9 +61,9 @@
* @hide
*/
public static CellLocation newFromBundle(Bundle bundle) {
- // TelephonyManager.getDefault().getPhoneType() handles the case when
+ // TelephonyManager.getDefault().getCurrentPhoneType() handles the case when
// ITelephony interface is not up yet.
- switch(TelephonyManager.getDefault().getPhoneType()) {
+ switch(TelephonyManager.getDefault().getCurrentPhoneType()) {
case Phone.PHONE_TYPE_CDMA:
return new CdmaCellLocation(bundle);
case Phone.PHONE_TYPE_GSM:
@@ -89,9 +89,9 @@
*
*/
public static CellLocation getEmpty() {
- // TelephonyManager.getDefault().getPhoneType() handles the case when
+ // TelephonyManager.getDefault().getCurrentPhoneType() handles the case when
// ITelephony interface is not up yet.
- switch(TelephonyManager.getDefault().getPhoneType()) {
+ switch(TelephonyManager.getDefault().getCurrentPhoneType()) {
case Phone.PHONE_TYPE_CDMA:
return new CdmaCellLocation();
case Phone.PHONE_TYPE_GSM:
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 88d9436..b0f0a43 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -276,15 +276,17 @@
public static final int PHONE_TYPE_SIP = Phone.PHONE_TYPE_SIP;
/**
- * Returns a constant indicating the device phone type. This
- * indicates the type of radio used to transmit voice calls.
+ * Returns the current phone type.
+ * TODO: This is a last minute change and hence hidden.
*
* @see #PHONE_TYPE_NONE
* @see #PHONE_TYPE_GSM
* @see #PHONE_TYPE_CDMA
* @see #PHONE_TYPE_SIP
+ *
+ * {@hide}
*/
- public int getPhoneType() {
+ public int getCurrentPhoneType() {
try{
ITelephony telephony = getITelephony();
if (telephony != null) {
@@ -304,6 +306,21 @@
}
}
+ /**
+ * Returns a constant indicating the device phone type. This
+ * indicates the type of radio used to transmit voice calls.
+ *
+ * @see #PHONE_TYPE_NONE
+ * @see #PHONE_TYPE_GSM
+ * @see #PHONE_TYPE_CDMA
+ * @see #PHONE_TYPE_SIP
+ */
+ public int getPhoneType() {
+ if (!isVoiceCapable()) {
+ return PHONE_TYPE_NONE;
+ }
+ return getCurrentPhoneType();
+ }
private int getPhoneTypeFromProperty() {
int type =
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index 2895b69..fc50334 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -78,6 +78,24 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+
+ <activity
+ android:name="ViewLayersActivity4"
+ android:label="_ViewLayers4">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
+ android:name="ViewLayersActivity5"
+ android:label="_ViewLayers5">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
<activity
android:name="AlphaLayersActivity"
diff --git a/tests/HwAccelerationTest/res/layout/view_layers_4.xml b/tests/HwAccelerationTest/res/layout/view_layers_4.xml
new file mode 100644
index 0000000..5436737
--- /dev/null
+++ b/tests/HwAccelerationTest/res/layout/view_layers_4.xml
@@ -0,0 +1,48 @@
+<?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:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1">
+
+ <Button
+ android:onClick="setListTranslucent"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Set translucent" />
+
+ <Button
+ android:onClick="setListOpaque"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Set opaque" />
+
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/list1"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+</LinearLayout>
diff --git a/tests/HwAccelerationTest/res/layout/view_layers_5.xml b/tests/HwAccelerationTest/res/layout/view_layers_5.xml
new file mode 100644
index 0000000..653f3a8
--- /dev/null
+++ b/tests/HwAccelerationTest/res/layout/view_layers_5.xml
@@ -0,0 +1,48 @@
+<?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:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1">
+
+ <Button
+ android:onClick="setLayerEnabled"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Enable layer" />
+
+ <Button
+ android:onClick="setLayerDisabled"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Disable layer" />
+
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/list1"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+</LinearLayout>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
new file mode 100644
index 0000000..6072c6e
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+package com.android.test.hwui;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class ViewLayersActivity4 extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.view_layers_4);
+
+ setupList(R.id.list1);
+ }
+
+ public void setListTranslucent(View v) {
+ findViewById(R.id.list1).setAlpha(0.5f);
+ }
+
+ public void setListOpaque(View v) {
+ findViewById(R.id.list1).setAlpha(1.0f);
+ }
+
+ private void setupList(int listId) {
+ final ListView list = (ListView) findViewById(listId);
+ list.setAdapter(new SimpleListAdapter(this));
+ list.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ }
+
+ private static class SimpleListAdapter extends ArrayAdapter<String> {
+ public SimpleListAdapter(Context context) {
+ super(context, android.R.layout.simple_list_item_1, DATA_LIST);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ TextView v = (TextView) super.getView(position, convertView, parent);
+ final Resources r = getContext().getResources();
+ final DisplayMetrics metrics = r.getDisplayMetrics();
+ v.setCompoundDrawablePadding((int) (6 * metrics.density + 0.5f));
+ v.setCompoundDrawablesWithIntrinsicBounds(r.getDrawable(R.drawable.icon),
+ null, null, null);
+ return v;
+ }
+ }
+
+ private static final String[] DATA_LIST = {
+ "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
+ "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
+ "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
+ "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
+ "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
+ "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil",
+ "British Indian Ocean Territory", "British Virgin Islands", "Brunei", "Bulgaria",
+ "Burkina Faso", "Burundi", "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
+ "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
+ "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
+ "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
+ "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
+ "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
+ "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
+ "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
+ "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
+ "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
+ "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
+ "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
+ "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
+ "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
+ "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
+ "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
+ "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
+ "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
+ "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
+ "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
+ "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
+ "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
+ "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
+ "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
+ "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
+ "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
+ "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
+ "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
+ "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
+ "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
+ "Ukraine", "United Arab Emirates", "United Kingdom",
+ "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
+ "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
+ "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
+ };
+}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
new file mode 100644
index 0000000..95a5b0d
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+package com.android.test.hwui;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class ViewLayersActivity5 extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.view_layers_5);
+
+ setupList(R.id.list1);
+ }
+
+ public void setLayerDisabled(View v) {
+ ((ViewGroup) findViewById(R.id.list1).getParent()).setChildrenLayersEnabled(false);
+ }
+
+ public void setLayerEnabled(View v) {
+ ((ViewGroup) findViewById(R.id.list1).getParent()).setChildrenLayersEnabled(true);
+ }
+
+ private void setupList(int listId) {
+ final Paint p = new Paint();
+ p.setColorFilter(new PorterDuffColorFilter(0xff00ff00, PorterDuff.Mode.MULTIPLY));
+
+ final ListView list = (ListView) findViewById(listId);
+ list.setAdapter(new SimpleListAdapter(this));
+ list.setLayerType(View.LAYER_TYPE_HARDWARE, p);
+ }
+
+ private static class SimpleListAdapter extends ArrayAdapter<String> {
+ public SimpleListAdapter(Context context) {
+ super(context, android.R.layout.simple_list_item_1, DATA_LIST);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ TextView v = (TextView) super.getView(position, convertView, parent);
+ final Resources r = getContext().getResources();
+ final DisplayMetrics metrics = r.getDisplayMetrics();
+ v.setCompoundDrawablePadding((int) (6 * metrics.density + 0.5f));
+ v.setCompoundDrawablesWithIntrinsicBounds(r.getDrawable(R.drawable.icon),
+ null, null, null);
+ return v;
+ }
+ }
+
+ private static final String[] DATA_LIST = {
+ "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
+ "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
+ "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
+ "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
+ "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
+ "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil",
+ "British Indian Ocean Territory", "British Virgin Islands", "Brunei", "Bulgaria",
+ "Burkina Faso", "Burundi", "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
+ "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
+ "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
+ "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
+ "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
+ "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
+ "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
+ "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
+ "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
+ "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
+ "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
+ "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
+ "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
+ "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
+ "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
+ "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
+ "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
+ "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
+ "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
+ "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
+ "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
+ "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
+ "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
+ "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
+ "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
+ "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
+ "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
+ "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
+ "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
+ "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
+ "Ukraine", "United Arab Emirates", "United Kingdom",
+ "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
+ "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
+ "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
+ };
+}