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

Commit a4d2a6c5 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'gingerbread' into gingerbread-release

parents 1d369ecf 66907078
Loading
Loading
Loading
Loading
+46 −56
Original line number Diff line number Diff line
@@ -15838,6 +15838,50 @@
 visibility="public"
>
</field>
<field name="TextAppearance_StatusBar_EventContent"
 type="int"
 transient="false"
 volatile="false"
 value="16973927"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_StatusBar_EventContent_Title"
 type="int"
 transient="false"
 volatile="false"
 value="16973928"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_StatusBar_Icon"
 type="int"
 transient="false"
 volatile="false"
 value="16973926"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_StatusBar_Title"
 type="int"
 transient="false"
 volatile="false"
 value="16973925"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TextAppearance_Theme"
 type="int"
 transient="false"
@@ -17059,50 +17103,6 @@
 visibility="public"
>
</field>
<field name="kraken_resource_pad41"
 type="int"
 transient="false"
 volatile="false"
 value="16973928"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad42"
 type="int"
 transient="false"
 volatile="false"
 value="16973927"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad43"
 type="int"
 transient="false"
 volatile="false"
 value="16973926"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad44"
 type="int"
 transient="false"
 volatile="false"
 value="16973925"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad5"
 type="int"
 transient="false"
@@ -78402,7 +78402,7 @@
 type="float"
 transient="false"
 volatile="false"
 value="0.0010f"
 value="0.001f"
 static="true"
 final="true"
 deprecated="not deprecated"
@@ -166460,16 +166460,6 @@
<parameter name="cursorController" type="android.widget.TextView.CursorController">
</parameter>
</method>
<field name="mCursorController"
 type="android.widget.TextView.CursorController"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
</field>
</class>
<class name="BaseKeyListener"
 extends="android.text.method.MetaKeyKeyListener"
@@ -225403,7 +225393,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>
+14 −14
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ int delete_cache(const char *pkgname, int encrypted_fs_flag)
/* TODO(oam): depending on use case (ecryptfs or dmcrypt)
 * change implementation
 */
