1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.permissioncontroller.role.ui; 18 19 import android.content.pm.ApplicationInfo; 20 21 import androidx.annotation.NonNull; 22 23 import com.android.permissioncontroller.role.model.Role; 24 25 import java.util.List; 26 27 /** 28 * Information about a role to be displayed in a list of roles. 29 */ 30 public class RoleItem { 31 32 /** 33 * The {@link Role} for this role. 34 */ 35 @NonNull 36 private final Role mRole; 37 38 /** 39 * The list of {@link ApplicationInfo} of applications holding this role. 40 */ 41 @NonNull 42 private final List<ApplicationInfo> mHolderApplicationInfos; 43 RoleItem(@onNull Role role, @NonNull List<ApplicationInfo> holderApplicationInfos)44 public RoleItem(@NonNull Role role, @NonNull List<ApplicationInfo> holderApplicationInfos) { 45 mRole = role; 46 mHolderApplicationInfos = holderApplicationInfos; 47 } 48 49 @NonNull getRole()50 public Role getRole() { 51 return mRole; 52 } 53 54 @NonNull getHolderApplicationInfos()55 public List<ApplicationInfo> getHolderApplicationInfos() { 56 return mHolderApplicationInfos; 57 } 58 } 59