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

Commit 1508a506 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "Add tracing to loadHeaderAppName and recoverBuilder" into main

parents 8bab3312 6b93a31a
Loading
Loading
Loading
Loading
+56 −42
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -3023,6 +3024,9 @@ public class Notification implements Parcelable
     * @hide
     */
    public String loadHeaderAppName(Context context) {
        Trace.beginSection("Notification#loadHeaderAppName");
        try {
            CharSequence name = null;
            // Check if there is a non-empty substitute app name and return that.
            if (extras.containsKey(EXTRA_SUBSTITUTE_APP_NAME)) {
@@ -3038,7 +3042,8 @@ public class Notification implements Parcelable
            final PackageManager pm = context.getPackageManager();
            if (TextUtils.isEmpty(name)) {
                if (extras.containsKey(EXTRA_BUILDER_APPLICATION_INFO)) {
                final ApplicationInfo info = extras.getParcelable(EXTRA_BUILDER_APPLICATION_INFO,
                    final ApplicationInfo info = extras.getParcelable(
                            EXTRA_BUILDER_APPLICATION_INFO,
                            ApplicationInfo.class);
                    if (info != null) {
                        name = pm.getApplicationLabel(info);
@@ -3054,6 +3059,9 @@ public class Notification implements Parcelable
                return null;
            }
            return name.toString();
        } finally {
            Trace.endSection();
        }
    }
    /**
@@ -6722,6 +6730,9 @@ public class Notification implements Parcelable
         */
        @NonNull
        public static Notification.Builder recoverBuilder(Context context, Notification n) {
            Trace.beginSection("Notification.Builder#recoverBuilder");
            try {
                // Re-create notification context so we can access app resources.
                ApplicationInfo applicationInfo = n.extras.getParcelable(
                        EXTRA_BUILDER_APPLICATION_INFO, ApplicationInfo.class);
@@ -6739,6 +6750,9 @@ public class Notification implements Parcelable
                }
                return new Builder(builderContext, n);
            } finally {
                Trace.endSection();
            }
        }
        /**