summaryrefslogtreecommitdiff
path: root/PermissionController/src/com/android/permissioncontroller/permission/model/livedatatypes/AppPermGroupUiInfo.kt
blob: bebb108ab752ca087a8dc1a0c2ce8910b535a340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.permissioncontroller.permission.model.livedatatypes

/**
 * A triple of booleans that correspond to an App Permission Group, and give information about how
 * the UI should treat the App Permission Group
 *
 * @param shouldShow Whether or not this app perm group should be shown in the UI
 * @param permGrantState Whether this app perm group has granted permissions
 * @param isSystem Whether or not this app is a system app, which should be hidden by default
 */
data class AppPermGroupUiInfo(
    val shouldShow: Boolean,
    val permGrantState: PermGrantState,
    val isSystem: Boolean
) {
    enum class PermGrantState(private val grantState: Int) {
        PERMS_DENIED(0),
        PERMS_ALLOWED(1),
        PERMS_ALLOWED_FOREGROUND_ONLY(2),
        PERMS_ALLOWED_ALWAYS(3),
        PERMS_ASK(4)
    }
}