• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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.appops.data.model.v31
18 
19 /**
20  * Data class representing historical package ops read from DiscreteRegistry, These ops are for one
21  * permission group, as the permission timeline page show one group at a time.
22  */
23 data class DiscretePackageOpsModel(
24     val packageName: String,
25     val userId: Int,
26     val appOpAccesses: List<DiscreteOpModel>,
27     // some package may support attribution, in that case we want to group ops by label.
28     var attributionLabel: String? = null,
29     // variable to indicate whether the permission group is user sensitive or not.
30     var isUserSensitive: Boolean = false,
31 ) {
32     /**
33      * The time stamps (i.e. accessTimeMillis and durationMillis) are with precision rounded to
34      * minute.
35      */
36     data class DiscreteOpModel(
37         val opName: String,
38         val accessTimeMillis: Long,
39         val durationMillis: Long,
40         val attributionTag: String? = null,
41         val proxyPackageName: String? = null,
42         val proxyUserId: Int? = null,
43     )
44 }
45