1 /* 2 * Copyright (C) 2022 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.car.telemetry.publisher; 18 19 /** 20 * Container class for all constants that are related to transfer of data within 21 * {@link com.android.car.telemetry.CarTelemetryService} and between {@link 22 * com.android.car.telemetry.CarTelemetryService} and 23 * {@link com.android.car.scriptexecutor.ScriptExecutor} 24 * by using {@link android.os.PersistableBundle} objects. 25 * 26 * Each publisher is responsible for populating {@link android.os.PersistableBundle} instances with 27 * data. This file keeps names of keys used in the bundles by various publishers all in one place. 28 * This measure should allow clients of data to understand structure of {@link 29 * android.os.PersistableBundle} objects without having to look for places where the objects are 30 * populated. 31 */ 32 public final class Constants { 33 // Session Annotations 34 public static final String ANNOTATION_BUNDLE_KEY_SESSION_ID = "session.sessionId"; 35 public static final String ANNOTATION_BUNDLE_KEY_SESSION_STATE = "session.sessionState"; 36 public static final String ANNOTATION_BUNDLE_KEY_CREATED_AT_SINCE_BOOT_MILLIS = 37 "session.createdAtSinceBootMillis"; 38 public static final String ANNOTATION_BUNDLE_KEY_CREATED_AT_MILLIS = "session.createdAtMillis"; 39 public static final String ANNOTATION_BUNDLE_KEY_BOOT_REASON = "session.bootReason"; 40 public static final String ANNOTATION_BUNDLE_KEY_BOOT_COUNT = "session.bootCount"; 41 42 // StatsPublisher 43 public static final String STATS_BUNDLE_KEY_PREFIX = "stats."; 44 public static final String STATS_BUNDLE_KEY_ELAPSED_TIMESTAMP = "stats.elapsed_timestamp_nanos"; 45 46 // CarTelemetrydPublisher 47 public static final String CAR_TELEMETRYD_BUNDLE_KEY_ID = "ct.id"; 48 public static final String CAR_TELEMETRYD_BUNDLE_KEY_CONTENT = "ct.content"; 49 50 // MemoryPublisher 51 public static final String MEMORY_BUNDLE_KEY_PREFIX = "mem."; 52 public static final String MEMORY_BUNDLE_KEY_MEMINFO = "mem.meminfo"; 53 public static final String MEMORY_BUNDLE_KEY_TIMESTAMP = "mem.timestamp_millis"; 54 public static final String MEMORY_BUNDLE_KEY_TOTAL_SWAPPABLE_PSS = "mem.total_swappable_pss"; 55 public static final String MEMORY_BUNDLE_KEY_TOTAL_PRIVATE_DIRTY = "mem.total_private_dirty"; 56 public static final String MEMORY_BUNDLE_KEY_TOTAL_SHARED_DIRTY = "mem.total_shared_dirty"; 57 public static final String MEMORY_BUNDLE_KEY_TOTAL_PRIVATE_CLEAN = "mem.total_private_clean"; 58 public static final String MEMORY_BUNDLE_KEY_TOTAL_SHARED_CLEAN = "mem.total_shared_clean"; 59 60 // ConnectivityPublisher 61 public static final String CONNECTIVITY_BUNDLE_KEY_START_MILLIS = "conn.startMillis"; 62 public static final String CONNECTIVITY_BUNDLE_KEY_END_MILLIS = "conn.endMillis"; 63 public static final String CONNECTIVITY_BUNDLE_KEY_SIZE = "conn.size"; 64 public static final String CONNECTIVITY_BUNDLE_KEY_UID = "conn.uid"; 65 public static final String CONNECTIVITY_BUNDLE_KEY_PACKAGES = "conn.packages"; 66 public static final String CONNECTIVITY_BUNDLE_KEY_TAG = "conn.tag"; 67 public static final String CONNECTIVITY_BUNDLE_KEY_RX_BYTES = "conn.rxBytes"; 68 public static final String CONNECTIVITY_BUNDLE_KEY_TX_BYTES = "conn.txBytes"; 69 70 // VehiclePropertyPublisher 71 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_TIMESTAMP = "vp.timestamp"; 72 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_PROP_ID = "vp.propertyId"; 73 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_AREA_ID = "vp.areaId"; 74 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_STATUS = "vp.status"; 75 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_STRING = "vp.stringVal"; 76 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_BOOLEAN = "vp.boolVal"; 77 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_INT = "vp.intVal"; 78 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_INT_ARRAY = "vp.intArrayVal"; 79 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_LONG = "vp.longVal"; 80 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_LONG_ARRAY = "vp.longArrayVal"; 81 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_FLOAT = "vp.floatVal"; 82 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_FLOAT_ARRAY = "vp.floatArrayVal"; 83 public static final String VEHICLE_PROPERTY_BUNDLE_KEY_BYTE_ARRAY = "vp.byteArrayVal"; 84 Constants()85 private Constants() { 86 } 87 } 88