From e0486f150354722ffa8c2fea751ee39161ad7504 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 19 Nov 2012 15:07:33 -0800 Subject: [PATCH 1/2] workaround: don't reset compositionType to HWC_FRAMEBUFFER This workaround a HWC HAL issue in Nexus 7, which causes videos and live wallpapers to animate slowly. Bug: 7563862 Change-Id: I87803aaad9751b1fd8392b9732304d4bccec659a --- services/surfaceflinger/DisplayHardware/HWComposer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 328022997..73794c44c 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -811,7 +811,7 @@ public: getLayer()->acquireFenceFd = fenceFd; } virtual void setPerFrameDefaultState() { - getLayer()->compositionType = HWC_FRAMEBUFFER; + //getLayer()->compositionType = HWC_FRAMEBUFFER; } virtual void setDefaultState() { getLayer()->compositionType = HWC_FRAMEBUFFER; From e9dbe75aa7f1addb46e75ea66aef6ac966b1c4cd Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 9 Jan 2013 16:00:35 -0800 Subject: [PATCH 2/2] Revert "App home directories are now 0700 for targetSdkVersion > 17" This reverts commit 7f5c84a0b25706746a92ad1233cbbb8923eda54d. Bug: 7966399 Bug: 7208882 Change-Id: I9fb13cf06c0f6605f3d992525346b14fe3259c66 --- cmds/installd/Android.mk | 5 +++-- cmds/installd/commands.c | 16 ++++++---------- cmds/installd/installd.c | 16 ++++------------ cmds/installd/installd.h | 7 ++----- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/cmds/installd/Android.mk b/cmds/installd/Android.mk index 6eecb2025..1dd4ee5d6 100644 --- a/cmds/installd/Android.mk +++ b/cmds/installd/Android.mk @@ -11,8 +11,9 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(common_src_files) -LOCAL_CFLAGS := -std=gnu99 + LOCAL_MODULE := libinstalld + LOCAL_MODULE_TAGS := eng tests include $(BUILD_STATIC_LIBRARY) @@ -35,7 +36,7 @@ LOCAL_STATIC_LIBRARIES := \ libdiskusage LOCAL_MODULE := installd -LOCAL_CFLAGS := -std=gnu99 + LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index e22fa6a32..c272e47b3 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -28,15 +28,13 @@ dir_rec_t android_app_lib_dir; dir_rec_t android_media_dir; dir_rec_array_t android_system_dirs; -int install(const char *pkgname, uid_t uid, gid_t gid, bool restrictHomeDir) +int install(const char *pkgname, uid_t uid, gid_t gid) { char pkgdir[PKG_PATH_MAX]; char libsymlink[PKG_PATH_MAX]; char applibdir[PKG_PATH_MAX]; struct stat libStat; - mode_t defaultMode = restrictHomeDir ? 0700 : 0751; - if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) { ALOGE("invalid uid/gid: %d %d\n", uid, gid); return -1; @@ -57,11 +55,11 @@ int install(const char *pkgname, uid_t uid, gid_t gid, bool restrictHomeDir) return -1; } - if (mkdir(pkgdir, defaultMode) < 0) { + if (mkdir(pkgdir, 0751) < 0) { ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -1; } - if (chmod(pkgdir, defaultMode) < 0) { + if (chmod(pkgdir, 0751) < 0) { ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -1; @@ -186,15 +184,13 @@ int delete_user_data(const char *pkgname, uid_t persona) return delete_dir_contents(pkgdir, 0, "lib"); } -int make_user_data(const char *pkgname, uid_t uid, uid_t persona, bool restrictHomeDir) +int make_user_data(const char *pkgname, uid_t uid, uid_t persona) { char pkgdir[PKG_PATH_MAX]; char applibdir[PKG_PATH_MAX]; char libsymlink[PKG_PATH_MAX]; struct stat libStat; - mode_t defaultMode = restrictHomeDir ? 0700 : 0751; - // Create the data dir for the package if (create_pkg_path(pkgdir, pkgname, PKG_DIR_POSTFIX, persona)) { return -1; @@ -208,11 +204,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona, bool restrictH return -1; } - if (mkdir(pkgdir, defaultMode) < 0) { + if (mkdir(pkgdir, 0751) < 0) { ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -errno; } - if (chmod(pkgdir, defaultMode) < 0) { + if (chmod(pkgdir, 0751) < 0) { ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index bf21102ab..2285e79fc 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -31,11 +31,7 @@ static int do_ping(char **arg, char reply[REPLY_MAX]) static int do_install(char **arg, char reply[REPLY_MAX]) { - bool restrictHomeDir = (strncmp(arg[3], "false", 6) != 0); - return install(arg[0], /* pkgname */ - atoi(arg[1]), /* uid */ - atoi(arg[2]), /* gid */ - restrictHomeDir); /* restrictHomeDir */ + return install(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, gid */ } static int do_dexopt(char **arg, char reply[REPLY_MAX]) @@ -107,11 +103,7 @@ static int do_rm_user_data(char **arg, char reply[REPLY_MAX]) static int do_mk_user_data(char **arg, char reply[REPLY_MAX]) { - bool restrictHomeDir = (strncmp(arg[3], "false", 6) != 0); - return make_user_data(arg[0], /* pkgname */ - atoi(arg[1]), /* uid */ - atoi(arg[2]), /* userid */ - restrictHomeDir); /* restrictHomeDir */ + return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, userid */ } static int do_rm_user(char **arg, char reply[REPLY_MAX]) @@ -137,7 +129,7 @@ struct cmdinfo { struct cmdinfo cmds[] = { { "ping", 0, do_ping }, - { "install", 4, do_install }, + { "install", 3, do_install }, { "dexopt", 3, do_dexopt }, { "movedex", 2, do_move_dex }, { "rmdex", 1, do_rm_dex }, @@ -150,7 +142,7 @@ struct cmdinfo cmds[] = { { "rmuserdata", 2, do_rm_user_data }, { "movefiles", 0, do_movefiles }, { "linklib", 3, do_linklib }, - { "mkuserdata", 4, do_mk_user_data }, + { "mkuserdata", 3, do_mk_user_data }, { "rmuser", 1, do_rm_user }, }; diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index cf2bed62b..efd3aa7db 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -193,14 +192,12 @@ int ensure_media_user_dirs(userid_t userid); /* commands.c */ -int install(const char *pkgname, uid_t uid, gid_t gid, - bool restrictHomeDirectory); +int install(const char *pkgname, uid_t uid, gid_t gid); int uninstall(const char *pkgname, uid_t persona); int renamepkg(const char *oldpkgname, const char *newpkgname); int fix_uid(const char *pkgname, uid_t uid, gid_t gid); int delete_user_data(const char *pkgname, uid_t persona); -int make_user_data(const char *pkgname, uid_t uid, uid_t persona, - bool restrictHomeDirectory); +int make_user_data(const char *pkgname, uid_t uid, uid_t persona); int delete_persona(uid_t persona); int delete_cache(const char *pkgname, uid_t persona); int move_dex(const char *src, const char *dst);