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

Commit f1ac1176 authored by Richard Coles's avatar Richard Coles Committed by Automerger Merge Worker
Browse files

Merge "webview: switch timestamps to uptimeMillis()." into sc-dev am: da01e47e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14390473

Change-Id: I164bdd317b37ae9e1c96c22a322428fbe0e651d3
parents 5101d398 da01e47e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,10 +16,10 @@

package android.webkit;

import android.annotation.ElapsedRealtimeLong;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.UptimeMillisLong;
import android.app.ActivityThread;
import android.app.Application;
import android.app.ResourcesManager;
@@ -227,7 +227,7 @@ public final class WebViewDelegate {
     * WebViewChromiumFactoryProvider#create method was invoked.
     */
    @NonNull
    @ElapsedRealtimeLong
    @UptimeMillisLong
    public long[] getTimestamps() {
        return WebViewFactory.getTimestamps();
    }
+8 −8
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ public final class WebViewFactory {
            // us honest and minimize usage of WebView internals when binding the proxy.
            if (sProviderInstance != null) return sProviderInstance;

            sTimestamps[WEBVIEW_LOAD_START] = SystemClock.elapsedRealtime();
            sTimestamps[WEBVIEW_LOAD_START] = SystemClock.uptimeMillis();
            final int uid = android.os.Process.myUid();
            if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID
                    || uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID
@@ -413,7 +413,7 @@ public final class WebViewFactory {

            Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW,
                    "initialApplication.createApplicationContext");
            sTimestamps[CREATE_CONTEXT_START] = SystemClock.elapsedRealtime();
            sTimestamps[CREATE_CONTEXT_START] = SystemClock.uptimeMillis();
            try {
                // Construct an app context to load the Java code into the current app.
                Context webViewContext = initialApplication.createApplicationContext(
@@ -422,7 +422,7 @@ public final class WebViewFactory {
                sPackageInfo = newPackageInfo;
                return webViewContext;
            } finally {
                sTimestamps[CREATE_CONTEXT_END] = SystemClock.elapsedRealtime();
                sTimestamps[CREATE_CONTEXT_END] = SystemClock.uptimeMillis();
                Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
            }
        } catch (RemoteException | PackageManager.NameNotFoundException e) {
@@ -448,26 +448,26 @@ public final class WebViewFactory {

            Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.getChromiumProviderClass()");
            try {
                sTimestamps[ADD_ASSETS_START] = SystemClock.elapsedRealtime();
                sTimestamps[ADD_ASSETS_START] = SystemClock.uptimeMillis();
                for (String newAssetPath : webViewContext.getApplicationInfo().getAllApkPaths()) {
                    initialApplication.getAssets().addAssetPathAsSharedLibrary(newAssetPath);
                }
                sTimestamps[ADD_ASSETS_END] = sTimestamps[GET_CLASS_LOADER_START] =
                        SystemClock.elapsedRealtime();
                        SystemClock.uptimeMillis();
                ClassLoader clazzLoader = webViewContext.getClassLoader();
                Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.loadNativeLibrary()");
                sTimestamps[GET_CLASS_LOADER_END] = sTimestamps[NATIVE_LOAD_START] =
                        SystemClock.elapsedRealtime();
                        SystemClock.uptimeMillis();
                WebViewLibraryLoader.loadNativeLibrary(clazzLoader,
                        getWebViewLibrary(sPackageInfo.applicationInfo));
                Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
                Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "Class.forName()");
                sTimestamps[NATIVE_LOAD_END] = sTimestamps[PROVIDER_CLASS_FOR_NAME_START] =
                        SystemClock.elapsedRealtime();
                        SystemClock.uptimeMillis();
                try {
                    return getWebViewProviderClass(clazzLoader);
                } finally {
                    sTimestamps[PROVIDER_CLASS_FOR_NAME_END] = SystemClock.elapsedRealtime();
                    sTimestamps[PROVIDER_CLASS_FOR_NAME_END] = SystemClock.uptimeMillis();
                    Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
                }
            } catch (ClassNotFoundException e) {