blob: c3899638f40ff17a8836427d503e4617fe61c48b [file] [log] [blame]
Khaled Abdelmohsen4524c422019-12-02 17:43:31 +00001/*
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
17package com.android.server.integrity.model;
18
19import android.content.integrity.Rule;
20
21/**
22 * A helper class containing information about the binary representation of different {@link Rule}
23 * components.
24 */
25public final class ComponentBitSize {
Song Pan8a0b6fc2020-01-14 16:33:50 +000026 public static final int FORMAT_VERSION_BITS = 8;
27
Khaled Abdelmohsen4524c422019-12-02 17:43:31 +000028 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 Pan8a0b6fc2020-01-14 16:33:50 +000033 public static final int VALUE_SIZE_BITS = 8;
Khaled Abdelmohsen4524c422019-12-02 17:43:31 +000034 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 Pan8a0b6fc2020-01-14 16:33:50 +000042
43 public static final int BYTE_BITS = 8;
Khaled Abdelmohsen4524c422019-12-02 17:43:31 +000044}