Khaled Abdelmohsen | 4524c42 | 2019-12-02 17:43:31 +0000 | [diff] [blame] | 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 { |
Song Pan | 8a0b6fc | 2020-01-14 16:33:50 +0000 | [diff] [blame] | 26 | public static final int FORMAT_VERSION_BITS = 8; |
| 27 | |
Khaled Abdelmohsen | 4524c42 | 2019-12-02 17:43:31 +0000 | [diff] [blame] | 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 = 2; |
Song Pan | 8a0b6fc | 2020-01-14 16:33:50 +0000 | [diff] [blame] | 33 | public static final int VALUE_SIZE_BITS = 8; |
Khaled Abdelmohsen | 4524c42 | 2019-12-02 17:43:31 +0000 | [diff] [blame] | 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 | |
| 40 | public static final int DEFAULT_FORMAT_VERSION = 1; |
| 41 | public static final int SIGNAL_BIT = 1; |
Song Pan | 8a0b6fc | 2020-01-14 16:33:50 +0000 | [diff] [blame] | 42 | |
| 43 | public static final int BYTE_BITS = 8; |
Khaled Abdelmohsen | 4524c42 | 2019-12-02 17:43:31 +0000 | [diff] [blame] | 44 | } |