Merge change I4499ad72 into eclair
* changes:
Fix bad merge fixes build breakage.
diff --git a/api/current.xml b/api/current.xml
index 3abd38b..e72a88c 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -161987,6 +161987,17 @@
visibility="public"
>
</method>
+<method name="isChildrenDrawingOrderEnabled"
+ return="boolean"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+</method>
<method name="isChildrenDrawnWithCacheEnabled"
return="boolean"
abstract="false"
@@ -162370,6 +162381,19 @@
<parameter name="enabled" type="boolean">
</parameter>
</method>
+<method name="setChildrenDrawingOrderEnabled"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<parameter name="enabled" type="boolean">
+</parameter>
+</method>
<method name="setChildrenDrawnWithCacheEnabled"
return="void"
abstract="false"
@@ -162537,17 +162561,6 @@
visibility="protected"
>
</field>
-<field name="FLAG_USE_CHILD_DRAWING_ORDER"
- type="int"
- transient="false"
- volatile="false"
- value="1024"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="protected"
->
-</field>
<field name="FOCUS_AFTER_DESCENDANTS"
type="int"
transient="false"
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index f7b7f02..e2f15c7 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -150,6 +150,8 @@
/**
* When set, the drawing method will call {@link #getChildDrawingOrder(int, int)}
* to get the index of the child to draw for that iteration.
+ *
+ * @hide
*/
protected static final int FLAG_USE_CHILD_DRAWING_ORDER = 0x400;
@@ -1307,11 +1309,14 @@
* if you want to change the drawing order of children. By default, it
* returns i.
* <p>
- * NOTE: In order for this method to be called, the
- * {@link #FLAG_USE_CHILD_DRAWING_ORDER} must be set.
+ * NOTE: In order for this method to be called, you must enable child ordering
+ * first by calling {@link #setChildrenDrawingOrderEnabled(boolean)}.
*
* @param i The current iteration.
* @return The index of the child to draw this iteration.
+ *
+ * @see #setChildrenDrawingOrderEnabled(boolean)
+ * @see #isChildrenDrawingOrderEnabled()
*/
protected int getChildDrawingOrder(int childCount, int i) {
return i;
@@ -2706,6 +2711,35 @@
setBooleanFlag(FLAG_CHILDREN_DRAWN_WITH_CACHE, enabled);
}
+ /**
+ * Indicates whether the ViewGroup is drawing its children in the order defined by
+ * {@link #getChildDrawingOrder(int, int)}.
+ *
+ * @return true if children drawing order is defined by {@link #getChildDrawingOrder(int, int)},
+ * false otherwise
+ *
+ * @see #setChildrenDrawingOrderEnabled(boolean)
+ * @see #getChildDrawingOrder(int, int)
+ */
+ @ViewDebug.ExportedProperty
+ protected boolean isChildrenDrawingOrderEnabled() {
+ return (mGroupFlags & FLAG_USE_CHILD_DRAWING_ORDER) == FLAG_USE_CHILD_DRAWING_ORDER;
+ }
+
+ /**
+ * Tells the ViewGroup whether to draw its children in the order defined by the method
+ * {@link #getChildDrawingOrder(int, int)}.
+ *
+ * @param enabled true if the order of the children when drawing is determined by
+ * {@link #getChildDrawingOrder(int, int)}, false otherwise
+ *
+ * @see #isChildrenDrawingOrderEnabled()
+ * @see #getChildDrawingOrder(int, int)
+ */
+ protected void setChildrenDrawingOrderEnabled(boolean enabled) {
+ setBooleanFlag(FLAG_USE_CHILD_DRAWING_ORDER, enabled);
+ }
+
private void setBooleanFlag(int flag, boolean value) {
if (value) {
mGroupFlags |= flag;
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 86c3df6..d474571 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -422,31 +422,13 @@
<< getReturnString(cmd) << endl;
}
- bool isTainted = false;
-
- {
- SchedPolicy policy;
- get_sched_policy(getpid(), &policy);
-
- if (policy == SP_BACKGROUND) {
- isTainted = true;
- }
- }
result = executeCommand(cmd);
- // Make sure that after executing the commands that we put the thread back into the
- // default cgroup.
- {
- int pid = getpid();
- SchedPolicy policy;
- get_sched_policy(pid, &policy);
-
- if (!isTainted && policy == SP_BACKGROUND) {
- LOGW("*** THREAD %p (PID %p) was left in SP_BACKGROUND with a priority of %d\n",
- (void*)pthread_self(), pid, getpriority(PRIO_PROCESS, pid));
- }
- }
+ // Make sure that after executing the command that we put the thread back into the
+ // default cgroup. This is just a failsafe incase the thread's priority or cgroup was
+ // not properly restored.
+ set_sched_policy(getpid(), SP_FOREGROUND);
}
// Let this thread exit the thread pool if it is no longer
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index b522e11..673c174 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -635,6 +635,7 @@
switch (format) {
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_RGBA_8888:
+ case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_RGBA_4444:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_BGRA_8888:
@@ -804,6 +805,7 @@
case GGL_PIXEL_FORMAT_A_8: size *= 1; break;
case GGL_PIXEL_FORMAT_RGB_565: size *= 2; break;
case GGL_PIXEL_FORMAT_RGBA_8888: size *= 4; break;
+ case GGL_PIXEL_FORMAT_RGBX_8888: size *= 4; break;
default:
LOGE("incompatible pixel format for pbuffer (format=%d)", f);
pbuffer.data = 0;
@@ -975,7 +977,7 @@
// These configs can override the base attribute list
// NOTE: when adding a config here, don't forget to update eglCreate*Surface()
-
+// 565 configs
static config_pair_t const config_0_attribute_list[] = {
{ EGL_BUFFER_SIZE, 16 },
{ EGL_ALPHA_SIZE, 0 },
@@ -998,8 +1000,32 @@
{ EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
};
+// RGB 888 configs
static config_pair_t const config_2_attribute_list[] = {
{ EGL_BUFFER_SIZE, 32 },
+ { EGL_ALPHA_SIZE, 0 },
+ { EGL_BLUE_SIZE, 8 },
+ { EGL_GREEN_SIZE, 8 },
+ { EGL_RED_SIZE, 8 },
+ { EGL_DEPTH_SIZE, 0 },
+ { EGL_CONFIG_ID, 6 },
+ { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
+};
+
+static config_pair_t const config_3_attribute_list[] = {
+ { EGL_BUFFER_SIZE, 32 },
+ { EGL_ALPHA_SIZE, 0 },
+ { EGL_BLUE_SIZE, 8 },
+ { EGL_GREEN_SIZE, 8 },
+ { EGL_RED_SIZE, 8 },
+ { EGL_DEPTH_SIZE, 16 },
+ { EGL_CONFIG_ID, 7 },
+ { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
+};
+
+// 8888 configs
+static config_pair_t const config_4_attribute_list[] = {
+ { EGL_BUFFER_SIZE, 32 },
{ EGL_ALPHA_SIZE, 8 },
{ EGL_BLUE_SIZE, 8 },
{ EGL_GREEN_SIZE, 8 },
@@ -1009,7 +1035,7 @@
{ EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
};
-static config_pair_t const config_3_attribute_list[] = {
+static config_pair_t const config_5_attribute_list[] = {
{ EGL_BUFFER_SIZE, 32 },
{ EGL_ALPHA_SIZE, 8 },
{ EGL_BLUE_SIZE, 8 },
@@ -1020,7 +1046,8 @@
{ EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
};
-static config_pair_t const config_4_attribute_list[] = {
+// A8 configs
+static config_pair_t const config_6_attribute_list[] = {
{ EGL_BUFFER_SIZE, 8 },
{ EGL_ALPHA_SIZE, 8 },
{ EGL_BLUE_SIZE, 0 },
@@ -1031,7 +1058,7 @@
{ EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
};
-static config_pair_t const config_5_attribute_list[] = {
+static config_pair_t const config_7_attribute_list[] = {
{ EGL_BUFFER_SIZE, 8 },
{ EGL_ALPHA_SIZE, 8 },
{ EGL_BLUE_SIZE, 0 },
@@ -1049,6 +1076,8 @@
{ config_3_attribute_list, NELEM(config_3_attribute_list) },
{ config_4_attribute_list, NELEM(config_4_attribute_list) },
{ config_5_attribute_list, NELEM(config_5_attribute_list) },
+ { config_6_attribute_list, NELEM(config_6_attribute_list) },
+ { config_7_attribute_list, NELEM(config_7_attribute_list) },
};
static config_management_t const gConfigManagement[] = {
@@ -1095,6 +1124,50 @@
// ----------------------------------------------------------------------------
+static status_t getConfigFormatInfo(EGLint configID,
+ int32_t& pixelFormat, int32_t& depthFormat)
+{
+ switch(configID) {
+ case 0:
+ pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
+ depthFormat = 0;
+ break;
+ case 1:
+ pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
+ depthFormat = GGL_PIXEL_FORMAT_Z_16;
+ break;
+ case 2:
+ pixelFormat = GGL_PIXEL_FORMAT_RGBX_8888;
+ depthFormat = 0;
+ break;
+ case 3:
+ pixelFormat = GGL_PIXEL_FORMAT_RGBX_8888;
+ depthFormat = GGL_PIXEL_FORMAT_Z_16;
+ break;
+ case 4:
+ pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
+ depthFormat = 0;
+ break;
+ case 5:
+ pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
+ depthFormat = GGL_PIXEL_FORMAT_Z_16;
+ break;
+ case 6:
+ pixelFormat = GGL_PIXEL_FORMAT_A_8;
+ depthFormat = 0;
+ break;
+ case 7:
+ pixelFormat = GGL_PIXEL_FORMAT_A_8;
+ depthFormat = GGL_PIXEL_FORMAT_Z_16;
+ break;
+ default:
+ return NAME_NOT_FOUND;
+ }
+ return NO_ERROR;
+}
+
+// ----------------------------------------------------------------------------
+
template<typename T>
static int binarySearch(T const sortedArray[], int first, int last, EGLint key)
{
@@ -1238,32 +1311,7 @@
int32_t depthFormat;
int32_t pixelFormat;
- switch(configID) {
- case 0:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = 0;
- break;
- case 1:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 2:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = 0;
- break;
- case 3:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 4:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = 0;
- break;
- case 5:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- default:
+ if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
}
@@ -1312,32 +1360,7 @@
int32_t depthFormat;
int32_t pixelFormat;
- switch(configID) {
- case 0:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = 0;
- break;
- case 1:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 2:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = 0;
- break;
- case 3:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 4:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = 0;
- break;
- case 5:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- default:
+ if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
}
@@ -1376,32 +1399,7 @@
int32_t depthFormat;
int32_t pixelFormat;
- switch(configID) {
- case 0:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = 0;
- break;
- case 1:
- pixelFormat = GGL_PIXEL_FORMAT_RGB_565;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 2:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = 0;
- break;
- case 3:
- pixelFormat = GGL_PIXEL_FORMAT_RGBA_8888;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- case 4:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = 0;
- break;
- case 5:
- pixelFormat = GGL_PIXEL_FORMAT_A_8;
- depthFormat = GGL_PIXEL_FORMAT_Z_16;
- break;
- default:
+ if (getConfigFormatInfo(configID, pixelFormat, depthFormat) != NO_ERROR) {
return setError(EGL_BAD_MATCH, EGL_NO_SURFACE);
}
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 754e6e5..c3b591e 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -1260,9 +1260,20 @@
// ----- Restore handling -----
- private boolean signaturesMatch(Signature[] storedSigs, Signature[] deviceSigs) {
+ private boolean signaturesMatch(Signature[] storedSigs, PackageInfo target) {
+ // If the target resides on the system partition, we allow it to restore
+ // data from the like-named package in a restore set even if the signatures
+ // do not match. (Unlike general applications, those flashed to the system
+ // partition will be signed with the device's platform certificate, so on
+ // different phones the same system app will have different signatures.)
+ if ((target.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
+ if (DEBUG) Log.v(TAG, "System app " + target.packageName + " - skipping sig check");
+ return true;
+ }
+
// Allow unsigned apps, but not signed on one device and unsigned on the other
// !!! TODO: is this the right policy?
+ Signature[] deviceSigs = target.signatures;
if (DEBUG) Log.v(TAG, "signaturesMatch(): stored=" + storedSigs
+ " device=" + deviceSigs);
if ((storedSigs == null || storedSigs.length == 0)
@@ -1465,7 +1476,7 @@
continue;
}
- if (!signaturesMatch(metaInfo.signatures, packageInfo.signatures)) {
+ if (!signaturesMatch(metaInfo.signatures, packageInfo)) {
Log.w(TAG, "Signature mismatch restoring " + packageName);
EventLog.writeEvent(RESTORE_AGENT_FAILURE_EVENT, packageName,
"Signature mismatch");