Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75276c24 authored by Steve Kondik's avatar Steve Kondik
Browse files

Merge branch 'm' of git://codeaurora.org/platform/frameworks/base into cm-13.0

parents 51ea2ebc caaba96f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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;
        }

@@ -50,7 +53,7 @@ namespace {
fail:
        if (fd != -1) {
            close(fd);
            unlink(path);
            if (needUnlink) unlink(path);
        }
        return -1;
    }
+11 −5
Original line number Diff line number Diff line
@@ -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 {
@@ -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) {
@@ -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);
                }
            }

+7 −2
Original line number Diff line number Diff line
@@ -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.
@@ -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);
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -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"}
};

// ----------------------------------------------------------------------------
+35 −1
Original line number Diff line number Diff line
@@ -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)
@@ -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
@@ -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)
@@ -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