1 /*
2  * Copyright (C) 2019 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.permission.model.livedatatypes
18 
19 /**
20  * A triple of booleans that correspond to an App Permission Group, and give information about how
21  * the UI should treat the App Permission Group
22  *
23  * @param shouldShow Whether or not this app perm group should be shown in the UI
24  * @param permGrantState Whether this app perm group has granted permissions
25  * @param isSystem Whether or not this app is a system app, which should be hidden by default
26  */
27 data class AppPermGroupUiInfo(
28     val shouldShow: Boolean,
29     val permGrantState: PermGrantState,
30     val isSystem: Boolean
31 ) {
32     enum class PermGrantState(private val grantState: Int) {
33         PERMS_DENIED(0),
34         PERMS_ALLOWED(1),
35         PERMS_ALLOWED_FOREGROUND_ONLY(2),
36         PERMS_ALLOWED_ALWAYS(3),
37         PERMS_ASK(4)
38     }
39 }
40