• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 android.system;
18 
19 import libcore.util.Objects;
20 
21 /**
22  * Corresponds to Linux' __user_cap_data_struct for capget and capset.
23  *
24  * @hide
25  */
26 @libcore.api.CorePlatformApi
27 public final class StructCapUserData {
28     /** Effective capability mask. */
29     @libcore.api.CorePlatformApi
30     public final int effective; /* __u32 */
31 
32     /** Permitted capability mask. */
33     @libcore.api.CorePlatformApi
34     public final int permitted; /* __u32 */
35 
36     /** Inheritable capability mask. */
37     @libcore.api.CorePlatformApi
38     public final int inheritable; /* __u32 */
39 
40     /**
41      * Constructs an instance with the given field values.
42      */
43     @libcore.api.CorePlatformApi
StructCapUserData(int effective, int permitted, int inheritable)44     public StructCapUserData(int effective, int permitted, int inheritable) {
45         this.effective = effective;
46         this.permitted = permitted;
47         this.inheritable = inheritable;
48     }
49 
toString()50     @Override public String toString() {
51         return Objects.toString(this);
52     }
53 }
54