Merge "Maybe fix build."
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index c777250..41d470b 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -64,44 +64,30 @@
*/
public static final int MODE_PRIVATE = 0x0000;
/**
+ * @deprecated Creating world-readable files is very dangerous, and likely
+ * to cause security holes in applications. It is strongly discouraged;
+ * instead, applications should use more formal mechanism for interactions
+ * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
+ * {@link android.app.Service}. There are no guarantees that this
+ * access mode will remain on a file, such as when it goes through a
+ * backup and restore.
* File creation mode: allow all other applications to have read access
* to the created file.
- *
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, world-readable files created within the
- * application's home directory will not be accessible to other applications.
- *
- * @deprecated Creating world-readable files is very dangerous, and likely
- * to cause security holes in applications. It is strongly discouraged;
- * instead, applications should use more formal mechanism for interactions
- * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
- * {@link android.app.Service}. There are no guarantees that this
- * access mode will remain on a file, such as when it goes through a
- * backup and restore.
* @see #MODE_PRIVATE
* @see #MODE_WORLD_WRITEABLE
*/
@Deprecated
public static final int MODE_WORLD_READABLE = 0x0001;
/**
+ * @deprecated Creating world-writable files is very dangerous, and likely
+ * to cause security holes in applications. It is strongly discouraged;
+ * instead, applications should use more formal mechanism for interactions
+ * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
+ * {@link android.app.Service}. There are no guarantees that this
+ * access mode will remain on a file, such as when it goes through a
+ * backup and restore.
* File creation mode: allow all other applications to have write access
* to the created file.
- *
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, world-writable files created within the
- * application's home directory will not be accessible to other applications.
- *
- * @deprecated Creating world-writable files is very dangerous, and likely
- * to cause security holes in applications. It is strongly discouraged;
- * instead, applications should use more formal mechanism for interactions
- * such as {@link ContentProvider}, {@link BroadcastReceiver}, and
- * {@link android.app.Service}. There are no guarantees that this
- * access mode will remain on a file, such as when it goes through a
- * backup and restore.
* @see #MODE_PRIVATE
* @see #MODE_WORLD_READABLE
*/
@@ -515,22 +501,18 @@
throws FileNotFoundException;
/**
- * Open a file associated with this Context's application package
+ * Open a private file associated with this Context's application package
* for writing. Creates the file if it doesn't already exist.
*
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, files created with {@code mode}
- * {@link #MODE_WORLD_READABLE} or {@link #MODE_WORLD_WRITEABLE} will not be
- * accessible to other applications.
- *
- * @param name The name of the file to open; can not contain path separators.
+ * @param name The name of the file to open; can not contain path
+ * separators.
* @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the
- * default operation, {@link #MODE_APPEND} to append to an existing file,
- * {@link #MODE_WORLD_READABLE} and {@link #MODE_WORLD_WRITEABLE} to control
- * permissions.
+ * default operation, {@link #MODE_APPEND} to append to an existing file,
+ * {@link #MODE_WORLD_READABLE} and {@link #MODE_WORLD_WRITEABLE} to control
+ * permissions.
+ *
* @return FileOutputStream Resulting output stream.
+ *
* @see #MODE_APPEND
* @see #MODE_PRIVATE
* @see #MODE_WORLD_READABLE
@@ -756,19 +738,14 @@
* application; you can only set the mode of the entire directory, not
* of individual files.
*
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, world-readable / world-writable directories
- * created using this method will not be accessible to other applications.
- *
* @param name Name of the directory to retrieve. This is a directory
- * that is created as part of your application data.
+ * that is created as part of your application data.
* @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the
- * default operation, {@link #MODE_WORLD_READABLE} and
- * {@link #MODE_WORLD_WRITEABLE} to control permissions.
+ * default operation, {@link #MODE_WORLD_READABLE} and
+ * {@link #MODE_WORLD_WRITEABLE} to control permissions.
+ *
* @return Returns a File object for the requested directory. The directory
- * will have been created if it does not already exist.
+ * will have been created if it does not already exist.
*
* @see #openFileOutput(String, int)
*/
@@ -778,13 +755,6 @@
* Open a new private SQLiteDatabase associated with this Context's
* application package. Create the database file if it doesn't exist.
*
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, {@code SQLiteDatabase}s created with {@code mode}
- * {@link #MODE_WORLD_READABLE} or {@link #MODE_WORLD_WRITEABLE} will not be
- * accessible to other applications.
- *
* @param name The name (unique in the application package) of the database.
* @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the
* default operation, {@link #MODE_WORLD_READABLE}
@@ -792,8 +762,10 @@
* Use {@link #MODE_ENABLE_WRITE_AHEAD_LOGGING} to enable write-ahead logging by default.
* @param factory An optional factory class that is called to instantiate a
* cursor when query is called.
+ *
* @return The contents of a newly created database with the given name.
* @throws android.database.sqlite.SQLiteException if the database file could not be opened.
+ *
* @see #MODE_PRIVATE
* @see #MODE_WORLD_READABLE
* @see #MODE_WORLD_WRITEABLE
@@ -810,13 +782,6 @@
* <p>Accepts input param: a concrete instance of {@link DatabaseErrorHandler} to be
* used to handle corruption when sqlite reports database corruption.</p>
*
- * <b>Note:</b> Applications with {@code targetSdkVersion}
- * {@link android.os.Build.VERSION_CODES#K} or greater have home directories
- * with {@code 0700} permissions. Because an application's home directory
- * is no longer world-accessible, {@code SQLiteDatabase}s created with {@code mode}
- * {@link #MODE_WORLD_READABLE} or {@link #MODE_WORLD_WRITEABLE} will not be
- * accessible to other applications.
- *
* @param name The name (unique in the application package) of the database.
* @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the
* default operation, {@link #MODE_WORLD_READABLE}
@@ -825,9 +790,10 @@
* @param factory An optional factory class that is called to instantiate a
* cursor when query is called.
* @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database
- * corruption. if null, {@link android.database.DefaultDatabaseErrorHandler} is assumed.
+ * corruption. if null, {@link android.database.DefaultDatabaseErrorHandler} is assumed.
* @return The contents of a newly created database with the given name.
* @throws android.database.sqlite.SQLiteException if the database file could not be opened.
+ *
* @see #MODE_PRIVATE
* @see #MODE_WORLD_READABLE
* @see #MODE_WORLD_WRITEABLE
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index d69d2a6..52c89e8 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -434,12 +434,6 @@
/**
* Android X.X: "K". Just "K"
- *
- * <p>Applications targeting this or a later release will get these
- * new changes in behavior:</p>
- * <ul>
- * <li>Application home directory permissions are now {@code 0700}.</li>
- * </ul>
*/
public static final int K = CUR_DEVELOPMENT;
}
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 900720a..fa115ff 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -240,10 +240,10 @@
rsnElementGetSubElements(mContext, id, IDs, names, arraySizes);
}
- native int rsnTypeCreate(int con, int eid, int x, int y, int z, boolean mips, boolean faces);
- synchronized int nTypeCreate(int eid, int x, int y, int z, boolean mips, boolean faces) {
+ native int rsnTypeCreate(int con, int eid, int x, int y, int z, boolean mips, boolean faces, int yuv);
+ synchronized int nTypeCreate(int eid, int x, int y, int z, boolean mips, boolean faces, int yuv) {
validate();
- return rsnTypeCreate(mContext, eid, x, y, z, mips, faces);
+ return rsnTypeCreate(mContext, eid, x, y, z, mips, faces, yuv);
}
native void rsnTypeGetNativeData(int con, int id, int[] typeData);
synchronized void nTypeGetNativeData(int id, int[] typeData) {
diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java
index 93d8b4b..cb12594 100644
--- a/graphics/java/android/renderscript/Type.java
+++ b/graphics/java/android/renderscript/Type.java
@@ -18,6 +18,8 @@
import java.lang.reflect.Field;
+
+import android.graphics.ImageFormat;
import android.util.Log;
/**
@@ -208,6 +210,7 @@
int mDimZ;
boolean mDimMipmaps;
boolean mDimFaces;
+ int mYuv;
Element mElement;
@@ -263,6 +266,25 @@
return this;
}
+ /**
+ * @hide
+ *
+ * only NV21, YV12. Enums from ImageFormat
+ */
+ public Builder setYuvFormat(int yuvFormat) {
+ switch (yuvFormat) {
+ case android.graphics.ImageFormat.NV21:
+ case android.graphics.ImageFormat.YV12:
+ break;
+
+ default:
+ throw new RSIllegalArgumentException("Only NV21 and YV12 are supported..");
+ }
+
+ mYuv = yuvFormat;
+ return this;
+ }
+
/**
* Validate structure and create a new type.
@@ -289,8 +311,14 @@
}
}
+ if (mYuv != 0) {
+ if ((mDimZ != 0) || mDimFaces || mDimMipmaps) {
+ throw new RSInvalidStateException("YUV only supports basic 2D.");
+ }
+ }
+
int id = mRS.nTypeCreate(mElement.getID(mRS),
- mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces);
+ mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces, mYuv);
Type t = new Type(id, mRS);
t.mElement = mElement;
t.mDimX = mDimX;
@@ -298,6 +326,7 @@
t.mDimZ = mDimZ;
t.mDimMipmaps = mDimMipmaps;
t.mDimFaces = mDimFaces;
+ t.mDimYuv = mYuv;
t.calcElementCount();
return t;
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 75c7903..54413b4 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -427,12 +427,12 @@
static int
nTypeCreate(JNIEnv *_env, jobject _this, RsContext con, RsElement eid,
- jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces)
+ jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces, jint yuv)
{
- LOG_API("nTypeCreate, con(%p) eid(%p), x(%i), y(%i), z(%i), mips(%i), faces(%i)",
- con, eid, dimx, dimy, dimz, mips, faces);
+ LOG_API("nTypeCreate, con(%p) eid(%p), x(%i), y(%i), z(%i), mips(%i), faces(%i), yuv(%i)",
+ con, eid, dimx, dimy, dimz, mips, faces, yuv);
- jint id = (jint)rsTypeCreate(con, (RsElement)eid, dimx, dimy, dimz, mips, faces);
+ jint id = (jint)rsTypeCreate(con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv);
return (jint)id;
}
@@ -1454,7 +1454,7 @@
{"rsnElementGetNativeData", "(II[I)V", (void*)nElementGetNativeData },
{"rsnElementGetSubElements", "(II[I[Ljava/lang/String;[I)V", (void*)nElementGetSubElements },
-{"rsnTypeCreate", "(IIIIIZZ)I", (void*)nTypeCreate },
+{"rsnTypeCreate", "(IIIIIZZI)I", (void*)nTypeCreate },
{"rsnTypeGetNativeData", "(II[I)V", (void*)nTypeGetNativeData },
{"rsnAllocationCreateTyped", "(IIIII)I", (void*)nAllocationCreateTyped },
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp
index 902c82f..e490151 100644
--- a/libs/hwui/Patch.cpp
+++ b/libs/hwui/Patch.cpp
@@ -37,7 +37,7 @@
// 2 triangles per patch, 3 vertices per triangle
uint32_t maxVertices = ((xCount + 1) * (yCount + 1) - emptyQuads) * 2 * 3;
mVertices = new TextureVertex[maxVertices];
- mUploaded = false;
+ mAllocatedVerticesCount = 0;
verticesCount = 0;
hasEmptyQuads = emptyQuads > 0;
@@ -68,38 +68,37 @@
memcpy(mYDivs, yDivs, mYCount * sizeof(int32_t));
}
-void Patch::copy(const int32_t* yDivs) {
- memcpy(mYDivs, yDivs, mYCount * sizeof(int32_t));
-}
-
void Patch::updateColorKey(const uint32_t colorKey) {
mColorKey = colorKey;
}
-bool Patch::matches(const int32_t* xDivs, const int32_t* yDivs, const uint32_t colorKey) {
+bool Patch::matches(const int32_t* xDivs, const int32_t* yDivs,
+ const uint32_t colorKey, const int8_t emptyQuads) {
+
+ bool matches = true;
+
+ if (mEmptyQuads != emptyQuads) {
+ mEmptyQuads = emptyQuads;
+ hasEmptyQuads = emptyQuads > 0;
+ matches = false;
+ }
+
if (mColorKey != colorKey) {
updateColorKey(colorKey);
- copy(xDivs, yDivs);
- return false;
+ matches = false;
}
- for (uint32_t i = 0; i < mXCount; i++) {
- if (mXDivs[i] != xDivs[i]) {
- // The Y divs may or may not match, copy everything
- copy(xDivs, yDivs);
- return false;
- }
+ if (memcmp(mXDivs, xDivs, mXCount * sizeof(int32_t))) {
+ memcpy(mXDivs, xDivs, mXCount * sizeof(int32_t));
+ matches = false;
}
- for (uint32_t i = 0; i < mYCount; i++) {
- if (mYDivs[i] != yDivs[i]) {
- // We know all the X divs match, copy only Y divs
- copy(yDivs);
- return false;
- }
+ if (memcmp(mYDivs, yDivs, mYCount * sizeof(int32_t))) {
+ memcpy(mYDivs, yDivs, mYCount * sizeof(int32_t));
+ matches = false;
}
- return true;
+ return matches;
}
///////////////////////////////////////////////////////////////////////////////
@@ -203,10 +202,10 @@
if (verticesCount > 0) {
Caches& caches = Caches::getInstance();
caches.bindMeshBuffer(meshBuffer);
- if (!mUploaded) {
+ if (mAllocatedVerticesCount < verticesCount) {
glBufferData(GL_ARRAY_BUFFER, sizeof(TextureVertex) * verticesCount,
mVertices, GL_DYNAMIC_DRAW);
- mUploaded = true;
+ mAllocatedVerticesCount = verticesCount;
} else {
glBufferSubData(GL_ARRAY_BUFFER, 0,
sizeof(TextureVertex) * verticesCount, mVertices);
diff --git a/libs/hwui/Patch.h b/libs/hwui/Patch.h
index 0518d91..cab0e54 100644
--- a/libs/hwui/Patch.h
+++ b/libs/hwui/Patch.h
@@ -45,7 +45,7 @@
* indices to render the vertices.
*/
struct Patch {
- Patch(const uint32_t xCount, const uint32_t yCount, const int8_t emptyQuads = 0);
+ Patch(const uint32_t xCount, const uint32_t yCount, const int8_t emptyQuads);
~Patch();
void updateVertices(const float bitmapWidth, const float bitmapHeight,
@@ -53,7 +53,8 @@
void updateColorKey(const uint32_t colorKey);
void copy(const int32_t* xDivs, const int32_t* yDivs);
- bool matches(const int32_t* xDivs, const int32_t* yDivs, const uint32_t colorKey);
+ bool matches(const int32_t* xDivs, const int32_t* yDivs,
+ const uint32_t colorKey, const int8_t emptyQuads);
GLuint meshBuffer;
uint32_t verticesCount;
@@ -62,7 +63,7 @@
private:
TextureVertex* mVertices;
- bool mUploaded;
+ uint32_t mAllocatedVerticesCount;
int32_t* mXDivs;
int32_t* mYDivs;
@@ -72,8 +73,6 @@
uint32_t mYCount;
int8_t mEmptyQuads;
- void copy(const int32_t* yDivs);
-
void generateRow(TextureVertex*& vertex, float y1, float y2,
float v1, float v2, float stretchX, float rescaleX,
float width, float bitmapWidth, uint32_t& quadCount);
diff --git a/libs/hwui/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index 9702c3d..8ee8f5c 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -97,7 +97,7 @@
}
mCache.add(description, mesh);
- } else if (!mesh->matches(xDivs, yDivs, colorKey)) {
+ } else if (!mesh->matches(xDivs, yDivs, colorKey, transparentQuads)) {
PATCH_LOGD("Patch mesh does not match, refreshing vertices");
mesh->updateVertices(bitmapWidth, bitmapHeight, 0.0f, 0.0f, pixelWidth, pixelHeight);
}
diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_silent.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_silent.png
new file mode 100644
index 0000000..6872ec8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_silent.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_vibrate.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_vibrate.png
new file mode 100644
index 0000000..98520d3
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-hdpi/stat_sys_ringer_vibrate.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_silent.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_silent.png
new file mode 100644
index 0000000..66b4741
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_silent.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_vibrate.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_vibrate.png
new file mode 100644
index 0000000..f8abf25
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-mdpi/stat_sys_ringer_vibrate.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_silent.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_silent.png
new file mode 100644
index 0000000..629b5f8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_silent.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_vibrate.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_vibrate.png
new file mode 100644
index 0000000..8e3e8b4
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl-xhdpi/stat_sys_ringer_vibrate.png
Binary files differ
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index dbc55c8..39d56a4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -118,12 +118,7 @@
mIcon = icon.clone();
setContentDescription(icon.contentDescription);
if (!iconEquals) {
- Drawable drawable = getIcon(icon);
- if (drawable == null) {
- Slog.w(TAG, "No icon for slot " + mSlot);
- return false;
- }
- setImageDrawable(drawable);
+ if (!updateDrawable(false /* no clear */)) return false;
}
if (!levelEquals) {
setImageLevel(icon.iconLevel);
@@ -149,6 +144,23 @@
return true;
}
+ public void updateDrawable() {
+ updateDrawable(true /* with clear */);
+ }
+
+ private boolean updateDrawable(boolean withClear) {
+ Drawable drawable = getIcon(mIcon);
+ if (drawable == null) {
+ Slog.w(TAG, "No icon for slot " + mSlot);
+ return false;
+ }
+ if (withClear) {
+ setImageDrawable(null);
+ }
+ setImageDrawable(drawable);
+ return true;
+ }
+
private Drawable getIcon(StatusBarIcon icon) {
return getIcon(getContext(), icon);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a5d782e..3227a34 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -837,6 +837,16 @@
mWindowManager.addView(mIntruderAlertView, lp);
}
+ public void refreshAllStatusBarIcons() {
+ final int count = mStatusIcons.getChildCount();
+ for (int n = 0; n < count; n++) {
+ View child = mStatusIcons.getChildAt(n);
+ if (child instanceof StatusBarIconView) {
+ ((StatusBarIconView) child).updateDrawable();
+ }
+ }
+ }
+
public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
if (SPEW) Slog.d(TAG, "addIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex
+ " icon=" + icon);
@@ -984,6 +994,8 @@
mNotificationButton.setImageDrawable(null);
mNotificationButton.setImageResource(R.drawable.ic_notifications);
}
+
+ refreshAllStatusBarIcons();
}
private void updateShowSearchHoldoff() {
diff --git a/services/java/com/android/server/pm/Installer.java b/services/java/com/android/server/pm/Installer.java
index e96820f..02a2c1b 100644
--- a/services/java/com/android/server/pm/Installer.java
+++ b/services/java/com/android/server/pm/Installer.java
@@ -188,12 +188,7 @@
}
}
- /**
- * @param restrictHomeDir if {@code true}, installd will create the application's
- * home directory with {@code 0700} permissions. If false, {@code 0751} will
- * be used instead.
- */
- public int install(String name, int uid, int gid, boolean restrictHomeDir) {
+ public int install(String name, int uid, int gid) {
StringBuilder builder = new StringBuilder("install");
builder.append(' ');
builder.append(name);
@@ -201,8 +196,6 @@
builder.append(uid);
builder.append(' ');
builder.append(gid);
- builder.append(' ');
- builder.append(restrictHomeDir);
return execute(builder.toString());
}
@@ -270,12 +263,7 @@
return execute(builder.toString());
}
- /**
- * @param restrictHomeDir if {@code true}, installd will create the application's
- * home directory with {@code 0700} permissions. If false, {@code 0751} will
- * be used instead.
- */
- public int createUserData(String name, int uid, int userId, boolean restrictHomeDir) {
+ public int createUserData(String name, int uid, int userId) {
StringBuilder builder = new StringBuilder("mkuserdata");
builder.append(' ');
builder.append(name);
@@ -283,8 +271,6 @@
builder.append(uid);
builder.append(' ');
builder.append(userId);
- builder.append(' ');
- builder.append(restrictHomeDir);
return execute(builder.toString());
}
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index aa2b461..2238f17 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -24,6 +24,7 @@
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static com.android.internal.util.ArrayUtils.appendInt;
import static com.android.internal.util.ArrayUtils.removeInt;
+import static libcore.io.OsConstants.S_ISLNK;
import static libcore.io.OsConstants.S_IRWXU;
import static libcore.io.OsConstants.S_IRGRP;
import static libcore.io.OsConstants.S_IXGRP;
@@ -110,6 +111,7 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.Environment.UserEnvironment;
+import android.provider.Settings.Secure;
import android.security.SystemKeyStore;
import android.util.DisplayMetrics;
import android.util.EventLog;
@@ -146,11 +148,13 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import libcore.io.ErrnoException;
import libcore.io.IoUtils;
import libcore.io.Libcore;
+import libcore.io.OsConstants;
import libcore.io.StructStat;
/**
@@ -3578,17 +3582,16 @@
}
}
- private int createDataDirsLI(String packageName, int uid, int targetSdkVersion) {
+ private int createDataDirsLI(String packageName, int uid) {
int[] users = sUserManager.getUserIds();
- boolean restrictHomeDir = (targetSdkVersion >= Build.VERSION_CODES.K);
- int res = mInstaller.install(packageName, uid, uid, restrictHomeDir);
+ int res = mInstaller.install(packageName, uid, uid);
if (res < 0) {
return res;
}
for (int user : users) {
if (user != 0) {
res = mInstaller.createUserData(packageName,
- UserHandle.getUid(user, uid), user, restrictHomeDir);
+ UserHandle.getUid(user, uid), user);
if (res < 0) {
return res;
}
@@ -3982,8 +3985,7 @@
recovered = true;
// And now re-install the app.
- ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid,
- pkg.applicationInfo.targetSdkVersion);
+ ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid);
if (ret == -1) {
// Ack should not happen!
msg = prefix + pkg.packageName
@@ -4028,9 +4030,8 @@
if ((parseFlags & PackageParser.PARSE_CHATTY) != 0)
Log.v(TAG, "Want this data dir: " + dataPath);
}
- // invoke installer to do the actual installation
- int ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid,
- pkg.applicationInfo.targetSdkVersion);
+ //invoke installer to do the actual installation
+ int ret = createDataDirsLI(pkgName, pkg.applicationInfo.uid);
if (ret < 0) {
// Error from installer
mLastScanError = PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE;
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index f791a6e..06f11bc 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -25,6 +25,7 @@
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.JournaledFile;
import com.android.internal.util.XmlUtils;
+import com.android.server.IntentResolver;
import com.android.server.pm.PackageManagerService.DumpState;
import org.xmlpull.v1.XmlPullParser;
@@ -45,7 +46,6 @@
import android.content.pm.PackageUserState;
import android.content.pm.VerifierDeviceIdentity;
import android.os.Binder;
-import android.os.Build;
import android.os.Environment;
import android.os.FileUtils;
import android.os.Process;
@@ -2335,11 +2335,9 @@
for (PackageSetting ps : mPackages.values()) {
// Only system apps are initially installed.
ps.setInstalled((ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) != 0, userHandle);
- boolean restrictHomeDir = (ps.pkg.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.K);
// Need to create a data directory for all apps under this user.
installer.createUserData(ps.name,
- UserHandle.getUid(userHandle, ps.appId), userHandle,
- restrictHomeDir);
+ UserHandle.getUid(userHandle, ps.appId), userHandle);
}
readDefaultPreferredAppsLPw(userHandle);
writePackageRestrictionsLPr(userHandle);
diff --git a/tests/HwAccelerationTest/res/drawable/patch.9.png b/tests/HwAccelerationTest/res/drawable/patch.9.png
deleted file mode 100644
index e3b3639..0000000
--- a/tests/HwAccelerationTest/res/drawable/patch.9.png
+++ /dev/null
Binary files differ
diff --git a/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/ImageProcessingActivity2.java b/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/ImageProcessingActivity2.java
index 227518f..19bea43 100644
--- a/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/ImageProcessingActivity2.java
+++ b/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/ImageProcessingActivity2.java
@@ -229,7 +229,7 @@
break;
}
- mTest.createBaseTest(this, mBitmapIn, mBitmapIn2);
+ mTest.createBaseTest(this, mBitmapIn, mBitmapIn2, mBitmapOut);
setupBars();
mTest.runTest();
diff --git a/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/TestBase.java b/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/TestBase.java
index 9df2eff..dbbc594 100644
--- a/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/TestBase.java
+++ b/tests/RenderScriptTests/ImageProcessing2/src/com/android/rs/image/TestBase.java
@@ -88,18 +88,14 @@
return false;
}
- public final void createBaseTest(ImageProcessingActivity2 ipact, Bitmap b, Bitmap b2) {
+ public final void createBaseTest(ImageProcessingActivity2 ipact, Bitmap b, Bitmap b2, Bitmap outb) {
act = ipact;
mRS = RenderScript.create(act);
- mInPixelsAllocation = Allocation.createFromBitmap(mRS, b,
- Allocation.MipmapControl.MIPMAP_NONE,
- Allocation.USAGE_SCRIPT);
- mInPixelsAllocation2 = Allocation.createFromBitmap(mRS, b2,
- Allocation.MipmapControl.MIPMAP_NONE,
- Allocation.USAGE_SCRIPT);
- mOutPixelsAllocation = Allocation.createFromBitmap(mRS, b,
- Allocation.MipmapControl.MIPMAP_NONE,
- Allocation.USAGE_SCRIPT);
+
+ mInPixelsAllocation = Allocation.createFromBitmap(mRS, b);
+ mInPixelsAllocation2 = Allocation.createFromBitmap(mRS, b2);
+ mOutPixelsAllocation = Allocation.createFromBitmap(mRS, outb);
+
createTest(act.getResources());
}