• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  * @param isUserSet Whether or not the user has set or fixed this app perm group
27  */
28 data class AppPermGroupUiInfo(
29     val shouldShow: Boolean,
30     val permGrantState: PermGrantState,
31     val isSystem: Boolean,
32     val isUserSet: Boolean
33 ) {
34     enum class PermGrantState(private val grantState: Int) {
35         PERMS_DENIED(0),
36         PERMS_ALLOWED(1),
37         PERMS_ALLOWED_FOREGROUND_ONLY(2),
38         PERMS_ALLOWED_ALWAYS(3),
39         PERMS_ASK(4)
40     }
41 }
42