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

Commit ddbe0492 authored by Hai Zhang's avatar Hai Zhang Committed by android-build-merger
Browse files

Fix RoleSearchIndexablesProvider.

am: 7887f34d

Change-Id: Iaf4ed99939013c8033a86a88f6597c66756279e3
parents fce79c97 7887f34d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.packageinstaller.role.service;
import android.content.Context;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.os.Binder;
import android.provider.SearchIndexablesContract;
import android.util.ArrayMap;

@@ -50,9 +51,14 @@ public class RoleSearchIndexablesProvider extends BaseSearchIndexablesProvider {
        for (int i = 0; i < rolesSize; i++) {
            Role role = roles.valueAt(i);

            long token = Binder.clearCallingIdentity();
            try {
                if (!role.isAvailable(context) || !role.isVisible(context)) {
                    continue;
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }

            String label = context.getString(role.getLabelResource());
            boolean isExclusive = role.isExclusive();