• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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.integrity.model;
18 
19 import android.content.integrity.Rule;
20 
21 /**
22  * A helper class containing information about the binary representation of different {@link Rule}
23  * components.
24  */
25 public final class ComponentBitSize {
26     public static final int FORMAT_VERSION_BITS = 8;
27 
28     public static final int EFFECT_BITS = 3;
29     public static final int KEY_BITS = 4;
30     public static final int OPERATOR_BITS = 3;
31     public static final int CONNECTOR_BITS = 2;
32     public static final int SEPARATOR_BITS = 3;
33     public static final int VALUE_SIZE_BITS = 8;
34     public static final int IS_HASHED_BITS = 1;
35 
36     public static final int ATOMIC_FORMULA_START = 0;
37     public static final int COMPOUND_FORMULA_START = 1;
38     public static final int COMPOUND_FORMULA_END = 2;
39     public static final int INSTALLER_ALLOWED_BY_MANIFEST_START = 3;
40 
41     public static final int DEFAULT_FORMAT_VERSION = 1;
42     public static final int SIGNAL_BIT = 1;
43 
44     public static final int BYTE_BITS = 8;
45 }
46