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

Commit 700abfaa authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Catch exception on onBindSlice for keyguard" into main

parents 22efac91 42c9a08e
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.provider.Settings;
import android.service.notification.ZenModeConfig;
import android.text.TextUtils;
import android.text.style.StyleSpan;
import android.util.Log;

import androidx.core.graphics.drawable.IconCompat;
import androidx.slice.Slice;
@@ -212,10 +213,12 @@ public class KeyguardSliceProvider extends SliceProvider implements
    @AnyThread
    @Override
    public Slice onBindSlice(Uri sliceUri) {
        Slice slice = null;
        try {
            Trace.beginSection("KeyguardSliceProvider#onBindSlice");
        Slice slice;
            synchronized (this) {
            ListBuilder builder = new ListBuilder(getContext(), mSliceUri, ListBuilder.INFINITY);
                ListBuilder builder = new ListBuilder(getContext(), mSliceUri,
                        ListBuilder.INFINITY);
                if (needsMediaLocked()) {
                    addMediaLocked(builder);
                } else {
@@ -226,7 +229,11 @@ public class KeyguardSliceProvider extends SliceProvider implements
                addPrimaryActionLocked(builder);
                slice = builder.build();
            }
        } catch (IllegalStateException e) {
            Log.w(TAG, "Could not initialize slice", e);
        } finally {
            Trace.endSection();
        }
        return slice;
    }