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.bedstead.nene.users
18 
19 import android.cts.testapisreflection.UserInfoProxy;
20 
21 /**
22  * Information about a User.
23  *
24  * See [android.content.pm.UserInfo].
25  */
26 class UserInfo {
27 
28     val id: Int?
29     val creationTime: Long?
30     val userType: String?
31     val profileGroupId : Int?
32     val partial : Boolean?
33     val preCreated : Boolean?
34     val name : String?
35     val serialNumber : Int?
36     val profileBadge : Int?
37     val lastLoggedInTime : Long?
38     val restrictedProfileParentId : Int?
39     val guestToRemove : Boolean?
40     val iconPath : String?
41     val flags : Int?
42     val lastLoggedInFingerprint : String?
43 
44     val proxy: UserInfoProxy
45 
46     constructor(proxy: UserInfoProxy) {
47         this.proxy = proxy
48         this.id = proxy.id;
49         this.creationTime = proxy.creationTime
50         this.userType = proxy.userType
51         this.profileGroupId = proxy.profileGroupId
52         this.partial = proxy.partial
53         this.preCreated = proxy.preCreated
54         this.name = proxy.name
55         this.serialNumber = proxy.serialNumber
56         this.profileBadge = proxy.profileBadge
57         this.lastLoggedInTime = proxy.lastLoggedInTime
58         this.restrictedProfileParentId = proxy.restrictedProfileParentId
59         this.guestToRemove = proxy.guestToRemove
60         this.iconPath = proxy.iconPath
61         this.flags = proxy.flags
62         this.lastLoggedInFingerprint = proxy.lastLoggedInFingerprint
63     }
64 
65     /** See [android.content.pm.UserInfo#supportsSwitchTo] */
supportsSwitchTonull66     fun supportsSwitchTo(): Boolean = proxy.supportsSwitchTo()
67 
68     /** See [android.content.pm.UserInfo#isPrimary] */
69     fun isPrimary(): Boolean = proxy.isPrimary()
70 
71     /** See [android.content.pm.UserInfo#isAdmin] */
72     fun isAdmin(): Boolean = proxy.isAdmin()
73 
74     /** See [android.content.pm.UserInfo#isGuest] */
75     fun isGuest(): Boolean = proxy.isGuest()
76 
77     /** See [android.content.pm.UserInfo#isRestricted] */
78     fun isRestricted(): Boolean = proxy.isRestricted()
79 
80     /** See [android.content.pm.UserInfo#isProfile] */
81     fun isProfile(): Boolean = proxy.isProfile()
82 
83     /** See [android.content.pm.UserInfo#isManagedProfile] */
84     fun isManagedProfile(): Boolean = proxy.isManagedProfile()
85 
86     /** See [android.content.pm.UserInfo#isCloneProfile] */
87     fun isCloneProfile(): Boolean = proxy.isCloneProfile()
88 
89     /** See [android.content.pm.UserInfo#isCommunalProfile] */
90     fun isCommunalProfile(): Boolean = proxy.isCommunalProfile()
91 
92     /** See [android.content.pm.UserInfo#isPrivateProfile] */
93     fun isPrivateProfile(): Boolean = proxy.isPrivateProfile()
94 
95     /** See [android.content.pm.UserInfo#isEnabled] */
96     fun isEnabled(): Boolean = proxy.isEnabled()
97 
98     /** See [android.content.pm.UserInfo#isQuietModeEnabled] */
99     fun isQuietModeEnabled(): Boolean = proxy.isQuietModeEnabled()
100 
101     /** See [android.content.pm.UserInfo#isEphemeral] */
102     fun isEphemeral(): Boolean = proxy.isEphemeral()
103 
104     /** See [android.content.pm.UserInfo#isInitialized] */
105     fun isInitialized(): Boolean = proxy.isInitialized()
106 
107     /** See [android.content.pm.UserInfo#isDemo] */
108     fun isDemo(): Boolean = proxy.isDemo()
109 
110     /** See [android.content.pm.UserInfo#isFull] */
111     fun isFull(): Boolean = proxy.isFull()
112 
113     /** See [android.content.pm.UserInfo#isMain] */
114     fun isMain(): Boolean = proxy.isMain()
115 
116     /** See [android.content.pm.UserInfo#isForTesting] */
117     fun isForTesting(): Boolean = proxy.isForTesting()
118 }