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

Commit edc63064 authored by Calin Juravle's avatar Calin Juravle Committed by android-build-merger
Browse files

Add logic for recording dex files use on disk am: 6ea5ace7 am: 34bdf168

am: bc7f234d

Change-Id: Iaf2ffd60d374eef179705e35743338ff3d8105c3
parents 8e52be9d bc7f234d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -60,12 +60,12 @@ public abstract class AbstractStatsBase<T> {
        return new AtomicFile(fname);
    }

    void writeNow(final T data) {
    protected void writeNow(final T data) {
        writeImpl(data);
        mLastTimeWritten.set(SystemClock.elapsedRealtime());
    }

    boolean maybeWriteAsync(final T data) {
    protected boolean maybeWriteAsync(final T data) {
        if (SystemClock.elapsedRealtime() - mLastTimeWritten.get() < WRITE_INTERVAL_MS
            && !PackageManagerService.DEBUG_DEXOPT) {
            return false;
@@ -105,7 +105,7 @@ public abstract class AbstractStatsBase<T> {

    protected abstract void writeInternal(T data);

    void read(T data) {
    protected void read(T data) {
        if (mLock) {
            synchronized (data) {
                synchronized (mFileLock) {
+15 −0
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@ import android.app.AppGlobals;
import android.content.Intent;
import android.content.pm.PackageParser;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.os.RemoteException;
import android.os.UserHandle;
import android.system.ErrnoException;
import android.util.ArraySet;
import android.util.Log;
import dalvik.system.VMRuntime;
import libcore.io.Libcore;

import java.io.File;
@@ -197,4 +199,17 @@ public class PackageManagerServiceUtils {
        }
        return sb.toString();
    }

    /**
     * Verifies that the given string {@code isa} is a valid supported isa on
     * the running device.
     */
    public static boolean checkISA(String isa) {
        for (String abi : Build.SUPPORTED_ABIS) {
            if (VMRuntime.getInstructionSet(abi).equals(isa)) {
                return true;
            }
        }
        return false;
    }
}
+512 −0

File added.

Preview size limit exceeded, changes collapsed.

+318 −0

File added.

Preview size limit exceeded, changes collapsed.