static int disk_free()
static int64_t disk_free()
{
    struct statfs sfs;
    if (statfs(PKG_DIR_PREFIX, &sfs) == 0) {
@@ -154,18 +154,18 @@ static int disk_free()
 * also require that apps constantly modify file metadata even
 * when just reading from the cache, which is pretty awful.
 */
int free_cache(int free_size)
int free_cache(int64_t free_size)
{
    const char *name;
    int dfd, subfd;
    DIR *d;
    struct dirent *de;
    int avail;
    int64_t avail;

    avail = disk_free();
    if (avail < 0) return -1;

    LOGI("free_cache(%d) avail %d\n", free_size, avail);
    LOGI("free_cache(%" PRId64 ") avail %" PRId64 "\n", free_size, avail);
    if (avail >= free_size) return 0;

    /* First try encrypted dir */
@@ -327,10 +327,10 @@ int protect(char *pkgname, gid_t gid)
    return 0;
}

static int stat_size(struct stat *s)
static int64_t stat_size(struct stat *s)
{
    int blksize = s->st_blksize;
    int size = s->st_size;
    int64_t blksize = s->st_blksize;
    int64_t size = s->st_size;

    if (blksize) {
            /* round up to filesystem block size */
@@ -340,9 +340,9 @@ static int stat_size(struct stat *s)
    return size;
}

static int calculate_dir_size(int dfd)
static int64_t calculate_dir_size(int dfd)
{
    int size = 0;
    int64_t size = 0;
    struct stat s;
    DIR *d;
    struct dirent *de;
@@ -378,7 +378,7 @@ static int calculate_dir_size(int dfd)

int get_size(const char *pkgname, const char *apkpath,
             const char *fwdlock_apkpath,
             int *_codesize, int *_datasize, int *_cachesize, int encrypted_fs_flag)
             int64_t *_codesize, int64_t *_datasize, int64_t *_cachesize, int encrypted_fs_flag)
{
    DIR *d;
    int dfd;
@@ -386,9 +386,9 @@ int get_size(const char *pkgname, const char *apkpath,
    struct stat s;
    char path[PKG_PATH_MAX];

    int codesize = 0;
    int datasize = 0;
    int cachesize = 0;
    int64_t codesize = 0;
    int64_t datasize = 0;
    int64_t cachesize = 0;

        /* count the source apk as code -- but only if it's not
         * on the /system partition and its not on the sdcard.
@@ -445,7 +445,7 @@ int get_size(const char *pkgname, const char *apkpath,
            }
            subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY);
            if (subfd >= 0) {
                int size = calculate_dir_size(subfd);
                int64_t size = calculate_dir_size(subfd);
                if (!strcmp(name,"lib")) {
                    codesize += size;
                } else if(!strcmp(name,"cache")) {
+9 −5
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ static int do_rename(char **arg, char reply[REPLY_MAX])

static int do_free_cache(char **arg, char reply[REPLY_MAX]) /* TODO int:free_size */
{
    return free_cache(atoi(arg[0])); /* free_size */
    return free_cache((int64_t)atoll(arg[0])); /* free_size */
}

static int do_rm_cache(char **arg, char reply[REPLY_MAX])
@@ -75,15 +75,19 @@ static int do_protect(char **arg, char reply[REPLY_MAX])

static int do_get_size(char **arg, char reply[REPLY_MAX])
{
    int codesize = 0;
    int datasize = 0;
    int cachesize = 0;
    int64_t codesize = 0;
    int64_t datasize = 0;
    int64_t cachesize = 0;
    int res = 0;

        /* pkgdir, apkpath */
    res = get_size(arg[0], arg[1], arg[2], &codesize, &datasize, &cachesize, atoi(arg[3]));

    sprintf(reply,"%d %d %d", codesize, datasize, cachesize);
    /*
     * Each int64_t can take up 22 characters printed out. Make sure it
     * doesn't go over REPLY_MAX in the future.
     */
    snprintf(reply, REPLY_MAX, "%" PRId64 " %" PRId64 " %" PRId64, codesize, datasize, cachesize);
    return res;
}

+4 −2
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
@@ -105,7 +107,7 @@ int move_dex(const char *src, const char *dst);
int rm_dex(const char *path);
int protect(char *pkgname, gid_t gid);
int get_size(const char *pkgname, const char *apkpath, const char *fwdlock_apkpath,
             int *codesize, int *datasize, int *cachesize, int encrypted_fs_flag);
int free_cache(int free_size);
             int64_t *codesize, int64_t *datasize, int64_t *cachesize, int encrypted_fs_flag);
int free_cache(int64_t free_size);
int dexopt(const char *apk_path, uid_t uid, int is_public);
int movefiles();
+63 −41
Original line number Diff line number Diff line
@@ -337,31 +337,41 @@ class ContextImpl extends Context {
    @Override
    public SharedPreferences getSharedPreferences(String name, int mode) {
        SharedPreferencesImpl sp;
        File prefsFile;
        boolean needInitialLoad = false;
        synchronized (sSharedPrefs) {
            sp = sSharedPrefs.get(name);
            if (sp != null && !sp.hasFileChanged()) {
                //Log.i(TAG, "Returning existing prefs " + name + ": " + sp);
            if (sp != null && !sp.hasFileChangedUnexpectedly()) {
                return sp;
            }
            prefsFile = getSharedPrefsFile(name);
            if (sp == null) {
                sp = new SharedPreferencesImpl(prefsFile, mode, null);
                sSharedPrefs.put(name, sp);
                needInitialLoad = true;
            }
        }
        File f = getSharedPrefsFile(name);

        FileInputStream str = null;
        File backup = makeBackupFile(f);
        synchronized (sp) {
            if (needInitialLoad && sp.isLoaded()) {
                // lost the race to load; another thread handled it
                return sp;
            }
            File backup = makeBackupFile(prefsFile);
            if (backup.exists()) {
            f.delete();
            backup.renameTo(f);
                prefsFile.delete();
                backup.renameTo(prefsFile);
            }

            // Debugging
        if (f.exists() && !f.canRead()) {
            Log.w(TAG, "Attempt to read preferences file " + f + " without permission");
            if (prefsFile.exists() && !prefsFile.canRead()) {
                Log.w(TAG, "Attempt to read preferences file " + prefsFile + " without permission");
            }

            Map map = null;
        if (f.exists() && f.canRead()) {
            if (prefsFile.exists() && prefsFile.canRead()) {
                try {
                str = new FileInputStream(f);
                    FileInputStream str = new FileInputStream(prefsFile);
                    map = XmlUtils.readMapXml(str);
                    str.close();
                } catch (org.xmlpull.v1.XmlPullParserException e) {
@@ -372,21 +382,10 @@ class ContextImpl extends Context {
                    Log.w(TAG, "getSharedPreferences", e);
                }
            }

        synchronized (sSharedPrefs) {
            if (sp != null) {
                //Log.i(TAG, "Updating existing prefs " + name + " " + sp + ": " + map);
            sp.replace(map);
            } else {
                sp = sSharedPrefs.get(name);
                if (sp == null) {
                    sp = new SharedPreferencesImpl(f, mode, map);
                    sSharedPrefs.put(name, sp);
                }
        }
        return sp;
    }
    }

    private File getPreferencesDir() {
        synchronized (mSync) {
@@ -2712,6 +2711,10 @@ class ContextImpl extends Context {

    private static final class SharedPreferencesImpl implements SharedPreferences {

        // Lock ordering rules:
        //  - acquire SharedPreferencesImpl.this before EditorImpl.this
        //  - acquire mWritingToDiskLock before EditorImpl.this

        private final File mFile;
        private final File mBackupFile;
        private final int mMode;
@@ -2719,6 +2722,7 @@ class ContextImpl extends Context {
        private Map<String, Object> mMap;  // guarded by 'this'
        private long mTimestamp;  // guarded by 'this'
        private int mDiskWritesInFlight = 0;  // guarded by 'this'
        private boolean mLoaded = false;  // guarded by 'this'

        private final Object mWritingToDiskLock = new Object();
        private static final Object mContent = new Object();
@@ -2729,6 +2733,7 @@ class ContextImpl extends Context {
            mFile = file;
            mBackupFile = makeBackupFile(file);
            mMode = mode;
            mLoaded = initialContents != null;
            mMap = initialContents != null ? initialContents : new HashMap<String, Object>();
            FileStatus stat = new FileStatus();
            if (FileUtils.getFileStatus(file.getPath(), stat)) {
@@ -2737,7 +2742,23 @@ class ContextImpl extends Context {
            mListeners = new WeakHashMap<OnSharedPreferenceChangeListener, Object>();
        }

        public boolean hasFileChanged() {
        // Has this SharedPreferences ever had values assigned to it?
        boolean isLoaded() {
            synchronized (this) {
                return mLoaded;
            }
        }

        // Has the file changed out from under us?  i.e. writes that
        // we didn't instigate.
        public boolean hasFileChangedUnexpectedly() {
            synchronized (this) {
                if (mDiskWritesInFlight > 0) {
                    // If we know we caused it, it's not unexpected.
                    Log.d(TAG, "disk write in flight, not unexpected.");
                    return false;
                }
            }
            FileStatus stat = new FileStatus();
            if (!FileUtils.getFileStatus(mFile.getPath(), stat)) {
                return true;
@@ -2748,8 +2769,9 @@ class ContextImpl extends Context {
        }

        public void replace(Map newContents) {
            if (newContents != null) {
            synchronized (this) {
                mLoaded = true;
                if (newContents != null) {
                    mMap = newContents;
                }
            }
Loading