Loading cmds/idmap/create.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ namespace { int open_idmap(const char *path) { int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)); bool needUnlink = true; if (fd == -1) { ALOGD("error: open %s: %s\n", path, strerror(errno)); goto fail; Loading @@ -43,6 +44,8 @@ namespace { } if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) { ALOGD("error: flock %s: %s\n", path, strerror(errno)); // If the file is locked by another process, then we needn't unlink the file. needUnlink = false; goto fail; } Loading @@ -50,7 +53,7 @@ namespace { fail: if (fd != -1) { close(fd); unlink(path); if (needUnlink) unlink(path); } return -1; } Loading core/java/android/widget/OverScroller.java +11 −5 Original line number Diff line number Diff line Loading @@ -609,6 +609,7 @@ public class OverScroller { private boolean mIsPerfLockAcquired = false; private boolean mIsPerfBoostEnabled = false; private int fBoostTimeOut = 0; private int flingBoostTimeOut = 0; private int fBoostParamVal[]; static { Loading Loading @@ -664,6 +665,10 @@ public class OverScroller { fBoostParamVal = context.getResources().getIntArray( com.android.internal.R.array.flingboost_param_value); } if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new BoostFramework(); } } void updateScroll(float q) { Loading Loading @@ -786,16 +791,17 @@ public class OverScroller { if (velocity != 0) { mDuration = mSplineDuration = getSplineFlingDuration(velocity); totalDistance = getSplineFlingDistance(velocity); if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new BoostFramework(); } if (mPerf != null) { mIsPerfLockAcquired = true; if (0 == fBoostTimeOut) { fBoostTimeOut = mDuration; //config value is not defined flingBoostTimeOut = mDuration; } else { //config value is present flingBoostTimeOut = fBoostTimeOut; } mPerf.perfLockAcquire(fBoostTimeOut, fBoostParamVal); mPerf.perfLockAcquire(flingBoostTimeOut, fBoostParamVal); } } Loading core/java/android/widget/Scroller.java +7 −2 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class Scroller { private BoostFramework mPerf = null; boolean bIsPerfBoostEnabled = false; private int sBoostTimeOut = 0; private int scrollBoostTimeOut = 0; private int sBoostParamVal[]; // A context-specific coefficient adjusted to physical values. Loading Loading @@ -422,9 +423,13 @@ public class Scroller { if ((mPerf != null) && (duration != 0)) { if (0 == sBoostTimeOut) { sBoostTimeOut = mDuration; //config value is not defined scrollBoostTimeOut = mDuration; } else { //config value is present scrollBoostTimeOut = sBoostTimeOut; } mPerf.perfLockAcquire(sBoostTimeOut, sBoostParamVal); mPerf.perfLockAcquire(scrollBoostTimeOut, sBoostParamVal); } } Loading core/jni/com_android_internal_app_ActivityTrigger.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ static dlLibHandler mDlLibHandlers[] = { "ro.vendor.at_library"}, {NULL, NULL, NULL, NULL, NULL, "ro.vendor.gt_library"}, {NULL, NULL, NULL, NULL, NULL, "ro.vendor.wl_library"} }; // ---------------------------------------------------------------------------- Loading core/jni/com_android_internal_content_NativeLibraryHelper.cpp +35 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ #include <inttypes.h> #include <sys/stat.h> #include <sys/types.h> #include <dlfcn.h> #define APK_LIB "lib/" #define APK_LIB_LEN (sizeof(APK_LIB) - 1) Loading @@ -55,6 +55,10 @@ #define TMP_FILE_PATTERN "/tmp.XXXXXX" #define TMP_FILE_PATTERN_LEN (sizeof(TMP_FILE_PATTERN) - 1) #define LIB_UNINIT 0 #define LIB_INITED_AND_FAIL -1 #define LIB_INITED_AND_SUCCESS 1 namespace android { // These match PackageManager.java install codes Loading @@ -70,6 +74,24 @@ enum install_status_t { typedef install_status_t (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*); typedef int (*PGetAssetsStatusFunc) (ZipFileRO*, Vector<ScopedUtfChars*>, const int); static PGetAssetsStatusFunc GetAssetsStatusFunc = NULL; static int g_assetLibInit = LIB_UNINIT; static int initAssetsVerifierLib() { if (g_assetLibInit != LIB_UNINIT) return g_assetLibInit; void* handle = dlopen("libassetsverifier.so", RTLD_NOW); if (handle != NULL) { GetAssetsStatusFunc = (PGetAssetsStatusFunc)dlsym(handle, "getAssetsStatus"); if (GetAssetsStatusFunc != NULL) { g_assetLibInit = LIB_INITED_AND_SUCCESS; } else { g_assetLibInit = LIB_INITED_AND_FAIL; } } return g_assetLibInit; } // Equivalent to android.os.FileUtils.isFilenameSafe static bool isFilenameSafe(const char* filename) Loading Loading @@ -477,6 +499,18 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported } } } int asset_status = NO_NATIVE_LIBRARIES; int rc = initAssetsVerifierLib(); if (rc == LIB_INITED_AND_SUCCESS) { asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis); } else { ALOGE("Failed to load assets verifier: %d", rc); } if (asset_status == 1) { // override the status if asset_status hints at 32-bit abi status = 1; } for (int i = 0; i < numAbis; ++i) { delete supportedAbis[i]; Loading Loading
cmds/idmap/create.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ namespace { int open_idmap(const char *path) { int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)); bool needUnlink = true; if (fd == -1) { ALOGD("error: open %s: %s\n", path, strerror(errno)); goto fail; Loading @@ -43,6 +44,8 @@ namespace { } if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) { ALOGD("error: flock %s: %s\n", path, strerror(errno)); // If the file is locked by another process, then we needn't unlink the file. needUnlink = false; goto fail; } Loading @@ -50,7 +53,7 @@ namespace { fail: if (fd != -1) { close(fd); unlink(path); if (needUnlink) unlink(path); } return -1; } Loading
core/java/android/widget/OverScroller.java +11 −5 Original line number Diff line number Diff line Loading @@ -609,6 +609,7 @@ public class OverScroller { private boolean mIsPerfLockAcquired = false; private boolean mIsPerfBoostEnabled = false; private int fBoostTimeOut = 0; private int flingBoostTimeOut = 0; private int fBoostParamVal[]; static { Loading Loading @@ -664,6 +665,10 @@ public class OverScroller { fBoostParamVal = context.getResources().getIntArray( com.android.internal.R.array.flingboost_param_value); } if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new BoostFramework(); } } void updateScroll(float q) { Loading Loading @@ -786,16 +791,17 @@ public class OverScroller { if (velocity != 0) { mDuration = mSplineDuration = getSplineFlingDuration(velocity); totalDistance = getSplineFlingDistance(velocity); if (mPerf == null && mIsPerfBoostEnabled) { mPerf = new BoostFramework(); } if (mPerf != null) { mIsPerfLockAcquired = true; if (0 == fBoostTimeOut) { fBoostTimeOut = mDuration; //config value is not defined flingBoostTimeOut = mDuration; } else { //config value is present flingBoostTimeOut = fBoostTimeOut; } mPerf.perfLockAcquire(fBoostTimeOut, fBoostParamVal); mPerf.perfLockAcquire(flingBoostTimeOut, fBoostParamVal); } } Loading
core/java/android/widget/Scroller.java +7 −2 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class Scroller { private BoostFramework mPerf = null; boolean bIsPerfBoostEnabled = false; private int sBoostTimeOut = 0; private int scrollBoostTimeOut = 0; private int sBoostParamVal[]; // A context-specific coefficient adjusted to physical values. Loading Loading @@ -422,9 +423,13 @@ public class Scroller { if ((mPerf != null) && (duration != 0)) { if (0 == sBoostTimeOut) { sBoostTimeOut = mDuration; //config value is not defined scrollBoostTimeOut = mDuration; } else { //config value is present scrollBoostTimeOut = sBoostTimeOut; } mPerf.perfLockAcquire(sBoostTimeOut, sBoostParamVal); mPerf.perfLockAcquire(scrollBoostTimeOut, sBoostParamVal); } } Loading
core/jni/com_android_internal_app_ActivityTrigger.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ static dlLibHandler mDlLibHandlers[] = { "ro.vendor.at_library"}, {NULL, NULL, NULL, NULL, NULL, "ro.vendor.gt_library"}, {NULL, NULL, NULL, NULL, NULL, "ro.vendor.wl_library"} }; // ---------------------------------------------------------------------------- Loading
core/jni/com_android_internal_content_NativeLibraryHelper.cpp +35 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ #include <inttypes.h> #include <sys/stat.h> #include <sys/types.h> #include <dlfcn.h> #define APK_LIB "lib/" #define APK_LIB_LEN (sizeof(APK_LIB) - 1) Loading @@ -55,6 +55,10 @@ #define TMP_FILE_PATTERN "/tmp.XXXXXX" #define TMP_FILE_PATTERN_LEN (sizeof(TMP_FILE_PATTERN) - 1) #define LIB_UNINIT 0 #define LIB_INITED_AND_FAIL -1 #define LIB_INITED_AND_SUCCESS 1 namespace android { // These match PackageManager.java install codes Loading @@ -70,6 +74,24 @@ enum install_status_t { typedef install_status_t (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*); typedef int (*PGetAssetsStatusFunc) (ZipFileRO*, Vector<ScopedUtfChars*>, const int); static PGetAssetsStatusFunc GetAssetsStatusFunc = NULL; static int g_assetLibInit = LIB_UNINIT; static int initAssetsVerifierLib() { if (g_assetLibInit != LIB_UNINIT) return g_assetLibInit; void* handle = dlopen("libassetsverifier.so", RTLD_NOW); if (handle != NULL) { GetAssetsStatusFunc = (PGetAssetsStatusFunc)dlsym(handle, "getAssetsStatus"); if (GetAssetsStatusFunc != NULL) { g_assetLibInit = LIB_INITED_AND_SUCCESS; } else { g_assetLibInit = LIB_INITED_AND_FAIL; } } return g_assetLibInit; } // Equivalent to android.os.FileUtils.isFilenameSafe static bool isFilenameSafe(const char* filename) Loading Loading @@ -477,6 +499,18 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported } } } int asset_status = NO_NATIVE_LIBRARIES; int rc = initAssetsVerifierLib(); if (rc == LIB_INITED_AND_SUCCESS) { asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis); } else { ALOGE("Failed to load assets verifier: %d", rc); } if (asset_status == 1) { // override the status if asset_status hints at 32-bit abi status = 1; } for (int i = 0; i < numAbis; ++i) { delete supportedAbis[i]; Loading