• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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.content.pm.parsing.component;
18 
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 
22 import com.android.internal.util.DataClass;
23 
24 /** @hide */
25 public class ParsedPermissionGroup extends ParsedComponent {
26 
27     int requestDetailResourceId;
28     int backgroundRequestResourceId;
29     int backgroundRequestDetailResourceId;
30     int requestRes;
31     int priority;
32 
setPriority(int priority)33     public void setPriority(int priority) {
34         this.priority = priority;
35     }
36 
toString()37     public String toString() {
38         return "PermissionGroup{"
39                 + Integer.toHexString(System.identityHashCode(this))
40                 + " " + getName() + "}";
41     }
42 
43     @Override
describeContents()44     public int describeContents() {
45         return 0;
46     }
47 
48     @Override
writeToParcel(Parcel dest, int flags)49     public void writeToParcel(Parcel dest, int flags) {
50         super.writeToParcel(dest, flags);
51         dest.writeInt(this.requestDetailResourceId);
52         dest.writeInt(this.backgroundRequestResourceId);
53         dest.writeInt(this.backgroundRequestDetailResourceId);
54         dest.writeInt(this.requestRes);
55         dest.writeInt(this.priority);
56     }
57 
ParsedPermissionGroup()58     public ParsedPermissionGroup() {
59     }
60 
ParsedPermissionGroup(Parcel in)61     protected ParsedPermissionGroup(Parcel in) {
62         super(in);
63         this.requestDetailResourceId = in.readInt();
64         this.backgroundRequestResourceId = in.readInt();
65         this.backgroundRequestDetailResourceId = in.readInt();
66         this.requestRes = in.readInt();
67         this.priority = in.readInt();
68     }
69 
70     public static final Parcelable.Creator<ParsedPermissionGroup> CREATOR =
71             new Parcelable.Creator<ParsedPermissionGroup>() {
72                 @Override
73                 public ParsedPermissionGroup createFromParcel(Parcel source) {
74                     return new ParsedPermissionGroup(source);
75                 }
76 
77                 @Override
78                 public ParsedPermissionGroup[] newArray(int size) {
79                     return new ParsedPermissionGroup[size];
80                 }
81             };
82 
getRequestDetailResourceId()83     public int getRequestDetailResourceId() {
84         return requestDetailResourceId;
85     }
86 
getBackgroundRequestResourceId()87     public int getBackgroundRequestResourceId() {
88         return backgroundRequestResourceId;
89     }
90 
getBackgroundRequestDetailResourceId()91     public int getBackgroundRequestDetailResourceId() {
92         return backgroundRequestDetailResourceId;
93     }
94 
getRequestRes()95     public int getRequestRes() {
96         return requestRes;
97     }
98 
getPriority()99     public int getPriority() {
100         return priority;
101     }
102 }
103