• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 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.server.pm;
18 
19 import android.content.pm.PackageParser;
20 import android.content.pm.PermissionInfo;
21 
22 final class BasePermission {
23     final static int TYPE_NORMAL = 0;
24 
25     final static int TYPE_BUILTIN = 1;
26 
27     final static int TYPE_DYNAMIC = 2;
28 
29     final String name;
30 
31     String sourcePackage;
32 
33     PackageSettingBase packageSetting;
34 
35     final int type;
36 
37     int protectionLevel;
38 
39     PackageParser.Permission perm;
40 
41     PermissionInfo pendingInfo;
42 
43     int uid;
44 
45     int[] gids;
46 
BasePermission(String _name, String _sourcePackage, int _type)47     BasePermission(String _name, String _sourcePackage, int _type) {
48         name = _name;
49         sourcePackage = _sourcePackage;
50         type = _type;
51         // Default to most conservative protection level.
52         protectionLevel = PermissionInfo.PROTECTION_SIGNATURE;
53     }
54 
toString()55     public String toString() {
56         return "BasePermission{" + Integer.toHexString(System.identityHashCode(this)) + " " + name
57                 + "}";
58     }
59 }
60