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

Commit bdaf88bc authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6220271 from 4fbb21d3 to rvc-release

Change-Id: Ic221d0e13053e48c5d7e4a80bdf3415b76d365e5
parents 648ec93f 4fbb21d3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ class PendingList {
                        .setDeleteIntent(deny)
                        .setColor(mContext.getColor(
                                    android.R.color.system_notification_accent_color))
                        .extend(new Notification.TvExtender())
                        .build();

                // Show the notification
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public final class AppPermissionGroupsFragment extends SettingsWithLargeHeader {

                PermissionControlPreference preference = new PermissionControlPreference(context,
                        mPackageName, groupName, mUser, AppPermissionGroupsFragment.class.getName(),
                        sessionId, grantCategory);
                        sessionId, grantCategory.getCategoryName(), true);
                preference.setTitle(KotlinUtils.INSTANCE.getPermGroupLabel(context, groupName));
                preference.setIcon(KotlinUtils.INSTANCE.getPermGroupIcon(context, groupName));
                preference.setKey(preference.getTitle().toString());
+19 −15
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import androidx.preference.PreferenceViewHolder;
import com.android.permissioncontroller.R;
import com.android.permissioncontroller.permission.model.AppPermissionGroup;
import com.android.permissioncontroller.permission.ui.AppPermissionActivity;
import com.android.permissioncontroller.permission.ui.Category;

import java.util.List;

@@ -59,6 +58,7 @@ public class PermissionControlPreference extends Preference {
    private @NonNull String mPermGroupName;
    private @NonNull String mCaller;
    private @NonNull long mSessionId;
    private boolean mHasNavGraph;
    private @NonNull UserHandle mUser;

    public PermissionControlPreference(@NonNull Context context,
@@ -69,12 +69,12 @@ public class PermissionControlPreference extends Preference {
    public PermissionControlPreference(@NonNull Context context,
            @NonNull AppPermissionGroup group, @NonNull String caller, long sessionId) {
        this(context, group.getApp().packageName, group.getName(), group.getUser(), caller,
                sessionId, null);
                sessionId, null, false);
    }

    public PermissionControlPreference(@NonNull Context context,
            @NonNull String packageName, @NonNull String permGroupName, @NonNull UserHandle user,
            @NonNull String caller, long sessionId, Category category) {
            @NonNull String caller, long sessionId, String granted, boolean hasNavGraph) {
        super(context);
        mContext = context;
        mWidgetIcon = null;
@@ -87,7 +87,8 @@ public class PermissionControlPreference extends Preference {
        mPermGroupName = permGroupName;
        mSessionId = sessionId;
        mUser = user;
        mGranted = category.getCategoryName();
        mGranted = granted;
        mHasNavGraph = hasNavGraph;
    }

    /**
@@ -182,6 +183,7 @@ public class PermissionControlPreference extends Preference {
        setIcons(holder, mSummaryIcons, R.id.summary_widget_frame);
        setIcons(holder, mTitleIcons, R.id.title_widget_frame);

        if (mHasNavGraph) {
            setOnPreferenceClickListener(pref -> {
                Bundle args = new Bundle();
                args.putString(Intent.EXTRA_PACKAGE_NAME, mPackageName);
@@ -190,10 +192,12 @@ public class PermissionControlPreference extends Preference {
                args.putString(AppPermissionActivity.EXTRA_CALLER_NAME, mCaller);
                args.putLong(EXTRA_SESSION_ID, mSessionId);
                args.putString(GRANT_CATEGORY, mGranted);
            Navigation.findNavController(holder.itemView).navigate(R.id.perm_groups_to_app, args);
                Navigation.findNavController(holder.itemView).navigate(R.id.perm_groups_to_app,
                        args);
                return true;
            });
        }
    }

    private void setIcons(PreferenceViewHolder holder, @Nullable List<Integer> icons, int frameId) {
        ViewGroup frame = (ViewGroup) holder.findViewById(frameId);