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

Commit dbc2ef41 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Offer to measure disk stats using quotas." am: f8720b95 am: 4b80a4a3 am: 1e1cdbea

am: 7664e618

Change-Id: I91c0810aad2ec530650855bcd2f1d25c309717a1
parents 7751269d 7664e618
Loading
Loading
Loading
Loading
+17 −4
Original line number Original line Diff line number Diff line
@@ -509,10 +509,23 @@ class ContextImpl extends Context {
     * Common-path handling of app data dir creation
     * Common-path handling of app data dir creation
     */
     */
    private static File ensurePrivateDirExists(File file) {
    private static File ensurePrivateDirExists(File file) {
        return ensurePrivateDirExists(file, 0771, -1);
    }

    private static File ensurePrivateCacheDirExists(File file) {
        final int gid = UserHandle.getCacheAppGid(Process.myUid());
        return ensurePrivateDirExists(file, 02771, gid);
    }

    private static File ensurePrivateDirExists(File file, int mode, int gid) {
        if (!file.exists()) {
        if (!file.exists()) {
            final String path = file.getAbsolutePath();
            try {
            try {
                Os.mkdir(file.getAbsolutePath(), 0771);
                Os.mkdir(path, mode);
                Os.chmod(file.getAbsolutePath(), 0771);
                Os.chmod(path, mode);
                if (gid != -1) {
                    Os.chown(path, -1, gid);
                }
            } catch (ErrnoException e) {
            } catch (ErrnoException e) {
                if (e.errno == OsConstants.EEXIST) {
                if (e.errno == OsConstants.EEXIST) {
                    // We must have raced with someone; that's okay
                    // We must have raced with someone; that's okay
@@ -581,7 +594,7 @@ class ContextImpl extends Context {
            if (mCacheDir == null) {
            if (mCacheDir == null) {
                mCacheDir = new File(getDataDir(), "cache");
                mCacheDir = new File(getDataDir(), "cache");
            }
            }
            return ensurePrivateDirExists(mCacheDir);
            return ensurePrivateCacheDirExists(mCacheDir);
        }
        }
    }
    }


@@ -591,7 +604,7 @@ class ContextImpl extends Context {
            if (mCodeCacheDir == null) {
            if (mCodeCacheDir == null) {
                mCodeCacheDir = new File(getDataDir(), "code_cache");
                mCodeCacheDir = new File(getDataDir(), "code_cache");
            }
            }
            return ensurePrivateDirExists(mCodeCacheDir);
            return ensurePrivateCacheDirExists(mCodeCacheDir);
        }
        }
    }
    }


+5 −1
Original line number Original line Diff line number Diff line
@@ -818,7 +818,7 @@ public class Build {
     */
     */
    public static boolean isBuildConsistent() {
    public static boolean isBuildConsistent() {
        // Don't care on eng builds.  Incremental build may trigger false negative.
        // Don't care on eng builds.  Incremental build may trigger false negative.
        if ("eng".equals(TYPE)) return true;
        if (IS_ENG) return true;


        final String system = SystemProperties.get("ro.build.fingerprint");
        final String system = SystemProperties.get("ro.build.fingerprint");
        final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
        final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
@@ -882,6 +882,10 @@ public class Build {
    public static final boolean IS_DEBUGGABLE =
    public static final boolean IS_DEBUGGABLE =
            SystemProperties.getInt("ro.debuggable", 0) == 1;
            SystemProperties.getInt("ro.debuggable", 0) == 1;


    /** {@hide} */
    public static final boolean IS_ENG =
            "eng".equals(getString("ro.build.type"));

    /**
    /**
     * Specifies whether the permissions needed by a legacy app should be
     * Specifies whether the permissions needed by a legacy app should be
     * reviewed before any of its components can run. A legacy app is one
     * reviewed before any of its components can run. A legacy app is one
+5 −0
Original line number Original line Diff line number Diff line
@@ -184,6 +184,11 @@ public class Process {
     */
     */
    public static final int LAST_SHARED_APPLICATION_GID = 59999;
    public static final int LAST_SHARED_APPLICATION_GID = 59999;


    /** {@hide} */
    public static final int FIRST_APPLICATION_CACHE_GID = 20000;
    /** {@hide} */
    public static final int LAST_APPLICATION_CACHE_GID = 29999;

    /**
    /**
     * Standard priority of application threads.
     * Standard priority of application threads.
     * Use with {@link #setThreadPriority(int)} and
     * Use with {@link #setThreadPriority(int)} and
+9 −0
Original line number Original line Diff line number Diff line
@@ -214,6 +214,15 @@ public final class UserHandle implements Parcelable {
        return appId;
        return appId;
    }
    }


    /**
     * Returns the cache GID for a given UID or appId.
     * @hide
     */
    public static int getCacheAppGid(int id) {
        return Process.FIRST_APPLICATION_CACHE_GID + (id % PER_USER_RANGE)
                - Process.FIRST_APPLICATION_UID;
    }

    /**
    /**
     * Generate a text representation of the uid, breaking out its individual
     * Generate a text representation of the uid, breaking out its individual
     * components -- user, app, isolated, etc.
     * components -- user, app, isolated, etc.
+2 −1
Original line number Original line Diff line number Diff line
@@ -154,7 +154,8 @@ option java_package com.android.server
3110 unknown_sources_enabled (value|1)
3110 unknown_sources_enabled (value|1)
# Package Manager critical info
# Package Manager critical info
3120 pm_critical_info (msg|3)
3120 pm_critical_info (msg|3)

# Disk usage stats for verifying quota correctness
3121 pm_package_stats (manual_time|2|3),(quota_time|2|3),(manual_data|2|2),(quota_data|2|2),(manual_cache|2|2),(quota_cache|2|2)


# ---------------------------
# ---------------------------
# WindowManagerService.java
# WindowManagerService.java
Loading