diff options
370 files changed, 2023 insertions, 2011 deletions
diff --git a/api/11.xml b/api/11.xml index 2180aea929c2..232f62c45fd9 100644 --- a/api/11.xml +++ b/api/11.xml @@ -29889,6 +29889,17 @@ visibility="public" > </method> +<method name="isRemoving" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="isResumed" return="boolean" abstract="false" @@ -53797,6 +53808,17 @@ visibility="public" > </field> +<field name="EXTRA_LOCAL_ONLY" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.intent.extra.LOCAL_ONLY"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_PHONE_NUMBER" type="java.lang.String" transient="false" @@ -137488,8 +137510,18 @@ <parameter name="values" type="Progress..."> </parameter> </method> +<field name="SERIAL_EXECUTOR" + type="java.util.concurrent.Executor" + transient="false" + volatile="false" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="THREAD_POOL_EXECUTOR" - type="java.util.concurrent.ThreadPoolExecutor" + type="java.util.concurrent.Executor" transient="false" volatile="false" static="true" diff --git a/api/current.xml b/api/current.xml index e34bc8ad3077..8b9f3812f943 100644 --- a/api/current.xml +++ b/api/current.xml @@ -53808,6 +53808,17 @@ visibility="public" > </field> +<field name="EXTRA_LOCAL_ONLY" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.intent.extra.LOCAL_ONLY"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_PHONE_NUMBER" type="java.lang.String" transient="false" @@ -137499,8 +137510,18 @@ <parameter name="values" type="Progress..."> </parameter> </method> +<field name="SERIAL_EXECUTOR" + type="java.util.concurrent.Executor" + transient="false" + volatile="false" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="THREAD_POOL_EXECUTOR" - type="java.util.concurrent.ThreadPoolExecutor" + type="java.util.concurrent.Executor" transient="false" volatile="false" static="true" @@ -225855,6 +225876,16 @@ visibility="public" > </field> +<field name="systemUiVisibility" + type="int" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="token" type="android.os.IBinder" transient="false" diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index 6388dc572a21..5bdc79d054b1 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -195,6 +195,13 @@ public class AccountManager { public static final String KEY_CALLER_UID = "callerUid"; public static final String KEY_CALLER_PID = "callerPid"; + /** + * Boolean, if set and 'customTokens' the authenticator is responsible for + * notifications. + * @hide + */ + public static final String KEY_NOTIFY_ON_FAILURE = "notifyOnAuthFailure"; + public static final String ACTION_AUTHENTICATOR_INTENT = "android.accounts.AccountAuthenticator"; public static final String AUTHENTICATOR_META_DATA_NAME = diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 2c99f14d2554..fb166097573c 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -897,6 +897,9 @@ public class AccountManagerService // let authenticator know the identity of the caller loginOptions.putInt(AccountManager.KEY_CALLER_UID, callerUid); loginOptions.putInt(AccountManager.KEY_CALLER_PID, callerPid); + if (notifyOnAuthFailure) { + loginOptions.putBoolean(AccountManager.KEY_NOTIFY_ON_FAILURE, true); + } } long identityToken = clearCallingIdentity(); @@ -964,7 +967,7 @@ public class AccountManagerService } Intent intent = result.getParcelable(AccountManager.KEY_INTENT); - if (intent != null && notifyOnAuthFailure) { + if (intent != null && notifyOnAuthFailure && !customTokens) { doNotification( account, result.getString(AccountManager.KEY_AUTH_FAILED_MESSAGE), intent); diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 7365670a9aaa..f4fa567e28fd 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -85,6 +85,7 @@ public class Dialog implements DialogInterface, Window.Callback, */ protected boolean mCancelable = true; + private String mCancelAndDismissTaken; private Message mCancelMessage; private Message mDismissMessage; private Message mShowMessage; @@ -1029,6 +1030,11 @@ public class Dialog implements DialogInterface, Window.Callback, * @param listener The {@link DialogInterface.OnCancelListener} to use. */ public void setOnCancelListener(final OnCancelListener listener) { + if (mCancelAndDismissTaken != null) { + throw new IllegalStateException( + "OnCancelListener is already taken by " + + mCancelAndDismissTaken + " and can not be replaced."); + } if (listener != null) { mCancelMessage = mListenersHandler.obtainMessage(CANCEL, listener); } else { @@ -1050,6 +1056,11 @@ public class Dialog implements DialogInterface, Window.Callback, * @param listener The {@link DialogInterface.OnDismissListener} to use. */ public void setOnDismissListener(final OnDismissListener listener) { + if (mCancelAndDismissTaken != null) { + throw new IllegalStateException( + "OnDismissListener is already taken by " + + mCancelAndDismissTaken + " and can not be replaced."); + } if (listener != null) { mDismissMessage = mListenersHandler.obtainMessage(DISMISS, listener); } else { @@ -1077,6 +1088,22 @@ public class Dialog implements DialogInterface, Window.Callback, mDismissMessage = msg; } + /** @hide */ + public boolean takeCancelAndDismissListeners(String msg, final OnCancelListener cancel, + final OnDismissListener dismiss) { + if (mCancelAndDismissTaken != null) { + mCancelAndDismissTaken = null; + } else if (mCancelMessage != null || mDismissMessage != null) { + return false; + } + + setOnCancelListener(cancel); + setOnDismissListener(dismiss); + mCancelAndDismissTaken = msg; + + return true; + } + /** * By default, this will use the owner Activity's suggested stream type. * diff --git a/core/java/android/app/DialogFragment.java b/core/java/android/app/DialogFragment.java index 8bdd086eb466..50953d72e24f 100644 --- a/core/java/android/app/DialogFragment.java +++ b/core/java/android/app/DialogFragment.java @@ -378,6 +378,12 @@ public class DialogFragment extends Fragment * default implementation simply instantiates and returns a {@link Dialog} * class. * + * <p><em>Note: DialogFragment own the {@link Dialog#setOnCancelListener + * Dialog.setOnCancelListener} and {@link Dialog#setOnDismissListener + * Dialog.setOnDismissListener} callbacks. You must not set them yourself.</em> + * To find out about these events, override {@link #onCancel(DialogInterface)} + * and {@link #onDismiss(DialogInterface)}.</p> + * * @param savedInstanceState The last saved instance state of the Fragment, * or null if this is a freshly created Fragment. * @@ -417,8 +423,10 @@ public class DialogFragment extends Fragment } mDialog.setOwnerActivity(getActivity()); mDialog.setCancelable(mCancelable); - mDialog.setOnCancelListener(this); - mDialog.setOnDismissListener(this); + if (!mDialog.takeCancelAndDismissListeners("DialogFragment", this, this)) { + throw new IllegalStateException( + "You can not set Dialog's OnCancelListener or OnDismissListener"); + } if (savedInstanceState != null) { Bundle dialogState = savedInstanceState.getBundle(SAVED_DIALOG_STATE_TAG); if (dialogState != null) { diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java index 61b43036ef3d..9246a1035087 100644 --- a/core/java/android/bluetooth/BluetoothA2dp.java +++ b/core/java/android/bluetooth/BluetoothA2dp.java @@ -50,15 +50,18 @@ public final class BluetoothA2dp implements BluetoothProfile { * profile. * * <p>This intent will have 3 extras: - * {@link #EXTRA_STATE} - The current state of the profile. - * {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile - * {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. + * <ul> + * <li> {@link #EXTRA_STATE} - The current state of the profile. </li> + * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile.</li> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li> + * </ul> * - * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of + * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_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. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_CONNECTION_STATE_CHANGED = @@ -69,14 +72,17 @@ public final class BluetoothA2dp implements BluetoothProfile { * profile. * * <p>This intent will have 3 extras: - * {@link #EXTRA_STATE} - The current state of the profile. - * {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile - * {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. + * <ul> + * <li> {@link #EXTRA_STATE} - The current state of the profile. </li> + * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile. </li> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li> + * </ul> * - * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of + * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of * {@link #STATE_PLAYING}, {@link #STATE_NOT_PLAYING}, * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_PLAYING_STATE_CHANGED = @@ -258,7 +264,7 @@ public final class BluetoothA2dp implements BluetoothProfile { /** * Check if A2DP profile is streaming music. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param device BluetoothDevice device */ @@ -281,11 +287,12 @@ public final class BluetoothA2dp implements BluetoothProfile { * * <p> This API will return false in scenarios like the A2DP * device is not in connected state etc. When this API returns, - * true, it is guaranteed that {@link #ACTION_SINK_STATE_CHANGED} + * true, it is guaranteed that {@link #ACTION_CONNECTION_STATE_CHANGED} * intent will be broadcasted with the state. Users can get the * state of the A2DP device from this intent. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. * * @param device Remote A2DP sink * @return false on immediate error, diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 24217d7dc011..254e2f813a04 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -748,6 +748,15 @@ public final class BluetoothDevice implements Parcelable { * outgoing connection to this remote device on given channel. * <p>The remote device will be authenticated and communication on this * socket will be encrypted. + * <p> Use this socket only if an authenticated socket link is possible. + * Authentication refers to the authentication of the link key to + * prevent man-in-the-middle type of attacks. + * For example, for Bluetooth 2.1 devices, if any of the devices does not + * have an input and output capability or just has the ability to + * display a numeric key, a secure socket connection is not possible. + * In such a case, use {#link createInsecureRfcommSocket}. + * For more details, refer to the Security Model section 5.2 (vol 3) of + * Bluetooth Core Specification version 2.1 + EDR. * <p>Use {@link BluetoothSocket#connect} to initiate the outgoing * connection. * <p>Valid RFCOMM channels are in range 1 to 30. @@ -775,6 +784,15 @@ public final class BluetoothDevice implements Parcelable { * determine which channel to connect to. * <p>The remote device will be authenticated and communication on this * socket will be encrypted. + * <p> Use this socket only if an authenticated socket link is possible. + * Authentication refers to the authentication of the link key to + * prevent man-in-the-middle type of attacks. + * For example, for Bluetooth 2.1 devices, if any of the devices does not + * have an input and output capability or just has the ability to + * display a numeric key, a secure socket connection is not possible. + * In such a case, use {#link createInsecureRfcommSocketToServiceRecord}. + * For more details, refer to the Security Model section 5.2 (vol 3) of + * Bluetooth Core Specification version 2.1 + EDR. * <p>Hint: If you are connecting to a Bluetooth serial board then try * using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. * However if you are connecting to an Android peer then please generate diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index a7e45182aa4f..fa5552096605 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -52,15 +52,17 @@ public final class BluetoothHeadset implements BluetoothProfile { * profile. * * <p>This intent will have 3 extras: - * {@link #EXTRA_STATE} - The current state of the profile. - * {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile - * {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. - * - * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of + * <ul> + * <li> {@link #EXTRA_STATE} - The current state of the profile. </li> + * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile. </li> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li> + * </ul> + * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_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. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_CONNECTION_STATE_CHANGED = @@ -71,14 +73,16 @@ public final class BluetoothHeadset implements BluetoothProfile { * A2DP profile. * * <p>This intent will have 3 extras: - * {@link #EXTRA_STATE} - The current state of the profile. - * {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile - * {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. - * - * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of + * <ul> + * <li> {@link #EXTRA_STATE} - The current state of the profile. </li> + * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile. </li> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li> + * </ul> + * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of * {@link #STATE_AUDIO_CONNECTED}, {@link #STATE_AUDIO_DISCONNECTED}, * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission + * to receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_AUDIO_STATE_CHANGED = @@ -90,29 +94,33 @@ public final class BluetoothHeadset implements BluetoothProfile { * vendor-specific event. * * <p>This intent will have 4 extras and 1 category. - * {@link BluetoothDevice#EXTRA_DEVICE} - The remote Bluetooth Device - * {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD} - The vendor specific - * command - * {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE} - The AT command - * type. - * Can be one of {@link #AT_CMD_TYPE_READ}, {@link #AT_CMD_TYPE_TEST}, - * or {@link #AT_CMD_TYPE_SET}, {@link #AT_CMD_TYPE_BASIC}, - * {@link #AT_CMD_TYPE_ACTION}. - * - * {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS} - Command arguments. + * <ul> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote Bluetooth Device + * </li> + * <li> {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD} - The vendor + * specific command </li> + * <li> {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE} - The AT + * command type which can be one of {@link #AT_CMD_TYPE_READ}, + * {@link #AT_CMD_TYPE_TEST}, or {@link #AT_CMD_TYPE_SET}, + * {@link #AT_CMD_TYPE_BASIC},{@link #AT_CMD_TYPE_ACTION}. </li> + * <li> {@link #EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS} - Command + * arguments. </li> + * </ul> * - * The category is the Company ID of the vendor defining the + *<p> The category is the Company ID of the vendor defining the * vendor-specific command. {@link BluetoothAssignedNumbers} * * For example, for Plantronics specific events * Category will be {@link #VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY}.55 * * <p> For example, an AT+XEVENT=foo,3 will get translated into - * EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD = +XEVENT - * EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE = AT_CMD_TYPE_SET - * EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS = foo, 3 - * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive. + * <ul> + * <li> EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD = +XEVENT </li> + * <li> EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE = AT_CMD_TYPE_SET </li> + * <li> EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS = foo, 3 </li> + * </ul> + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission + * to receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_VENDOR_SPECIFIC_HEADSET_EVENT = @@ -184,7 +192,7 @@ public final class BluetoothHeadset implements BluetoothProfile { "android.bluetooth.headset.intent.category.companyid"; /** - * Headset state when SCO audio is not connected + * Headset state when SCO audio is not connected. * This state can be one of * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of * {@link #ACTION_AUDIO_STATE_CHANGED} intent. @@ -192,7 +200,7 @@ public final class BluetoothHeadset implements BluetoothProfile { public static final int STATE_AUDIO_DISCONNECTED = 10; /** - * Headset state when SCO audio is connecting + * Headset state when SCO audio is connecting. * This state can be one of * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of * {@link #ACTION_AUDIO_STATE_CHANGED} intent. @@ -200,7 +208,7 @@ public final class BluetoothHeadset implements BluetoothProfile { public static final int STATE_AUDIO_CONNECTING = 11; /** - * Headset state when SCO audio is connected + * Headset state when SCO audio is connected. * This state can be one of * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of * {@link #ACTION_AUDIO_STATE_CHANGED} intent. @@ -410,7 +418,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * Stop Bluetooth Voice Recognition mode, and shut down the * Bluetooth audio path. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param device Bluetooth headset * @return false if there is no headset connected @@ -433,7 +441,7 @@ public final class BluetoothHeadset implements BluetoothProfile { /** * Check if Bluetooth SCO audio is connected. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param device Bluetooth headset * @return true if SCO is connected, @@ -674,26 +682,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return false; } - /** - * Send a AT command message to the headset. - * @param device Remote Bluetooth Device - * @param cmd The String to send. - * @hide - */ - public void sendAtCommand(BluetoothDevice device, String command) { - if (DBG) log("sendAtCommand()"); - if (mService != null && isEnabled() && isValidDevice(device)) { - try { - mService.sendAtCommand(device, command); - } catch (RemoteException e) { - Log.e(TAG, e.toString()); - } - } else { - Log.w(TAG, "Proxy not attached to service"); - if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable())); - } - } - private ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index 3949b26186eb..ef80195d935d 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -105,6 +105,7 @@ public interface BluetoothProfile { * from this intent. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, @@ -132,6 +133,7 @@ public interface BluetoothProfile { * two scenarios. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. * * @param device Remote Bluetooth Device * @return false on immediate error, @@ -145,20 +147,20 @@ public interface BluetoothProfile { * * <p> Return the set of devices which are in state {@link #STATE_CONNECTED} * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return List of devices. The list will be empty on error. */ public List<BluetoothDevice> getConnectedDevices(); /** - * Get a set of devices that match any of the given connection + * Get a list of devices that match any of the given connection * states. * - * <p> If none of devices match any of the given states, - * an empty set will be returned. + * <p> If none of the devices match any of the given states, + * an empty list will be returned. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param states Array of states. States can be one of * {@link #STATE_CONNECTED}, {@link #STATE_CONNECTING}, @@ -170,7 +172,7 @@ public interface BluetoothProfile { /** * Get the current connection state of the profile * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param device Remote bluetooth device. * @return State of the profile connection. One of @@ -187,6 +189,7 @@ public interface BluetoothProfile { * {@link #PRIORITY_OFF}, * * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. * * @param device Paired bluetooth device * @param priority @@ -202,7 +205,7 @@ public interface BluetoothProfile { * {@link #PRIORITY_AUTO_CONNECT}, {@link #PRIORITY_OFF}, * {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED} * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @param device Bluetooth device * @return priority of the device diff --git a/core/java/android/bluetooth/IBluetoothHeadset.aidl b/core/java/android/bluetooth/IBluetoothHeadset.aidl index 41f63b27721e..273cda73bea5 100644 --- a/core/java/android/bluetooth/IBluetoothHeadset.aidl +++ b/core/java/android/bluetooth/IBluetoothHeadset.aidl @@ -50,6 +50,4 @@ interface IBluetoothHeadset { boolean startScoUsingVirtualVoiceCall(in BluetoothDevice device); boolean stopScoUsingVirtualVoiceCall(in BluetoothDevice device); - - void sendAtCommand(in BluetoothDevice device, String urc); } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index ca5ff2446b0b..6e3663e341d5 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -859,11 +859,19 @@ public class Intent implements Parcelable, Cloneable { * only pick from data that can be represented as a stream. This is * accomplished by requiring the {@link #CATEGORY_OPENABLE} in the Intent. * <p> + * Callers can optionally specify {@link #EXTRA_LOCAL_ONLY} to request that + * the launched content chooser only return results representing data that + * is locally available on the device. For example, if this extra is set + * to true then an image picker should not show any pictures that are available + * from a remote server but not already on the local device (thus requiring + * they be downloaded when opened). + * <p> * Input: {@link #getType} is the desired MIME type to retrieve. Note * that no URI is supplied in the intent, as there are no constraints on * where the returned data originally comes from. You may also include the * {@link #CATEGORY_OPENABLE} if you can only accept data that can be - * opened as a stream. + * opened as a stream. You may use {@link #EXTRA_LOCAL_ONLY} to limit content + * selection to local data. * <p> * Output: The URI of the item that was picked. This must be a content: * URI so that any receiver can access it. @@ -2397,6 +2405,18 @@ public class Intent implements Parcelable, Cloneable { public static final String EXTRA_CLIENT_INTENT = "android.intent.extra.client_intent"; + /** + * Used to indicate that a {@link #ACTION_GET_CONTENT} intent should only return + * data that is on the local device. This is a boolean extra; the default + * is false. If true, an implementation of ACTION_GET_CONTENT should only allow + * the user to select media that is already on the device, not requiring it + * be downloaded from a remote service when opened. Another way to look + * at it is that such content should generally have a "_data" column to the + * path of the content on local external storage. + */ + public static final String EXTRA_LOCAL_ONLY = + "android.intent.extra.LOCAL_ONLY"; + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Intent flags (see mFlags variable). diff --git a/core/java/android/os/AsyncTask.java b/core/java/android/os/AsyncTask.java index 5a35eb050482..1803604a85ee 100644 --- a/core/java/android/os/AsyncTask.java +++ b/core/java/android/os/AsyncTask.java @@ -166,13 +166,17 @@ public abstract class AsyncTask<Params, Progress, Result> { new LinkedBlockingQueue<Runnable>(10); /** - * A {@link ThreadPoolExecutor} that can be used to execute tasks in parallel. + * An {@link Executor} that can be used to execute tasks in parallel. */ - public static final ThreadPoolExecutor THREAD_POOL_EXECUTOR + public static final Executor THREAD_POOL_EXECUTOR = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, KEEP_ALIVE, TimeUnit.SECONDS, sPoolWorkQueue, sThreadFactory); - private static final SerialExecutor sSerialExecutor = new SerialExecutor(); + /** + * An {@link Executor} that executes tasks one at a time in serial + * order. This serialization is global to a particular process. + */ + public static final Executor SERIAL_EXECUTOR = new SerialExecutor(); private static final int MESSAGE_POST_RESULT = 0x1; private static final int MESSAGE_POST_PROGRESS = 0x2; @@ -468,13 +472,21 @@ public abstract class AsyncTask<Params, Progress, Result> { /** * Executes the task with the specified parameters. The task returns - * itself (this) so that the caller can keep a reference to it. The tasks - * started by all invocations of this method in a given process are run - * sequentially. Call the executeOnExecutor(Executor,Params...) - * with a custom {@link Executor} to have finer grained control over how the - * tasks are run. - * - * This method must be invoked on the UI thread. + * itself (this) so that the caller can keep a reference to it. + * + * <p>Note: this function schedules the task on a queue for a single background + * thread or pool of threads depending on the platform version. When first + * introduced, AsyncTasks were executed serially on a single background thread. + * Starting with {@link android.os.Build.VERSION_CODES#DONUT}, this was changed + * to a pool of threads allowing multiple tasks to operate in parallel. After + * {@link android.os.Build.VERSION_CODES#HONEYCOMB}, it is planned to change this + * back to a single thread to avoid common application errors caused + * by parallel execution. If you truly want parallel execution, you can use + * the {@link #executeOnExecutor} version of this method + * with {@link #THREAD_POOL_EXECUTOR}; however, see commentary there for warnings on + * its use. + * + * <p>This method must be invoked on the UI thread. * * @param params The parameters of the task. * @@ -484,14 +496,30 @@ public abstract class AsyncTask<Params, Progress, Result> { * {@link AsyncTask.Status#RUNNING} or {@link AsyncTask.Status#FINISHED}. */ public final AsyncTask<Params, Progress, Result> execute(Params... params) { - return executeOnExecutor(sSerialExecutor, params); + return executeOnExecutor(THREAD_POOL_EXECUTOR, params); } /** * Executes the task with the specified parameters. The task returns * itself (this) so that the caller can keep a reference to it. - * - * This method must be invoked on the UI thread. + * + * <p>This method is typically used with {@link #THREAD_POOL_EXECUTOR} to + * allow multiple tasks to run in parallel on a pool of threads managed by + * AsyncTask, however you can also use your own {@link Executor} for custom + * behavior. + * + * <p><em>Warning:</em> Allowing multiple tasks to run in parallel from + * a thread pool is generally <em>not</em> what one wants, because the order + * of their operation is not defined. For example, if these tasks are used + * to modify any state in common (such as writing a file due to a button click), + * there are no guarantees on the order of the modifications. + * Without careful work it is possible in rare cases for the newer version + * of the data to be over-written by an older one, leading to obscure data + * loss and stability issues. Such changes are best + * executed in serial; to guarantee such work is serialized regardless of + * platform version you can use this function with {@link #SERIAL_EXECUTOR}. + * + * <p>This method must be invoked on the UI thread. * * @param exec The executor to use. {@link #THREAD_POOL_EXECUTOR} is available as a * convenient process-wide thread pool for tasks that are loosely coupled. @@ -527,11 +555,11 @@ public abstract class AsyncTask<Params, Progress, Result> { } /** - * Schedules the {@link Runnable} in serial with the other AsyncTasks that were started - * with {@link #execute}. + * Convenience version of {@link #execute(Object...)} for use with + * a simple Runnable object. */ public static void execute(Runnable runnable) { - sSerialExecutor.execute(runnable); + THREAD_POOL_EXECUTOR.execute(runnable); } /** diff --git a/core/java/android/os/storage/IObbActionListener.java b/core/java/android/os/storage/IObbActionListener.java index d6fa58af5bba..35da4b097ee5 100644 --- a/core/java/android/os/storage/IObbActionListener.java +++ b/core/java/android/os/storage/IObbActionListener.java @@ -112,7 +112,8 @@ public interface IObbActionListener extends IInterface { _data.writeString(filename); _data.writeInt(nonce); _data.writeInt(status); - mRemote.transact(Stub.TRANSACTION_onObbResult, _data, _reply, 0); + mRemote.transact(Stub.TRANSACTION_onObbResult, _data, _reply, + android.os.IBinder.FLAG_ONEWAY); _reply.readException(); } finally { _reply.recycle(); diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index cd3bc3e7c32a..7456acd33360 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -648,7 +648,8 @@ class BluetoothEventLoop { } else { Log.i(TAG, "Rejecting incoming A2DP / AVRCP connection from " + address); } - } else if (BluetoothUuid.isInputDevice(uuid) && !isOtherInputDeviceConnected(address)) { + } else if (BluetoothUuid.isInputDevice(uuid) && !isOtherInputDeviceConnected(address) && + isKeyboard(address)) { BluetoothInputDevice inputDevice = new BluetoothInputDevice(mContext); authorized = inputDevice.getInputDevicePriority(device) > BluetoothInputDevice.PRIORITY_OFF; @@ -667,6 +668,17 @@ class BluetoothEventLoop { return authorized; } + private boolean isKeyboard(String address) { + BluetoothClass btClass = new BluetoothClass(mBluetoothService.getRemoteClass(address)); + int btDeviceClass = btClass.getDeviceClass(); + if (btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD || + btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD_POINTING) { + return true; + } + log("Incoming Connect: Input device class: " + btDeviceClass + " Not a keyboard"); + return false; + } + private boolean isOtherInputDeviceConnected(String address) { List<BluetoothDevice> devices = mBluetoothService.lookupInputDevicesMatchingStates(new int[] { diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index dd888380d952..5608603daf90 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -1729,6 +1729,15 @@ public class BluetoothService extends IBluetooth.Stub { getInputDevicePriority(device) == BluetoothInputDevice.PRIORITY_OFF) { return false; } + + BluetoothClass btClass = new BluetoothClass(getRemoteClass(device.getAddress())); + int btDeviceClass = btClass.getDeviceClass(); + if (btDeviceClass != BluetoothClass.Device.PERIPHERAL_KEYBOARD && + btDeviceClass != BluetoothClass.Device.PERIPHERAL_KEYBOARD_POINTING) { + log("Input device btDeviceClass: " + btDeviceClass + " Not a keyboard"); + return false; + } + BluetoothDeviceProfileState state = mDeviceProfileState.get(device.getAddress()); if (state != null) { Message msg = new Message(); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 65d2e11ae0e6..3ed75493241b 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4750,7 +4750,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } void performCollectViewAttributes(int visibility) { - if ((visibility & VISIBILITY_MASK) == VISIBLE) { + if ((visibility & VISIBILITY_MASK) == VISIBLE && mAttachInfo != null) { if ((mViewFlags & KEEP_SCREEN_ON) == KEEP_SCREEN_ON) { mAttachInfo.mKeepScreenOn = true; } @@ -8249,7 +8249,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // If we got here, we're recreating it. Mark it as such to ensure that // we copy in child display lists into ours in drawChild() mRecreateDisplayList = true; - if (mDisplayList == null) { mDisplayList = mAttachInfo.mHardwareRenderer.createDisplayList(this); // If we're creating a new display list, make sure our parent gets invalidated @@ -8287,6 +8286,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mDisplayList.end(); } + } else { + mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID; + mPrivateFlags &= ~DIRTY_MASK; } return mDisplayList; @@ -10805,6 +10807,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** */ public void dispatchSystemUiVisibilityChanged(int visibility) { + mSystemUiVisibility = visibility; if (mOnSystemUiVisibilityChangeListener != null) { mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility); } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index f198c4678dae..9e5b23ccca09 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3497,7 +3497,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager ((ViewRoot) parent).invalidate(); parent = null; } else if (view != null) { - if ((mPrivateFlags & DRAWN) == DRAWN) { + if ((view.mPrivateFlags & DRAWN) == DRAWN || + (view.mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID) { view.mPrivateFlags &= ~DRAWING_CACHE_VALID; view.mPrivateFlags |= DIRTY; parent = view.mParent; @@ -3594,7 +3595,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE_CHILD_IN_PARENT); } - if ((mPrivateFlags & DRAWN) == DRAWN) { + if ((mPrivateFlags & DRAWN) == DRAWN || + (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID) { if ((mGroupFlags & (FLAG_OPTIMIZE_INVALIDATE | FLAG_ANIMATION_DONE)) != FLAG_OPTIMIZE_INVALIDATE) { dirty.offset(location[CHILD_LEFT_INDEX] - mScrollX, diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index ca19da266e17..042095a14d69 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -784,6 +784,7 @@ public final class ViewRoot extends Handler implements ViewParent, Bitmap.Config.ARGB_8888); mResizeBitmap.setHasAlpha(false); Canvas canvas = new Canvas(mResizeBitmap); + canvas.drawColor(0xff000000, PorterDuff.Mode.SRC); int yoff; final boolean scrolling = mScroller != null && mScroller.computeScrollOffset(); @@ -902,8 +903,9 @@ public final class ViewRoot extends Handler implements ViewParent, attachInfo.mSystemUiVisibility = 0; attachInfo.mHasSystemUiListeners = false; host.dispatchCollectViewAttributes(0); - if (attachInfo.mKeepScreenOn != oldScreenOn || - attachInfo.mSystemUiVisibility != oldVis) { + if (attachInfo.mKeepScreenOn != oldScreenOn + || attachInfo.mSystemUiVisibility != oldVis + || attachInfo.mHasSystemUiListeners) { params = lp; } } @@ -986,8 +988,10 @@ public final class ViewRoot extends Handler implements ViewParent, if (attachInfo.mKeepScreenOn) { params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; } - params.systemUiVisibility = attachInfo.mSystemUiVisibility; - params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners; + params.subtreeSystemUiVisibility = attachInfo.mSystemUiVisibility; + params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners + || params.subtreeSystemUiVisibility != 0 + || params.systemUiVisibility != 0; } if (DEBUG_LAYOUT) { Log.i(TAG, "host=w:" + host.getMeasuredWidth() + ", h:" + @@ -1500,7 +1504,12 @@ public final class ViewRoot extends Handler implements ViewParent, mPreviousDirty.set(dirty); dirty.setEmpty(); - mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this, mCurrentDirty); + Rect currentDirty = mCurrentDirty; + if (animating) { + currentDirty = null; + } + + mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this, currentDirty); } if (animating) { @@ -2848,6 +2857,9 @@ public final class ViewRoot extends Handler implements ViewParent, public void handleDispatchSystemUiVisibilityChanged(int visibility) { if (mView == null) return; + if (mAttachInfo != null) { + mAttachInfo.mSystemUiVisibility = visibility; + } mView.dispatchSystemUiVisibilityChanged(visibility); } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 491a79f1557d..c26fa933cecd 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -953,11 +953,20 @@ public interface WindowManager extends ViewManager { /** * Control the visibility of the status bar. - * @hide + * + * @see View#STATUS_BAR_VISIBLE + * @see View#STATUS_BAR_HIDDEN */ public int systemUiVisibility; /** + * @hide + * The ui visibility as requested by the views in this hierarchy. + * the combined value should be systemUiVisibility | subtreeSystemUiVisibility. + */ + public int subtreeSystemUiVisibility; + + /** * Get callbacks about the system ui visibility changing. * * TODO: Maybe there should be a bitfield of optional callbacks that we need. @@ -1046,6 +1055,7 @@ public interface WindowManager extends ViewManager { TextUtils.writeToParcel(mTitle, out, parcelableFlags); out.writeInt(screenOrientation); out.writeInt(systemUiVisibility); + out.writeInt(subtreeSystemUiVisibility); out.writeInt(hasSystemUiListeners ? 1 : 0); } @@ -1083,6 +1093,7 @@ public interface WindowManager extends ViewManager { mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); screenOrientation = in.readInt(); systemUiVisibility = in.readInt(); + subtreeSystemUiVisibility = in.readInt(); hasSystemUiListeners = in.readInt() != 0; } @@ -1212,8 +1223,10 @@ public interface WindowManager extends ViewManager { changes |= SCREEN_ORIENTATION_CHANGED; } - if (systemUiVisibility != o.systemUiVisibility) { + if (systemUiVisibility != o.systemUiVisibility + || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) { systemUiVisibility = o.systemUiVisibility; + subtreeSystemUiVisibility = o.subtreeSystemUiVisibility; changes |= SYSTEM_UI_VISIBILITY_CHANGED; } @@ -1298,6 +1311,10 @@ public interface WindowManager extends ViewManager { sb.append(" sysui=0x"); sb.append(Integer.toHexString(systemUiVisibility)); } + if (subtreeSystemUiVisibility != 0) { + sb.append(" vsysui=0x"); + sb.append(Integer.toHexString(subtreeSystemUiVisibility)); + } if (hasSystemUiListeners) { sb.append(" sysuil="); sb.append(hasSystemUiListeners); diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index ca45e68af64b..1d5d08f91708 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -4087,7 +4087,9 @@ public class WebView extends AbsoluteLayout df = mScrollFilter; } canvas.setDrawFilter(df); - int content = nativeDraw(canvas, color, extras, true); + // XXX: Revisit splitting content. Right now it causes a + // synchronization problem with layers. + int content = nativeDraw(canvas, color, extras, false); canvas.setDrawFilter(null); if (content != 0) { mWebViewCore.sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0); @@ -8073,7 +8075,7 @@ public class WebView extends AbsoluteLayout + " mLastCursorTime=" + mLastCursorTime + " handled=" + keyHandled); } - if (keyHandled == false || mHeightCanMeasure == false) { + if (keyHandled == false) { return keyHandled; } Rect contentCursorRingBounds = nativeGetCursorRingBounds(); @@ -8082,6 +8084,9 @@ public class WebView extends AbsoluteLayout // set last touch so that context menu related functions will work mLastTouchX = (viewCursorRingBounds.left + viewCursorRingBounds.right) / 2; mLastTouchY = (viewCursorRingBounds.top + viewCursorRingBounds.bottom) / 2; + if (mHeightCanMeasure == false) { + return keyHandled; + } Rect visRect = new Rect(); calcOurVisibleRect(visRect); Rect outset = new Rect(visRect); diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java index 23a1a5ce7b64..d596339e95a5 100644 --- a/core/java/android/widget/AdapterViewAnimator.java +++ b/core/java/android/widget/AdapterViewAnimator.java @@ -252,7 +252,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> * being removed * @param view The view that is being animated */ - void animateViewForTransition(int fromIndex, int toIndex, View view) { + void transformViewForTransition(int fromIndex, int toIndex, View view, boolean animate) { if (fromIndex == -1) { mInAnimation.setTarget(view); mInAnimation.start(); @@ -479,7 +479,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> int oldRelativeIndex = mViewsMap.get(index).index; mPreviousViews.add(index); - animateViewForTransition(oldRelativeIndex, -1, previousView); + transformViewForTransition(oldRelativeIndex, -1, previousView, animate); } } @@ -507,7 +507,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> View view = mViewsMap.get(index).view; mViewsMap.get(index).index = newRelativeIndex; applyTransformForChildAtIndex(view, newRelativeIndex); - animateViewForTransition(oldRelativeIndex, newRelativeIndex, view); + transformViewForTransition(oldRelativeIndex, newRelativeIndex, view, animate); // Otherwise this view is new to the window } else { @@ -525,7 +525,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> mViewsMap.put(index, new ViewAndIndex(fl, newRelativeIndex)); addChild(fl); applyTransformForChildAtIndex(fl, newRelativeIndex); - animateViewForTransition(-1, newRelativeIndex, fl); + transformViewForTransition(-1, newRelativeIndex, fl, animate); } mViewsMap.get(index).view.bringToFront(); } @@ -701,9 +701,9 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> if (mWhichChild >= getWindowSize()) { mWhichChild = 0; - showOnly(mWhichChild, true); + showOnly(mWhichChild, false); } else if (mOldItemCount != getCount()) { - showOnly(mWhichChild, true); + showOnly(mWhichChild, false); } refreshChildren(); requestLayout(); @@ -930,7 +930,8 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> mItemCount = mAdapter.getCount(); } setFocusable(true); - setDisplayedChild(0); + mWhichChild = 0; + showOnly(mWhichChild, false); } /** diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java index 03c073c3d10b..d57d5c682883 100644 --- a/core/java/android/widget/StackView.java +++ b/core/java/android/widget/StackView.java @@ -69,7 +69,7 @@ public class StackView extends AdapterViewAnimator { private float mNewPerspectiveShiftY; @SuppressWarnings({"FieldCanBeLocal"}) - private static final float PERSPECTIVE_SCALE_FACTOR = 0.f; + private static final float PERSPECTIVE_SCALE_FACTOR = 0f; /** * Represent the two possible stack modes, one where items slide up, and the other @@ -193,19 +193,16 @@ public class StackView extends AdapterViewAnimator { /** * Animate the views between different relative indexes within the {@link AdapterViewAnimator} */ - void animateViewForTransition(int fromIndex, int toIndex, final View view) { + void transformViewForTransition(int fromIndex, int toIndex, final View view, boolean animate) { ObjectAnimator alphaOa = null; ObjectAnimator oldAlphaOa = null; - // If there is currently an alpha animation on this view, we need - // to know about it, and may need to cancel it so as not to interfere with - // a new alpha animation. - Object tag = view.getTag(com.android.internal.R.id.viewAlphaAnimation); - if (tag instanceof WeakReference<?>) { - Object obj = ((WeakReference<?>) tag).get(); - if (obj instanceof ObjectAnimator) { - oldAlphaOa = (ObjectAnimator) obj; - } + if (!animate) { + ((StackFrame) view).cancelSliderAnimator(); + view.setRotationX(0f); + LayoutParams lp = (LayoutParams) view.getLayoutParams(); + lp.setVerticalOffset(0); + lp.setHorizontalOffset(0); } if (fromIndex == -1 && toIndex == getNumActiveViews() -1) { @@ -216,63 +213,87 @@ public class StackView extends AdapterViewAnimator { transformViewAtIndex(toIndex, view, false); view.setVisibility(VISIBLE); - alphaOa = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 1.0f); - alphaOa.setDuration(FADE_IN_ANIMATION_DURATION); - if (oldAlphaOa != null) oldAlphaOa.cancel(); - alphaOa.start(); - view.setTagInternal(com.android.internal.R.id.viewAlphaAnimation, - new WeakReference<ObjectAnimator>(alphaOa)); + ((StackFrame) view).cancelAlphaAnimator(); + if (animate) { + alphaOa = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 1.0f); + alphaOa.setDuration(FADE_IN_ANIMATION_DURATION); + ((StackFrame) view).setAlphaAnimator(alphaOa); + alphaOa.start(); + } else { + view.setAlpha(1.0f); + } } else if (fromIndex == 0 && toIndex == 1) { // Slide item in + ((StackFrame) view).cancelSliderAnimator(); view.setVisibility(VISIBLE); int duration = Math.round(mStackSlider.getDurationForNeutralPosition(mYVelocity)); - StackSlider animationSlider = new StackSlider(mStackSlider); animationSlider.setView(view); - PropertyValuesHolder slideInY = PropertyValuesHolder.ofFloat("YProgress", 0.0f); - PropertyValuesHolder slideInX = PropertyValuesHolder.ofFloat("XProgress", 0.0f); - ObjectAnimator slideIn = ObjectAnimator.ofPropertyValuesHolder(animationSlider, - slideInX, slideInY); - slideIn.setDuration(duration); - slideIn.setInterpolator(new LinearInterpolator()); - slideIn.start(); + + if (animate) { + PropertyValuesHolder slideInY = PropertyValuesHolder.ofFloat("YProgress", 0.0f); + PropertyValuesHolder slideInX = PropertyValuesHolder.ofFloat("XProgress", 0.0f); + ObjectAnimator slideIn = ObjectAnimator.ofPropertyValuesHolder(animationSlider, + slideInX, slideInY); + slideIn.setDuration(duration); + slideIn.setInterpolator(new LinearInterpolator()); + ((StackFrame) view).setSliderAnimator(slideIn); + slideIn.start(); + } else { + animationSlider.setYProgress(0f); + animationSlider.setXProgress(0f); + } } else if (fromIndex == 1 && toIndex == 0) { // Slide item out + ((StackFrame) view).cancelSliderAnimator(); int duration = Math.round(mStackSlider.getDurationForOffscreenPosition(mYVelocity)); StackSlider animationSlider = new StackSlider(mStackSlider); animationSlider.setView(view); - PropertyValuesHolder slideOutY = PropertyValuesHolder.ofFloat("YProgress", 1.0f); - PropertyValuesHolder slideOutX = PropertyValuesHolder.ofFloat("XProgress", 0.0f); - ObjectAnimator slideOut = ObjectAnimator.ofPropertyValuesHolder(animationSlider, - slideOutX, slideOutY); - slideOut.setDuration(duration); - slideOut.setInterpolator(new LinearInterpolator()); - slideOut.start(); + if (animate) { + PropertyValuesHolder slideOutY = PropertyValuesHolder.ofFloat("YProgress", 1.0f); + PropertyValuesHolder slideOutX = PropertyValuesHolder.ofFloat("XProgress", 0.0f); + ObjectAnimator slideOut = ObjectAnimator.ofPropertyValuesHolder(animationSlider, + slideOutX, slideOutY); + slideOut.setDuration(duration); + slideOut.setInterpolator(new LinearInterpolator()); + ((StackFrame) view).setSliderAnimator(slideOut); + slideOut.start(); + } else { + animationSlider.setYProgress(1.0f); + animationSlider.setXProgress(0f); + } } else if (toIndex == 0) { // Make sure this view that is "waiting in the wings" is invisible view.setAlpha(0.0f); view.setVisibility(INVISIBLE); - } else if (fromIndex == 0 && toIndex > 1) { + } else if ((fromIndex == 0 || fromIndex == 1) && toIndex > 1) { view.setVisibility(VISIBLE); view.setAlpha(1.0f); + view.setRotationX(0f); + LayoutParams lp = (LayoutParams) view.getLayoutParams(); + lp.setVerticalOffset(0); + lp.setHorizontalOffset(0); } else if (fromIndex == -1) { view.setAlpha(1.0f); view.setVisibility(VISIBLE); } else if (toIndex == -1) { // Fade item out - alphaOa = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 0.0f); - alphaOa.setDuration(STACK_RELAYOUT_DURATION); - if (oldAlphaOa != null) oldAlphaOa.cancel(); - alphaOa.start(); - view.setTagInternal(com.android.internal.R.id.viewAlphaAnimation, - new WeakReference<ObjectAnimator>(alphaOa)); + ((StackFrame) view).cancelAlphaAnimator(); + if (animate) { + alphaOa = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 0.0f); + alphaOa.setDuration(STACK_RELAYOUT_DURATION); + ((StackFrame) view).setAlphaAnimator(alphaOa); + alphaOa.start(); + } else { + view.setAlpha(0f); + } } // Implement the faked perspective if (toIndex != -1) { - transformViewAtIndex(toIndex, view, true); + transformViewAtIndex(toIndex, view, animate); } } @@ -304,12 +325,8 @@ public class StackView extends AdapterViewAnimator { // If this view is currently being animated for a certain position, we need to cancel // this animation so as not to interfere with the new transformation. - Object tag = view.getTag(com.android.internal.R.id.viewAnimation); - if (tag instanceof WeakReference<?>) { - Object obj = ((WeakReference<?>) tag).get(); - if (obj instanceof ObjectAnimator) { - ((ObjectAnimator) obj).cancel(); - } + if (view instanceof StackFrame) { + ((StackFrame) view).cancelTransformAnimator(); } if (animate) { @@ -321,8 +338,9 @@ public class StackView extends AdapterViewAnimator { ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(view, scalePropX, scalePropY, translationY, translationX); oa.setDuration(STACK_RELAYOUT_DURATION); - view.setTagInternal(com.android.internal.R.id.viewAnimation, - new WeakReference<ObjectAnimator>(oa)); + if (view instanceof StackFrame) { + ((StackFrame) view).setTransformAnimator(oa); + } oa.start(); } else { view.setTranslationX(transX); @@ -396,6 +414,9 @@ public class StackView extends AdapterViewAnimator { if (v != null) v.bringToFront(); } } + if (mHighlight != null) { + mHighlight.bringToFront(); + } mTransitionIsSetup = false; mClickFeedbackIsValid = false; } @@ -436,9 +457,64 @@ public class StackView extends AdapterViewAnimator { } } + private static class StackFrame extends FrameLayout { + WeakReference<ObjectAnimator> alphaAnimator; + WeakReference<ObjectAnimator> transformAnimator; + WeakReference<ObjectAnimator> sliderAnimator; + + public StackFrame(Context context) { + super(context); + } + + void setAlphaAnimator(ObjectAnimator oa) { + alphaAnimator = new WeakReference<ObjectAnimator>(oa); + } + + void setTransformAnimator(ObjectAnimator oa) { + transformAnimator = new WeakReference<ObjectAnimator>(oa); + } + + void setSliderAnimator(ObjectAnimator oa) { + sliderAnimator = new WeakReference<ObjectAnimator>(oa); + } + + boolean cancelAlphaAnimator() { + if (alphaAnimator != null) { + ObjectAnimator oa = alphaAnimator.get(); + if (oa != null) { + oa.cancel(); + return true; + } + } + return false; + } + + boolean cancelTransformAnimator() { + if (transformAnimator != null) { + ObjectAnimator oa = transformAnimator.get(); + if (oa != null) { + oa.cancel(); + return true; + } + } + return false; + } + + boolean cancelSliderAnimator() { + if (sliderAnimator != null) { + ObjectAnimator oa = sliderAnimator.get(); + if (oa != null) { + oa.cancel(); + return true; + } + } + return false; + } + } + @Override FrameLayout getFrameForChild() { - FrameLayout fl = new FrameLayout(mContext); + StackFrame fl = new StackFrame(mContext); fl.setPadding(mFramePadding, mFramePadding, mFramePadding, mFramePadding); return fl; } @@ -471,16 +547,26 @@ public class StackView extends AdapterViewAnimator { private void onLayout() { if (!mFirstLayoutHappened) { mSlideAmount = Math.round(SLIDE_UP_RATIO * getMeasuredHeight()); - updateChildTransforms(); mSwipeThreshold = Math.round(SWIPE_THRESHOLD_RATIO * mSlideAmount); mFirstLayoutHappened = true; + post(new Runnable() { + public void run() { + updateChildTransforms(); + } + }); } if (Float.compare(mPerspectiveShiftY, mNewPerspectiveShiftY) != 0 || Float.compare(mPerspectiveShiftX, mNewPerspectiveShiftX) != 0) { + mPerspectiveShiftY = mNewPerspectiveShiftY; mPerspectiveShiftX = mNewPerspectiveShiftX; - updateChildTransforms(); + + post(new Runnable() { + public void run() { + updateChildTransforms(); + } + }); } } @@ -1034,11 +1120,11 @@ public class StackView extends AdapterViewAnimator { mNewPerspectiveShiftX = PERSPECTIVE_SHIFT_FACTOR_X * measuredWidth; mNewPerspectiveShiftY = PERSPECTIVE_SHIFT_FACTOR_Y * measuredHeight; - if (maxWidth > 0 && maxWidth < childWidth) { + if (maxWidth > 0 && count > 0 && maxWidth < childWidth) { mNewPerspectiveShiftX = measuredWidth - maxWidth; } - if (maxHeight > 0 && maxHeight < childHeight) { + if (maxHeight > 0 && count > 0 && maxHeight < childHeight) { mNewPerspectiveShiftY = measuredHeight - maxHeight; } } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index ae6ecfbae90f..fedda686b712 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8596,7 +8596,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private long mTouchTimer; private boolean mIsInsertionHandle = false; private PastePopupMenu mPastePopupWindow; - private Runnable mLongPressCallback; // Touch-up filter: number of previous positions remembered private static final int HISTORY_SIZE = 5; @@ -8839,73 +8838,49 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override public boolean onTouchEvent(MotionEvent ev) { switch (ev.getActionMasked()) { - case MotionEvent.ACTION_DOWN: { - startTouchUpFilter(mController.getCurrentOffset(this)); - mDownPositionX = ev.getRawX(); - mDownPositionY = ev.getRawY(); - mTouchToWindowOffsetX = mDownPositionX - mPositionX; - mTouchToWindowOffsetY = mDownPositionY - mPositionY; - final int[] coords = mTempCoords; - TextView.this.getLocationInWindow(coords); - mLastParentX = coords[0]; - mLastParentY = coords[1]; - mIsDragging = true; - if (mIsInsertionHandle) { - mTouchTimer = SystemClock.uptimeMillis(); - if (mLongPressCallback == null) { - mLongPressCallback = new Runnable() { - public void run() { - mController.hide(); - startSelectionActionMode(); - } - }; - } - postDelayed(mLongPressCallback, ViewConfiguration.getLongPressTimeout()); + case MotionEvent.ACTION_DOWN: { + startTouchUpFilter(mController.getCurrentOffset(this)); + mDownPositionX = ev.getRawX(); + mDownPositionY = ev.getRawY(); + mTouchToWindowOffsetX = mDownPositionX - mPositionX; + mTouchToWindowOffsetY = mDownPositionY - mPositionY; + final int[] coords = mTempCoords; + TextView.this.getLocationInWindow(coords); + mLastParentX = coords[0]; + mLastParentY = coords[1]; + mIsDragging = true; + break; } - break; - } - case MotionEvent.ACTION_MOVE: { - final float rawX = ev.getRawX(); - final float rawY = ev.getRawY(); - final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX; - final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY; + case MotionEvent.ACTION_MOVE: { + final float rawX = ev.getRawX(); + final float rawY = ev.getRawY(); + final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX; + final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY; - mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY)); - - if (mIsInsertionHandle) { - final float dx = rawX - mDownPositionX; - final float dy = rawY - mDownPositionY; - final float distanceSquared = dx * dx + dy * dy; - if (distanceSquared >= mSquaredTouchSlopDistance) { - removeLongPressCallback(); - } + mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY)); + break; } - break; - } - case MotionEvent.ACTION_UP: - if (mIsInsertionHandle) { - removeLongPressCallback(); - long delay = SystemClock.uptimeMillis() - mTouchTimer; - if (delay < ViewConfiguration.getTapTimeout()) { - if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) { - // Tapping on the handle dismisses the displayed paste view, - mPastePopupWindow.hide(); - } else { - ((InsertionPointCursorController) mController).show(0); + case MotionEvent.ACTION_UP: + if (mIsInsertionHandle) { + long delay = SystemClock.uptimeMillis() - mTouchTimer; + if (delay < ViewConfiguration.getTapTimeout()) { + if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) { + // Tapping on the handle dismisses the displayed paste view, + mPastePopupWindow.hide(); + } else { + ((InsertionPointCursorController) mController).show(0); + } } } - } - filterOnTouchUp(); - mIsDragging = false; - break; + filterOnTouchUp(); + mIsDragging = false; + break; - case MotionEvent.ACTION_CANCEL: - if (mIsInsertionHandle) { - removeLongPressCallback(); - } - mIsDragging = false; + case MotionEvent.ACTION_CANCEL: + mIsDragging = false; + break; } return true; } @@ -8943,16 +8918,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPastePopupWindow.show(); } } - - private void removeLongPressCallback() { - if (mLongPressCallback != null) { - removeCallbacks(mLongPressCallback); - } - } - - void onDetached() { - removeLongPressCallback(); - } } private class InsertionPointCursorController implements CursorController { @@ -9079,9 +9044,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void onDetached() { removeHiderCallback(); removePastePopupCallback(); - if (mHandle != null) { - mHandle.onDetached(); - } } } diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index d83a53497141..d1ea52e8863b 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -30,7 +30,6 @@ interface IStatusBarService void setIcon(String slot, String iconPackage, int iconId, int iconLevel); void setIconVisibility(String slot, boolean visible); void removeIcon(String slot); - void setActiveWindowIsFullscreen(boolean fullscreen); void setMenuKeyVisible(boolean visible); void setIMEButtonVisible(in IBinder token, boolean visible); diff --git a/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_dark.9.png Binary files differindex 3007a84d8e42..8ea94e1856d5 100644 --- a/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png Binary files differindex 5a1084546196..8ea94e1856d5 100644 --- a/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_default_disabled_holo_dark.9.png Binary files differindex bc35a364c6fe..bee345e19528 100644 --- a/core/res/res/drawable-hdpi/btn_default_disabled_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_default_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/btn_default_disabled_holo_light.9.png Binary files differindex bc35a364c6fe..bee345e19528 100644 --- a/core/res/res/drawable-hdpi/btn_default_disabled_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_default_disabled_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_default_focused_holo_dark.9.png Binary files differindex f6380fa6cb00..e83686ab6d3a 100644 --- a/core/res/res/drawable-hdpi/btn_default_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_default_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_default_focused_holo_light.9.png Binary files differindex f6380fa6cb00..e83686ab6d3a 100644 --- a/core/res/res/drawable-hdpi/btn_default_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_default_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_normal_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_default_normal_holo_dark.9.png Binary files differindex 7016db1cb3c4..42e8ba4d5ae9 100644 --- a/core/res/res/drawable-hdpi/btn_default_normal_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_default_normal_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_normal_holo_light.9.png b/core/res/res/drawable-hdpi/btn_default_normal_holo_light.9.png Binary files differindex 228af2e34748..42e8ba4d5ae9 100644 --- a/core/res/res/drawable-hdpi/btn_default_normal_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_default_normal_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_default_pressed_holo_dark.9.png Binary files differindex bc3bfc2e19fd..a24b13bc5f2e 100644 --- a/core/res/res/drawable-hdpi/btn_default_pressed_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_default_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_default_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/btn_default_pressed_holo_light.9.png Binary files differindex 8a4759b1f37f..a24b13bc5f2e 100644 --- a/core/res/res/drawable-hdpi/btn_default_pressed_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_default_pressed_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png Binary files differindex 8f95407afeb3..63a921987c6f 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png Binary files differindex 408d3d7edb9b..d977914d290f 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png Binary files differindex 092fea0dcb50..c04393c541f2 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png Binary files differindex 2e310a48fa1f..96bd3511e35b 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_disabled_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png Binary files differindex 127b7e244cbd..c30b99360876 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png Binary files differindex a5bde5833b4f..730c1138d583 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png Binary files differindex e46c1af26ea2..17de0eba1ba9 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png Binary files differindex 8756b62c382e..7e62cf998487 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_normal_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_dark.9.png Binary files differindex b5e1e9c60ff4..a06f1fcb6048 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_light.9.png Binary files differindex 46ea0d6cb69f..21ad0d8aa897 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_off_pressed_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png Binary files differindex 4593375ffdf7..c0f6f7493dcc 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png Binary files differindex 4593375ffdf7..c0f6f7493dcc 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png Binary files differindex df2e203b4fbe..44a2f8bb8aec 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png Binary files differindex cd4d819654ee..44a2f8bb8aec 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_disabled_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png Binary files differindex 785a9d88e2e2..53eb636fd711 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png Binary files differindex b1a190c959b5..53eb636fd711 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png Binary files differindex 25a144b3fc70..baab86fa10b2 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png Binary files differindex 1cf6fcd2d815..baab86fa10b2 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_normal_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_dark.9.png Binary files differindex 126dc28166b8..6a954a618342 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_light.9.png Binary files differindex d4d3f411b201..6a954a618342 100755 --- a/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_light.9.png +++ b/core/res/res/drawable-hdpi/btn_toggle_on_pressed_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_dark.png Binary files differdeleted file mode 100644 index 6de74a7b4ac2..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_light.png b/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_light.png Binary files differdeleted file mode 100644 index a0e201d32933..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_disabled_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_dark.png Binary files differdeleted file mode 100644 index 9bb69c43639f..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_light.png b/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_light.png Binary files differdeleted file mode 100644 index bffc5aaaf3bf..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_disabled_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_focused_off_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_focused_off_holo_dark.png Binary files differdeleted file mode 100644 index bbe04b62d739..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_focused_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_focused_off_holo_light.png b/core/res/res/drawable-hdpi/checkbox_focused_off_holo_light.png Binary files differdeleted file mode 100644 index 62f1efa51ada..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_focused_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_focused_on_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_focused_on_holo_dark.png Binary files differdeleted file mode 100644 index c4026a80313c..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_focused_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_focused_on_holo_light.png b/core/res/res/drawable-hdpi/checkbox_focused_on_holo_light.png Binary files differdeleted file mode 100644 index 409aa3e6a198..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_focused_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_normal_off_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_normal_off_holo_dark.png Binary files differdeleted file mode 100644 index 10f1bc47369e..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_normal_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_normal_off_holo_light.png b/core/res/res/drawable-hdpi/checkbox_normal_off_holo_light.png Binary files differdeleted file mode 100644 index 20a1efa391aa..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_normal_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_normal_on_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_normal_on_holo_dark.png Binary files differdeleted file mode 100644 index 0a10ec833955..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_normal_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_normal_on_holo_light.png b/core/res/res/drawable-hdpi/checkbox_normal_on_holo_light.png Binary files differdeleted file mode 100644 index 34b53ee57e7d..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_normal_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_dark.png Binary files differdeleted file mode 100644 index 7f1462078a1c..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_light.png b/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_light.png Binary files differdeleted file mode 100644 index cabf93664ca4..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_pressed_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_dark.png b/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_dark.png Binary files differdeleted file mode 100644 index bcddb3141ffe..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_light.png b/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_light.png Binary files differdeleted file mode 100644 index 84160e5246c5..000000000000 --- a/core/res/res/drawable-hdpi/checkbox_pressed_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/ic_contact_picture.png b/core/res/res/drawable-hdpi/ic_contact_picture.png Binary files differindex a60565abe8b6..e29e63a1a040 100644 --- a/core/res/res/drawable-hdpi/ic_contact_picture.png +++ b/core/res/res/drawable-hdpi/ic_contact_picture.png diff --git a/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png Binary files differnew file mode 100644 index 000000000000..f5b762ecf37e --- /dev/null +++ b/core/res/res/drawable-hdpi/notify_panel_notification_icon_bg.png diff --git a/core/res/res/drawable-hdpi/stat_notify_call_mute.png b/core/res/res/drawable-hdpi/stat_notify_call_mute.png Binary files differindex b0f7990ce592..048f56ea0b9b 100755 --- a/core/res/res/drawable-hdpi/stat_notify_call_mute.png +++ b/core/res/res/drawable-hdpi/stat_notify_call_mute.png diff --git a/core/res/res/drawable-hdpi/stat_notify_car_mode.png b/core/res/res/drawable-hdpi/stat_notify_car_mode.png Binary files differindex e700d795703b..76dd2ae410e3 100644 --- a/core/res/res/drawable-hdpi/stat_notify_car_mode.png +++ b/core/res/res/drawable-hdpi/stat_notify_car_mode.png diff --git a/core/res/res/drawable-hdpi/stat_notify_chat.png b/core/res/res/drawable-hdpi/stat_notify_chat.png Binary files differindex 71ea8de6b682..b2e65c627380 100644 --- a/core/res/res/drawable-hdpi/stat_notify_chat.png +++ b/core/res/res/drawable-hdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-hdpi/stat_notify_disk_full.png Binary files differindex 66e738041845..9956fada25b9 100755 --- a/core/res/res/drawable-hdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-hdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-hdpi/stat_notify_email_generic.png Binary files differindex bc5fcab3c365..4ea619cee944 100644 --- a/core/res/res/drawable-hdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-hdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-hdpi/stat_notify_error.png b/core/res/res/drawable-hdpi/stat_notify_error.png Binary files differindex b3a18b30a7e2..598094fb40e1 100755 --- a/core/res/res/drawable-hdpi/stat_notify_error.png +++ b/core/res/res/drawable-hdpi/stat_notify_error.png diff --git a/core/res/res/drawable-hdpi/stat_notify_gmail.png b/core/res/res/drawable-hdpi/stat_notify_gmail.png Binary files differindex ea8beaee100a..7028ea79824c 100644 --- a/core/res/res/drawable-hdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-hdpi/stat_notify_gmail.png diff --git a/core/res/res/drawable-hdpi/stat_notify_missed_call.png b/core/res/res/drawable-hdpi/stat_notify_missed_call.png Binary files differindex 3c19c932bdc0..b0f7a6e6d4bc 100644 --- a/core/res/res/drawable-hdpi/stat_notify_missed_call.png +++ b/core/res/res/drawable-hdpi/stat_notify_missed_call.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sdcard.png b/core/res/res/drawable-hdpi/stat_notify_sdcard.png Binary files differindex dd947a53ae71..a9164881fddb 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sdcard.png +++ b/core/res/res/drawable-hdpi/stat_notify_sdcard.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sdcard_prepare.png b/core/res/res/drawable-hdpi/stat_notify_sdcard_prepare.png Binary files differindex 4b9b9cac5c69..e26770000dfb 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sdcard_prepare.png +++ b/core/res/res/drawable-hdpi/stat_notify_sdcard_prepare.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sdcard_usb.png b/core/res/res/drawable-hdpi/stat_notify_sdcard_usb.png Binary files differindex fb2b26a8fb1e..233e43828b8a 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sdcard_usb.png +++ b/core/res/res/drawable-hdpi/stat_notify_sdcard_usb.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sim_toolkit.png b/core/res/res/drawable-hdpi/stat_notify_sim_toolkit.png Binary files differindex 8865bda6e360..4210107780b6 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sim_toolkit.png +++ b/core/res/res/drawable-hdpi/stat_notify_sim_toolkit.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sync.png b/core/res/res/drawable-hdpi/stat_notify_sync.png Binary files differindex 004cfab1f1ae..2076c5564780 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sync.png +++ b/core/res/res/drawable-hdpi/stat_notify_sync.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sync_anim0.png b/core/res/res/drawable-hdpi/stat_notify_sync_anim0.png Binary files differindex 6973fc5ec932..2076c5564780 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sync_anim0.png +++ b/core/res/res/drawable-hdpi/stat_notify_sync_anim0.png diff --git a/core/res/res/drawable-hdpi/stat_notify_sync_error.png b/core/res/res/drawable-hdpi/stat_notify_sync_error.png Binary files differindex 26b24467fcd3..bade5086c4ac 100755 --- a/core/res/res/drawable-hdpi/stat_notify_sync_error.png +++ b/core/res/res/drawable-hdpi/stat_notify_sync_error.png diff --git a/core/res/res/drawable-hdpi/stat_notify_voicemail.png b/core/res/res/drawable-hdpi/stat_notify_voicemail.png Binary files differindex 5b77846d1836..43fe5301495e 100755 --- a/core/res/res/drawable-hdpi/stat_notify_voicemail.png +++ b/core/res/res/drawable-hdpi/stat_notify_voicemail.png diff --git a/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png b/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png Binary files differindex 76034e5053ad..5c42e53d8e1c 100644 --- a/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png +++ b/core/res/res/drawable-hdpi/stat_notify_wifi_in_range.png diff --git a/core/res/res/drawable-hdpi/stat_sys_adb.png b/core/res/res/drawable-hdpi/stat_sys_adb.png Binary files differindex f99b7800a3a5..58c17468f7cd 100755 --- a/core/res/res/drawable-hdpi/stat_sys_adb.png +++ b/core/res/res/drawable-hdpi/stat_sys_adb.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_0.png b/core/res/res/drawable-hdpi/stat_sys_battery_0.png Binary files differindex 82f2509228f6..160a6f70bda0 100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_0.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_0.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_100.png b/core/res/res/drawable-hdpi/stat_sys_battery_100.png Binary files differindex e49448d94221..fa1624c23504 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_100.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_100.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim0.png b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim0.png Binary files differindex c7464f7313dc..f9f2baff39d8 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim0.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_charge_anim0.png diff --git a/core/res/res/drawable-hdpi/stat_sys_battery_unknown.png b/core/res/res/drawable-hdpi/stat_sys_battery_unknown.png Binary files differindex dadfe8d701bb..368e7d999f32 100755..100644 --- a/core/res/res/drawable-hdpi/stat_sys_battery_unknown.png +++ b/core/res/res/drawable-hdpi/stat_sys_battery_unknown.png diff --git a/core/res/res/drawable-hdpi/stat_sys_data_usb.png b/core/res/res/drawable-hdpi/stat_sys_data_usb.png Binary files differindex e916fbb55c8f..bdec07205034 100755 --- a/core/res/res/drawable-hdpi/stat_sys_data_usb.png +++ b/core/res/res/drawable-hdpi/stat_sys_data_usb.png diff --git a/core/res/res/drawable-hdpi/stat_sys_gps_on.png b/core/res/res/drawable-hdpi/stat_sys_gps_on.png Binary files differindex 2ed60825f5f6..0d6f622035c4 100644 --- a/core/res/res/drawable-hdpi/stat_sys_gps_on.png +++ b/core/res/res/drawable-hdpi/stat_sys_gps_on.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call.png b/core/res/res/drawable-hdpi/stat_sys_phone_call.png Binary files differindex 950713b1c71a..9b5f07576cc5 100644..100755 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png b/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png Binary files differindex 07a2e9de5cc5..032f8f15d8b9 100644..100755 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call_forward.png diff --git a/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png b/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png Binary files differindex 033a5589322e..5b0a68dd30e4 100644..100755 --- a/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png +++ b/core/res/res/drawable-hdpi/stat_sys_phone_call_on_hold.png diff --git a/core/res/res/drawable-hdpi/stat_sys_secure.png b/core/res/res/drawable-hdpi/stat_sys_secure.png Binary files differindex 0889e49bd943..8d24990b318e 100755 --- a/core/res/res/drawable-hdpi/stat_sys_secure.png +++ b/core/res/res/drawable-hdpi/stat_sys_secure.png diff --git a/core/res/res/drawable-hdpi/stat_sys_speakerphone.png b/core/res/res/drawable-hdpi/stat_sys_speakerphone.png Binary files differindex 21f96c49eb6a..82c06a9f0088 100755 --- a/core/res/res/drawable-hdpi/stat_sys_speakerphone.png +++ b/core/res/res/drawable-hdpi/stat_sys_speakerphone.png diff --git a/core/res/res/drawable-hdpi/stat_sys_throttled.png b/core/res/res/drawable-hdpi/stat_sys_throttled.png Binary files differindex 58eafc06e515..bd8323a1294d 100755 --- a/core/res/res/drawable-hdpi/stat_sys_throttled.png +++ b/core/res/res/drawable-hdpi/stat_sys_throttled.png diff --git a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png Binary files differindex dfb34249e730..83e8ead7142b 100644..100755 --- a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png +++ b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call.png diff --git a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png Binary files differindex 402295b71575..9731c469b518 100644..100755 --- a/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png +++ b/core/res/res/drawable-hdpi/stat_sys_vp_phone_call_on_hold.png diff --git a/core/res/res/drawable-hdpi/stat_sys_warning.png b/core/res/res/drawable-hdpi/stat_sys_warning.png Binary files differindex cb8a3d4f4400..2783d894a9bd 100755 --- a/core/res/res/drawable-hdpi/stat_sys_warning.png +++ b/core/res/res/drawable-hdpi/stat_sys_warning.png diff --git a/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_dark.9.png Binary files differindex ab5d68b9920f..5ce73213fed0 100644 --- a/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png Binary files differindex 9421b1b78f80..5ce73213fed0 100644 --- a/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_default_disabled_holo_dark.9.png Binary files differindex a2c9b3f6ced4..34f69d3f32e5 100644 --- a/core/res/res/drawable-mdpi/btn_default_disabled_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_default_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/btn_default_disabled_holo_light.9.png Binary files differindex a2c9b3f6ced4..34f69d3f32e5 100644 --- a/core/res/res/drawable-mdpi/btn_default_disabled_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_default_disabled_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_default_focused_holo_dark.9.png Binary files differindex 02e332377985..0629efead10f 100644 --- a/core/res/res/drawable-mdpi/btn_default_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_default_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_default_focused_holo_light.9.png Binary files differindex 02e332377985..0629efead10f 100644 --- a/core/res/res/drawable-mdpi/btn_default_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_default_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_normal_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_default_normal_holo_dark.9.png Binary files differindex 5b05722b8cc4..a2f411ee34e5 100644 --- a/core/res/res/drawable-mdpi/btn_default_normal_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_default_normal_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_normal_holo_light.9.png b/core/res/res/drawable-mdpi/btn_default_normal_holo_light.9.png Binary files differindex e7f1690a5c25..a2f411ee34e5 100644 --- a/core/res/res/drawable-mdpi/btn_default_normal_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_default_normal_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_default_pressed_holo_dark.9.png Binary files differindex b49a5835cfac..231997a1adf3 100644 --- a/core/res/res/drawable-mdpi/btn_default_pressed_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_default_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_default_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/btn_default_pressed_holo_light.9.png Binary files differindex e6f13626a345..231997a1adf3 100644 --- a/core/res/res/drawable-mdpi/btn_default_pressed_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_default_pressed_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png Binary files differindex a087fb39f056..196408510e53 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png Binary files differindex 4f0572b001de..d86a9e632916 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png Binary files differindex a0693778e357..f3f1ab24a393 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png Binary files differindex bbb7eb752ef8..d157fed124fd 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_disabled_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png Binary files differindex 0fc02ccf7d86..f99d9465a158 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png Binary files differindex eec3980b0823..a31374497557 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png Binary files differindex 9732a8498240..00a589f31ede 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png Binary files differindex 043d35acf70d..e16e470c64fa 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_normal_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_dark.9.png Binary files differindex 0763b239183e..6f7dd45a1142 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_light.9.png Binary files differindex ba93aa3d06d8..490c83d4372d 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_off_pressed_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png Binary files differindex dcf4436a3998..45dc08f06f0b 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png Binary files differindex dcf4436a3998..45dc08f06f0b 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png Binary files differindex 41c3bb01e206..11dc01d752ea 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png Binary files differindex d7c7d9f98f4c..11dc01d752ea 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_disabled_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png Binary files differindex d3d257565545..2c95ebd9925d 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png Binary files differindex 7802e39505d8..2c95ebd9925d 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png Binary files differindex 8f46c382c20d..7c410c01107a 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png Binary files differindex a38eb12e9f3d..7c410c01107a 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_normal_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_dark.9.png Binary files differindex a216e35c1cc4..afb31e179046 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_light.9.png Binary files differindex c9af9b236849..afb31e179046 100755 --- a/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_light.9.png +++ b/core/res/res/drawable-mdpi/btn_toggle_on_pressed_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_dark.png Binary files differdeleted file mode 100644 index e1094beac5cb..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_light.png b/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_light.png Binary files differdeleted file mode 100644 index c17377c11765..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_disabled_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_dark.png Binary files differdeleted file mode 100644 index f2c529018666..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_light.png b/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_light.png Binary files differdeleted file mode 100644 index 06bd9033c6b8..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_disabled_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_focused_off_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_focused_off_holo_dark.png Binary files differdeleted file mode 100644 index be624c23c90b..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_focused_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_focused_off_holo_light.png b/core/res/res/drawable-mdpi/checkbox_focused_off_holo_light.png Binary files differdeleted file mode 100644 index 2493ce2347f6..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_focused_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_focused_on_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_focused_on_holo_dark.png Binary files differdeleted file mode 100644 index 7cdc1dfa96f2..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_focused_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_focused_on_holo_light.png b/core/res/res/drawable-mdpi/checkbox_focused_on_holo_light.png Binary files differdeleted file mode 100644 index f977e72bae3c..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_focused_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_normal_off_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_normal_off_holo_dark.png Binary files differdeleted file mode 100644 index f824f76e2d56..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_normal_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_normal_off_holo_light.png b/core/res/res/drawable-mdpi/checkbox_normal_off_holo_light.png Binary files differdeleted file mode 100644 index a76f68c85841..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_normal_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_normal_on_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_normal_on_holo_dark.png Binary files differdeleted file mode 100644 index e4fd41804b4d..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_normal_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_normal_on_holo_light.png b/core/res/res/drawable-mdpi/checkbox_normal_on_holo_light.png Binary files differdeleted file mode 100644 index d572ef59f2fe..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_normal_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_dark.png Binary files differdeleted file mode 100644 index 686707e91e50..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_light.png b/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_light.png Binary files differdeleted file mode 100644 index 17dd1dab1628..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_pressed_off_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_dark.png b/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_dark.png Binary files differdeleted file mode 100644 index 8cf2b1bb00dd..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_light.png b/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_light.png Binary files differdeleted file mode 100644 index c2df6da1e10f..000000000000 --- a/core/res/res/drawable-mdpi/checkbox_pressed_on_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/ic_contact_picture.png b/core/res/res/drawable-mdpi/ic_contact_picture.png Binary files differindex 3a338e8e219b..faa3dc04644f 100644 --- a/core/res/res/drawable-mdpi/ic_contact_picture.png +++ b/core/res/res/drawable-mdpi/ic_contact_picture.png diff --git a/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png Binary files differnew file mode 100644 index 000000000000..9ecb8af06c6e --- /dev/null +++ b/core/res/res/drawable-mdpi/notify_panel_notification_icon_bg.png diff --git a/core/res/res/drawable-mdpi/password_keyboard_background_holo.9.png b/core/res/res/drawable-mdpi/password_keyboard_background_holo.9.png Binary files differnew file mode 100644 index 000000000000..c56c704bb70a --- /dev/null +++ b/core/res/res/drawable-mdpi/password_keyboard_background_holo.9.png diff --git a/core/res/res/drawable-mdpi/stat_notify_call_mute.png b/core/res/res/drawable-mdpi/stat_notify_call_mute.png Binary files differindex 4a3b057c248d..be2606578802 100644 --- a/core/res/res/drawable-mdpi/stat_notify_call_mute.png +++ b/core/res/res/drawable-mdpi/stat_notify_call_mute.png diff --git a/core/res/res/drawable-mdpi/stat_notify_car_mode.png b/core/res/res/drawable-mdpi/stat_notify_car_mode.png Binary files differindex 3b644d3c408a..60d9202ec444 100644 --- a/core/res/res/drawable-mdpi/stat_notify_car_mode.png +++ b/core/res/res/drawable-mdpi/stat_notify_car_mode.png diff --git a/core/res/res/drawable-mdpi/stat_notify_chat.png b/core/res/res/drawable-mdpi/stat_notify_chat.png Binary files differindex 306d9c561b6b..f98b032bcc4b 100644 --- a/core/res/res/drawable-mdpi/stat_notify_chat.png +++ b/core/res/res/drawable-mdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-mdpi/stat_notify_disk_full.png Binary files differindex 3eebeb81a41c..4e198ef9c5ea 100755 --- a/core/res/res/drawable-mdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-mdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-mdpi/stat_notify_email_generic.png Binary files differindex 1620ad537eaf..a01485e9a0a4 100644 --- a/core/res/res/drawable-mdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-mdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-mdpi/stat_notify_error.png b/core/res/res/drawable-mdpi/stat_notify_error.png Binary files differindex 1275738d3f76..69c02d7e0181 100644 --- a/core/res/res/drawable-mdpi/stat_notify_error.png +++ b/core/res/res/drawable-mdpi/stat_notify_error.png diff --git a/core/res/res/drawable-mdpi/stat_notify_gmail.png b/core/res/res/drawable-mdpi/stat_notify_gmail.png Binary files differindex 4860c3459ff6..55bae333c0db 100644 --- a/core/res/res/drawable-mdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-mdpi/stat_notify_gmail.png diff --git a/core/res/res/drawable-mdpi/stat_notify_missed_call.png b/core/res/res/drawable-mdpi/stat_notify_missed_call.png Binary files differindex 7bd5fcd48fa7..58030fd0d847 100644 --- a/core/res/res/drawable-mdpi/stat_notify_missed_call.png +++ b/core/res/res/drawable-mdpi/stat_notify_missed_call.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sdcard.png b/core/res/res/drawable-mdpi/stat_notify_sdcard.png Binary files differindex fc0784d6406b..0071bf439828 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sdcard.png +++ b/core/res/res/drawable-mdpi/stat_notify_sdcard.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sdcard_prepare.png b/core/res/res/drawable-mdpi/stat_notify_sdcard_prepare.png Binary files differindex 93fad384024d..c04d70d1ed3d 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sdcard_prepare.png +++ b/core/res/res/drawable-mdpi/stat_notify_sdcard_prepare.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sdcard_usb.png b/core/res/res/drawable-mdpi/stat_notify_sdcard_usb.png Binary files differindex cda4546d2e0c..2880934a4bfb 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sdcard_usb.png +++ b/core/res/res/drawable-mdpi/stat_notify_sdcard_usb.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sim_toolkit.png b/core/res/res/drawable-mdpi/stat_notify_sim_toolkit.png Binary files differindex 8b33a0fe0284..ee7b10c628f8 100755 --- a/core/res/res/drawable-mdpi/stat_notify_sim_toolkit.png +++ b/core/res/res/drawable-mdpi/stat_notify_sim_toolkit.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sync.png b/core/res/res/drawable-mdpi/stat_notify_sync.png Binary files differindex 03ce57a471ac..ef9d4ebbccb2 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sync.png +++ b/core/res/res/drawable-mdpi/stat_notify_sync.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sync_anim0.png b/core/res/res/drawable-mdpi/stat_notify_sync_anim0.png Binary files differindex 54814614660d..ef9d4ebbccb2 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sync_anim0.png +++ b/core/res/res/drawable-mdpi/stat_notify_sync_anim0.png diff --git a/core/res/res/drawable-mdpi/stat_notify_sync_error.png b/core/res/res/drawable-mdpi/stat_notify_sync_error.png Binary files differindex f849b5040360..f55bf5888ef4 100644 --- a/core/res/res/drawable-mdpi/stat_notify_sync_error.png +++ b/core/res/res/drawable-mdpi/stat_notify_sync_error.png diff --git a/core/res/res/drawable-mdpi/stat_notify_voicemail.png b/core/res/res/drawable-mdpi/stat_notify_voicemail.png Binary files differindex 636d1ccaaa56..b72a07a40bd2 100644 --- a/core/res/res/drawable-mdpi/stat_notify_voicemail.png +++ b/core/res/res/drawable-mdpi/stat_notify_voicemail.png diff --git a/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png b/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png Binary files differindex 517c515a1880..90dd76ea472f 100644 --- a/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png +++ b/core/res/res/drawable-mdpi/stat_notify_wifi_in_range.png diff --git a/core/res/res/drawable-mdpi/stat_sys_adb.png b/core/res/res/drawable-mdpi/stat_sys_adb.png Binary files differindex f0fad76486b1..255ce949ff02 100644 --- a/core/res/res/drawable-mdpi/stat_sys_adb.png +++ b/core/res/res/drawable-mdpi/stat_sys_adb.png diff --git a/core/res/res/drawable-mdpi/stat_sys_data_usb.png b/core/res/res/drawable-mdpi/stat_sys_data_usb.png Binary files differindex 2d0da4c8ec1b..4175b2917a16 100644 --- a/core/res/res/drawable-mdpi/stat_sys_data_usb.png +++ b/core/res/res/drawable-mdpi/stat_sys_data_usb.png diff --git a/core/res/res/drawable-mdpi/stat_sys_gps_on.png b/core/res/res/drawable-mdpi/stat_sys_gps_on.png Binary files differindex df737f29a7a8..ab59f7ce2710 100644 --- a/core/res/res/drawable-mdpi/stat_sys_gps_on.png +++ b/core/res/res/drawable-mdpi/stat_sys_gps_on.png diff --git a/core/res/res/drawable-mdpi/stat_sys_secure.png b/core/res/res/drawable-mdpi/stat_sys_secure.png Binary files differindex a632fb26c503..db73d060463b 100644 --- a/core/res/res/drawable-mdpi/stat_sys_secure.png +++ b/core/res/res/drawable-mdpi/stat_sys_secure.png diff --git a/core/res/res/drawable-mdpi/stat_sys_speakerphone.png b/core/res/res/drawable-mdpi/stat_sys_speakerphone.png Binary files differindex d0411cfba2e7..06730601a910 100644 --- a/core/res/res/drawable-mdpi/stat_sys_speakerphone.png +++ b/core/res/res/drawable-mdpi/stat_sys_speakerphone.png diff --git a/core/res/res/drawable-mdpi/stat_sys_throttled.png b/core/res/res/drawable-mdpi/stat_sys_throttled.png Binary files differindex bc9b22345b62..28a293b08268 100644 --- a/core/res/res/drawable-mdpi/stat_sys_throttled.png +++ b/core/res/res/drawable-mdpi/stat_sys_throttled.png diff --git a/core/res/res/drawable-mdpi/stat_sys_warning.png b/core/res/res/drawable-mdpi/stat_sys_warning.png Binary files differindex c0823daede2a..494c96adc568 100644 --- a/core/res/res/drawable-mdpi/stat_sys_warning.png +++ b/core/res/res/drawable-mdpi/stat_sys_warning.png diff --git a/core/res/res/drawable-xlarge-mdpi/sym_keyboard_delete_holo.png b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_delete_holo.png Binary files differnew file mode 100644 index 000000000000..1555791691aa --- /dev/null +++ b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_delete_holo.png diff --git a/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift.png b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift.png Binary files differnew file mode 100644 index 000000000000..91d6e32f9d0e --- /dev/null +++ b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift.png diff --git a/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift_locked.png b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift_locked.png Binary files differnew file mode 100644 index 000000000000..2bd053656a5a --- /dev/null +++ b/core/res/res/drawable-xlarge-mdpi/sym_keyboard_shift_locked.png diff --git a/core/res/res/drawable/btn_default_small_holo_dark.xml b/core/res/res/drawable/btn_default_small_holo_dark.xml deleted file mode 100644 index a5f5d46775c8..000000000000 --- a/core/res/res/drawable/btn_default_small_holo_dark.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/btn_default_small_normal_holo_dark" /> - <item android:state_window_focused="false" android:state_enabled="false" - android:drawable="@drawable/btn_default_small_disabled_holo_dark" /> - <item android:state_pressed="true" - android:drawable="@drawable/btn_default_small_pressed_holo_dark" /> - <item android:state_focused="true" android:state_enabled="true" - android:drawable="@drawable/btn_default_small_focused_holo_dark" /> - <item android:state_enabled="true" - android:drawable="@drawable/btn_default_small_normal_holo_dark" /> - <item android:state_focused="true" - android:drawable="@drawable/btn_default_small_disabled_focused_holo_dark" /> - <item - android:drawable="@drawable/btn_default_small_disabled_holo_dark" /> -</selector> diff --git a/core/res/res/drawable/btn_default_small_holo_light.xml b/core/res/res/drawable/btn_default_small_holo_light.xml deleted file mode 100644 index ed86f78b1c09..000000000000 --- a/core/res/res/drawable/btn_default_small_holo_light.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/btn_default_small_normal_holo_light" /> - <item android:state_window_focused="false" android:state_enabled="false" - android:drawable="@drawable/btn_default_small_disabled_holo_light" /> - <item android:state_pressed="true" - android:drawable="@drawable/btn_default_small_pressed_holo_light" /> - <item android:state_focused="true" android:state_enabled="true" - android:drawable="@drawable/btn_default_small_focused_holo_light" /> - <item android:state_enabled="true" - android:drawable="@drawable/btn_default_small_normal_holo_light" /> - <item android:state_focused="true" - android:drawable="@drawable/btn_default_small_disabled_focused_holo_light" /> - <item - android:drawable="@drawable/btn_default_small_disabled_holo_light" /> -</selector> diff --git a/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml b/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml index c1149e349f8a..16bfc3123d2a 100644 --- a/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml +++ b/core/res/res/layout-xlarge/keyguard_screen_password_landscape.xml @@ -69,7 +69,7 @@ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" android:layout_width="330dip" android:layout_height="330dip" - android:background="#00000000" + android:background="#40000000" android:layout_marginTop="5dip" android:keyBackground="@drawable/btn_keyboard_key_fulltrans" android:visibility="gone" @@ -88,8 +88,9 @@ <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboardAlpha" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="#00000000" + android:background="@drawable/password_keyboard_background_holo" android:keyBackground="@drawable/btn_keyboard_key_fulltrans" + android:keyTextSize="28dip" android:visibility="gone" /> diff --git a/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml b/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml index e4a1b81e131d..b87b51fda6b1 100644 --- a/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml +++ b/core/res/res/layout-xlarge/keyguard_screen_password_portrait.xml @@ -61,19 +61,28 @@ android:textColor="#ffffffff" /> + <View + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1" + /> + <!-- Numeric keyboard --> <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" android:layout_width="330dip" android:layout_height="260dip" - android:background="#00000000" + android:background="#40000000" android:keyBackground="@drawable/btn_keyboard_key_fulltrans" + android:layout_marginBottom="80dip" /> + <!-- Alphanumeric keyboard --> <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboardAlpha" android:layout_width="match_parent" android:layout_height="230dip" - android:background="#00000000" + android:background="@drawable/password_keyboard_background_holo" android:keyBackground="@drawable/btn_keyboard_key_fulltrans" + android:keyTextSize="28dip" android:visibility="gone" /> diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml index dca2c5753a9f..1a3ee827e37f 100644 --- a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml +++ b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml @@ -3,9 +3,9 @@ android:layout_height="match_parent" > <ImageView android:id="@+id/icon" - android:layout_width="48dp" - android:layout_height="64dp" - android:layout_marginLeft="4dp" + android:layout_width="@dimen/notification_large_icon_width" + android:layout_height="@dimen/notification_large_icon_height" + android:background="@drawable/notify_panel_notification_icon_bg" android:scaleType="center" /> <LinearLayout @@ -14,7 +14,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:orientation="vertical" - android:paddingLeft="8dp" + android:paddingLeft="16dp" > <TextView android:id="@+id/title" android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title" @@ -23,6 +23,7 @@ android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" + android:layout_marginBottom="-4dp" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml index 144fa0dc64a7..e9b106d8654b 100644 --- a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml +++ b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml @@ -8,6 +8,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:orientation="vertical" + android:paddingLeft="16dp" > <TextView android:id="@+id/title" android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title" @@ -16,6 +17,7 @@ android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" + android:layout_marginBottom="-4dp" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" @@ -28,20 +30,27 @@ android:fadingEdge="horizontal" /> </LinearLayout> - <TextView android:id="@+id/info" - android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info" + <RelativeLayout android:layout_width="wrap_content" android:layout_height="match_parent" - android:singleLine="true" - android:gravity="center_vertical" - android:paddingLeft="8dp" - /> - <ImageView android:id="@+id/icon" - android:layout_width="48dp" - android:layout_height="32dp" - android:layout_gravity="top" - android:layout_marginTop="8dp" - android:scaleType="center" - /> + > + <TextView android:id="@+id/info" + android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:singleLine="true" + android:gravity="center_vertical" + android:layout_alignParentLeft="true" + android:paddingLeft="8dp" + /> + <ImageView android:id="@+id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignRight="@id/info" + android:layout_marginBottom="8dip" + android:scaleType="center" + /> + </RelativeLayout> </LinearLayout> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index a404fba6dd66..260c7c6d41ec 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1832,7 +1832,7 @@ </attr> <!-- Specifies the type of layer backing this view. The default value is none. - Refer to {@link android.view.View#setLayerType(int, android.graphics.Paint) + Refer to {@link android.view.View#setLayerType(int, android.graphics.Paint)} for more information.--> <attr name="layerType"> <!-- Don't use a layer. --> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index d094bad5db2f..8a590cd0851b 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -70,9 +70,9 @@ <item type="dimen" name="dialog_min_width_minor">95%</item> <!-- The width of the big icons in notifications. --> - <dimen name="notification_large_icon_width">60dp</dimen> + <dimen name="notification_large_icon_width">64dp</dimen> <!-- The width of the big icons in notifications. --> - <dimen name="notification_large_icon_height">60dp</dimen> + <dimen name="notification_large_icon_height">64dp</dimen> <!-- Minimum width of the search view text entry area. --> <dimen name="search_view_text_min_width">160dip</dimen> diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml index 837e04f536e8..7a0fede01dd9 100644 --- a/core/res/res/values/ids.xml +++ b/core/res/res/values/ids.xml @@ -73,6 +73,4 @@ <item type="id" name="fillInIntent" /> <item type="id" name="rowTypeId" /> <item type="id" name="up" /> - <item type="id" name="viewAnimation" /> - <item type="id" name="viewAlphaAnimation" /> </resources> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 25a43e015223..15341015cb76 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -224,7 +224,7 @@ <item name="android:textStyle">bold</item> </style> <style name="TextAppearance.StatusBar.EventContent"> - <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> + <item name="android:textSize">10sp</item> <item name="android:textColor">?android:attr/textColorPrimaryInverse</item> </style> <style name="TextAppearance.StatusBar.EventContent.Title"> @@ -1399,6 +1399,7 @@ <item name="android:textAppearance">?android:attr/textAppearanceMedium</item> <item name="android:textColor">@android:color/primary_text_holo_dark</item> <item name="android:minHeight">48dip</item> + <item name="android:minWidth">64dip</item> </style> <style name="Widget.Holo.Button.Borderless"> @@ -1406,10 +1407,11 @@ </style> <style name="Widget.Holo.Button.Small"> - <item name="android:background">@android:drawable/btn_default_small_holo_dark</item> + <item name="android:background">@android:drawable/btn_default_holo_dark</item> <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> <item name="android:textColor">@android:color/primary_text_holo_dark</item> <item name="android:minHeight">48dip</item> + <item name="android:minWidth">48dip</item> </style> <style name="Widget.Holo.Button.Inset"> @@ -1788,6 +1790,7 @@ <item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item> <item name="android:textColor">@android:color/primary_text_holo_light</item> <item name="android:minHeight">48dip</item> + <item name="android:minWidth">64dip</item> </style> <style name="Widget.Holo.Light.Button.Borderless"> @@ -1795,10 +1798,11 @@ </style> <style name="Widget.Holo.Light.Button.Small"> - <item name="android:background">@android:drawable/btn_default_small_holo_light</item> + <item name="android:background">@android:drawable/btn_default_holo_light</item> <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> <item name="android:textColor">@android:color/primary_text_holo_light</item> <item name="android:minHeight">48dip</item> + <item name="android:minWidth">48dip</item> </style> <style name="Widget.Holo.Light.Button.Inset"> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 03eca1cc579a..ddaeb8210bc6 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -522,6 +522,7 @@ <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:windowCloseOnTouchOutside">@bool/config_closeDialogWhenTouchOutside</item> + <item name="android:windowActionModeOverlay">true</item> <item name="android:colorBackgroundCacheHint">@null</item> diff --git a/core/res/res/xml-xlarge/password_kbd_numeric.xml b/core/res/res/xml-xlarge/password_kbd_numeric.xml new file mode 100755 index 000000000000..025312228318 --- /dev/null +++ b/core/res/res/xml-xlarge/password_kbd_numeric.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" + android:keyWidth="33.33%p" + android:verticalGap="0px" + android:keyHeight="@dimen/password_keyboard_key_height_numeric" + > + + <Row android:rowEdgeFlags="top"> + <Key android:codes="49" android:keyIcon="@drawable/sym_keyboard_num1" + android:keyEdgeFlags="left"/> + <Key android:codes="50" android:keyIcon="@drawable/sym_keyboard_num2"/> + <Key android:codes="51" android:keyIcon="@drawable/sym_keyboard_num3" + android:keyEdgeFlags="right"/> + </Row> + + <Row> + <Key android:codes="52" android:keyIcon="@drawable/sym_keyboard_num4" + android:keyEdgeFlags="left"/> + <Key android:codes="53" android:keyIcon="@drawable/sym_keyboard_num5"/> + <Key android:codes="54" android:keyIcon="@drawable/sym_keyboard_num6" + android:keyEdgeFlags="right"/> + </Row> + + <Row> + <Key android:codes="55" android:keyIcon="@drawable/sym_keyboard_num7" + android:keyEdgeFlags="left"/> + <Key android:codes="56" android:keyIcon="@drawable/sym_keyboard_num8"/> + <Key android:codes="57" android:keyIcon="@drawable/sym_keyboard_num9" + android:keyEdgeFlags="right"/> + </Row> + + <Row android:rowEdgeFlags="bottom"> + <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok" + android:keyEdgeFlags="left"/> + <Key android:codes="48" android:keyIcon="@drawable/sym_keyboard_num0_no_plus"/> + <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" + android:iconPreview="@drawable/sym_keyboard_feedback_delete" + android:isRepeatable="true" android:keyEdgeFlags="right"/> + </Row> + +</Keyboard> diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty.xml b/core/res/res/xml-xlarge/password_kbd_qwerty.xml index fd1d5f19a270..1009c9afbe32 100755 --- a/core/res/res/xml-xlarge/password_kbd_qwerty.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty.xml @@ -38,10 +38,9 @@ <Key android:keyLabel="i"/> <Key android:keyLabel="o"/> <Key android:keyLabel="p"/> - <Key android:keyIcon="@drawable/sym_keyboard_delete" + <Key android:keyIcon="@drawable/sym_keyboard_delete_holo" android:codes="-5" android:keyWidth="9.331%p" - android:iconPreview="@drawable/sym_keyboard_feedback_delete" android:isRepeatable="true" android:keyEdgeFlags="right"/> </Row> @@ -62,7 +61,6 @@ <Key android:keyLabel="l"/> <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok" - android:iconPreview="@drawable/sym_keyboard_feedback_ok" android:keyWidth="15.750%p" android:keyEdgeFlags="right"/> </Row> @@ -72,7 +70,6 @@ android:keyIcon="@drawable/sym_keyboard_shift" android:keyWidth="15.192%p" android:isModifier="true" - android:iconPreview="@drawable/sym_keyboard_feedback_shift" android:isSticky="true" android:keyEdgeFlags="left"/> <Key android:keyLabel="z"/> @@ -88,7 +85,6 @@ android:keyIcon="@drawable/sym_keyboard_shift" android:keyWidth="12.530%p" android:isModifier="true" - android:iconPreview="@drawable/sym_keyboard_feedback_shift" android:isSticky="true" android:keyEdgeFlags="right"/> </Row> @@ -96,9 +92,7 @@ <Row android:keyWidth="8.042%p" android:keyboardMode="@+id/mode_normal"> <Key android:keyLabel="/" android:horizontalGap="24.126%p"/> - <Key android:codes="32" - android:keyIcon="@drawable/sym_keyboard_space" - android:iconPreview="@drawable/sym_keyboard_feedback_space" + <Key android:keyLabel=" " android:keyWidth="37.454%p"/> <Key android:keyLabel="'" /> <Key android:keyLabel="-" /> diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml index 671d87f45a41..cbf17c3acbee 100755 --- a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml @@ -38,10 +38,9 @@ <Key android:keyLabel="I"/> <Key android:keyLabel="O"/> <Key android:keyLabel="P"/> - <Key android:keyIcon="@drawable/sym_keyboard_delete" + <Key android:keyIcon="@drawable/sym_keyboard_delete_holo" android:codes="-5" android:keyWidth="9.331%p" - android:iconPreview="@drawable/sym_keyboard_feedback_delete" android:isRepeatable="true" android:keyEdgeFlags="right"/> </Row> @@ -62,7 +61,6 @@ <Key android:keyLabel="L"/> <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok" - android:iconPreview="@drawable/sym_keyboard_feedback_ok" android:keyWidth="15.750%p" android:keyEdgeFlags="right"/> </Row> @@ -72,7 +70,6 @@ android:keyIcon="@drawable/sym_keyboard_shift" android:keyWidth="15.192%p" android:isModifier="true" - android:iconPreview="@drawable/sym_keyboard_feedback_shift" android:isSticky="true" android:keyEdgeFlags="left"/> <Key android:keyLabel="Z"/> @@ -88,7 +85,6 @@ android:keyIcon="@drawable/sym_keyboard_shift" android:keyWidth="12.530%p" android:isModifier="true" - android:iconPreview="@drawable/sym_keyboard_feedback_shift" android:isSticky="true" android:keyEdgeFlags="right"/> </Row> @@ -96,9 +92,7 @@ <Row android:keyWidth="8.042%p" android:keyboardMode="@+id/mode_normal"> <Key android:keyLabel="\@" android:horizontalGap="24.126%p"/> - <Key android:codes="32" - android:keyIcon="@drawable/sym_keyboard_space" - android:iconPreview="@drawable/sym_keyboard_feedback_space" + <Key android:keyLabel=" " android:keyWidth="37.454%p"/> <Key android:keyLabel=""" /> <Key android:keyLabel="_" /> diff --git a/core/res/res/xml-xlarge/password_kbd_symbols.xml b/core/res/res/xml-xlarge/password_kbd_symbols.xml index 5ae5577ae186..a58a023cc503 100755 --- a/core/res/res/xml-xlarge/password_kbd_symbols.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols.xml @@ -38,10 +38,9 @@ <Key android:keyLabel="8"/> <Key android:keyLabel="9"/> <Key android:keyLabel="0"/> - <Key android:keyIcon="@drawable/sym_keyboard_delete" + <Key android:keyIcon="@drawable/sym_keyboard_delete_holo" android:codes="-5" android:keyWidth="9.331%p" - android:iconPreview="@drawable/sym_keyboard_feedback_delete" android:isRepeatable="true" android:keyEdgeFlags="right"/> </Row> @@ -62,7 +61,6 @@ <Key android:keyLabel=")"/> <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok" - android:iconPreview="@drawable/sym_keyboard_feedback_ok" android:keyWidth="15.750%p" android:keyEdgeFlags="right"/> </Row> @@ -94,9 +92,7 @@ <Row android:keyWidth="8.042%p"> <Key android:keyLabel="\@" android:horizontalGap="16.084%p"/> <Key android:keyLabel="/" /> - <Key android:codes="32" - android:keyIcon="@drawable/sym_keyboard_space" - android:iconPreview="@drawable/sym_keyboard_feedback_space" + <Key android:keyLabel=" " android:keyWidth="37.454%p"/> <Key android:keyLabel="\'" /> <Key android:keyLabel="-" /> diff --git a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml index 26ade76275a9..9d9acf5986df 100755 --- a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml @@ -37,10 +37,9 @@ <Key android:keyLabel="×" /> <Key android:keyLabel="§" /> <Key android:keyLabel="Δ" /> - <Key android:keyIcon="@drawable/sym_keyboard_delete" + <Key android:keyIcon="@drawable/sym_keyboard_delete_holo" android:codes="-5" android:keyWidth="9.331%p" - android:iconPreview="@drawable/sym_keyboard_feedback_delete" android:isRepeatable="true" android:keyEdgeFlags="right"/> </Row> @@ -61,7 +60,6 @@ <Key android:keyLabel="}" /> <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok" - android:iconPreview="@drawable/sym_keyboard_feedback_ok" android:keyWidth="15.750%p" android:keyEdgeFlags="right"/> </Row> @@ -92,9 +90,7 @@ <!-- This row is intentionally not marked as a bottom row --> <Row android:keyWidth="8.042%p"> - <Key android:codes="32" android:horizontalGap="32.168%p" - android:keyIcon="@drawable/sym_keyboard_space" - android:iconPreview="@drawable/sym_keyboard_feedback_space" + <Key android:keyLabel=" " android:horizontalGap="32.168%p" android:keyWidth="37.454%p"/> </Row> </Keyboard> diff --git a/data/fonts/AndroidClock-Solid.ttf b/data/fonts/AndroidClock_Solid.ttf Binary files differindex 108839e39306..108839e39306 100644 --- a/data/fonts/AndroidClock-Solid.ttf +++ b/data/fonts/AndroidClock_Solid.ttf diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk index b8a93e83ed91..692ce3425d1e 100644 --- a/data/fonts/fonts.mk +++ b/data/fonts/fonts.mk @@ -28,4 +28,5 @@ PRODUCT_COPY_FILES := \ frameworks/base/data/fonts/Clockopia.ttf:system/fonts/Clockopia.ttf \ frameworks/base/data/fonts/DroidSansFallback.ttf:system/fonts/DroidSansFallback.ttf \ frameworks/base/data/fonts/AndroidClock.ttf:system/fonts/AndroidClock.ttf \ - frameworks/base/data/fonts/AndroidClock_Highlight.ttf:system/fonts/AndroidClock_Highlight.ttf + frameworks/base/data/fonts/AndroidClock_Highlight.ttf:system/fonts/AndroidClock_Highlight.ttf \ + frameworks/base/data/fonts/AndroidClock_Solid.ttf:system/fonts/AndroidClock_Solid.ttf diff --git a/data/keyboards/qwerty.idc b/data/keyboards/qwerty.idc index 4cf0b84625b2..375d78576548 100644 --- a/data/keyboards/qwerty.idc +++ b/data/keyboards/qwerty.idc @@ -16,6 +16,9 @@ # Emulator keyboard configuration file #1. # +touch.deviceType = touchScreen +touch.orientationAware = 1 + keyboard.layout = qwerty keyboard.characterMap = qwerty keyboard.orientationAware = 1 diff --git a/data/keyboards/qwerty2.idc b/data/keyboards/qwerty2.idc index 2e5a9381d668..369205ea3f98 100644 --- a/data/keyboards/qwerty2.idc +++ b/data/keyboards/qwerty2.idc @@ -16,6 +16,9 @@ # Emulator keyboard configuration file #2. # +touch.deviceType = touchScreen +touch.orientationAware = 1 + keyboard.layout = qwerty keyboard.characterMap = qwerty2 keyboard.orientationAware = 1 diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index c0963a662383..048f04179e98 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -126,8 +126,6 @@ public: virtual status_t setLooping(int loop) = 0; virtual player_type playerType() = 0; - virtual void setNotifyCallback(void* cookie, notify_callback_f notifyFunc) { - mCookie = cookie; mNotify = notifyFunc; } // Invoke a generic method on the player by using opaque parcels // for the request and reply. // @@ -149,9 +147,21 @@ public: return INVALID_OPERATION; }; - virtual void sendEvent(int msg, int ext1=0, int ext2=0) { if (mNotify) mNotify(mCookie, msg, ext1, ext2); } + void setNotifyCallback( + void* cookie, notify_callback_f notifyFunc) { + Mutex::Autolock autoLock(mNotifyLock); + mCookie = cookie; mNotify = notifyFunc; + } -protected: + void sendEvent(int msg, int ext1=0, int ext2=0) { + Mutex::Autolock autoLock(mNotifyLock); + if (mNotify) mNotify(mCookie, msg, ext1, ext2); + } + +private: + friend class MediaPlayerService; + + Mutex mNotifyLock; void* mCookie; notify_callback_f mNotify; }; diff --git a/include/media/stagefright/StagefrightMediaScanner.h b/include/media/stagefright/StagefrightMediaScanner.h index 4437eee7daf8..108acb4c3515 100644 --- a/include/media/stagefright/StagefrightMediaScanner.h +++ b/include/media/stagefright/StagefrightMediaScanner.h @@ -22,8 +22,6 @@ namespace android { -struct MediaMetadataRetriever; - struct StagefrightMediaScanner : public MediaScanner { StagefrightMediaScanner(); virtual ~StagefrightMediaScanner(); @@ -35,8 +33,6 @@ struct StagefrightMediaScanner : public MediaScanner { virtual char *extractAlbumArt(int fd); private: - sp<MediaMetadataRetriever> mRetriever; - StagefrightMediaScanner(const StagefrightMediaScanner &); StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); }; diff --git a/include/ui/Input.h b/include/ui/Input.h index 30b45f766bc5..2012fccf85fb 100644 --- a/include/ui/Input.h +++ b/include/ui/Input.h @@ -50,8 +50,10 @@ enum { /* * Maximum number of pointers supported per motion event. * Smallest number of pointers is 1. + * (We want at least 10 but some touch controllers obstensibly configured for 10 pointers + * will occasionally emit 11. There is not much harm making this constant bigger.) */ -#define MAX_POINTERS 10 +#define MAX_POINTERS 16 /* * Maximum pointer id value supported in a motion event. diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 9f491b3d31c1..c378f46117bb 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -218,6 +218,9 @@ void OpenGLRenderer::releaseContext() { bool OpenGLRenderer::callDrawGLFunction(Functor *functor) { interrupt(); + if (mDirtyClip) { + setScissorFromClip(); + } status_t result = (*functor)(); resume(); return (result == 0) ? false : true; @@ -1451,13 +1454,7 @@ void OpenGLRenderer::drawRect(float left, float top, float right, float bottom, mode = getXfermode(p->getXfermode()); } - // Skia draws using the color's alpha channel if < 255 - // Otherwise, it uses the paint's alpha int color = p->getColor(); - if (((color >> 24) & 0xff) == 255) { - color |= p->getAlpha() << 24; - } - drawColorRect(left, top, right, bottom, color, mode); } diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index beb4d724e05e..8a85f6ed5308 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -347,6 +347,489 @@ void SC_ForEach2(RsScript vs, s->runForEach(rsc, ain, aout, usr, call); } + +////////////////////////////////////////////////////////////////////////////// +// Heavy math functions +////////////////////////////////////////////////////////////////////////////// + +typedef struct { + float m[16]; +} rs_matrix4x4; + +typedef struct { + float m[9]; +} rs_matrix3x3; + +typedef struct { + float m[4]; +} rs_matrix2x2; + +static inline void +rsMatrixSet(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v) { + m->m[row * 4 + col] = v; +} + +static inline float +rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col) { + return m->m[row * 4 + col]; +} + +static inline void +rsMatrixSet(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v) { + m->m[row * 3 + col] = v; +} + +static inline float +rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col) { + return m->m[row * 3 + col]; +} + +static inline void +rsMatrixSet(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v) { + m->m[row * 2 + col] = v; +} + +static inline float +rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col) { + return m->m[row * 2 + col]; +} + + +static void SC_MatrixLoadIdentity_4x4(rs_matrix4x4 *m) { + m->m[0] = 1.f; + m->m[1] = 0.f; + m->m[2] = 0.f; + m->m[3] = 0.f; + m->m[4] = 0.f; + m->m[5] = 1.f; + m->m[6] = 0.f; + m->m[7] = 0.f; + m->m[8] = 0.f; + m->m[9] = 0.f; + m->m[10] = 1.f; + m->m[11] = 0.f; + m->m[12] = 0.f; + m->m[13] = 0.f; + m->m[14] = 0.f; + m->m[15] = 1.f; +} + +static void SC_MatrixLoadIdentity_3x3(rs_matrix3x3 *m) { + m->m[0] = 1.f; + m->m[1] = 0.f; + m->m[2] = 0.f; + m->m[3] = 0.f; + m->m[4] = 1.f; + m->m[5] = 0.f; + m->m[6] = 0.f; + m->m[7] = 0.f; + m->m[8] = 1.f; +} + +static void SC_MatrixLoadIdentity_2x2(rs_matrix2x2 *m) { + m->m[0] = 1.f; + m->m[1] = 0.f; + m->m[2] = 0.f; + m->m[3] = 1.f; +} + +static void SC_MatrixLoad_4x4_f(rs_matrix4x4 *m, const float *v) { + m->m[0] = v[0]; + m->m[1] = v[1]; + m->m[2] = v[2]; + m->m[3] = v[3]; + m->m[4] = v[4]; + m->m[5] = v[5]; + m->m[6] = v[6]; + m->m[7] = v[7]; + m->m[8] = v[8]; + m->m[9] = v[9]; + m->m[10] = v[10]; + m->m[11] = v[11]; + m->m[12] = v[12]; + m->m[13] = v[13]; + m->m[14] = v[14]; + m->m[15] = v[15]; +} + +static void SC_MatrixLoad_3x3_f(rs_matrix3x3 *m, const float *v) { + m->m[0] = v[0]; + m->m[1] = v[1]; + m->m[2] = v[2]; + m->m[3] = v[3]; + m->m[4] = v[4]; + m->m[5] = v[5]; + m->m[6] = v[6]; + m->m[7] = v[7]; + m->m[8] = v[8]; +} + +static void SC_MatrixLoad_2x2_f(rs_matrix2x2 *m, const float *v) { + m->m[0] = v[0]; + m->m[1] = v[1]; + m->m[2] = v[2]; + m->m[3] = v[3]; +} + +static void SC_MatrixLoad_4x4_4x4(rs_matrix4x4 *m, const rs_matrix4x4 *v) { + m->m[0] = v->m[0]; + m->m[1] = v->m[1]; + m->m[2] = v->m[2]; + m->m[3] = v->m[3]; + m->m[4] = v->m[4]; + m->m[5] = v->m[5]; + m->m[6] = v->m[6]; + m->m[7] = v->m[7]; + m->m[8] = v->m[8]; + m->m[9] = v->m[9]; + m->m[10] = v->m[10]; + m->m[11] = v->m[11]; + m->m[12] = v->m[12]; + m->m[13] = v->m[13]; + m->m[14] = v->m[14]; + m->m[15] = v->m[15]; +} + +static void SC_MatrixLoad_4x4_3x3(rs_matrix4x4 *m, const rs_matrix3x3 *v) { + m->m[0] = v->m[0]; + m->m[1] = v->m[1]; + m->m[2] = v->m[2]; + m->m[3] = 0.f; + m->m[4] = v->m[3]; + m->m[5] = v->m[4]; + m->m[6] = v->m[5]; + m->m[7] = 0.f; + m->m[8] = v->m[6]; + m->m[9] = v->m[7]; + m->m[10] = v->m[8]; + m->m[11] = 0.f; + m->m[12] = 0.f; + m->m[13] = 0.f; + m->m[14] = 0.f; + m->m[15] = 1.f; +} + +static void SC_MatrixLoad_4x4_2x2(rs_matrix4x4 *m, const rs_matrix2x2 *v) { + m->m[0] = v->m[0]; + m->m[1] = v->m[1]; + m->m[2] = 0.f; + m->m[3] = 0.f; + m->m[4] = v->m[2]; + m->m[5] = v->m[3]; + m->m[6] = 0.f; + m->m[7] = 0.f; + m->m[8] = 0.f; + m->m[9] = 0.f; + m->m[10] = 1.f; + m->m[11] = 0.f; + m->m[12] = 0.f; + m->m[13] = 0.f; + m->m[14] = 0.f; + m->m[15] = 1.f; +} + +static void SC_MatrixLoad_3x3_3x3(rs_matrix3x3 *m, const rs_matrix3x3 *v) { + m->m[0] = v->m[0]; + m->m[1] = v->m[1]; + m->m[2] = v->m[2]; + m->m[3] = v->m[3]; + m->m[4] = v->m[4]; + m->m[5] = v->m[5]; + m->m[6] = v->m[6]; + m->m[7] = v->m[7]; + m->m[8] = v->m[8]; +} + +static void SC_MatrixLoad_2x2_2x2(rs_matrix2x2 *m, const rs_matrix2x2 *v) { + m->m[0] = v->m[0]; + m->m[1] = v->m[1]; + m->m[2] = v->m[2]; + m->m[3] = v->m[3]; +} + +static void SC_MatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z) { + float c, s; + m->m[3] = 0; + m->m[7] = 0; + m->m[11]= 0; + m->m[12]= 0; + m->m[13]= 0; + m->m[14]= 0; + m->m[15]= 1; + rot *= (float)(M_PI / 180.0f); + c = cos(rot); + s = sin(rot); + + const float len = x*x + y*y + z*z; + if (len != 1) { + const float recipLen = 1.f / sqrt(len); + x *= recipLen; + y *= recipLen; + z *= recipLen; + } + const float nc = 1.0f - c; + const float xy = x * y; + const float yz = y * z; + const float zx = z * x; + const float xs = x * s; + const float ys = y * s; + const float zs = z * s; + m->m[ 0] = x*x*nc + c; + m->m[ 4] = xy*nc - zs; + m->m[ 8] = zx*nc + ys; + m->m[ 1] = xy*nc + zs; + m->m[ 5] = y*y*nc + c; + m->m[ 9] = yz*nc - xs; + m->m[ 2] = zx*nc - ys; + m->m[ 6] = yz*nc + xs; + m->m[10] = z*z*nc + c; +} + +static void SC_MatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z) { + SC_MatrixLoadIdentity_4x4(m); + m->m[0] = x; + m->m[5] = y; + m->m[10] = z; +} + +static void SC_MatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z) { + SC_MatrixLoadIdentity_4x4(m); + m->m[12] = x; + m->m[13] = y; + m->m[14] = z; +} + +static void SC_MatrixLoadMultiply_4x4_4x4_4x4(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs) { + for (int i=0 ; i<4 ; i++) { + float ri0 = 0; + float ri1 = 0; + float ri2 = 0; + float ri3 = 0; + for (int j=0 ; j<4 ; j++) { + const float rhs_ij = rsMatrixGet(rhs, i,j); + ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; + ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; + ri2 += rsMatrixGet(lhs, j, 2) * rhs_ij; + ri3 += rsMatrixGet(lhs, j, 3) * rhs_ij; + } + rsMatrixSet(m, i, 0, ri0); + rsMatrixSet(m, i, 1, ri1); + rsMatrixSet(m, i, 2, ri2); + rsMatrixSet(m, i, 3, ri3); + } +} + +static void SC_MatrixMultiply_4x4_4x4(rs_matrix4x4 *m, const rs_matrix4x4 *rhs) { + rs_matrix4x4 mt; + SC_MatrixLoadMultiply_4x4_4x4_4x4(&mt, m, rhs); + SC_MatrixLoad_4x4_4x4(m, &mt); +} + +static void SC_MatrixLoadMultiply_3x3_3x3_3x3(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs) { + for (int i=0 ; i<3 ; i++) { + float ri0 = 0; + float ri1 = 0; + float ri2 = 0; + for (int j=0 ; j<3 ; j++) { + const float rhs_ij = rsMatrixGet(rhs, i,j); + ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; + ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; + ri2 += rsMatrixGet(lhs, j, 2) * rhs_ij; + } + rsMatrixSet(m, i, 0, ri0); + rsMatrixSet(m, i, 1, ri1); + rsMatrixSet(m, i, 2, ri2); + } +} + +static void SC_MatrixMultiply_3x3_3x3(rs_matrix3x3 *m, const rs_matrix3x3 *rhs) { + rs_matrix3x3 mt; + SC_MatrixLoadMultiply_3x3_3x3_3x3(&mt, m, rhs); + SC_MatrixLoad_3x3_3x3(m, &mt); +} + +static void SC_MatrixLoadMultiply_2x2_2x2_2x2(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs) { + for (int i=0 ; i<2 ; i++) { + float ri0 = 0; + float ri1 = 0; + for (int j=0 ; j<2 ; j++) { + const float rhs_ij = rsMatrixGet(rhs, i,j); + ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; + ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; + } + rsMatrixSet(m, i, 0, ri0); + rsMatrixSet(m, i, 1, ri1); + } +} + +static void SC_MatrixMultiply_2x2_2x2(rs_matrix2x2 *m, const rs_matrix2x2 *rhs) { + rs_matrix2x2 mt; + SC_MatrixLoadMultiply_2x2_2x2_2x2(&mt, m, rhs); + SC_MatrixLoad_2x2_2x2(m, &mt); +} + +static void SC_MatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z) { + rs_matrix4x4 m1; + SC_MatrixLoadRotate(&m1, rot, x, y, z); + SC_MatrixMultiply_4x4_4x4(m, &m1); +} + +static void SC_MatrixScale(rs_matrix4x4 *m, float x, float y, float z) { + rs_matrix4x4 m1; + SC_MatrixLoadScale(&m1, x, y, z); + SC_MatrixMultiply_4x4_4x4(m, &m1); +} + +static void SC_MatrixTranslate(rs_matrix4x4 *m, float x, float y, float z) { + rs_matrix4x4 m1; + SC_MatrixLoadTranslate(&m1, x, y, z); + SC_MatrixMultiply_4x4_4x4(m, &m1); +} + +static void SC_MatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far) { + SC_MatrixLoadIdentity_4x4(m); + m->m[0] = 2.f / (right - left); + m->m[5] = 2.f / (top - bottom); + m->m[10]= -2.f / (far - near); + m->m[12]= -(right + left) / (right - left); + m->m[13]= -(top + bottom) / (top - bottom); + m->m[14]= -(far + near) / (far - near); +} + +static void SC_MatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far) { + SC_MatrixLoadIdentity_4x4(m); + m->m[0] = 2.f * near / (right - left); + m->m[5] = 2.f * near / (top - bottom); + m->m[8] = (right + left) / (right - left); + m->m[9] = (top + bottom) / (top - bottom); + m->m[10]= -(far + near) / (far - near); + m->m[11]= -1.f; + m->m[14]= -2.f * far * near / (far - near); + m->m[15]= 0.f; +} + +static void SC_MatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far) { + float top = near * tan((float) (fovy * M_PI / 360.0f)); + float bottom = -top; + float left = bottom * aspect; + float right = top * aspect; + SC_MatrixLoadFrustum(m, left, right, bottom, top, near, far); +} + + +// Returns true if the matrix was successfully inversed +static bool SC_MatrixInverse_4x4(rs_matrix4x4 *m) { + rs_matrix4x4 result; + + int i, j; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + // computeCofactor for int i, int j + int c0 = (i+1) % 4; + int c1 = (i+2) % 4; + int c2 = (i+3) % 4; + int r0 = (j+1) % 4; + int r1 = (j+2) % 4; + int r2 = (j+3) % 4; + + float minor = (m->m[c0 + 4*r0] * (m->m[c1 + 4*r1] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r1])) + - (m->m[c0 + 4*r1] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r0])) + + (m->m[c0 + 4*r2] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r1] - m->m[c1 + 4*r1] * m->m[c2 + 4*r0])); + + float cofactor = (i+j) & 1 ? -minor : minor; + + result.m[4*i + j] = cofactor; + } + } + + // Dot product of 0th column of source and 0th row of result + float det = m->m[0]*result.m[0] + m->m[4]*result.m[1] + + m->m[8]*result.m[2] + m->m[12]*result.m[3]; + + if (fabs(det) < 1e-6) { + return false; + } + + det = 1.0f / det; + for (i = 0; i < 16; ++i) { + m->m[i] = result.m[i] * det; + } + + return true; +} + +// Returns true if the matrix was successfully inversed +static bool SC_MatrixInverseTranspose_4x4(rs_matrix4x4 *m) { + rs_matrix4x4 result; + + int i, j; + for (i = 0; i < 4; ++i) { + for (j = 0; j < 4; ++j) { + // computeCofactor for int i, int j + int c0 = (i+1) % 4; + int c1 = (i+2) % 4; + int c2 = (i+3) % 4; + int r0 = (j+1) % 4; + int r1 = (j+2) % 4; + int r2 = (j+3) % 4; + + float minor = (m->m[c0 + 4*r0] * (m->m[c1 + 4*r1] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r1])) + - (m->m[c0 + 4*r1] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r0])) + + (m->m[c0 + 4*r2] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r1] - m->m[c1 + 4*r1] * m->m[c2 + 4*r0])); + + float cofactor = (i+j) & 1 ? -minor : minor; + + result.m[4*j + i] = cofactor; + } + } + + // Dot product of 0th column of source and 0th column of result + float det = m->m[0]*result.m[0] + m->m[4]*result.m[4] + + m->m[8]*result.m[8] + m->m[12]*result.m[12]; + + if (fabs(det) < 1e-6) { + return false; + } + + det = 1.0f / det; + for (i = 0; i < 16; ++i) { + m->m[i] = result.m[i] * det; + } + + return true; +} + +static void SC_MatrixTranspose_4x4(rs_matrix4x4 *m) { + int i, j; + float temp; + for (i = 0; i < 3; ++i) { + for (j = i + 1; j < 4; ++j) { + temp = m->m[i*4 + j]; + m->m[i*4 + j] = m->m[j*4 + i]; + m->m[j*4 + i] = temp; + } + } +} + +static void SC_MatrixTranspose_3x3(rs_matrix3x3 *m) { + int i, j; + float temp; + for (i = 0; i < 2; ++i) { + for (j = i + 1; j < 3; ++j) { + temp = m->m[i*3 + j]; + m->m[i*3 + j] = m->m[j*4 + i]; + m->m[j*3 + i] = temp; + } + } +} + +static void SC_MatrixTranspose_2x2(rs_matrix2x2 *m) { + float temp = m->m[1]; + m->m[1] = m->m[2]; + m->m[2] = temp; +} + + ////////////////////////////////////////////////////////////////////////////// // Class implementation ////////////////////////////////////////////////////////////////////////////// @@ -473,6 +956,45 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z22rsSendToClientBlockingi", (void *)&SC_toClientBlocking, false }, { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_toClientBlocking2, false }, + // matrix + { "_Z20rsMatrixLoadIdentityP12rs_matrix4x4", (void *)&SC_MatrixLoadIdentity_4x4, false }, + { "_Z20rsMatrixLoadIdentityP12rs_matrix3x3", (void *)&SC_MatrixLoadIdentity_3x3, false }, + { "_Z20rsMatrixLoadIdentityP12rs_matrix2x2", (void *)&SC_MatrixLoadIdentity_2x2, false }, + + { "_Z12rsMatrixLoadP12rs_matrix4x4PKf", (void *)&SC_MatrixLoad_4x4_f, false }, + { "_Z12rsMatrixLoadP12rs_matrix3x3PKf", (void *)&SC_MatrixLoad_3x3_f, false }, + { "_Z12rsMatrixLoadP12rs_matrix2x2PKf", (void *)&SC_MatrixLoad_2x2_f, false }, + + { "_Z12rsMatrixLoadP12rs_matrix4x4PKS_", (void *)&SC_MatrixLoad_4x4_4x4, false }, + { "_Z12rsMatrixLoadP12rs_matrix4x4PK12rs_matrix3x3", (void *)&SC_MatrixLoad_4x4_3x3, false }, + { "_Z12rsMatrixLoadP12rs_matrix4x4PK12rs_matrix2x2", (void *)&SC_MatrixLoad_4x4_2x2, false }, + { "_Z12rsMatrixLoadP12rs_matrix3x3PKS_", (void *)&SC_MatrixLoad_3x3_3x3, false }, + { "_Z12rsMatrixLoadP12rs_matrix2x2PKS_", (void *)&SC_MatrixLoad_2x2_2x2, false }, + + { "_Z18rsMatrixLoadRotateP12rs_matrix4x4ffff", (void *)&SC_MatrixLoadRotate, false }, + { "_Z17rsMatrixLoadScaleP12rs_matrix4x4fff", (void *)&SC_MatrixLoadScale, false }, + { "_Z21rsMatrixLoadTranslateP12rs_matrix4x4fff", (void *)&SC_MatrixLoadTranslate, false }, + { "_Z14rsMatrixRotateP12rs_matrix4x4ffff", (void *)&SC_MatrixRotate, false }, + { "_Z13rsMatrixScaleP12rs_matrix4x4fff", (void *)&SC_MatrixScale, false }, + { "_Z17rsMatrixTranslateP12rs_matrix4x4fff", (void *)&SC_MatrixTranslate, false }, + + { "_Z20rsMatrixLoadMultiplyP12rs_matrix4x4PKS_S2_", (void *)&SC_MatrixLoadMultiply_4x4_4x4_4x4, false }, + { "_Z16rsMatrixMultiplyP12rs_matrix4x4PKS_", (void *)&SC_MatrixMultiply_4x4_4x4, false }, + { "_Z20rsMatrixLoadMultiplyP12rs_matrix3x3PKS_S2_", (void *)&SC_MatrixLoadMultiply_3x3_3x3_3x3, false }, + { "_Z16rsMatrixMultiplyP12rs_matrix3x3PKS_", (void *)&SC_MatrixMultiply_3x3_3x3, false }, + { "_Z20rsMatrixLoadMultiplyP12rs_matrix2x2PKS_S2_", (void *)&SC_MatrixLoadMultiply_2x2_2x2_2x2, false }, + { "_Z16rsMatrixMultiplyP12rs_matrix2x2PKS_", (void *)&SC_MatrixMultiply_2x2_2x2, false }, + + { "_Z17rsMatrixLoadOrthoP12rs_matrix4x4ffffff", (void *)&SC_MatrixLoadOrtho, false }, + { "_Z19rsMatrixLoadFrustumP12rs_matrix4x4ffffff", (void *)&SC_MatrixLoadFrustum, false }, + { "_Z23rsMatrixLoadPerspectiveP12rs_matrix4x4ffff", (void *)&SC_MatrixLoadPerspective, false }, + + { "_Z15rsMatrixInverseP12rs_matrix4x4", (void *)&SC_MatrixInverse_4x4, false }, + { "_Z24rsMatrixInverseTransposeP12rs_matrix4x4", (void *)&SC_MatrixInverseTranspose_4x4, false }, + { "_Z17rsMatrixTransposeP12rs_matrix4x4", (void *)&SC_MatrixTranspose_4x4, false }, + { "_Z17rsMatrixTransposeP12rs_matrix4x4", (void *)&SC_MatrixTranspose_3x3, false }, + { "_Z17rsMatrixTransposeP12rs_matrix4x4", (void *)&SC_MatrixTranspose_2x2, false }, + { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach, false }, //{ "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach2, true }, diff --git a/libs/rs/scriptc/rs_cl.rsh b/libs/rs/scriptc/rs_cl.rsh index 3c0496d08e3f..3a9686bdaee2 100644 --- a/libs/rs/scriptc/rs_cl.rsh +++ b/libs/rs/scriptc/rs_cl.rsh @@ -1,30 +1,17 @@ #ifndef __RS_CL_RSH__ #define __RS_CL_RSH__ -#ifdef BCC_PREPARE_BC #define _RS_STATIC extern -#else -#define _RS_STATIC static -#endif // Conversions #define CVT_FUNC_2(typeout, typein) \ _RS_STATIC typeout##2 __attribute__((overloadable)) \ - convert_##typeout##2(typein##2 v) { \ - typeout##2 r = {(typeout)v.x, (typeout)v.y}; \ - return r; \ -} \ + convert_##typeout##2(typein##2 v); \ _RS_STATIC typeout##3 __attribute__((overloadable)) \ - convert_##typeout##3(typein##3 v) { \ - typeout##3 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z}; \ - return r; \ -} \ + convert_##typeout##3(typein##3 v); \ _RS_STATIC typeout##4 __attribute__((overloadable)) \ - convert_##typeout##4(typein##4 v) { \ - typeout##4 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z, \ - (typeout)v.w}; \ - return r; \ -} + convert_##typeout##4(typein##4 v); + #define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \ CVT_FUNC_2(type, char) \ @@ -45,279 +32,63 @@ CVT_FUNC(float) // Float ops, 6.11.2 #define FN_FUNC_FN(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v) { \ - float2 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v) { \ - float3 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v) { \ - float4 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - r.w = fnc(v.w); \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v); #define IN_FUNC_FN(fnc) \ -_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \ - int2 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - return r; \ -} \ -_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v) { \ - int3 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - return r; \ -} \ -_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \ - int4 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - r.w = fnc(v.w); \ - return r; \ -} +_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v); \ +_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v); \ +_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v); #define FN_FUNC_FN_FN(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2) { \ - float2 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2) { \ - float3 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2) { \ - float4 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - r.w = fnc(v1.w, v2.w); \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2); #define FN_FUNC_FN_F(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \ - float2 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2) { \ - float3 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - r.z = fnc(v1.z, v2); \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \ - float4 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - r.z = fnc(v1.z, v2); \ - r.w = fnc(v1.w, v2); \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2); #define FN_FUNC_FN_IN(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \ - float2 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \ - float3 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \ - float4 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - r.w = fnc(v1.w, v2.w); \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2); \ #define FN_FUNC_FN_I(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \ - float2 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \ - float3 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - r.z = fnc(v1.z, v2); \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \ - float4 r; \ - r.x = fnc(v1.x, v2); \ - r.y = fnc(v1.y, v2); \ - r.z = fnc(v1.z, v2); \ - r.w = fnc(v1.w, v2); \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2); #define FN_FUNC_FN_PFN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) \ - fnc(float2 v1, float2 *v2) { \ - float2 r; \ - float t[2]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - return r; \ -} \ + fnc(float2 v1, float2 *v2); \ _RS_STATIC float3 __attribute__((overloadable)) \ - fnc(float3 v1, float3 *v2) { \ - float3 r; \ - float t[3]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - r.z = fnc(v1.z, &t[2]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - v2->z = t[2]; \ - return r; \ -} \ + fnc(float3 v1, float3 *v2); \ _RS_STATIC float4 __attribute__((overloadable)) \ - fnc(float4 v1, float4 *v2) { \ - float4 r; \ - float t[4]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - r.z = fnc(v1.z, &t[2]); \ - r.w = fnc(v1.w, &t[3]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - v2->z = t[2]; \ - v2->w = t[3]; \ - return r; \ -} + fnc(float4 v1, float4 *v2); #define FN_FUNC_FN_PIN(fnc) \ -_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \ - float2 r; \ - int t[2]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - return r; \ -} \ -_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \ - float3 r; \ - int t[3]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - r.z = fnc(v1.z, &t[2]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - v2->z = t[2]; \ - return r; \ -} \ -_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \ - float4 r; \ - int t[4]; \ - r.x = fnc(v1.x, &t[0]); \ - r.y = fnc(v1.y, &t[1]); \ - r.z = fnc(v1.z, &t[2]); \ - r.w = fnc(v1.w, &t[3]); \ - v2->x = t[0]; \ - v2->y = t[1]; \ - v2->z = t[2]; \ - v2->w = t[3]; \ - return r; \ -} +_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2); \ +_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2); \ +_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2); #define FN_FUNC_FN_FN_FN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) \ - fnc(float2 v1, float2 v2, float2 v3) { \ - float2 r; \ - r.x = fnc(v1.x, v2.x, v3.x); \ - r.y = fnc(v1.y, v2.y, v3.y); \ - return r; \ -} \ + fnc(float2 v1, float2 v2, float2 v3); \ _RS_STATIC float3 __attribute__((overloadable)) \ - fnc(float3 v1, float3 v2, float3 v3) { \ - float3 r; \ - r.x = fnc(v1.x, v2.x, v3.x); \ - r.y = fnc(v1.y, v2.y, v3.y); \ - r.z = fnc(v1.z, v2.z, v3.z); \ - return r; \ -} \ + fnc(float3 v1, float3 v2, float3 v3); \ _RS_STATIC float4 __attribute__((overloadable)) \ - fnc(float4 v1, float4 v2, float4 v3) { \ - float4 r; \ - r.x = fnc(v1.x, v2.x, v3.x); \ - r.y = fnc(v1.y, v2.y, v3.y); \ - r.z = fnc(v1.z, v2.z, v3.z); \ - r.w = fnc(v1.w, v2.w, v3.w); \ - return r; \ -} + fnc(float4 v1, float4 v2, float4 v3); #define FN_FUNC_FN_FN_PIN(fnc) \ _RS_STATIC float2 __attribute__((overloadable)) \ - fnc(float2 v1, float2 v2, int2 *v3) { \ - float2 r; \ - int t[2]; \ - r.x = fnc(v1.x, v2.x, &t[0]); \ - r.y = fnc(v1.y, v2.y, &t[1]); \ - v3->x = t[0]; \ - v3->y = t[1]; \ - return r; \ -} \ + fnc(float2 v1, float2 v2, int2 *v3); \ _RS_STATIC float3 __attribute__((overloadable)) \ - fnc(float3 v1, float3 v2, int3 *v3) { \ - float3 r; \ - int t[3]; \ - r.x = fnc(v1.x, v2.x, &t[0]); \ - r.y = fnc(v1.y, v2.y, &t[1]); \ - r.z = fnc(v1.z, v2.z, &t[2]); \ - v3->x = t[0]; \ - v3->y = t[1]; \ - v3->z = t[2]; \ - return r; \ -} \ + fnc(float3 v1, float3 v2, int3 *v3); \ _RS_STATIC float4 __attribute__((overloadable)) \ - fnc(float4 v1, float4 v2, int4 *v3) { \ - float4 r; \ - int t[4]; \ - r.x = fnc(v1.x, v2.x, &t[0]); \ - r.y = fnc(v1.y, v2.y, &t[1]); \ - r.z = fnc(v1.z, v2.z, &t[2]); \ - r.w = fnc(v1.w, v2.w, &t[3]); \ - v3->x = t[0]; \ - v3->y = t[1]; \ - v3->z = t[2]; \ - v3->w = t[3]; \ - return r; \ -} + fnc(float4 v1, float4 v2, int4 *v3); extern float __attribute__((overloadable)) acos(float); @@ -326,9 +97,9 @@ FN_FUNC_FN(acos) extern float __attribute__((overloadable)) acosh(float); FN_FUNC_FN(acosh) -_RS_STATIC float __attribute__((overloadable)) acospi(float v) { - return acos(v) / M_PI; -} +_RS_STATIC float __attribute__((overloadable)) acospi(float v); + + FN_FUNC_FN(acospi) extern float __attribute__((overloadable)) asin(float); @@ -337,9 +108,8 @@ FN_FUNC_FN(asin) extern float __attribute__((overloadable)) asinh(float); FN_FUNC_FN(asinh) -_RS_STATIC float __attribute__((overloadable)) asinpi(float v) { - return asin(v) / M_PI; -} + +_RS_STATIC float __attribute__((overloadable)) asinpi(float v); FN_FUNC_FN(asinpi) extern float __attribute__((overloadable)) atan(float); @@ -351,14 +121,12 @@ FN_FUNC_FN_FN(atan2) extern float __attribute__((overloadable)) atanh(float); FN_FUNC_FN(atanh) -_RS_STATIC float __attribute__((overloadable)) atanpi(float v) { - return atan(v) / M_PI; -} + +_RS_STATIC float __attribute__((overloadable)) atanpi(float v); FN_FUNC_FN(atanpi) -_RS_STATIC float __attribute__((overloadable)) atan2pi(float y, float x) { - return atan2(y, x) / M_PI; -} + +_RS_STATIC float __attribute__((overloadable)) atan2pi(float y, float x); FN_FUNC_FN_FN(atan2pi) extern float __attribute__((overloadable)) cbrt(float); @@ -376,9 +144,8 @@ FN_FUNC_FN(cos) extern float __attribute__((overloadable)) cosh(float); FN_FUNC_FN(cosh) -_RS_STATIC float __attribute__((overloadable)) cospi(float v) { - return cos(v * M_PI); -} + +_RS_STATIC float __attribute__((overloadable)) cospi(float v); FN_FUNC_FN(cospi) extern float __attribute__((overloadable)) erfc(float); @@ -394,9 +161,8 @@ extern float __attribute__((overloadable)) exp2(float); FN_FUNC_FN(exp2) extern float __attribute__((overloadable)) pow(float, float); -_RS_STATIC float __attribute__((overloadable)) exp10(float v) { - return pow(10.f, v); -} + +_RS_STATIC float __attribute__((overloadable)) exp10(float v); FN_FUNC_FN(exp10) extern float __attribute__((overloadable)) expm1(float); @@ -425,11 +191,8 @@ FN_FUNC_FN_F(fmin); extern float __attribute__((overloadable)) fmod(float, float); FN_FUNC_FN_FN(fmod) -_RS_STATIC float __attribute__((overloadable)) fract(float v, float *iptr) { - int i = (int)floor(v); - iptr[0] = i; - return fmin(v - i, 0x1.fffffep-1f); -} + +_RS_STATIC float __attribute__((overloadable)) fract(float v, float *iptr); FN_FUNC_FN_PFN(fract) extern float __attribute__((overloadable)) frexp(float, int *); @@ -457,9 +220,8 @@ FN_FUNC_FN(log) extern float __attribute__((overloadable)) log10(float); FN_FUNC_FN(log10) -_RS_STATIC float __attribute__((overloadable)) log2(float v) { - return log10(v) / log10(2.f); -} + +_RS_STATIC float __attribute__((overloadable)) log2(float v); FN_FUNC_FN(log2) extern float __attribute__((overloadable)) log1p(float); @@ -481,31 +243,15 @@ FN_FUNC_FN_FN(nextafter) FN_FUNC_FN_FN(pow) -_RS_STATIC float __attribute__((overloadable)) pown(float v, int p) { - return pow(v, (float)p); -} -_RS_STATIC float2 __attribute__((overloadable)) pown(float2 v, int2 p) { - return pow(v, (float2)p); -} -_RS_STATIC float3 __attribute__((overloadable)) pown(float3 v, int3 p) { - return pow(v, (float3)p); -} -_RS_STATIC float4 __attribute__((overloadable)) pown(float4 v, int4 p) { - return pow(v, (float4)p); -} - -_RS_STATIC float __attribute__((overloadable)) powr(float v, float p) { - return pow(v, p); -} -_RS_STATIC float2 __attribute__((overloadable)) powr(float2 v, float2 p) { - return pow(v, p); -} -_RS_STATIC float3 __attribute__((overloadable)) powr(float3 v, float3 p) { - return pow(v, p); -} -_RS_STATIC float4 __attribute__((overloadable)) powr(float4 v, float4 p) { - return pow(v, p); -} +_RS_STATIC float __attribute__((overloadable)) pown(float v, int p); +_RS_STATIC float2 __attribute__((overloadable)) pown(float2 v, int2 p); +_RS_STATIC float3 __attribute__((overloadable)) pown(float3 v, int3 p); +_RS_STATIC float4 __attribute__((overloadable)) pown(float4 v, int4 p); + +_RS_STATIC float __attribute__((overloadable)) powr(float v, float p); +_RS_STATIC float2 __attribute__((overloadable)) powr(float2 v, float2 p); +_RS_STATIC float3 __attribute__((overloadable)) powr(float3 v, float3 p); +_RS_STATIC float4 __attribute__((overloadable)) powr(float4 v, float4 p); extern float __attribute__((overloadable)) remainder(float, float); FN_FUNC_FN_FN(remainder) @@ -516,57 +262,33 @@ FN_FUNC_FN_FN_PIN(remquo) extern float __attribute__((overloadable)) rint(float); FN_FUNC_FN(rint) -_RS_STATIC float __attribute__((overloadable)) rootn(float v, int r) { - return pow(v, 1.f / r); -} -_RS_STATIC float2 __attribute__((overloadable)) rootn(float2 v, int2 r) { - float2 t = {1.f / r.x, 1.f / r.y}; - return pow(v, t); -} -_RS_STATIC float3 __attribute__((overloadable)) rootn(float3 v, int3 r) { - float3 t = {1.f / r.x, 1.f / r.y, 1.f / r.z}; - return pow(v, t); -} -_RS_STATIC float4 __attribute__((overloadable)) rootn(float4 v, int4 r) { - float4 t = {1.f / r.x, 1.f / r.y, 1.f / r.z, 1.f / r.w}; - return pow(v, t); -} + +_RS_STATIC float __attribute__((overloadable)) rootn(float v, int r); +_RS_STATIC float2 __attribute__((overloadable)) rootn(float2 v, int2 r); +_RS_STATIC float3 __attribute__((overloadable)) rootn(float3 v, int3 r); +_RS_STATIC float4 __attribute__((overloadable)) rootn(float4 v, int4 r); + extern float __attribute__((overloadable)) round(float); FN_FUNC_FN(round) + extern float __attribute__((overloadable)) sqrt(float); -_RS_STATIC float __attribute__((overloadable)) rsqrt(float v) { - return 1.f / sqrt(v); -} +_RS_STATIC float __attribute__((overloadable)) rsqrt(float v); FN_FUNC_FN(rsqrt) extern float __attribute__((overloadable)) sin(float); FN_FUNC_FN(sin) -_RS_STATIC float __attribute__((overloadable)) sincos(float v, float *cosptr) { - *cosptr = cos(v); - return sin(v); -} -_RS_STATIC float2 __attribute__((overloadable)) sincos(float2 v, float2 *cosptr) { - *cosptr = cos(v); - return sin(v); -} -_RS_STATIC float3 __attribute__((overloadable)) sincos(float3 v, float3 *cosptr) { - *cosptr = cos(v); - return sin(v); -} -_RS_STATIC float4 __attribute__((overloadable)) sincos(float4 v, float4 *cosptr) { - *cosptr = cos(v); - return sin(v); -} +_RS_STATIC float __attribute__((overloadable)) sincos(float v, float *cosptr); +_RS_STATIC float2 __attribute__((overloadable)) sincos(float2 v, float2 *cosptr); +_RS_STATIC float3 __attribute__((overloadable)) sincos(float3 v, float3 *cosptr); +_RS_STATIC float4 __attribute__((overloadable)) sincos(float4 v, float4 *cosptr); extern float __attribute__((overloadable)) sinh(float); FN_FUNC_FN(sinh) -_RS_STATIC float __attribute__((overloadable)) sinpi(float v) { - return sin(v * M_PI); -} +_RS_STATIC float __attribute__((overloadable)) sinpi(float v); FN_FUNC_FN(sinpi) FN_FUNC_FN(sqrt) @@ -577,11 +299,10 @@ FN_FUNC_FN(tan) extern float __attribute__((overloadable)) tanh(float); FN_FUNC_FN(tanh) -_RS_STATIC float __attribute__((overloadable)) tanpi(float v) { - return tan(v * M_PI); -} +_RS_STATIC float __attribute__((overloadable)) tanpi(float v); FN_FUNC_FN(tanpi) + extern float __attribute__((overloadable)) tgamma(float); FN_FUNC_FN(tgamma) @@ -592,27 +313,9 @@ FN_FUNC_FN(trunc) #define XN_FUNC_YN(typeout, fnc, typein) \ extern typeout __attribute__((overloadable)) fnc(typein); \ -_RS_STATIC typeout##2 __attribute__((overloadable)) fnc(typein##2 v) { \ - typeout##2 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - return r; \ -} \ -_RS_STATIC typeout##3 __attribute__((overloadable)) fnc(typein##3 v) { \ - typeout##3 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - return r; \ -} \ -_RS_STATIC typeout##4 __attribute__((overloadable)) fnc(typein##4 v) { \ - typeout##4 r; \ - r.x = fnc(v.x); \ - r.y = fnc(v.y); \ - r.z = fnc(v.z); \ - r.w = fnc(v.w); \ - return r; \ -} +_RS_STATIC typeout##2 __attribute__((overloadable)) fnc(typein##2 v); \ +_RS_STATIC typeout##3 __attribute__((overloadable)) fnc(typein##3 v); \ +_RS_STATIC typeout##4 __attribute__((overloadable)) fnc(typein##4 v); #define UIN_FUNC_IN(fnc) \ XN_FUNC_YN(uchar, fnc, char) \ @@ -627,35 +330,16 @@ XN_FUNC_YN(short, fnc, short) \ XN_FUNC_YN(uint, fnc, uint) \ XN_FUNC_YN(int, fnc, int) + #define XN_FUNC_XN_XN_BODY(type, fnc, body) \ _RS_STATIC type __attribute__((overloadable)) \ - fnc(type v1, type v2) { \ - return body; \ -} \ + fnc(type v1, type v2); \ _RS_STATIC type##2 __attribute__((overloadable)) \ - fnc(type##2 v1, type##2 v2) { \ - type##2 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - return r; \ -} \ + fnc(type##2 v1, type##2 v2); \ _RS_STATIC type##3 __attribute__((overloadable)) \ - fnc(type##3 v1, type##3 v2) { \ - type##3 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - return r; \ -} \ + fnc(type##3 v1, type##3 v2); \ _RS_STATIC type##4 __attribute__((overloadable)) \ - fnc(type##4 v1, type##4 v2) { \ - type##4 r; \ - r.x = fnc(v1.x, v2.x); \ - r.y = fnc(v1.y, v2.y); \ - r.z = fnc(v1.z, v2.z); \ - r.w = fnc(v1.w, v2.w); \ - return r; \ -} + fnc(type##4 v1, type##4 v2); #define IN_FUNC_IN_IN_BODY(fnc, body) \ XN_FUNC_XN_XN_BODY(uchar, fnc, body) \ @@ -677,129 +361,35 @@ FN_FUNC_FN_F(max) // 6.11.4 -_RS_STATIC float __attribute__((overloadable)) clamp(float amount, float low, float high) { - return amount < low ? low : (amount > high ? high : amount); -} -_RS_STATIC float2 __attribute__((overloadable)) clamp(float2 amount, float2 low, float2 high) { - float2 r; - r.x = amount.x < low.x ? low.x : (amount.x > high.x ? high.x : amount.x); - r.y = amount.y < low.y ? low.y : (amount.y > high.y ? high.y : amount.y); - return r; -} -_RS_STATIC float3 __attribute__((overloadable)) clamp(float3 amount, float3 low, float3 high) { - float3 r; - r.x = amount.x < low.x ? low.x : (amount.x > high.x ? high.x : amount.x); - r.y = amount.y < low.y ? low.y : (amount.y > high.y ? high.y : amount.y); - r.z = amount.z < low.z ? low.z : (amount.z > high.z ? high.z : amount.z); - return r; -} -_RS_STATIC float4 __attribute__((overloadable)) clamp(float4 amount, float4 low, float4 high) { - float4 r; - r.x = amount.x < low.x ? low.x : (amount.x > high.x ? high.x : amount.x); - r.y = amount.y < low.y ? low.y : (amount.y > high.y ? high.y : amount.y); - r.z = amount.z < low.z ? low.z : (amount.z > high.z ? high.z : amount.z); - r.w = amount.w < low.w ? low.w : (amount.w > high.w ? high.w : amount.w); - return r; -} -_RS_STATIC float2 __attribute__((overloadable)) clamp(float2 amount, float low, float high) { - float2 r; - r.x = amount.x < low ? low : (amount.x > high ? high : amount.x); - r.y = amount.y < low ? low : (amount.y > high ? high : amount.y); - return r; -} -_RS_STATIC float3 __attribute__((overloadable)) clamp(float3 amount, float low, float high) { - float3 r; - r.x = amount.x < low ? low : (amount.x > high ? high : amount.x); - r.y = amount.y < low ? low : (amount.y > high ? high : amount.y); - r.z = amount.z < low ? low : (amount.z > high ? high : amount.z); - return r; -} -_RS_STATIC float4 __attribute__((overloadable)) clamp(float4 amount, float low, float high) { - float4 r; - r.x = amount.x < low ? low : (amount.x > high ? high : amount.x); - r.y = amount.y < low ? low : (amount.y > high ? high : amount.y); - r.z = amount.z < low ? low : (amount.z > high ? high : amount.z); - r.w = amount.w < low ? low : (amount.w > high ? high : amount.w); - return r; -} - -_RS_STATIC float __attribute__((overloadable)) degrees(float radians) { - return radians * (180.f / M_PI); -} +_RS_STATIC float __attribute__((overloadable)) clamp(float amount, float low, float high); +_RS_STATIC float2 __attribute__((overloadable)) clamp(float2 amount, float2 low, float2 high); +_RS_STATIC float3 __attribute__((overloadable)) clamp(float3 amount, float3 low, float3 high); +_RS_STATIC float4 __attribute__((overloadable)) clamp(float4 amount, float4 low, float4 high); +_RS_STATIC float2 __attribute__((overloadable)) clamp(float2 amount, float low, float high); +_RS_STATIC float3 __attribute__((overloadable)) clamp(float3 amount, float low, float high); +_RS_STATIC float4 __attribute__((overloadable)) clamp(float4 amount, float low, float high); + +_RS_STATIC float __attribute__((overloadable)) degrees(float radians); FN_FUNC_FN(degrees) -_RS_STATIC float __attribute__((overloadable)) mix(float start, float stop, float amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float2 amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float3 amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float4 amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float amount) { - return start + (stop - start) * amount; -} -_RS_STATIC float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float amount) { - return start + (stop - start) * amount; -} - -_RS_STATIC float __attribute__((overloadable)) radians(float degrees) { - return degrees * (M_PI / 180.f); -} +_RS_STATIC float __attribute__((overloadable)) mix(float start, float stop, float amount); +_RS_STATIC float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float2 amount); +_RS_STATIC float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float3 amount); +_RS_STATIC float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float4 amount); +_RS_STATIC float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float amount); +_RS_STATIC float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float amount); +_RS_STATIC float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float amount); + +_RS_STATIC float __attribute__((overloadable)) radians(float degrees); FN_FUNC_FN(radians) -_RS_STATIC float __attribute__((overloadable)) step(float edge, float v) { - return (v < edge) ? 0.f : 1.f; -} -_RS_STATIC float2 __attribute__((overloadable)) step(float2 edge, float2 v) { - float2 r; - r.x = (v.x < edge.x) ? 0.f : 1.f; - r.y = (v.y < edge.y) ? 0.f : 1.f; - return r; -} -_RS_STATIC float3 __attribute__((overloadable)) step(float3 edge, float3 v) { - float3 r; - r.x = (v.x < edge.x) ? 0.f : 1.f; - r.y = (v.y < edge.y) ? 0.f : 1.f; - r.z = (v.z < edge.z) ? 0.f : 1.f; - return r; -} -_RS_STATIC float4 __attribute__((overloadable)) step(float4 edge, float4 v) { - float4 r; - r.x = (v.x < edge.x) ? 0.f : 1.f; - r.y = (v.y < edge.y) ? 0.f : 1.f; - r.z = (v.z < edge.z) ? 0.f : 1.f; - r.w = (v.w < edge.w) ? 0.f : 1.f; - return r; -} -_RS_STATIC float2 __attribute__((overloadable)) step(float2 edge, float v) { - float2 r; - r.x = (v < edge.x) ? 0.f : 1.f; - r.y = (v < edge.y) ? 0.f : 1.f; - return r; -} -_RS_STATIC float3 __attribute__((overloadable)) step(float3 edge, float v) { - float3 r; - r.x = (v < edge.x) ? 0.f : 1.f; - r.y = (v < edge.y) ? 0.f : 1.f; - r.z = (v < edge.z) ? 0.f : 1.f; - return r; -} -_RS_STATIC float4 __attribute__((overloadable)) step(float4 edge, float v) { - float4 r; - r.x = (v < edge.x) ? 0.f : 1.f; - r.y = (v < edge.y) ? 0.f : 1.f; - r.z = (v < edge.z) ? 0.f : 1.f; - r.w = (v < edge.w) ? 0.f : 1.f; - return r; -} +_RS_STATIC float __attribute__((overloadable)) step(float edge, float v); +_RS_STATIC float2 __attribute__((overloadable)) step(float2 edge, float2 v); +_RS_STATIC float3 __attribute__((overloadable)) step(float3 edge, float3 v); +_RS_STATIC float4 __attribute__((overloadable)) step(float4 edge, float4 v); +_RS_STATIC float2 __attribute__((overloadable)) step(float2 edge, float v); +_RS_STATIC float3 __attribute__((overloadable)) step(float3 edge, float v); +_RS_STATIC float4 __attribute__((overloadable)) step(float4 edge, float v); extern float __attribute__((overloadable)) smoothstep(float, float, float); extern float2 __attribute__((overloadable)) smoothstep(float2, float2, float2); @@ -809,82 +399,33 @@ extern float2 __attribute__((overloadable)) smoothstep(float, float, float2); extern float3 __attribute__((overloadable)) smoothstep(float, float, float3); extern float4 __attribute__((overloadable)) smoothstep(float, float, float4); -_RS_STATIC float __attribute__((overloadable)) sign(float v) { - if (v > 0) return 1.f; - if (v < 0) return -1.f; - return v; -} +_RS_STATIC float __attribute__((overloadable)) sign(float v); FN_FUNC_FN(sign) // 6.11.5 -_RS_STATIC float3 __attribute__((overloadable)) cross(float3 lhs, float3 rhs) { - float3 r; - r.x = lhs.y * rhs.z - lhs.z * rhs.y; - r.y = lhs.z * rhs.x - lhs.x * rhs.z; - r.z = lhs.x * rhs.y - lhs.y * rhs.x; - return r; -} - -_RS_STATIC float4 __attribute__((overloadable)) cross(float4 lhs, float4 rhs) { - float4 r; - r.x = lhs.y * rhs.z - lhs.z * rhs.y; - r.y = lhs.z * rhs.x - lhs.x * rhs.z; - r.z = lhs.x * rhs.y - lhs.y * rhs.x; - r.w = 0.f; - return r; -} - -_RS_STATIC float __attribute__((overloadable)) dot(float lhs, float rhs) { - return lhs * rhs; -} -_RS_STATIC float __attribute__((overloadable)) dot(float2 lhs, float2 rhs) { - return lhs.x*rhs.x + lhs.y*rhs.y; -} -_RS_STATIC float __attribute__((overloadable)) dot(float3 lhs, float3 rhs) { - return lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z; -} -_RS_STATIC float __attribute__((overloadable)) dot(float4 lhs, float4 rhs) { - return lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z + lhs.w*rhs.w; -} - -_RS_STATIC float __attribute__((overloadable)) length(float v) { - return v; -} -_RS_STATIC float __attribute__((overloadable)) length(float2 v) { - return sqrt(v.x*v.x + v.y*v.y); -} -_RS_STATIC float __attribute__((overloadable)) length(float3 v) { - return sqrt(v.x*v.x + v.y*v.y + v.z*v.z); -} -_RS_STATIC float __attribute__((overloadable)) length(float4 v) { - return sqrt(v.x*v.x + v.y*v.y + v.z*v.z + v.w*v.w); -} - -_RS_STATIC float __attribute__((overloadable)) distance(float lhs, float rhs) { - return length(lhs - rhs); -} -_RS_STATIC float __attribute__((overloadable)) distance(float2 lhs, float2 rhs) { - return length(lhs - rhs); -} -_RS_STATIC float __attribute__((overloadable)) distance(float3 lhs, float3 rhs) { - return length(lhs - rhs); -} -_RS_STATIC float __attribute__((overloadable)) distance(float4 lhs, float4 rhs) { - return length(lhs - rhs); -} - -_RS_STATIC float __attribute__((overloadable)) normalize(float v) { - return 1.f; -} -_RS_STATIC float2 __attribute__((overloadable)) normalize(float2 v) { - return v / length(v); -} -_RS_STATIC float3 __attribute__((overloadable)) normalize(float3 v) { - return v / length(v); -} -_RS_STATIC float4 __attribute__((overloadable)) normalize(float4 v) { - return v / length(v); -} +_RS_STATIC float3 __attribute__((overloadable)) cross(float3 lhs, float3 rhs); + +_RS_STATIC float4 __attribute__((overloadable)) cross(float4 lhs, float4 rhs); + +_RS_STATIC float __attribute__((overloadable)) dot(float lhs, float rhs); +_RS_STATIC float __attribute__((overloadable)) dot(float2 lhs, float2 rhs); +_RS_STATIC float __attribute__((overloadable)) dot(float3 lhs, float3 rhs); +_RS_STATIC float __attribute__((overloadable)) dot(float4 lhs, float4 rhs); + +_RS_STATIC float __attribute__((overloadable)) length(float v); +_RS_STATIC float __attribute__((overloadable)) length(float2 v); +_RS_STATIC float __attribute__((overloadable)) length(float3 v); +_RS_STATIC float __attribute__((overloadable)) length(float4 v); + +_RS_STATIC float __attribute__((overloadable)) distance(float lhs, float rhs); +_RS_STATIC float __attribute__((overloadable)) distance(float2 lhs, float2 rhs); +_RS_STATIC float __attribute__((overloadable)) distance(float3 lhs, float3 rhs); +_RS_STATIC float __attribute__((overloadable)) distance(float4 lhs, float4 rhs); + +_RS_STATIC float __attribute__((overloadable)) normalize(float v); +_RS_STATIC float2 __attribute__((overloadable)) normalize(float2 v); +_RS_STATIC float3 __attribute__((overloadable)) normalize(float3 v); +_RS_STATIC float4 __attribute__((overloadable)) normalize(float4 v); #undef CVT_FUNC #undef CVT_FUNC_2 diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index 21c0f7b6832a..fdaa903e8e39 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -131,352 +131,62 @@ rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col) { return m->m[row * 2 + col]; } -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadIdentity(rs_matrix4x4 *m) { - m->m[0] = 1.f; - m->m[1] = 0.f; - m->m[2] = 0.f; - m->m[3] = 0.f; - m->m[4] = 0.f; - m->m[5] = 1.f; - m->m[6] = 0.f; - m->m[7] = 0.f; - m->m[8] = 0.f; - m->m[9] = 0.f; - m->m[10] = 1.f; - m->m[11] = 0.f; - m->m[12] = 0.f; - m->m[13] = 0.f; - m->m[14] = 0.f; - m->m[15] = 1.f; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadIdentity(rs_matrix3x3 *m) { - m->m[0] = 1.f; - m->m[1] = 0.f; - m->m[2] = 0.f; - m->m[3] = 0.f; - m->m[4] = 1.f; - m->m[5] = 0.f; - m->m[6] = 0.f; - m->m[7] = 0.f; - m->m[8] = 1.f; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadIdentity(rs_matrix2x2 *m) { - m->m[0] = 1.f; - m->m[1] = 0.f; - m->m[2] = 0.f; - m->m[3] = 1.f; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix4x4 *m, const float *v) { - m->m[0] = v[0]; - m->m[1] = v[1]; - m->m[2] = v[2]; - m->m[3] = v[3]; - m->m[4] = v[4]; - m->m[5] = v[5]; - m->m[6] = v[6]; - m->m[7] = v[7]; - m->m[8] = v[8]; - m->m[9] = v[9]; - m->m[10] = v[10]; - m->m[11] = v[11]; - m->m[12] = v[12]; - m->m[13] = v[13]; - m->m[14] = v[14]; - m->m[15] = v[15]; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix3x3 *m, const float *v) { - m->m[0] = v[0]; - m->m[1] = v[1]; - m->m[2] = v[2]; - m->m[3] = v[3]; - m->m[4] = v[4]; - m->m[5] = v[5]; - m->m[6] = v[6]; - m->m[7] = v[7]; - m->m[8] = v[8]; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix2x2 *m, const float *v) { - m->m[0] = v[0]; - m->m[1] = v[1]; - m->m[2] = v[2]; - m->m[3] = v[3]; -} +extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m); +extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix3x3 *m); +extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const float *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v); +extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v) { - m->m[0] = v->m[0]; - m->m[1] = v->m[1]; - m->m[2] = v->m[2]; - m->m[3] = v->m[3]; - m->m[4] = v->m[4]; - m->m[5] = v->m[5]; - m->m[6] = v->m[6]; - m->m[7] = v->m[7]; - m->m[8] = v->m[8]; - m->m[9] = v->m[9]; - m->m[10] = v->m[10]; - m->m[11] = v->m[11]; - m->m[12] = v->m[12]; - m->m[13] = v->m[13]; - m->m[14] = v->m[14]; - m->m[15] = v->m[15]; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v) { - m->m[0] = v->m[0]; - m->m[1] = v->m[1]; - m->m[2] = v->m[2]; - m->m[3] = 0.f; - m->m[4] = v->m[3]; - m->m[5] = v->m[4]; - m->m[6] = v->m[5]; - m->m[7] = 0.f; - m->m[8] = v->m[6]; - m->m[9] = v->m[7]; - m->m[10] = v->m[8]; - m->m[11] = 0.f; - m->m[12] = 0.f; - m->m[13] = 0.f; - m->m[14] = 0.f; - m->m[15] = 1.f; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v) { - m->m[0] = v->m[0]; - m->m[1] = v->m[1]; - m->m[2] = 0.f; - m->m[3] = 0.f; - m->m[4] = v->m[3]; - m->m[5] = v->m[4]; - m->m[6] = 0.f; - m->m[7] = 0.f; - m->m[8] = v->m[6]; - m->m[9] = v->m[7]; - m->m[10] = 1.f; - m->m[11] = 0.f; - m->m[12] = 0.f; - m->m[13] = 0.f; - m->m[14] = 0.f; - m->m[15] = 1.f; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v) { - m->m[0] = v->m[0]; - m->m[1] = v->m[1]; - m->m[2] = v->m[2]; - m->m[3] = v->m[3]; - m->m[4] = v->m[4]; - m->m[5] = v->m[5]; - m->m[6] = v->m[6]; - m->m[7] = v->m[7]; - m->m[8] = v->m[8]; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v) { - m->m[0] = v->m[0]; - m->m[1] = v->m[1]; - m->m[2] = v->m[2]; - m->m[3] = v->m[3]; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z) { - float c, s; - m->m[3] = 0; - m->m[7] = 0; - m->m[11]= 0; - m->m[12]= 0; - m->m[13]= 0; - m->m[14]= 0; - m->m[15]= 1; - rot *= (float)(M_PI / 180.0f); - c = cos(rot); - s = sin(rot); - - const float len = x*x + y*y + z*z; - if (len != 1) { - const float recipLen = 1.f / sqrt(len); - x *= recipLen; - y *= recipLen; - z *= recipLen; - } - const float nc = 1.0f - c; - const float xy = x * y; - const float yz = y * z; - const float zx = z * x; - const float xs = x * s; - const float ys = y * s; - const float zs = z * s; - m->m[ 0] = x*x*nc + c; - m->m[ 4] = xy*nc - zs; - m->m[ 8] = zx*nc + ys; - m->m[ 1] = xy*nc + zs; - m->m[ 5] = y*y*nc + c; - m->m[ 9] = yz*nc - xs; - m->m[ 2] = zx*nc - ys; - m->m[ 6] = yz*nc + xs; - m->m[10] = z*z*nc + c; -} +extern void __attribute__((overloadable)) +rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z) { - rsMatrixLoadIdentity(m); - m->m[0] = x; - m->m[5] = y; - m->m[10] = z; -} +extern void __attribute__((overloadable)) +rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z) { - rsMatrixLoadIdentity(m); - m->m[12] = x; - m->m[13] = y; - m->m[14] = z; -} +extern void __attribute__((overloadable)) +rsMatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs) { - for (int i=0 ; i<4 ; i++) { - float ri0 = 0; - float ri1 = 0; - float ri2 = 0; - float ri3 = 0; - for (int j=0 ; j<4 ; j++) { - const float rhs_ij = rsMatrixGet(rhs, i,j); - ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; - ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; - ri2 += rsMatrixGet(lhs, j, 2) * rhs_ij; - ri3 += rsMatrixGet(lhs, j, 3) * rhs_ij; - } - rsMatrixSet(m, i, 0, ri0); - rsMatrixSet(m, i, 1, ri1); - rsMatrixSet(m, i, 2, ri2); - rsMatrixSet(m, i, 3, ri3); - } -} +extern void __attribute__((overloadable)) +rsMatrixLoadMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *rhs) { - rs_matrix4x4 mt; - rsMatrixLoadMultiply(&mt, m, rhs); - rsMatrixLoad(m, &mt); -} +extern void __attribute__((overloadable)) +rsMatrixMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs) { - for (int i=0 ; i<3 ; i++) { - float ri0 = 0; - float ri1 = 0; - float ri2 = 0; - for (int j=0 ; j<3 ; j++) { - const float rhs_ij = rsMatrixGet(rhs, i,j); - ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; - ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; - ri2 += rsMatrixGet(lhs, j, 2) * rhs_ij; - } - rsMatrixSet(m, i, 0, ri0); - rsMatrixSet(m, i, 1, ri1); - rsMatrixSet(m, i, 2, ri2); - } -} +extern void __attribute__((overloadable)) +rsMatrixLoadMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *rhs) { - rs_matrix3x3 mt; - rsMatrixLoadMultiply(&mt, m, rhs); - rsMatrixLoad(m, &mt); -} +extern void __attribute__((overloadable)) +rsMatrixMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs) { - for (int i=0 ; i<2 ; i++) { - float ri0 = 0; - float ri1 = 0; - for (int j=0 ; j<2 ; j++) { - const float rhs_ij = rsMatrixGet(rhs, i,j); - ri0 += rsMatrixGet(lhs, j, 0) * rhs_ij; - ri1 += rsMatrixGet(lhs, j, 1) * rhs_ij; - } - rsMatrixSet(m, i, 0, ri0); - rsMatrixSet(m, i, 1, ri1); - } -} +extern void __attribute__((overloadable)) +rsMatrixLoadMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *rhs) { - rs_matrix2x2 mt; - rsMatrixLoadMultiply(&mt, m, rhs); - rsMatrixLoad(m, &mt); -} +extern void __attribute__((overloadable)) +rsMatrixMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *rhs); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z) { - rs_matrix4x4 m1; - rsMatrixLoadRotate(&m1, rot, x, y, z); - rsMatrixMultiply(m, &m1); -} +extern void __attribute__((overloadable)) +rsMatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixScale(rs_matrix4x4 *m, float x, float y, float z) { - rs_matrix4x4 m1; - rsMatrixLoadScale(&m1, x, y, z); - rsMatrixMultiply(m, &m1); -} +extern void __attribute__((overloadable)) +rsMatrixScale(rs_matrix4x4 *m, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixTranslate(rs_matrix4x4 *m, float x, float y, float z) { - rs_matrix4x4 m1; - rsMatrixLoadTranslate(&m1, x, y, z); - rsMatrixMultiply(m, &m1); -} +extern void __attribute__((overloadable)) +rsMatrixTranslate(rs_matrix4x4 *m, float x, float y, float z); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far) { - rsMatrixLoadIdentity(m); - m->m[0] = 2.f / (right - left); - m->m[5] = 2.f / (top - bottom); - m->m[10]= -2.f / (far - near); - m->m[12]= -(right + left) / (right - left); - m->m[13]= -(top + bottom) / (top - bottom); - m->m[14]= -(far + near) / (far - near); -} +extern void __attribute__((overloadable)) +rsMatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far) { - rsMatrixLoadIdentity(m); - m->m[0] = 2.f * near / (right - left); - m->m[5] = 2.f * near / (top - bottom); - m->m[8] = (right + left) / (right - left); - m->m[9] = (top + bottom) / (top - bottom); - m->m[10]= -(far + near) / (far - near); - m->m[11]= -1.f; - m->m[14]= -2.f * far * near / (far - near); - m->m[15]= 0.f; -} +extern void __attribute__((overloadable)) +rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); -_RS_STATIC void __attribute__((overloadable)) -rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far) { - float top = near * tan((float) (fovy * M_PI / 360.0f)); - float bottom = -top; - float left = bottom * aspect; - float right = top * aspect; - rsMatrixLoadFrustum(m, left, right, bottom, top, near, far); -} +extern void __attribute__((overloadable)) +rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far); _RS_STATIC float4 __attribute__((overloadable)) rsMatrixMultiply(rs_matrix4x4 *m, float4 in) { @@ -535,371 +245,11 @@ rsMatrixMultiply(rs_matrix2x2 *m, float2 in) { } // Returns true if the matrix was successfully inversed -_RS_STATIC bool __attribute__((overloadable)) -rsMatrixInverse(rs_matrix4x4 *m) { - rs_matrix4x4 result; - - int i, j; - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) { - // computeCofactor for int i, int j - int c0 = (i+1) % 4; - int c1 = (i+2) % 4; - int c2 = (i+3) % 4; - int r0 = (j+1) % 4; - int r1 = (j+2) % 4; - int r2 = (j+3) % 4; - - float minor = (m->m[c0 + 4*r0] * (m->m[c1 + 4*r1] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r1])) - - (m->m[c0 + 4*r1] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r0])) - + (m->m[c0 + 4*r2] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r1] - m->m[c1 + 4*r1] * m->m[c2 + 4*r0])); - - float cofactor = (i+j) & 1 ? -minor : minor; - - result.m[4*i + j] = cofactor; - } - } - - // Dot product of 0th column of source and 0th row of result - float det = m->m[0]*result.m[0] + m->m[4]*result.m[1] + - m->m[8]*result.m[2] + m->m[12]*result.m[3]; - - if (fabs(det) < 1e-6) { - return false; - } - - det = 1.0f / det; - for (i = 0; i < 16; ++i) { - m->m[i] = result.m[i] * det; - } - - return true; -} - -// Returns true if the matrix was successfully inversed -_RS_STATIC bool __attribute__((overloadable)) -rsMatrixInverseTranspose(rs_matrix4x4 *m) { - rs_matrix4x4 result; - - int i, j; - for (i = 0; i < 4; ++i) { - for (j = 0; j < 4; ++j) { - // computeCofactor for int i, int j - int c0 = (i+1) % 4; - int c1 = (i+2) % 4; - int c2 = (i+3) % 4; - int r0 = (j+1) % 4; - int r1 = (j+2) % 4; - int r2 = (j+3) % 4; - - float minor = (m->m[c0 + 4*r0] * (m->m[c1 + 4*r1] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r1])) - - (m->m[c0 + 4*r1] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r2] - m->m[c1 + 4*r2] * m->m[c2 + 4*r0])) - + (m->m[c0 + 4*r2] * (m->m[c1 + 4*r0] * m->m[c2 + 4*r1] - m->m[c1 + 4*r1] * m->m[c2 + 4*r0])); - - float cofactor = (i+j) & 1 ? -minor : minor; - - result.m[4*j + i] = cofactor; - } - } - - // Dot product of 0th column of source and 0th column of result - float det = m->m[0]*result.m[0] + m->m[4]*result.m[4] + - m->m[8]*result.m[8] + m->m[12]*result.m[12]; - - if (fabs(det) < 1e-6) { - return false; - } - - det = 1.0f / det; - for (i = 0; i < 16; ++i) { - m->m[i] = result.m[i] * det; - } - - return true; -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixTranspose(rs_matrix4x4 *m) { - int i, j; - float temp; - for (i = 0; i < 3; ++i) { - for (j = i + 1; j < 4; ++j) { - temp = m->m[i*4 + j]; - m->m[i*4 + j] = m->m[j*4 + i]; - m->m[j*4 + i] = temp; - } - } -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixTranspose(rs_matrix3x3 *m) { - int i, j; - float temp; - for (i = 0; i < 2; ++i) { - for (j = i + 1; j < 3; ++j) { - temp = m->m[i*3 + j]; - m->m[i*3 + j] = m->m[j*4 + i]; - m->m[j*3 + i] = temp; - } - } -} - -_RS_STATIC void __attribute__((overloadable)) -rsMatrixTranspose(rs_matrix2x2 *m) { - float temp = m->m[1]; - m->m[1] = m->m[2]; - m->m[2] = temp; -} - -///////////////////////////////////////////////////// -// quaternion ops -///////////////////////////////////////////////////// - -_RS_STATIC void __attribute__((overloadable)) -rsQuaternionSet(rs_quaternion *q, float w, float x, float y, float z) { - q->w = w; - q->x = x; - q->y = y; - q->z = z; -} - -_RS_STATIC void __attribute__((overloadable)) -rsQuaternionSet(rs_quaternion *q, const rs_quaternion *rhs) { - q->w = rhs->w; - q->x = rhs->x; - q->y = rhs->y; - q->z = rhs->z; -} - -_RS_STATIC void __attribute__((overloadable)) -rsQuaternionMultiply(rs_quaternion *q, float s) { - q->w *= s; - q->x *= s; - q->y *= s; - q->z *= s; -} - -_RS_STATIC void __attribute__((overloadable)) -rsQuaternionMultiply(rs_quaternion *q, const rs_quaternion *rhs) { - q->w = -q->x*rhs->x - q->y*rhs->y - q->z*rhs->z + q->w*rhs->w; - q->x = q->x*rhs->w + q->y*rhs->z - q->z*rhs->y + q->w*rhs->x; - q->y = -q->x*rhs->z + q->y*rhs->w + q->z*rhs->x + q->w*rhs->y; - q->z = q->x*rhs->y - q->y*rhs->x + q->z*rhs->w + q->w*rhs->z; -} - -_RS_STATIC void -rsQuaternionAdd(rs_quaternion *q, const rs_quaternion *rhs) { - q->w *= rhs->w; - q->x *= rhs->x; - q->y *= rhs->y; - q->z *= rhs->z; -} - -_RS_STATIC void -rsQuaternionLoadRotateUnit(rs_quaternion *q, float rot, float x, float y, float z) { - rot *= (float)(M_PI / 180.0f) * 0.5f; - float c = cos(rot); - float s = sin(rot); - - q->w = c; - q->x = x * s; - q->y = y * s; - q->z = z * s; -} - -_RS_STATIC void -rsQuaternionLoadRotate(rs_quaternion *q, float rot, float x, float y, float z) { - const float len = x*x + y*y + z*z; - if (len != 1) { - const float recipLen = 1.f / sqrt(len); - x *= recipLen; - y *= recipLen; - z *= recipLen; - } - rsQuaternionLoadRotateUnit(q, rot, x, y, z); -} - -_RS_STATIC void -rsQuaternionConjugate(rs_quaternion *q) { - q->x = -q->x; - q->y = -q->y; - q->z = -q->z; -} - -_RS_STATIC float -rsQuaternionDot(const rs_quaternion *q0, const rs_quaternion *q1) { - return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z; -} - -_RS_STATIC void -rsQuaternionNormalize(rs_quaternion *q) { - const float len = rsQuaternionDot(q, q); - if (len != 1) { - const float recipLen = 1.f / sqrt(len); - rsQuaternionMultiply(q, recipLen); - } -} - -_RS_STATIC void -rsQuaternionSlerp(rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) { - if (t <= 0.0f) { - rsQuaternionSet(q, q0); - return; - } - if (t >= 1.0f) { - rsQuaternionSet(q, q1); - return; - } - - rs_quaternion tempq0, tempq1; - rsQuaternionSet(&tempq0, q0); - rsQuaternionSet(&tempq1, q1); - - float angle = rsQuaternionDot(q0, q1); - if (angle < 0) { - rsQuaternionMultiply(&tempq0, -1.0f); - angle *= -1.0f; - } - - float scale, invScale; - if (angle + 1.0f > 0.05f) { - if (1.0f - angle >= 0.05f) { - float theta = acos(angle); - float invSinTheta = 1.0f / sin(theta); - scale = sin(theta * (1.0f - t)) * invSinTheta; - invScale = sin(theta * t) * invSinTheta; - } else { - scale = 1.0f - t; - invScale = t; - } - } else { - rsQuaternionSet(&tempq1, tempq0.z, -tempq0.y, tempq0.x, -tempq0.w); - scale = sin(M_PI * (0.5f - t)); - invScale = sin(M_PI * t); - } - - rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale, - tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale); -} - -_RS_STATIC void rsQuaternionGetMatrixUnit(rs_matrix4x4 *m, const rs_quaternion *q) { - float x2 = 2.0f * q->x * q->x; - float y2 = 2.0f * q->y * q->y; - float z2 = 2.0f * q->z * q->z; - float xy = 2.0f * q->x * q->y; - float wz = 2.0f * q->w * q->z; - float xz = 2.0f * q->x * q->z; - float wy = 2.0f * q->w * q->y; - float wx = 2.0f * q->w * q->x; - float yz = 2.0f * q->y * q->z; - - m->m[0] = 1.0f - y2 - z2; - m->m[1] = xy - wz; - m->m[2] = xz + wy; - m->m[3] = 0.0f; - - m->m[4] = xy + wz; - m->m[5] = 1.0f - x2 - z2; - m->m[6] = yz - wx; - m->m[7] = 0.0f; - - m->m[8] = xz - wy; - m->m[9] = yz - wx; - m->m[10] = 1.0f - x2 - y2; - m->m[11] = 0.0f; - - m->m[12] = 0.0f; - m->m[13] = 0.0f; - m->m[14] = 0.0f; - m->m[15] = 1.0f; -} - -///////////////////////////////////////////////////// -// utility funcs -///////////////////////////////////////////////////// -__inline__ _RS_STATIC void __attribute__((overloadable, always_inline)) -rsExtractFrustumPlanes(const rs_matrix4x4 *modelViewProj, - float4 *left, float4 *right, - float4 *top, float4 *bottom, - float4 *near, float4 *far) { - // x y z w = a b c d in the plane equation - left->x = modelViewProj->m[3] + modelViewProj->m[0]; - left->y = modelViewProj->m[7] + modelViewProj->m[4]; - left->z = modelViewProj->m[11] + modelViewProj->m[8]; - left->w = modelViewProj->m[15] + modelViewProj->m[12]; - - right->x = modelViewProj->m[3] - modelViewProj->m[0]; - right->y = modelViewProj->m[7] - modelViewProj->m[4]; - right->z = modelViewProj->m[11] - modelViewProj->m[8]; - right->w = modelViewProj->m[15] - modelViewProj->m[12]; - - top->x = modelViewProj->m[3] - modelViewProj->m[1]; - top->y = modelViewProj->m[7] - modelViewProj->m[5]; - top->z = modelViewProj->m[11] - modelViewProj->m[9]; - top->w = modelViewProj->m[15] - modelViewProj->m[13]; - - bottom->x = modelViewProj->m[3] + modelViewProj->m[1]; - bottom->y = modelViewProj->m[7] + modelViewProj->m[5]; - bottom->z = modelViewProj->m[11] + modelViewProj->m[9]; - bottom->w = modelViewProj->m[15] + modelViewProj->m[13]; - - near->x = modelViewProj->m[3] + modelViewProj->m[2]; - near->y = modelViewProj->m[7] + modelViewProj->m[6]; - near->z = modelViewProj->m[11] + modelViewProj->m[10]; - near->w = modelViewProj->m[15] + modelViewProj->m[14]; - - far->x = modelViewProj->m[3] - modelViewProj->m[2]; - far->y = modelViewProj->m[7] - modelViewProj->m[6]; - far->z = modelViewProj->m[11] - modelViewProj->m[10]; - far->w = modelViewProj->m[15] - modelViewProj->m[14]; - - float len = length(left->xyz); - *left /= len; - len = length(right->xyz); - *right /= len; - len = length(top->xyz); - *top /= len; - len = length(bottom->xyz); - *bottom /= len; - len = length(near->xyz); - *near /= len; - len = length(far->xyz); - *far /= len; -} - -__inline__ _RS_STATIC bool __attribute__((overloadable, always_inline)) -rsIsSphereInFrustum(float4 *sphere, - float4 *left, float4 *right, - float4 *top, float4 *bottom, - float4 *near, float4 *far) { - - float distToCenter = dot(left->xyz, sphere->xyz) + left->w; - if (distToCenter < -sphere->w) { - return false; - } - distToCenter = dot(right->xyz, sphere->xyz) + right->w; - if (distToCenter < -sphere->w) { - return false; - } - distToCenter = dot(top->xyz, sphere->xyz) + top->w; - if (distToCenter < -sphere->w) { - return false; - } - distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w; - if (distToCenter < -sphere->w) { - return false; - } - distToCenter = dot(near->xyz, sphere->xyz) + near->w; - if (distToCenter < -sphere->w) { - return false; - } - distToCenter = dot(far->xyz, sphere->xyz) + far->w; - if (distToCenter < -sphere->w) { - return false; - } - return true; -} - +extern bool __attribute__((overloadable)) rsMatrixInverse(rs_matrix4x4 *m); +extern bool __attribute__((overloadable)) rsMatrixInverseTranspose(rs_matrix4x4 *m); +extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix4x4 *m); +extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix3x3 *m); +extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix2x2 *m); ///////////////////////////////////////////////////// // int ops diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java index f078cf654eaa..f10f5e80aed5 100755 --- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java +++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java @@ -2867,11 +2867,8 @@ class MediaArtistNativeHelper { mClipProperties.clipProperties = new Properties[mTotalClips]; /** record the call back progress listner */ - if (listener != null) - { - mMediaProcessingProgressListener = listener; - mProgressToApp = 0; - } + mMediaProcessingProgressListener = listener; + mProgressToApp = 0; if (mediaItemsList.size() > 0) { for (int i = 0; i < mediaItemsList.size(); i++) { @@ -3022,9 +3019,8 @@ class MediaArtistNativeHelper { public void doPreview(Surface surface, long fromMs, long toMs, boolean loop, int callbackAfterFrameCount, PreviewProgressListener listener) { mPreviewProgress = fromMs; - if (listener != null) { - mPreviewProgressListener = listener; - } + mPreviewProgressListener = listener; + if (!mInvalidatePreviewArray) { try { /** Modify the image files names to rgb image files. */ @@ -3555,9 +3551,9 @@ class MediaArtistNativeHelper { int outBitrate = 0; mExportFilename = filePath; previewStoryBoard(mediaItemsList, mediaTransitionList, mediaBGMList,null); - if (listener != null) { - mExportProgressListener = listener; - } + + mExportProgressListener = listener; + mProgressToApp = 0; switch (bitrate) { @@ -3682,9 +3678,9 @@ class MediaArtistNativeHelper { int outBitrate = 0; mExportFilename = filePath; previewStoryBoard(mediaItemsList, mediaTransitionList, mediaBGMList,null); - if (listener != null) { - mExportProgressListener = listener; - } + + mExportProgressListener = listener; + mProgressToApp = 0; switch (bitrate) { @@ -3977,9 +3973,8 @@ class MediaArtistNativeHelper { ExtractAudioWaveformProgressListener listener, boolean isVideo) { String tempPCMFileName; - if (listener != null) { - mExtractAudioWaveformProgressListener = listener; - } + mExtractAudioWaveformProgressListener = listener; + /** * in case of Video , first call will generate the PCM file to make the * audio graph diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java index c19725c8370f..672ce19a20ef 100755 --- a/media/java/android/media/videoeditor/VideoEditorImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorImpl.java @@ -60,6 +60,11 @@ public class VideoEditorImpl implements VideoEditor { final Semaphore mPreviewSemaphore = new Semaphore(1, true); /* + * Semaphore to control export calls + */ + final Semaphore mExportSemaphore = new Semaphore(1, true); + + /* * XML tags */ private static final String TAG_PROJECT = "project"; @@ -401,8 +406,15 @@ public class VideoEditorImpl implements VideoEditor { throw new IllegalArgumentException("Argument Bitrate incorrect"); } - mMANativeHelper.export(filename, mProjectPath, height,bitrate,audioCodec, + try { + mExportSemaphore.acquire(); + mMANativeHelper.export(filename, mProjectPath, height,bitrate,audioCodec, videoCodec,mMediaItems, mTransitions, mAudioTracks,listener); + } catch (InterruptedException ex) { + Log.e("VideoEditorImpl", "Sem acquire NOT successful in export"); + } finally { + mExportSemaphore.release(); + } } /* @@ -466,9 +478,16 @@ public class VideoEditorImpl implements VideoEditor { throw new IllegalArgumentException("Argument Bitrate incorrect"); } - mMANativeHelper.export(filename, mProjectPath, height,bitrate, + try { + mExportSemaphore.acquire(); + mMANativeHelper.export(filename, mProjectPath, height,bitrate, mMediaItems, mTransitions, mAudioTracks, listener); + } catch (InterruptedException ex) { + Log.e("VideoEditorImpl", "Sem acquire NOT successful in export"); + } finally { + mExportSemaphore.release(); + } } /* @@ -476,7 +495,7 @@ public class VideoEditorImpl implements VideoEditor { */ public void generatePreview(MediaProcessingProgressListener listener) { boolean semAcquireDone = false; - try{ + try { mPreviewSemaphore.acquire(); semAcquireDone = true; mMANativeHelper.setGeneratePreview(true); diff --git a/media/java/android/mtp/MtpPropertyGroup.java b/media/java/android/mtp/MtpPropertyGroup.java index fff96c77940b..57e23042d432 100644 --- a/media/java/android/mtp/MtpPropertyGroup.java +++ b/media/java/android/mtp/MtpPropertyGroup.java @@ -282,7 +282,7 @@ class MtpPropertyGroup { } MtpPropertyList getPropertyList(int handle, int format, int depth, int storageID) { - Log.d(TAG, "getPropertyList handle: " + handle + " format: " + format + " depth: " + depth); + //Log.d(TAG, "getPropertyList handle: " + handle + " format: " + format + " depth: " + depth); if (depth > 1) { // we only support depth 0 and 1 // depth 0: single object, depth 1: immediate children diff --git a/media/java/android/mtp/MtpServer.java b/media/java/android/mtp/MtpServer.java index 2e693737e7c6..d433887cf9f2 100644 --- a/media/java/android/mtp/MtpServer.java +++ b/media/java/android/mtp/MtpServer.java @@ -54,12 +54,8 @@ public class MtpServer { native_set_ptp_mode(usePtp); } - // used by the JNI code - private int mNativeContext; - private native final void native_setup(MtpDatabase database, String storagePath, long reserveSpace); - private native final void native_finalize(); private native final void native_start(); private native final void native_stop(); private native final void native_send_object_added(int handle); diff --git a/media/jni/android_mtp_MtpServer.cpp b/media/jni/android_mtp_MtpServer.cpp index 1452d2191798..3883fb2dcd7a 100644 --- a/media/jni/android_mtp_MtpServer.cpp +++ b/media/jni/android_mtp_MtpServer.cpp @@ -40,9 +40,6 @@ using namespace android; // ---------------------------------------------------------------------------- -static jfieldID field_context; -static Mutex sMutex; - // in android_mtp_MtpDatabase.cpp extern MtpDatabase* getMtpDatabase(JNIEnv *env, jobject database); @@ -61,96 +58,74 @@ private: MtpServer* mServer; String8 mStoragePath; uint64_t mReserveSpace; - jobject mJavaServer; - bool mDone; + Mutex mMutex; + bool mUsePtp; int mFd; public: - MtpThread(MtpDatabase* database, const char* storagePath, uint64_t reserveSpace, - jobject javaServer) + MtpThread(MtpDatabase* database, const char* storagePath, uint64_t reserveSpace) : mDatabase(database), mServer(NULL), mStoragePath(storagePath), mReserveSpace(reserveSpace), - mJavaServer(javaServer), - mDone(false), mFd(-1) { } void setPtpMode(bool usePtp) { - sMutex.lock(); - if (mFd >= 0) { - ioctl(mFd, MTP_SET_INTERFACE_MODE, - (usePtp ? MTP_INTERFACE_MODE_PTP : MTP_INTERFACE_MODE_MTP)); - } else { - int fd = open("/dev/mtp_usb", O_RDWR); - if (fd >= 0) { - ioctl(fd, MTP_SET_INTERFACE_MODE, - (usePtp ? MTP_INTERFACE_MODE_PTP : MTP_INTERFACE_MODE_MTP)); - close(fd); - } - } - sMutex.unlock(); + mMutex.lock(); + mUsePtp = usePtp; + mMutex.unlock(); } virtual bool threadLoop() { - sMutex.lock(); - - while (!mDone) { - mFd = open("/dev/mtp_usb", O_RDWR); - printf("open returned %d\n", mFd); - if (mFd < 0) { - LOGE("could not open MTP driver\n"); - sMutex.unlock(); - return false; - } + mMutex.lock(); + mFd = open("/dev/mtp_usb", O_RDWR); + if (mFd >= 0) { + ioctl(mFd, MTP_SET_INTERFACE_MODE, + (mUsePtp ? MTP_INTERFACE_MODE_PTP : MTP_INTERFACE_MODE_MTP)); mServer = new MtpServer(mFd, mDatabase, AID_MEDIA_RW, 0664, 0775); mServer->addStorage(mStoragePath, mReserveSpace); - sMutex.unlock(); - + mMutex.unlock(); mServer->run(); - sleep(1); - - sMutex.lock(); + mMutex.lock(); close(mFd); mFd = -1; delete mServer; mServer = NULL; + } else { + LOGE("could not open MTP driver, errno: %d", errno); + } + mMutex.unlock(); + // delay a bit before retrying to avoid excessive spin + if (!exitPending()) { + sleep(1); } - JNIEnv* env = AndroidRuntime::getJNIEnv(); - env->SetIntField(mJavaServer, field_context, 0); - env->DeleteGlobalRef(mJavaServer); - sMutex.unlock(); - - return false; - } - - void stop() { - sMutex.lock(); - mDone = true; - sMutex.unlock(); + return true; } void sendObjectAdded(MtpObjectHandle handle) { - sMutex.lock(); + mMutex.lock(); if (mServer) mServer->sendObjectAdded(handle); - sMutex.unlock(); + mMutex.unlock(); } void sendObjectRemoved(MtpObjectHandle handle) { - sMutex.lock(); + mMutex.lock(); if (mServer) mServer->sendObjectRemoved(handle); - sMutex.unlock(); + mMutex.unlock(); } }; +// This smart pointer is necessary for preventing MtpThread from exiting too early +static sp<MtpThread> sThread; + #endif // HAVE_ANDROID_OS static void @@ -161,9 +136,8 @@ android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, MtpDatabase* database = getMtpDatabase(env, javaDatabase); const char *storagePathStr = env->GetStringUTFChars(storagePath, NULL); - MtpThread* thread = new MtpThread(database, storagePathStr, - reserveSpace, env->NewGlobalRef(thiz)); - env->SetIntField(thiz, field_context, (int)thread); + // create the thread and assign it to the smart pointer + sThread = new MtpThread(database, storagePathStr, reserveSpace); env->ReleaseStringUTFChars(storagePath, storagePathStr); #endif @@ -173,8 +147,9 @@ static void android_mtp_MtpServer_start(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS - MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); - thread->run("MtpThread"); + MtpThread *thread = sThread.get(); + if (thread) + thread->run("MtpThread"); #endif // HAVE_ANDROID_OS } @@ -182,9 +157,11 @@ static void android_mtp_MtpServer_stop(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS - MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); - if (thread) - thread->stop(); + MtpThread *thread = sThread.get(); + if (thread) { + thread->requestExitAndWait(); + sThread = NULL; + } #endif } @@ -192,7 +169,7 @@ static void android_mtp_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle) { #ifdef HAVE_ANDROID_OS - MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); + MtpThread *thread = sThread.get(); if (thread) thread->sendObjectAdded(handle); #endif @@ -202,7 +179,7 @@ static void android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle) { #ifdef HAVE_ANDROID_OS - MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); + MtpThread *thread = sThread.get(); if (thread) thread->sendObjectRemoved(handle); #endif @@ -212,7 +189,7 @@ static void android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) { #ifdef HAVE_ANDROID_OS - MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); + MtpThread *thread = sThread.get(); if (thread) thread->setPtpMode(usePtp); #endif @@ -241,11 +218,6 @@ int register_android_mtp_MtpServer(JNIEnv *env) LOGE("Can't find android/mtp/MtpServer"); return -1; } - field_context = env->GetFieldID(clazz, "mNativeContext", "I"); - if (field_context == NULL) { - LOGE("Can't find MtpServer.mNativeContext"); - return -1; - } return AndroidRuntime::registerNativeMethods(env, "android/mtp/MtpServer", gMethods, NELEM(gMethods)); diff --git a/media/jni/mediaeditor/Android.mk b/media/jni/mediaeditor/Android.mk index 0a01fb2e6f78..6a7116ca2505 100755 --- a/media/jni/mediaeditor/Android.mk +++ b/media/jni/mediaeditor/Android.mk @@ -51,6 +51,7 @@ LOCAL_SHARED_LIBRARIES := \ libandroid_runtime \ libnativehelper \ libmedia \ + libaudioflinger \ libbinder \ libstagefright \ libstagefright_omx \ diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp index 5ff934d390b4..e7c0299ad49c 100644 --- a/media/libstagefright/AudioPlayer.cpp +++ b/media/libstagefright/AudioPlayer.cpp @@ -286,7 +286,9 @@ size_t AudioPlayer::fillBuffer(void *data, size_t size) { } if (mReachedEOS) { - return 0; + memset(data, 0, size); + + return size; } size_t size_done = 0; diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 235d752542e9..f96df180e179 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -91,14 +91,17 @@ status_t AudioSource::start(MetaData *params) { mStartTimeUs = startTimeUs; } status_t err = mRecord->start(); - if (err == OK) { mGroup = new MediaBufferGroup; mGroup->add_buffer(new MediaBuffer(kMaxBufferSize)); mStarted = true; + } else { + delete mRecord; + mRecord = NULL; } + return err; } diff --git a/media/libstagefright/HTTPStream.cpp b/media/libstagefright/HTTPStream.cpp index 057868cf9b20..77a61a577c00 100644 --- a/media/libstagefright/HTTPStream.cpp +++ b/media/libstagefright/HTTPStream.cpp @@ -124,6 +124,80 @@ static status_t MyConnect( return result; } +// Apparently under out linux closing a socket descriptor from one thread +// will not unblock a pending send/recv on that socket on another thread. +static ssize_t MySendReceive( + int s, void *data, size_t size, int flags, bool sendData) { + ssize_t result = 0; + + while (size > 0) { + fd_set rs, ws, es; + FD_ZERO(&rs); + FD_ZERO(&ws); + FD_ZERO(&es); + FD_SET(s, sendData ? &ws : &rs); + FD_SET(s, &es); + + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 100000ll; + + int nfds = ::select( + s + 1, + sendData ? NULL : &rs, + sendData ? &ws : NULL, + &es, + &tv); + + if (nfds < 0) { + if (errno == EINTR) { + continue; + } + + result = -errno; + break; + } else if (nfds == 0) { + // timeout + + continue; + } + + CHECK_EQ(nfds, 1); + + ssize_t nbytes = + sendData ? send(s, data, size, flags) : recv(s, data, size, flags); + + if (nbytes < 0) { + if (errno == EINTR) { + continue; + } + + result = -errno; + break; + } else if (nbytes == 0) { + result = 0; + break; + } + + data = (uint8_t *)data + nbytes; + size -= nbytes; + + result = nbytes; + break; + } + + return result; +} + +static ssize_t MySend(int s, const void *data, size_t size, int flags) { + return MySendReceive( + s, const_cast<void *>(data), size, flags, true /* sendData */); +} + +static ssize_t MyReceive(int s, void *data, size_t size, int flags) { + return MySendReceive(s, data, size, flags, false /* sendData */); +} + status_t HTTPStream::connect(const char *server, int port) { Mutex::Autolock autoLock(mLock); @@ -202,16 +276,12 @@ status_t HTTPStream::send(const char *data, size_t size) { } while (size > 0) { - ssize_t n = ::send(mSocket, data, size, 0); + ssize_t n = MySend(mSocket, data, size, 0); if (n < 0) { - if (errno == EINTR) { - continue; - } - disconnect(); - return ERROR_IO; + return n; } else if (n == 0) { disconnect(); @@ -247,12 +317,8 @@ status_t HTTPStream::receive_line(char *line, size_t size) { for (;;) { char c; - ssize_t n = recv(mSocket, &c, 1, 0); + ssize_t n = MyReceive(mSocket, &c, 1, 0); if (n < 0) { - if (errno == EINTR) { - continue; - } - disconnect(); return ERROR_IO; @@ -371,14 +437,10 @@ status_t HTTPStream::receive_header(int *http_status) { ssize_t HTTPStream::receive(void *data, size_t size) { size_t total = 0; while (total < size) { - ssize_t n = recv(mSocket, (char *)data + total, size - total, 0); + ssize_t n = MyReceive(mSocket, (char *)data + total, size - total, 0); if (n < 0) { - if (errno == EINTR) { - continue; - } - - LOGE("recv failed, errno = %d (%s)", errno, strerror(errno)); + LOGE("recv failed, errno = %d (%s)", (int)n, strerror(-n)); disconnect(); return (ssize_t)ERROR_IO; diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index a47ee3a04264..d1a497f8ef94 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -78,6 +78,7 @@ private: volatile bool mDone; volatile bool mPaused; volatile bool mResumed; + volatile bool mStarted; bool mIsAvc; bool mIsAudio; bool mIsMPEG4; @@ -951,6 +952,7 @@ MPEG4Writer::Track::Track( mDone(false), mPaused(false), mResumed(false), + mStarted(false), mTrackDurationUs(0), mEstimatedTrackSizeBytes(0), mSamplesHaveSameSize(true), @@ -1279,6 +1281,7 @@ status_t MPEG4Writer::Track::start(MetaData *params) { pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); mDone = false; + mStarted = true; mTrackDurationUs = 0; mReachedEOS = false; mEstimatedTrackSizeBytes = 0; @@ -1307,10 +1310,14 @@ status_t MPEG4Writer::Track::pause() { status_t MPEG4Writer::Track::stop() { LOGD("Stopping %s track", mIsAudio? "Audio": "Video"); + if (!mStarted) { + LOGE("Stop() called but track is not started"); + return ERROR_END_OF_STREAM; + } + if (mDone) { return OK; } - mDone = true; void *dummy; diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 94694a3b74ff..7c6e561936ce 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -2203,8 +2203,9 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { crop.right = right; crop.bottom = bottom; - CHECK_EQ(0, native_window_set_crop( - mNativeWindow.get(), &crop)); + // We'll ignore any errors here, if the surface is + // already invalid, we'll know soon enough. + native_window_set_crop(mNativeWindow.get(), &crop); } } } @@ -3316,7 +3317,7 @@ status_t OMXCodec::stop() { mSource->stop(); - CODEC_LOGV("stopped"); + CODEC_LOGI("stopped in state %d", mState); return OK; } diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp index 39b002134164..be3df7c58a08 100644 --- a/media/libstagefright/StagefrightMediaScanner.cpp +++ b/media/libstagefright/StagefrightMediaScanner.cpp @@ -28,9 +28,7 @@ namespace android { -StagefrightMediaScanner::StagefrightMediaScanner() - : mRetriever(new MediaMetadataRetriever) { -} +StagefrightMediaScanner::StagefrightMediaScanner() {} StagefrightMediaScanner::~StagefrightMediaScanner() {} @@ -131,37 +129,41 @@ status_t StagefrightMediaScanner::processFile( if (status != OK) { return status; } - } else if (mRetriever->setDataSource(path) == OK) { - const char *value; - if ((value = mRetriever->extractMetadata( - METADATA_KEY_MIMETYPE)) != NULL) { - client.setMimeType(value); - } + } else { + sp<MediaMetadataRetriever> mRetriever(new MediaMetadataRetriever); - struct KeyMap { - const char *tag; - int key; - }; - static const KeyMap kKeyMap[] = { - { "tracknumber", METADATA_KEY_CD_TRACK_NUMBER }, - { "discnumber", METADATA_KEY_DISC_NUMBER }, - { "album", METADATA_KEY_ALBUM }, - { "artist", METADATA_KEY_ARTIST }, - { "albumartist", METADATA_KEY_ALBUMARTIST }, - { "composer", METADATA_KEY_COMPOSER }, - { "genre", METADATA_KEY_GENRE }, - { "title", METADATA_KEY_TITLE }, - { "year", METADATA_KEY_YEAR }, - { "duration", METADATA_KEY_DURATION }, - { "writer", METADATA_KEY_WRITER }, - { "compilation", METADATA_KEY_COMPILATION }, - }; - static const size_t kNumEntries = sizeof(kKeyMap) / sizeof(kKeyMap[0]); - - for (size_t i = 0; i < kNumEntries; ++i) { + if (mRetriever->setDataSource(path) == OK) { const char *value; - if ((value = mRetriever->extractMetadata(kKeyMap[i].key)) != NULL) { - client.addStringTag(kKeyMap[i].tag, value); + if ((value = mRetriever->extractMetadata( + METADATA_KEY_MIMETYPE)) != NULL) { + client.setMimeType(value); + } + + struct KeyMap { + const char *tag; + int key; + }; + static const KeyMap kKeyMap[] = { + { "tracknumber", METADATA_KEY_CD_TRACK_NUMBER }, + { "discnumber", METADATA_KEY_DISC_NUMBER }, + { "album", METADATA_KEY_ALBUM }, + { "artist", METADATA_KEY_ARTIST }, + { "albumartist", METADATA_KEY_ALBUMARTIST }, + { "composer", METADATA_KEY_COMPOSER }, + { "genre", METADATA_KEY_GENRE }, + { "title", METADATA_KEY_TITLE }, + { "year", METADATA_KEY_YEAR }, + { "duration", METADATA_KEY_DURATION }, + { "writer", METADATA_KEY_WRITER }, + { "compilation", METADATA_KEY_COMPILATION }, + }; + static const size_t kNumEntries = sizeof(kKeyMap) / sizeof(kKeyMap[0]); + + for (size_t i = 0; i < kNumEntries; ++i) { + const char *value; + if ((value = mRetriever->extractMetadata(kKeyMap[i].key)) != NULL) { + client.addStringTag(kKeyMap[i].tag, value); + } } } } @@ -180,6 +182,7 @@ char *StagefrightMediaScanner::extractAlbumArt(int fd) { } lseek64(fd, 0, SEEK_SET); + sp<MediaMetadataRetriever> mRetriever(new MediaMetadataRetriever); if (mRetriever->setDataSource(fd, 0, size) == OK) { sp<IMemory> mem = mRetriever->extractAlbumArt(); diff --git a/media/libstagefright/codecs/aacenc/AACEncoder.cpp b/media/libstagefright/codecs/aacenc/AACEncoder.cpp index 952488473212..a8b1292bf67b 100644 --- a/media/libstagefright/codecs/aacenc/AACEncoder.cpp +++ b/media/libstagefright/codecs/aacenc/AACEncoder.cpp @@ -151,7 +151,11 @@ status_t AACEncoder::start(MetaData *params) { mInputFrame = new int16_t[mChannels * kNumSamplesPerFrame]; CHECK(mInputFrame != NULL); - mSource->start(params); + status_t err = mSource->start(params); + if (err != OK) { + LOGE("AudioSource is not available"); + return err; + } mStarted = true; @@ -159,11 +163,6 @@ status_t AACEncoder::start(MetaData *params) { } status_t AACEncoder::stop() { - if (!mStarted) { - LOGW("Call stop() when encoder has not started"); - return OK; - } - if (mInputBuffer) { mInputBuffer->release(); mInputBuffer = NULL; @@ -172,8 +171,17 @@ status_t AACEncoder::stop() { delete mBufferGroup; mBufferGroup = NULL; - mSource->stop(); + if (mInputFrame) { + delete[] mInputFrame; + mInputFrame = NULL; + } + + if (!mStarted) { + LOGW("Call stop() when encoder has not started"); + return ERROR_END_OF_STREAM; + } + mSource->stop(); if (mEncoderHandle) { CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle)); mEncoderHandle = NULL; @@ -182,10 +190,6 @@ status_t AACEncoder::stop() { mApiHandle = NULL; mStarted = false; - if (mInputFrame) { - delete[] mInputFrame; - mInputFrame = NULL; - } return OK; } diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index 9b6d441a6e87..c7c14099f992 100644 --- a/media/libstagefright/omx/OMXNodeInstance.cpp +++ b/media/libstagefright/omx/OMXNodeInstance.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -//#define LOG_NDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "OMXNodeInstance" #include <utils/Log.h> @@ -124,6 +124,8 @@ static status_t StatusFromOMXError(OMX_ERRORTYPE err) { } status_t OMXNodeInstance::freeNode(OMXMaster *master) { + static int32_t kMaxNumIterations = 10; + // Transition the node from its current state all the way down // to "Loaded". // This ensures that all active buffers are properly freed even @@ -143,9 +145,16 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) { LOGV("forcing Executing->Idle"); sendCommand(OMX_CommandStateSet, OMX_StateIdle); OMX_ERRORTYPE err; + int32_t iteration = 0; while ((err = OMX_GetState(mHandle, &state)) == OMX_ErrorNone && state != OMX_StateIdle && state != OMX_StateInvalid) { + if (++iteration > kMaxNumIterations) { + LOGE("component failed to enter Idle state, aborting."); + state = OMX_StateInvalid; + break; + } + usleep(100000); } CHECK_EQ(err, OMX_ErrorNone); @@ -165,9 +174,16 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) { freeActiveBuffers(); OMX_ERRORTYPE err; + int32_t iteration = 0; while ((err = OMX_GetState(mHandle, &state)) == OMX_ErrorNone && state != OMX_StateLoaded && state != OMX_StateInvalid) { + if (++iteration > kMaxNumIterations) { + LOGE("component failed to enter Loaded state, aborting."); + state = OMX_StateInvalid; + break; + } + LOGV("waiting for Loaded state..."); usleep(100000); } @@ -185,8 +201,10 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) { break; } + LOGV("calling destroyComponentInstance"); OMX_ERRORTYPE err = master->destroyComponentInstance( static_cast<OMX_COMPONENTTYPE *>(mHandle)); + LOGV("destroyComponentInstance returned err %d", err); mHandle = NULL; diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index ed3617182cf4..8977fbf5ec9a 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -388,6 +388,13 @@ static tls_t* getTLS() return tls; } +static inline void clearError() { + if (gEGLThreadLocalStorageKey != -1) { + tls_t* tls = getTLS(); + tls->error = EGL_SUCCESS; + } +} + template<typename T> static __attribute__((noinline)) T setErrorEtc(const char* caller, int line, EGLint error, T returnValue) { @@ -708,6 +715,8 @@ using namespace android; EGLDisplay eglGetDisplay(NativeDisplayType display) { + clearError(); + uint32_t index = uint32_t(display); if (index >= NUM_DISPLAYS) { return setError(EGL_BAD_PARAMETER, EGL_NO_DISPLAY); @@ -727,6 +736,8 @@ EGLDisplay eglGetDisplay(NativeDisplayType display) EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) { + clearError(); + egl_display_t * const dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -858,6 +869,8 @@ EGLBoolean eglTerminate(EGLDisplay dpy) // after eglTerminate() has been called. eglTerminate() only // terminates an EGLDisplay, not a EGL itself. + clearError(); + egl_display_t* const dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -909,6 +922,8 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -933,6 +948,8 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1046,6 +1063,8 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (!cnx) return EGL_FALSE; @@ -1067,6 +1086,8 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { @@ -1097,6 +1118,8 @@ EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { @@ -1115,6 +1138,8 @@ EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { @@ -1132,6 +1157,8 @@ EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1154,6 +1181,8 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1181,6 +1210,8 @@ EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { @@ -1218,6 +1249,8 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) { + clearError(); + ContextRef _c(ctx); if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_FALSE); @@ -1257,6 +1290,8 @@ static void loseCurrent(egl_context_t * cur_c) EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { + clearError(); + // get a reference to the object passed in ContextRef _c(ctx); SurfaceRef _d(draw); @@ -1353,6 +1388,8 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value) { + clearError(); + ContextRef _c(ctx); if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_FALSE); @@ -1379,6 +1416,8 @@ EGLContext eglGetCurrentContext(void) // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would correctly return EGL_NO_CONTEXT. + clearError(); + EGLContext ctx = getContext(); return ctx; } @@ -1388,6 +1427,8 @@ EGLSurface eglGetCurrentSurface(EGLint readdraw) // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would correctly return EGL_NO_SURFACE. + clearError(); + EGLContext ctx = getContext(); if (ctx) { egl_context_t const * const c = get_context(ctx); @@ -1406,6 +1447,8 @@ EGLDisplay eglGetCurrentDisplay(void) // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would correctly return EGL_NO_DISPLAY. + clearError(); + EGLContext ctx = getContext(); if (ctx) { egl_context_t const * const c = get_context(ctx); @@ -1420,6 +1463,8 @@ EGLBoolean eglWaitGL(void) // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would return GL_TRUE, which isn't wrong. + clearError(); + EGLBoolean res = EGL_TRUE; EGLContext ctx = getContext(); if (ctx) { @@ -1439,7 +1484,9 @@ EGLBoolean eglWaitNative(EGLint engine) { // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would return GL_TRUE, which isn't wrong. - + + clearError(); + EGLBoolean res = EGL_TRUE; EGLContext ctx = getContext(); if (ctx) { @@ -1502,6 +1549,8 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) // in which case we must make sure we've initialized ourselves, this // happens the first time egl_get_display() is called. + clearError(); + if (egl_init_drivers() == EGL_FALSE) { setError(EGL_BAD_PARAMETER, NULL); return NULL; @@ -1577,6 +1626,8 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) { + clearError(); + SurfaceRef _s(draw); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1590,6 +1641,8 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, NativePixmapType target) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1603,6 +1656,8 @@ EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, const char* eglQueryString(EGLDisplay dpy, EGLint name) { + clearError(); + egl_display_t const * const dp = get_display(dpy); switch (name) { case EGL_VENDOR: @@ -1625,6 +1680,8 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name) EGLBoolean eglSurfaceAttrib( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1642,6 +1699,8 @@ EGLBoolean eglSurfaceAttrib( EGLBoolean eglBindTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1659,6 +1718,8 @@ EGLBoolean eglBindTexImage( EGLBoolean eglReleaseTexImage( EGLDisplay dpy, EGLSurface surface, EGLint buffer) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1675,6 +1736,8 @@ EGLBoolean eglReleaseTexImage( EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) { + clearError(); + egl_display_t * const dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1700,6 +1763,8 @@ EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) EGLBoolean eglWaitClient(void) { + clearError(); + // could be called before eglInitialize(), but we wouldn't have a context // then, and this function would return GL_TRUE, which isn't wrong. EGLBoolean res = EGL_TRUE; @@ -1723,6 +1788,8 @@ EGLBoolean eglWaitClient(void) EGLBoolean eglBindAPI(EGLenum api) { + clearError(); + if (egl_init_drivers() == EGL_FALSE) { return setError(EGL_BAD_PARAMETER, EGL_FALSE); } @@ -1744,6 +1811,8 @@ EGLBoolean eglBindAPI(EGLenum api) EGLenum eglQueryAPI(void) { + clearError(); + if (egl_init_drivers() == EGL_FALSE) { return setError(EGL_BAD_PARAMETER, EGL_FALSE); } @@ -1764,6 +1833,8 @@ EGLenum eglQueryAPI(void) EGLBoolean eglReleaseThread(void) { + clearError(); + // If there is context bound to the thread, release it loseCurrent(get_context(getContext())); @@ -1783,6 +1854,8 @@ EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list) { + clearError(); + egl_display_t const* dp = 0; egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (!cnx) return EGL_FALSE; @@ -1802,6 +1875,8 @@ EGLSurface eglCreatePbufferFromClientBuffer( EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1820,6 +1895,8 @@ EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface) { + clearError(); + SurfaceRef _s(surface); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1839,6 +1916,8 @@ EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface) EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) { + clearError(); + if (ctx != EGL_NO_CONTEXT) { ContextRef _c(ctx); if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR); @@ -1910,6 +1989,8 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (dp == 0) { return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1948,6 +2029,8 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list) { + clearError(); + EGLContext ctx = eglGetCurrentContext(); ContextRef _c(ctx); if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_NO_SYNC_KHR); @@ -1968,6 +2051,8 @@ EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_l EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (dp == 0) { return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1995,6 +2080,8 @@ EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (dp == 0) { return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -2022,6 +2109,8 @@ EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTi EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value) { + clearError(); + egl_display_t const * const dp = get_display(dpy); if (dp == 0) { return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -2054,6 +2143,8 @@ EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height) { + clearError(); + SurfaceRef _s(draw); if (!_s.get()) return setError(EGL_BAD_SURFACE, EGL_FALSE); diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png b/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png Binary files differindex d0833960129b..c3e381ebf2c8 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_notification_open.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_airplane_on.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_airplane_on.png Binary files differindex b76c3665ab43..728a25d9e2ed 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_airplane_on.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_airplane_on.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_brightness.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_brightness.png Binary files differindex 6e8995ec9ad6..299a0e7bc292 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_brightness.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_brightness.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_quicksettings.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_quicksettings.png Binary files differindex d9b4ecaf099c..47b4ba23f7a5 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_quicksettings.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_quicksettings.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_rotate_on.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_rotate_on.png Binary files differindex 9acd6f4bd482..20d28da3c277 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_rotate_on.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_rotate_on.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_sound_on.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_sound_on.png Binary files differindex a1d5a2ddf8b7..3be2eef25fed 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_sound_on.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_sound_on.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_wifi_on.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_wifi_on.png Binary files differindex 7c8893569536..88ac76046f62 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_wifi_on.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_wifi_on.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_notify_alarm.png b/packages/SystemUI/res/drawable-hdpi/stat_notify_alarm.png Binary files differindex 2d3eb30f8e5a..51b4f3f994d7 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_notify_alarm.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_notify_alarm.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_notify_more.png b/packages/SystemUI/res/drawable-hdpi/stat_notify_more.png Binary files differindex 1c7f9dbf4b73..170178cee172 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_notify_more.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_notify_more.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png Binary files differindex e8fbc9ee91cb..08f1993feaf7 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png Binary files differindex 18c77df2d2a8..4a40b14f1ef4 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png Binary files differindex 20ea73576e64..ecb39515cd82 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png Binary files differindex a5e9c7c4c9ba..e375a8a85b83 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png Binary files differindex 0287d5a4089b..13dde32a0738 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png Binary files differindex 4dfbcb29c555..24ade2c92220 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png Binary files differindex b9d4cb02a1a3..efa6f79d953c 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png Binary files differindex 4c8ec0e1badf..5b5baed65919 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png Binary files differindex 7e30894a5bbc..2eaff9869e06 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png Binary files differindex 72635a51cc0c..b515cf051435 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png Binary files differindex 6f56886f0fcb..d8599b512f15 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_flightmode.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_flightmode.png Binary files differindex 118a6b4c4786..c763976dba33 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_flightmode.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_flightmode.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png Binary files differindex ecd880fc236f..1b404b376df7 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png Binary files differindex 7251b141bc69..ba9cc9c69b6c 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png Binary files differindex 01135c862ed0..3e29d5e98bb9 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png Binary files differindex 794d9eddef27..e1900eaf3302 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png Binary files differindex 851ca41e62a3..2b00f3baa6d2 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png Binary files differindex f16783c971dc..6158e66ce057 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png Binary files differindex d217d0904ca2..b183160e50bd 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png Binary files differindex b577ebe4fb59..1b96f39691f9 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 6cf482926a5b..cf504f5d7de1 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/battery_low_battery.png b/packages/SystemUI/res/drawable-mdpi/battery_low_battery.png Binary files differindex e74c22fe1499..7417afc4a20f 100644 --- a/packages/SystemUI/res/drawable-mdpi/battery_low_battery.png +++ b/packages/SystemUI/res/drawable-mdpi/battery_low_battery.png diff --git a/packages/SystemUI/res/drawable-mdpi/button_frame_default.9.png b/packages/SystemUI/res/drawable-mdpi/button_frame_default.9.png Binary files differdeleted file mode 100644 index 7ab1f261cb27..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/button_frame_default.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/button_frame_pressed.9.png b/packages/SystemUI/res/drawable-mdpi/button_frame_pressed.9.png Binary files differdeleted file mode 100644 index 08f7a4d6bb45..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/button_frame_pressed.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png b/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png Binary files differindex 17fd52ea848c..e0f67e849024 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_notification_open.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_airplane_on.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_airplane_on.png Binary files differindex 0296b5bc2379..f8d7008397ba 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_airplane_on.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_airplane_on.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_brightness.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_brightness.png Binary files differindex 97fa5fccab74..55b767f6b467 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_brightness.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_brightness.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_quicksettings.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_quicksettings.png Binary files differindex 4434b5cd9954..792810427f92 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_quicksettings.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_quicksettings.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_rotate_on.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_rotate_on.png Binary files differindex 4517d1b773f1..d338fc01da06 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_rotate_on.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_rotate_on.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_sound_on.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_sound_on.png Binary files differindex 1b3ba2f6643d..70f72fa7dec4 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_sound_on.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_sound_on.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_wifi_on.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_wifi_on.png Binary files differindex bbb1c74cf339..f2d0cd9d1cea 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_wifi_on.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_wifi_on.png diff --git a/packages/SystemUI/res/drawable-mdpi/signal_0.png b/packages/SystemUI/res/drawable-mdpi/signal_0.png Binary files differdeleted file mode 100644 index 00fb261e8b91..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/signal_0.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_notify_alarm.png b/packages/SystemUI/res/drawable-mdpi/stat_notify_alarm.png Binary files differindex 1b01b850619d..d846afe5c520 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_notify_alarm.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_notify_alarm.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_notify_more.png b/packages/SystemUI/res/drawable-mdpi/stat_notify_more.png Binary files differindex e129ba9723a6..9b2825259352 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_notify_more.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_notify_more.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png Binary files differindex 3ddf7288c85d..5ca2415a6670 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png Binary files differindex f09b83bfad67..b727c2d81310 100755..100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png Binary files differindex f8b6f1172e8e..78ece9e344f6 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png Binary files differindex 3198abc25a5e..31fc1b023d00 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png Binary files differindex 16e3b0b9fb2e..19adb4b02744 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png Binary files differindex 91db8e8e0703..fd419ea4d64e 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png Binary files differindex 44ab1ec726a2..94e77ae79e8f 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_1x.png Binary files differindex c9d6719990ea..91328c0211c0 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_3g.png Binary files differindex e0a39cf1a1f4..2fee69248af9 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_e.png Binary files differindex 93b8f94b6aee..d0968aa19a5a 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_g.png Binary files differindex 5561011f11b0..991228b06a21 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_h.png Binary files differindex 697b90869a90..ae03e3891a98 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_1x.png Binary files differindex 4cced103a00f..97b011e0bda4 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_3g.png Binary files differindex 6f2f058dc9cc..a826866c3bdb 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_e.png Binary files differindex b523d640d782..f6a68916921b 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_g.png Binary files differindex c9bbf6c52e70..19b98167e602 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_h.png Binary files differindex 6bc637a4ad55..f8c09614f216 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_in_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_1x.png Binary files differindex 6e47d437a356..22deb701e357 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_3g.png Binary files differindex a20e5bfc1ddd..c7c1b49227ed 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_e.png Binary files differindex 8f135a53a30f..d9a0702c7952 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_g.png Binary files differindex cecf2c63b61a..6beed8a1b7fa 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_h.png Binary files differindex 3f8674104020..e4179c13f2ff 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_inandout_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_1x.png Binary files differindex 4740b9fdd664..4b2f86d3b4a1 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_3g.png Binary files differindex 5d0ac29fd674..6779604782f6 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_e.png Binary files differindex 768eac6df649..1309a9790ddc 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_g.png Binary files differindex 49d6279bacba..2fc1e8ec2865 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_h.png Binary files differindex 4d7df9610b00..0eef2c10c82c 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_out_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_1x.png Binary files differindex 3045a57d3bea..f8904e2c3fb3 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_3g.png Binary files differindex 661ecccc86c5..3ef306e7db26 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_e.png Binary files differindex 401cb556a587..2ff6d90d3b54 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_g.png Binary files differindex cc4e26fb7803..8ff49b0f3830 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_h.png Binary files differindex a000da26a6a2..f416203aeedc 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_in_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_1x.png Binary files differindex 32c547e7d3e5..24b7daacd561 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_3g.png Binary files differindex d769174f570d..5ea91427ef76 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_e.png Binary files differindex c895aeb10be2..5bf6acac5cab 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_g.png Binary files differindex c201350d7ffd..002bf46436f1 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_h.png Binary files differindex df2aa30f1d9b..924b84f54a7c 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_inandout_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_1x.png Binary files differindex 6b1a91433f8e..bd0d1caaf772 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_1x.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_1x.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_3g.png Binary files differindex 5edc35ab4b3e..f583eecac5fc 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_3g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_3g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_e.png Binary files differindex c94c001d56ef..66940eaf40ea 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_e.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_e.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_g.png Binary files differindex 16c3d6b846a7..0381f52d4de0 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_g.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_g.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_h.png Binary files differindex 7daf6af58ed5..0b84fe8ccbd9 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_h.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_out_h.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png Binary files differindex 31bc94ec1e56..e5e98f91201e 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png Binary files differindex 8f5b3ef23ad3..7f6fa9cae6cf 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully.png Binary files differindex 8f5b3ef23ad3..7f6fa9cae6cf 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png Binary files differindex 960c0e2350ce..ca208399d15e 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully.png Binary files differindex 960c0e2350ce..1ad5d8b499c3 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png Binary files differindex a115a23cb10a..6eba560ebb89 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully.png Binary files differindex a115a23cb10a..f2358dd63638 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png Binary files differindex 0ef34dfcd3a3..1ebe23e704a8 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully.png Binary files differindex 0ef34dfcd3a3..468ad7d4858a 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png Binary files differindex 648599ba45dc..d9f2a0d0fdea 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully.png Binary files differindex 648599ba45dc..290822ad9bc1 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_silent.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_silent.png Binary files differindex d62f32d72b19..e0a31410e529 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_silent.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_silent.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_vibrate.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_vibrate.png Binary files differindex 665ca38fefbd..116b8e237fce 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_vibrate.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_ringer_vibrate.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png Binary files differindex 39025f03bb2f..cf11f0dd40f3 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png Binary files differindex a1f7057ad9e5..3b69d1ea6c40 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png Binary files differindex 7cc9f027678e..b012b184a11d 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png Binary files differindex 122a47308bb6..87362349367a 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png Binary files differindex 4b126dcb523f..cc68512477e7 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png Binary files differindex 828c0e23a269..5a2d3c0c5eb8 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png Binary files differindex f52d8f9c39b6..a93d49c85bd3 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png Binary files differindex 61501c16546c..3fbf7fc8c09b 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png Binary files differindex 1171ffc754b6..e3ff8b9b7b89 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png Binary files differindex 98c3b10aaf0a..a1a97947765c 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png Binary files differindex cf13c7932325..5d9957ae9867 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png Binary files differindex 94c41a75fbe5..b11ad16539dc 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png Binary files differindex ac32aa619ff8..94d40e078f8c 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png Binary files differindex 9845c46ebeba..4a896f32cf5d 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png Binary files differindex 34494e30c782..b09b40dce070 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png Binary files differindex 77f4a7bd1cf9..0f9c18721ffb 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png Binary files differindex a635c3c9db9a..b852dba30caf 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png Binary files differindex c3e924084127..0468d0603deb 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png Binary files differindex 68ffdc94b913..06bbb4a7498c 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 93a3dc0830a0..1858af3a32df 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable/button_frame.xml b/packages/SystemUI/res/drawable/button_frame.xml deleted file mode 100644 index 5db39a5da562..000000000000 --- a/packages/SystemUI/res/drawable/button_frame.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2008 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/button_frame_pressed" /> - <item android:drawable="@drawable/button_frame_default" /> -</selector> - 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 faae62cb501e..2ee2ac427e98 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml @@ -68,20 +68,16 @@ android:id="@+id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" + android:layout_marginBottom="2dip" + android:layout_marginLeft="4dip" + android:layout_marginRight="4dip" > - <TextView android:id="@+id/time_bg" + <TextView android:id="@+id/time_solid" android:layout_width="wrap_content" - android:layout_height="match_parent" - android:singleLine="true" - android:textSize="40sp" - android:textColor="#1f1f1f" /> - <TextView android:id="@+id/time_fg" - android:layout_width="wrap_content" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:singleLine="true" android:textSize="40sp" - android:textColor="#2e2e2e" /> + android:textColor="#8cffffff" /> </com.android.systemui.statusbar.tablet.HoloClock> <TextView diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml index 821cf6af6dde..ef57228d69b1 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml @@ -57,7 +57,7 @@ android:layout_width="match_parent" android:layout_weight="1" > - <com.android.systemui.statusbar.tablet.NotificationLinearLayout + <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -66,21 +66,9 @@ android:clickable="true" android:focusable="true" android:descendantFocusability="afterDescendants" - > - </com.android.systemui.statusbar.tablet.NotificationLinearLayout> + /> </ScrollView> </LinearLayout> </RelativeLayout> - <View - android:id="@+id/glow" - android:background="@drawable/notify_glow_back" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignTop="@id/content_parent" - android:layout_alignLeft="@id/content_parent" - android:layout_marginLeft="100dip" - android:layout_marginTop="50dip" - /> - </com.android.systemui.statusbar.tablet.NotificationPanel> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml index 233cb46f0b85..0f3f5f0afb10 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml @@ -1,7 +1,6 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="65dp" - android:background="@drawable/status_bar_item_background" > <ImageButton @@ -12,8 +11,9 @@ android:layout_alignParentRight="true" android:src="@drawable/status_bar_veto" android:scaleType="center" - android:background="#ff000000" + android:background="@null" android:paddingRight="8dp" + android:paddingLeft="8dp" /> <ImageView @@ -24,7 +24,6 @@ android:layout_alignParentLeft="true" android:scaleType="center" /> - <!-- TODO: scaleType should be top-left but ImageView doesn't support that. --> <com.android.systemui.statusbar.LatestItemView android:id="@+id/content" android:layout_width="match_parent" diff --git a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml index cdf56c565f07..3105dabf767a 100644 --- a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml +++ b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml @@ -27,7 +27,7 @@ android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" - android:button="@drawable/status_bar_toggle_button" + android:button="@null" /> <SeekBar android:id="@+id/slider" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java index 3b76434acc7e..0121211af583 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java @@ -52,8 +52,13 @@ public class HoloClock extends FrameLayout { private String mClockFormatString; private SimpleDateFormat mClockFormat; - private static Typeface sBackgroundType, sForegroundType; - private TextView mBgText, mFgText; + private static final String FONT_DIR = "/system/fonts/"; + private static final String CLOCK_FONT = FONT_DIR + "AndroidClock_Solid.ttf"; + private static final String CLOCK_FG_FONT = FONT_DIR + "AndroidClock.ttf"; + private static final String CLOCK_BG_FONT = FONT_DIR + "AndroidClock_Highlight.ttf"; + + private static Typeface sBackgroundType, sForegroundType, sSolidType; + private TextView mSolidText, mBgText, mFgText; public HoloClock(Context context) { this(context, null); @@ -71,13 +76,10 @@ public class HoloClock extends FrameLayout { protected void onFinishInflate() { super.onFinishInflate(); - if (sBackgroundType == null) { - AssetManager assets = getContext().getAssets(); - - sBackgroundType = Typeface.createFromAsset(assets, - "fonts/AndroidClock.ttf"); - sForegroundType = Typeface.createFromAsset(assets, - "fonts/AndroidClock2.ttf"); + if (sSolidType == null) { + sSolidType = Typeface.createFromFile(CLOCK_FONT); + sBackgroundType = Typeface.createFromFile(CLOCK_BG_FONT); + sForegroundType = Typeface.createFromFile(CLOCK_FG_FONT); } mBgText = (TextView) findViewById(R.id.time_bg); if (mBgText != null) { @@ -87,6 +89,10 @@ public class HoloClock extends FrameLayout { if (mFgText != null) { mFgText.setTypeface(sForegroundType); } + mSolidText = (TextView) findViewById(R.id.time_solid); + if (mSolidText != null) { + mSolidText.setTypeface(sSolidType); + } } @Override @@ -142,8 +148,9 @@ public class HoloClock extends FrameLayout { final void updateClock() { mCalendar.setTimeInMillis(System.currentTimeMillis()); CharSequence txt = getTimeText(); - mBgText.setText(txt); - mFgText.setText(txt); + if (mBgText != null) mBgText.setText(txt); + if (mFgText != null) mFgText.setText(txt); + if (mSolidText != null) mSolidText.setText(txt); } private final CharSequence getTimeText() { 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 06c789c7a4e0..a1cc274ef99c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -16,8 +16,10 @@ package com.android.systemui.statusbar.tablet; +import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.os.IBinder; @@ -49,14 +51,24 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O private static final boolean DEBUG = TabletStatusBar.DEBUG; private static final String TAG = "InputMethodsPanel"; + private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + onPackageChanged(); + } + }; + private final InputMethodManager mImm; + private final IntentFilter mIntentFilter = new IntentFilter(); + private final HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>> mRadioViewAndImiMap = + new HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>>(); private final TreeMap<InputMethodInfo, List<InputMethodSubtype>> mEnabledInputMethodAndSubtypesCache = new TreeMap<InputMethodInfo, List<InputMethodSubtype>>( new InputMethodComparator()); - private final HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>> mRadioViewAndImiMap = - new HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>>(); + private boolean mAttached = false; + private boolean mPackageChanged = false; private Context mContext; private IBinder mToken; private InputMethodButton mInputMethodSwitchButton; @@ -88,6 +100,28 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O super(context, attrs, defStyle); mContext = context; mImm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + mIntentFilter.addAction(Intent.ACTION_PACKAGE_REPLACED); + mIntentFilter.addAction(Intent.ACTION_PACKAGE_ADDED); + mIntentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); + mIntentFilter.addDataScheme("package"); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + if (mAttached) { + getContext().unregisterReceiver(mBroadcastReceiver); + mAttached = false; + } + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (!mAttached) { + getContext().registerReceiver(mBroadcastReceiver, mIntentFilter); + mAttached = true; + } } @Override @@ -302,7 +336,8 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O String newEnabledIMIs = Settings.Secure.getString( mContext.getContentResolver(), Settings.Secure.ENABLED_INPUT_METHODS); if (mEnabledInputMethodAndSubtypesCacheStr == null - || !mEnabledInputMethodAndSubtypesCacheStr.equals(newEnabledIMIs)) { + || !mEnabledInputMethodAndSubtypesCacheStr.equals(newEnabledIMIs) + || mPackageChanged) { mEnabledInputMethodAndSubtypesCache.clear(); final List<InputMethodInfo> imis = mImm.getEnabledInputMethodList(); for (InputMethodInfo imi: imis) { @@ -310,6 +345,7 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O mImm.getEnabledInputMethodSubtypeList(imi, true)); } mEnabledInputMethodAndSubtypesCacheStr = newEnabledIMIs; + mPackageChanged = false; } return mEnabledInputMethodAndSubtypesCache; } @@ -376,4 +412,11 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } return null; } + + private void onPackageChanged() { + if (DEBUG) { + Log.d(TAG, "onPackageChanged."); + } + mPackageChanged = true; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 092f0b889512..1004e18ee064 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -58,7 +58,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, ViewGroup mContentFrame; Rect mContentArea = new Rect(); View mSettingsView; - View mGlow; ViewGroup mContentParent; Choreographer mChoreo = new Choreographer(); @@ -83,8 +82,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, mModeToggle = findViewById(R.id.mode_toggle); mModeToggle.setOnClickListener(this); - mGlow = findViewById(R.id.glow); - mSettingsButton = (ImageView)findViewById(R.id.settings_button); mNotificationButton = (ImageView)findViewById(R.id.notification_button); @@ -306,18 +303,15 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, ? new android.view.animation.DecelerateInterpolator(1.0f) : new android.view.animation.AccelerateInterpolator(1.0f)); - Animator glowAnim = ObjectAnimator.ofInt(mGlow.getBackground(), "alpha", - mVisible ? 255 : 0, appearing ? 255 : 0); - glowAnim.setInterpolator(appearing - ? new android.view.animation.AccelerateInterpolator(1.0f) - : new android.view.animation.DecelerateInterpolator(1.0f)); + if (mContentAnim != null && mContentAnim.isRunning()) { + mContentAnim.cancel(); + } mContentAnim = new AnimatorSet(); mContentAnim .play(ObjectAnimator.ofFloat(mContentParent, "alpha", mContentParent.getAlpha(), appearing ? 1.0f : 0.0f)) .with(bgAnim) - .with(glowAnim) .with(posAnim) ; mContentAnim.setDuration((DEBUG?10:1)*(appearing ? OPEN_DURATION : CLOSE_DURATION)); @@ -330,7 +324,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, createAnimation(appearing); mContentParent.setLayerType(View.LAYER_TYPE_HARDWARE, null); - mGlow.setLayerType(View.LAYER_TYPE_HARDWARE, null); mContentAnim.start(); mVisible = appearing; @@ -338,8 +331,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, public void onAnimationCancel(Animator animation) { if (DEBUG) Slog.d(TAG, "onAnimationCancel"); - // force this to zero so we close the window - mVisible = false; } public void onAnimationEnd(Animator animation) { @@ -348,7 +339,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, setVisibility(View.GONE); } mContentParent.setLayerType(View.LAYER_TYPE_NONE, null); - mGlow.setLayerType(View.LAYER_TYPE_NONE, null); mContentAnim = null; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index 7544f4621ebd..a5e2fda01913 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -98,10 +98,12 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O }; public boolean isInContentArea(int x, int y) { - final int l = mRecentsContainer.getPaddingLeft(); - final int r = mRecentsContainer.getWidth() - mRecentsContainer.getPaddingRight(); - final int t = mRecentsContainer.getPaddingTop(); - final int b = mRecentsContainer.getHeight() - mRecentsContainer.getPaddingBottom(); + // use mRecentsContainer's exact bounds to determine horizontal position + final int l = mRecentsContainer.getLeft(); + final int r = mRecentsContainer.getRight(); + // use surrounding mRecentsGlowView's position in parent determine vertical bounds + final int t = mRecentsGlowView.getTop(); + final int b = mRecentsGlowView.getBottom(); return x >= l && x < r && y >= t && y < b; } 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 954993063f38..14a2f90acbfe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -391,8 +391,11 @@ public class TabletStatusBar extends StatusBar implements new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { - mShadow.setVisibility(View.GONE); - mBarContents.setVisibility(View.VISIBLE); + try { + mBarService.setSystemUiVisibility(View.STATUS_BAR_VISIBLE); + } catch (RemoteException ex) { + // system process dead + } } return false; } @@ -1222,6 +1225,7 @@ public class TabletStatusBar extends StatusBar implements void workAroundBadLayerDrawableOpacity(View v) { LayerDrawable d = (LayerDrawable)v.getBackground(); + if (d == null) return; v.setBackgroundDrawable(null); d.setOpacity(PixelFormat.TRANSLUCENT); v.setBackgroundDrawable(d); diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 9b5c42e158a3..fd84a2a2ea48 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1892,14 +1892,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { + (topNeedsMenu ? "needs" : "does not need") + " the MENU key"); - final boolean changedFullscreen = (mTopIsFullscreen != topIsFullscreen); + mTopIsFullscreen = topIsFullscreen; final boolean changedMenu = (topNeedsMenu != mShowMenuKey); - if (changedFullscreen || changedMenu) { - final boolean topIsFullscreenF = topIsFullscreen; + if (changedMenu) { final boolean topNeedsMenuF = topNeedsMenu; - mTopIsFullscreen = topIsFullscreen; mShowMenuKey = topNeedsMenu; mHandler.post(new Runnable() { @@ -1918,9 +1916,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (changedMenu) { sbs.setMenuKeyVisible(topNeedsMenuF); } - if (changedFullscreen) { - sbs.setActiveWindowIsFullscreen(topIsFullscreenF); - } } catch (RemoteException e) { // This should be impossible because we're in the same process. mStatusBarService = null; @@ -2860,7 +2855,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. if (mFocusedWindow != null) { - final int visibility = mFocusedWindow.getAttrs().systemUiVisibility; + final WindowManager.LayoutParams params = mFocusedWindow.getAttrs(); + final int visibility = params.systemUiVisibility | params.subtreeSystemUiVisibility; mHandler.post(new Runnable() { public void run() { if (mStatusBarService == null) { diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp index 487e73fbbdce..41dbe2fb1980 100644 --- a/services/input/EventHub.cpp +++ b/services/input/EventHub.cpp @@ -778,12 +778,12 @@ int EventHub::openDevice(const char *devicePath) { // Is this a new modern multi-touch driver? if (test_bit(ABS_MT_POSITION_X, abs_bitmask) && test_bit(ABS_MT_POSITION_Y, abs_bitmask)) { - device->classes |= INPUT_DEVICE_CLASS_TOUCHSCREEN | INPUT_DEVICE_CLASS_TOUCHSCREEN_MT; + device->classes |= INPUT_DEVICE_CLASS_TOUCH | INPUT_DEVICE_CLASS_TOUCH_MT; // Is this an old style single-touch driver? } else if (test_bit(BTN_TOUCH, key_bitmask) && test_bit(ABS_X, abs_bitmask) && test_bit(ABS_Y, abs_bitmask)) { - device->classes |= INPUT_DEVICE_CLASS_TOUCHSCREEN; + device->classes |= INPUT_DEVICE_CLASS_TOUCH; } } @@ -808,7 +808,7 @@ int EventHub::openDevice(const char *devicePath) { } #endif - if ((device->classes & INPUT_DEVICE_CLASS_TOUCHSCREEN)) { + if ((device->classes & INPUT_DEVICE_CLASS_TOUCH)) { // Load the virtual keys for the touch screen, if any. // We do this now so that we can make sure to load the keymap if necessary. status_t status = loadVirtualKeyMap(device); diff --git a/services/input/EventHub.h b/services/input/EventHub.h index 74b7ec5e9ebc..0ee0b9b853bc 100644 --- a/services/input/EventHub.h +++ b/services/input/EventHub.h @@ -106,14 +106,14 @@ enum { /* The input device is an alpha-numeric keyboard (not just a dial pad). */ INPUT_DEVICE_CLASS_ALPHAKEY = 0x00000002, - /* The input device is a touchscreen (either single-touch or multi-touch). */ - INPUT_DEVICE_CLASS_TOUCHSCREEN = 0x00000004, + /* The input device is a touchscreen or a touchpad (either single-touch or multi-touch). */ + INPUT_DEVICE_CLASS_TOUCH = 0x00000004, /* The input device is a cursor device such as a trackball or mouse. */ INPUT_DEVICE_CLASS_CURSOR = 0x00000008, /* The input device is a multi-touch touchscreen. */ - INPUT_DEVICE_CLASS_TOUCHSCREEN_MT= 0x00000010, + INPUT_DEVICE_CLASS_TOUCH_MT = 0x00000010, /* The input device is a directional pad (implies keyboard, has DPAD keys). */ INPUT_DEVICE_CLASS_DPAD = 0x00000020, diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index e314145112bf..cbfdd755df09 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -1165,12 +1165,15 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, mTempTouchState.reset(); mTempTouchState.down = true; mTempTouchState.deviceId = entry->deviceId; + mTempTouchState.source = entry->source; isSplit = false; wrongDevice = false; } else { mTempTouchState.copyFrom(mTouchState); isSplit = mTempTouchState.split; - wrongDevice = mTempTouchState.down && mTempTouchState.deviceId != entry->deviceId; + wrongDevice = mTempTouchState.down + && (mTempTouchState.deviceId != entry->deviceId + || mTempTouchState.source != entry->source); if (wrongDevice) { #if DEBUG_INPUT_DISPATCHER_POLICY LOGD("Dropping event because a pointer for a different device is already down."); @@ -1599,6 +1602,9 @@ void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, if (inputTarget->pointerIds.count() != originalMotionEntry->pointerCount) { MotionEntry* splitMotionEntry = splitMotionEvent( originalMotionEntry, inputTarget->pointerIds); + if (!splitMotionEntry) { + return; // split event was dropped + } #if DEBUG_FOCUS LOGD("channel '%s' ~ Split motion event.", connection->getInputChannelName()); @@ -2120,7 +2126,19 @@ InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet splitPointerCount += 1; } } - assert(splitPointerCount == pointerIds.count()); + + if (splitPointerCount != pointerIds.count()) { + // This is bad. We are missing some of the pointers that we expected to deliver. + // Most likely this indicates that we received an ACTION_MOVE events that has + // different pointer ids than we expected based on the previous ACTION_DOWN + // or ACTION_POINTER_DOWN events that caused us to decide to split the pointers + // in this way. + LOGW("Dropping split motion event because the pointer count is %d but " + "we expected there to be %d pointers. This probably means we received " + "a broken sequence of pointer ids from the input device.", + splitPointerCount, pointerIds.count()); + return NULL; + } int32_t action = originalMotionEntry->action; int32_t maskedAction = action & AMOTION_EVENT_ACTION_MASK; @@ -2196,7 +2214,7 @@ void InputDispatcher::notifyConfigurationChanged(nsecs_t eventTime) { } } -void InputDispatcher::notifyKey(nsecs_t eventTime, int32_t deviceId, int32_t source, +void InputDispatcher::notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, nsecs_t downTime) { #if DEBUG_INBOUND_EVENT_DETAILS @@ -2243,7 +2261,7 @@ void InputDispatcher::notifyKey(nsecs_t eventTime, int32_t deviceId, int32_t sou } } -void InputDispatcher::notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t source, +void InputDispatcher::notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, uint32_t pointerCount, const int32_t* pointerIds, const PointerCoords* pointerCoords, float xPrecision, float yPrecision, nsecs_t downTime) { @@ -2296,6 +2314,7 @@ void InputDispatcher::notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t } if (motionEntry->action != AMOTION_EVENT_ACTION_MOVE + || motionEntry->source != source || motionEntry->pointerCount != pointerCount || motionEntry->isInjected()) { // Last motion event in the queue for this device is not compatible for @@ -2355,6 +2374,7 @@ void InputDispatcher::notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t dispatchEntry->eventEntry); if (motionEntry->action != AMOTION_EVENT_ACTION_MOVE || motionEntry->deviceId != deviceId + || motionEntry->source != source || motionEntry->pointerCount != pointerCount || motionEntry->isInjected()) { // The motion event is not compatible with this move. @@ -2883,6 +2903,7 @@ void InputDispatcher::dumpDispatchStateLocked(String8& dump) { dump.appendFormat(INDENT "TouchDown: %s\n", toString(mTouchState.down)); dump.appendFormat(INDENT "TouchSplit: %s\n", toString(mTouchState.split)); dump.appendFormat(INDENT "TouchDeviceId: %d\n", mTouchState.deviceId); + dump.appendFormat(INDENT "TouchSource: 0x%08x\n", mTouchState.source); if (!mTouchState.windows.isEmpty()) { dump.append(INDENT "TouchedWindows:\n"); for (size_t i = 0; i < mTouchState.windows.size(); i++) { @@ -3308,7 +3329,7 @@ InputDispatcher::Allocator::obtainConfigurationChangedEntry(nsecs_t eventTime) { } InputDispatcher::KeyEntry* InputDispatcher::Allocator::obtainKeyEntry(nsecs_t eventTime, - int32_t deviceId, int32_t source, uint32_t policyFlags, int32_t action, + int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, int32_t repeatCount, nsecs_t downTime) { KeyEntry* entry = mKeyEntryPool.alloc(); @@ -3329,7 +3350,7 @@ InputDispatcher::KeyEntry* InputDispatcher::Allocator::obtainKeyEntry(nsecs_t ev } InputDispatcher::MotionEntry* InputDispatcher::Allocator::obtainMotionEntry(nsecs_t eventTime, - int32_t deviceId, int32_t source, uint32_t policyFlags, int32_t action, int32_t flags, + int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, float xPrecision, float yPrecision, nsecs_t downTime, uint32_t pointerCount, const int32_t* pointerIds, const PointerCoords* pointerCoords) { @@ -3757,7 +3778,7 @@ InputDispatcher::CommandEntry::~CommandEntry() { // --- InputDispatcher::TouchState --- InputDispatcher::TouchState::TouchState() : - down(false), split(false), deviceId(-1) { + down(false), split(false), deviceId(-1), source(0) { } InputDispatcher::TouchState::~TouchState() { @@ -3767,6 +3788,7 @@ void InputDispatcher::TouchState::reset() { down = false; split = false; deviceId = -1; + source = 0; windows.clear(); } @@ -3774,6 +3796,7 @@ void InputDispatcher::TouchState::copyFrom(const TouchState& other) { down = other.down; split = other.split; deviceId = other.deviceId; + source = other.source; windows.clear(); windows.appendVector(other.windows); } diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h index 11e511732061..006c6b8a22f8 100644 --- a/services/input/InputDispatcher.h +++ b/services/input/InputDispatcher.h @@ -227,10 +227,10 @@ public: * These methods should only be called on the input reader thread. */ virtual void notifyConfigurationChanged(nsecs_t eventTime) = 0; - virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, nsecs_t downTime) = 0; - virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, uint32_t pointerCount, const int32_t* pointerIds, const PointerCoords* pointerCoords, @@ -313,10 +313,10 @@ public: virtual void dispatchOnce(); virtual void notifyConfigurationChanged(nsecs_t eventTime); - virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, nsecs_t downTime); - virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, uint32_t pointerCount, const int32_t* pointerIds, const PointerCoords* pointerCoords, @@ -379,7 +379,7 @@ private: struct KeyEntry : EventEntry { int32_t deviceId; - int32_t source; + uint32_t source; int32_t action; int32_t flags; int32_t keyCode; @@ -407,7 +407,7 @@ private: struct MotionEntry : EventEntry { int32_t deviceId; - int32_t source; + uint32_t source; int32_t action; int32_t flags; int32_t metaState; @@ -549,11 +549,11 @@ private: InjectionState* obtainInjectionState(int32_t injectorPid, int32_t injectorUid); ConfigurationChangedEntry* obtainConfigurationChangedEntry(nsecs_t eventTime); KeyEntry* obtainKeyEntry(nsecs_t eventTime, - int32_t deviceId, int32_t source, uint32_t policyFlags, int32_t action, + int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, int32_t repeatCount, nsecs_t downTime); MotionEntry* obtainMotionEntry(nsecs_t eventTime, - int32_t deviceId, int32_t source, uint32_t policyFlags, int32_t action, + int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, float xPrecision, float yPrecision, nsecs_t downTime, uint32_t pointerCount, @@ -645,7 +645,7 @@ private: private: struct KeyMemento { int32_t deviceId; - int32_t source; + uint32_t source; int32_t keyCode; int32_t scanCode; int32_t flags; @@ -654,7 +654,7 @@ private: struct MotionMemento { int32_t deviceId; - int32_t source; + uint32_t source; float xPrecision; float yPrecision; nsecs_t downTime; @@ -846,6 +846,7 @@ private: bool down; bool split; int32_t deviceId; // id of the device that is currently down, others are rejected + uint32_t source; // source of the device that is current down, others are rejected Vector<TouchedWindow> windows; TouchState(); diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 2e832568cf90..46d374d7203e 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -260,10 +260,10 @@ InputDevice* InputReader::createDevice(int32_t deviceId, const String8& name, ui device->addMapper(new CursorInputMapper(device)); } - // Touchscreen-like devices. - if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN_MT) { + // Touchscreens and touchpad devices. + if (classes & INPUT_DEVICE_CLASS_TOUCH_MT) { device->addMapper(new MultiTouchInputMapper(device)); - } else if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN) { + } else if (classes & INPUT_DEVICE_CLASS_TOUCH) { device->addMapper(new SingleTouchInputMapper(device)); } @@ -605,11 +605,19 @@ void InputDevice::configure() { mSources = 0; - size_t numMappers = mMappers.size(); - for (size_t i = 0; i < numMappers; i++) { + for (size_t i = 0; i < mMappers.size(); i++) { InputMapper* mapper = mMappers[i]; mapper->configure(); - mSources |= mapper->getSources(); + + uint32_t sources = mapper->getSources(); + if (sources) { + mSources |= sources; + } else { + // The input mapper does not provide any sources. Remove it from the list. + mMappers.removeAt(i); + delete mapper; + i -= 1; + } } } @@ -1074,7 +1082,7 @@ void CursorInputMapper::configure() { // Configure device mode. switch (mParameters.mode) { case Parameters::MODE_POINTER: - mSources = AINPUT_SOURCE_MOUSE; + mSources = 0; // AINPUT_SOURCE_MOUSE; disable mouse support mXPrecision = 1.0f; mYPrecision = 1.0f; mXScale = 1.0f; @@ -1455,12 +1463,12 @@ void TouchInputMapper::configureParameters() { mParameters.virtualKeyQuietTime = getPolicy()->getVirtualKeyQuietTime(); String8 deviceTypeString; - mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_SCREEN; + mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_PAD; if (getDevice()->getConfiguration().tryGetProperty(String8("touch.deviceType"), deviceTypeString)) { - if (deviceTypeString == "touchPad") { - mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_PAD; - } else if (deviceTypeString != "touchScreen") { + if (deviceTypeString == "touchScreen") { + mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_SCREEN; + } else if (deviceTypeString != "touchPad") { LOGW("Invalid value for touch.deviceType: '%s'", deviceTypeString.string()); } } diff --git a/services/input/tests/InputReader_test.cpp b/services/input/tests/InputReader_test.cpp index 98d627d300dc..25030d81c1d6 100644 --- a/services/input/tests/InputReader_test.cpp +++ b/services/input/tests/InputReader_test.cpp @@ -188,7 +188,7 @@ public: struct NotifyKeyArgs { nsecs_t eventTime; int32_t deviceId; - int32_t source; + uint32_t source; uint32_t policyFlags; int32_t action; int32_t flags; @@ -201,7 +201,7 @@ public: struct NotifyMotionArgs { nsecs_t eventTime; int32_t deviceId; - int32_t source; + uint32_t source; uint32_t policyFlags; int32_t action; int32_t flags; @@ -288,7 +288,7 @@ private: mNotifyConfigurationChangedArgs.push_back(args); } - virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyKey(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, nsecs_t downTime) { NotifyKeyArgs args; @@ -305,7 +305,7 @@ private: mNotifyKeyArgs.push_back(args); } - virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, int32_t source, + virtual void notifyMotion(nsecs_t eventTime, int32_t deviceId, uint32_t source, uint32_t policyFlags, int32_t action, int32_t flags, int32_t metaState, int32_t edgeFlags, uint32_t pointerCount, const int32_t* pointerIds, const PointerCoords* pointerCoords, @@ -976,8 +976,10 @@ TEST_F(InputReaderTest, GetInputConfiguration_WhenAlphabeticKeyboardPresent_Retu } TEST_F(InputReaderTest, GetInputConfiguration_WhenTouchScreenPresent_ReturnsFingerTouchScreen) { + PropertyMap configuration; + configuration.addProperty(String8("touch.deviceType"), String8("touchScreen")); ASSERT_NO_FATAL_FAILURE(addDevice(0, String8("touchscreen"), - INPUT_DEVICE_CLASS_TOUCHSCREEN, NULL)); + INPUT_DEVICE_CLASS_TOUCH, &configuration)); InputConfiguration config; mReader->getInputConfiguration(&config); @@ -987,6 +989,18 @@ TEST_F(InputReaderTest, GetInputConfiguration_WhenTouchScreenPresent_ReturnsFing ASSERT_EQ(InputConfiguration::TOUCHSCREEN_FINGER, config.touchScreen); } +TEST_F(InputReaderTest, GetInputConfiguration_WhenTouchPadPresent_ReturnsFingerNoTouch) { + ASSERT_NO_FATAL_FAILURE(addDevice(0, String8("touchpad"), + INPUT_DEVICE_CLASS_TOUCH, NULL)); + + InputConfiguration config; + mReader->getInputConfiguration(&config); + + ASSERT_EQ(InputConfiguration::KEYBOARD_NOKEYS, config.keyboard); + ASSERT_EQ(InputConfiguration::NAVIGATION_NONAV, config.navigation); + ASSERT_EQ(InputConfiguration::TOUCHSCREEN_NOTOUCH, config.touchScreen); +} + TEST_F(InputReaderTest, GetInputConfiguration_WhenMousePresent_ReturnsNoNavigation) { sp<FakePointerController> controller = new FakePointerController(); mFakePolicy->setPointerController(0, controller); @@ -2385,6 +2399,14 @@ void SingleTouchInputMapperTest::processSync(SingleTouchInputMapper* mapper) { } +TEST_F(SingleTouchInputMapperTest, GetSources_WhenDeviceTypeIsNotSpecified_ReturnsTouchPad) { + SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + prepareAxes(POSITION); + addMapperAndConfigure(mapper); + + ASSERT_EQ(AINPUT_SOURCE_TOUCHPAD, mapper->getSources()); +} + TEST_F(SingleTouchInputMapperTest, GetSources_WhenDeviceTypeIsTouchPad_ReturnsTouchPad) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); prepareAxes(POSITION); @@ -2405,6 +2427,7 @@ TEST_F(SingleTouchInputMapperTest, GetSources_WhenDeviceTypeIsTouchScreen_Return TEST_F(SingleTouchInputMapperTest, GetKeyCodeState) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2432,6 +2455,7 @@ TEST_F(SingleTouchInputMapperTest, GetKeyCodeState) { TEST_F(SingleTouchInputMapperTest, GetScanCodeState) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2459,6 +2483,7 @@ TEST_F(SingleTouchInputMapperTest, GetScanCodeState) { TEST_F(SingleTouchInputMapperTest, MarkSupportedKeyCodes) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2475,6 +2500,7 @@ TEST_F(SingleTouchInputMapperTest, Reset_WhenVirtualKeysAreDown_SendsUp) { // Note: Ideally we should send cancels but the implementation is more straightforward // with up and this will only happen if a device is forcibly removed. SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2508,6 +2534,7 @@ TEST_F(SingleTouchInputMapperTest, Reset_WhenVirtualKeysAreDown_SendsUp) { TEST_F(SingleTouchInputMapperTest, Reset_WhenNothingIsPressed_NothingMuchHappens) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2534,6 +2561,7 @@ TEST_F(SingleTouchInputMapperTest, Reset_WhenNothingIsPressed_NothingMuchHappens TEST_F(SingleTouchInputMapperTest, Process_WhenVirtualKeyIsPressedAndReleasedNormally_SendsKeyDownAndKeyUp) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2583,6 +2611,7 @@ TEST_F(SingleTouchInputMapperTest, Process_WhenVirtualKeyIsPressedAndReleasedNor TEST_F(SingleTouchInputMapperTest, Process_WhenVirtualKeyIsPressedAndMovedOutOfBounds_SendsKeyDownAndKeyCancel) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2697,6 +2726,7 @@ TEST_F(SingleTouchInputMapperTest, Process_WhenVirtualKeyIsPressedAndMovedOutOfB TEST_F(SingleTouchInputMapperTest, Process_WhenTouchStartsOutsideDisplayAndMovesIn_SendsDownAsTouchEntersDisplay) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2765,6 +2795,7 @@ TEST_F(SingleTouchInputMapperTest, Process_WhenTouchStartsOutsideDisplayAndMoves TEST_F(SingleTouchInputMapperTest, Process_NormalSingleTouchGesture) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -2848,6 +2879,7 @@ TEST_F(SingleTouchInputMapperTest, Process_NormalSingleTouchGesture) { TEST_F(SingleTouchInputMapperTest, Process_WhenNotOrientationAware_DoesNotRotateMotions) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareAxes(POSITION); addConfigurationProperty("touch.orientationAware", "0"); addMapperAndConfigure(mapper); @@ -2870,6 +2902,7 @@ TEST_F(SingleTouchInputMapperTest, Process_WhenNotOrientationAware_DoesNotRotate TEST_F(SingleTouchInputMapperTest, Process_WhenOrientationAware_RotatesMotions) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareAxes(POSITION); addMapperAndConfigure(mapper); @@ -2930,6 +2963,7 @@ TEST_F(SingleTouchInputMapperTest, Process_WhenOrientationAware_RotatesMotions) TEST_F(SingleTouchInputMapperTest, Process_AllAxes_DefaultCalibration) { SingleTouchInputMapper* mapper = new SingleTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | PRESSURE | TOOL); addMapperAndConfigure(mapper); @@ -3062,6 +3096,7 @@ void MultiTouchInputMapperTest::processSync(MultiTouchInputMapper* mapper) { TEST_F(MultiTouchInputMapperTest, Process_NormalMultiTouchGesture_WithoutTrackingIds) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION); prepareVirtualKeys(); @@ -3313,6 +3348,7 @@ TEST_F(MultiTouchInputMapperTest, Process_NormalMultiTouchGesture_WithoutTrackin TEST_F(MultiTouchInputMapperTest, Process_NormalMultiTouchGesture_WithTrackingIds) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | ID); prepareVirtualKeys(); @@ -3473,6 +3509,7 @@ TEST_F(MultiTouchInputMapperTest, Process_NormalMultiTouchGesture_WithTrackingId TEST_F(MultiTouchInputMapperTest, Process_AllAxes_WithDefaultCalibration) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | TOUCH | TOOL | PRESSURE | ORIENTATION | ID | MINOR); addMapperAndConfigure(mapper); @@ -3518,6 +3555,7 @@ TEST_F(MultiTouchInputMapperTest, Process_AllAxes_WithDefaultCalibration) { TEST_F(MultiTouchInputMapperTest, Process_TouchAndToolAxes_GeometricCalibration) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | TOUCH | TOOL | MINOR); addConfigurationProperty("touch.touchSize.calibration", "geometric"); @@ -3559,6 +3597,7 @@ TEST_F(MultiTouchInputMapperTest, Process_TouchAndToolAxes_GeometricCalibration) TEST_F(MultiTouchInputMapperTest, Process_TouchToolPressureSizeAxes_SummedLinearCalibration) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | TOUCH | TOOL); addConfigurationProperty("touch.touchSize.calibration", "pressure"); @@ -3615,6 +3654,7 @@ TEST_F(MultiTouchInputMapperTest, Process_TouchToolPressureSizeAxes_SummedLinear TEST_F(MultiTouchInputMapperTest, Process_TouchToolPressureSizeAxes_AreaCalibration) { MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice); + addConfigurationProperty("touch.deviceType", "touchScreen"); prepareDisplay(DISPLAY_ORIENTATION_0); prepareAxes(POSITION | TOUCH | TOOL); addConfigurationProperty("touch.touchSize.calibration", "pressure"); diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index 50ea3fa351b8..bdaa3b02e2b9 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -283,33 +283,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - /** - * This is used for the automatic version of lights-out mode. Only call this from - * the window manager. - * - * @see setLightsOn(boolean) - */ - public void setActiveWindowIsFullscreen(boolean fullscreen) { - // We could get away with a separate permission here, but STATUS_BAR is - // signatureOrSystem which is probably good enough. There is no public API - // for this, so the question is a security issue, not an API compatibility issue. - enforceStatusBar(); - - synchronized (mLock) { - updateLightsOnLocked(!fullscreen); - } - } - - /** - * This is used for the user-controlled version of lights-out mode. Only call this from - * the status bar itself. - * - * We have two different functions here, because I think we're going to want to - * tweak the behavior when the user keeps turning lights-out mode off and the - * app keeps trying to turn it on. For now they can just fight it out. Having - * these two separte inputs will allow us to keep that change local to here. --joeo - */ public void setSystemUiVisibility(int vis) { + // also allows calls from window manager which is in this process. enforceStatusBarService(); synchronized (mLock) { diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 7506bb1642ab..39bbd63da94b 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -214,7 +214,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { * Wake lock timeout should be longer than the longest timeout in * the vendor ril. */ - private static final int DEFAULT_WAKE_LOCK_TIMEOUT = 30000; + private static final int DEFAULT_WAKE_LOCK_TIMEOUT = 60000; //***** Instance Variables diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java index 5bcf727787f6..622fb0e8387c 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java @@ -16,8 +16,6 @@ package com.android.dumprendertree; -import dalvik.system.VMRuntime; - import android.app.Instrumentation; import android.content.Context; import android.content.Intent; @@ -34,12 +32,15 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShellActivity> { private final static String LOGTAG = "LoadTest"; private final static String LOAD_TEST_RESULT = Environment.getExternalStorageDirectory() + "/load_test_result.txt"; + private final static int MAX_GC_WAIT_SEC = 10; private boolean mFinished; static final String LOAD_TEST_RUNNER_FILES[] = { "run_page_cycler.py" @@ -90,14 +91,23 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel private void freeMem() { Log.v(LOGTAG, "freeMem: calling gc..."); - final VMRuntime runtime = VMRuntime.getRuntime(); - - runtime.gcSoftReferences(); - runtime.gcSoftReferences(); - runtime.gcSoftReferences(); - Runtime.getRuntime().gc(); - Runtime.getRuntime().gc(); - + final CountDownLatch latch = new CountDownLatch(1); + Object dummy = new Object() { + @Override + protected void finalize() throws Throwable { + latch.countDown(); + super.finalize(); + } + }; + dummy = null; + System.gc(); + try { + if (!latch.await(MAX_GC_WAIT_SEC, TimeUnit.SECONDS)) { + Log.w(LOGTAG, "gc did not happen in 10s"); + } + } catch (InterruptedException e) { + //ignore + } } private void printRow(PrintStream ps, String format, Object...objs) { diff --git a/tests/StatusBar/res/drawable-mdpi/pineapple.png b/tests/StatusBar/res/drawable-mdpi/pineapple.png Binary files differindex 7377b9659800..a903723b6049 100644 --- a/tests/StatusBar/res/drawable-mdpi/pineapple.png +++ b/tests/StatusBar/res/drawable-mdpi/pineapple.png diff --git a/tests/StatusBar/res/drawable-mdpi/pineapple2.png b/tests/StatusBar/res/drawable-mdpi/pineapple2.png Binary files differindex ddc103803b6d..8e5009bcc6a4 100644 --- a/tests/StatusBar/res/drawable-mdpi/pineapple2.png +++ b/tests/StatusBar/res/drawable-mdpi/pineapple2.png diff --git a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java index 9b6fb82a6329..d2b6b27bf543 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Region_Delegate.java @@ -446,6 +446,15 @@ public class Region_Delegate { return region1.mArea.equals(region2.mArea); } + /*package*/ static String nativeToString(int native_region) { + Region_Delegate region = sManager.getDelegate(native_region); + if (region == null) { + return "not found"; + } + + return region.mArea.toString(); + } + // ---- Private delegate/helper methods ---- } diff --git a/tools/layoutlib/bridge/src/android/os/Build_Delegate.java b/tools/layoutlib/bridge/src/android/os/Build_Delegate.java new file mode 100644 index 000000000000..f71860f76ec0 --- /dev/null +++ b/tools/layoutlib/bridge/src/android/os/Build_Delegate.java @@ -0,0 +1,46 @@ +/* + * 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 android.os; + +import com.android.layoutlib.bridge.Bridge; +import com.android.layoutlib.bridge.impl.DelegateManager; + +import java.util.Map; + +/** + * Delegate implementing the native methods of android.os.Build + * + * Through the layoutlib_create tool, the original native methods of Build have been replaced + * by calls to methods of the same name in this delegate class. + * + * Because it's a stateless class to start with, there's no need to keep a {@link DelegateManager} + * around to map int to instance of the delegate. + * + */ +public class Build_Delegate { + + /*package*/ static String getString(String property) { + Map<String, String> properties = Bridge.getPlatformProperties(); + String value = properties.get(property); + if (value != null) { + return value; + } + + return Build.UNKNOWN; + } + +} diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java index 37576b4ec9c0..0c3aef419c20 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java @@ -93,6 +93,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { new HashMap<String, SoftReference<NinePatchChunk>>(); private static Map<String, Map<String, Integer>> sEnumValueMap; + private static Map<String, String> sPlatformProperties; /** * int[] wrapper to use as keys in maps. @@ -157,10 +158,8 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { */ private static LayoutLog sCurrentLog = sDefaultLog; - private EnumSet<Capability> mCapabilities; - @Override public int getApiLevel() { return com.android.ide.common.rendering.api.Bridge.API_CURRENT; @@ -172,8 +171,11 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { } @Override - public boolean init(File fontLocation, Map<String, Map<String, Integer>> enumValueMap, + public boolean init(Map<String,String> platformProperties, + File fontLocation, + Map<String, Map<String, Integer>> enumValueMap, LayoutLog log) { + sPlatformProperties = platformProperties; sEnumValueMap = enumValueMap; // don't use EnumSet.allOf(), because the bridge doesn't come with its specific version @@ -429,6 +431,13 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { } /** + * Returns the platform build properties. + */ + public static Map<String, String> getPlatformProperties() { + return sPlatformProperties; + } + + /** * Returns the bitmap for a specific path, from a specific project cache, or from the * framework cache. * @param value the path of the bitmap diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java index bc2301d9a748..3bc02024df84 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeRenderSession.java @@ -30,6 +30,7 @@ import android.view.ViewGroup; import android.view.ViewParent; import java.awt.image.BufferedImage; +import java.util.List; import java.util.Map; /** @@ -55,8 +56,8 @@ public class BridgeRenderSession extends RenderSession { } @Override - public ViewInfo getRootView() { - return mSession.getViewInfo(); + public List<ViewInfo> getRootViews() { + return mSession.getViewInfos(); } @Override diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index 63d52e9638da..d7b70094e494 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -116,7 +116,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { // information being returned through the API private BufferedImage mImage; - private ViewInfo mViewInfo; + private List<ViewInfo> mViewInfoList; private static final class PostInflateException extends Exception { private static final long serialVersionUID = 1L; @@ -478,7 +478,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { mViewRoot.draw(mCanvas); - mViewInfo = visit(((ViewGroup)mViewRoot).getChildAt(0), mContext); + mViewInfoList = visitAllChildren((ViewGroup)mViewRoot, mContext); // success! return SUCCESS.createResult(); @@ -1101,16 +1101,25 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { if (view instanceof ViewGroup) { ViewGroup group = ((ViewGroup) view); - List<ViewInfo> children = new ArrayList<ViewInfo>(); - for (int i = 0; i < group.getChildCount(); i++) { - children.add(visit(group.getChildAt(i), context)); - } - result.setChildren(children); + result.setChildren(visitAllChildren(group, context)); } return result; } + private List<ViewInfo> visitAllChildren(ViewGroup viewGroup, BridgeContext context) { + if (viewGroup == null) { + return null; + } + + List<ViewInfo> children = new ArrayList<ViewInfo>(); + for (int i = 0; i < viewGroup.getChildCount(); i++) { + children.add(visit(viewGroup.getChildAt(i), context)); + } + return children; + } + + private void invalidateRenderingSize() { mMeasuredScreenWidth = mMeasuredScreenHeight = -1; } @@ -1119,8 +1128,8 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { return mImage; } - public ViewInfo getViewInfo() { - return mViewInfo; + public List<ViewInfo> getViewInfos() { + return mViewInfoList; } public Map<String, String> getDefaultProperties(Object viewObject) { diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java index e3c5b4be95e8..55e9e48662c9 100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java @@ -96,6 +96,7 @@ public final class CreateInfo implements ICreateInfo { private final static String[] DELEGATE_METHODS = new String[] { "android.app.Fragment#instantiate", //(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Landroid/app/Fragment;", "android.os.Handler#sendMessageAtTime", + "android.os.Build#getString", "android.view.LayoutInflater#rInflate", "android.view.View#isInEditMode", "com.android.internal.util.XmlUtils#convertValueToInt", |