CasUtil
public
final
class
CasUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.CasUtil |
Résumé
Constantes | |
|---|---|
String |
ANDROID_INFO_FILENAME
|
String |
CAS_LOG_ROOT_NAME
|
String |
CHUNKS_DIR_NAME
|
String |
CHUNKS_INDEX_FILENAME
|
String |
SUPER_IMAGE_FILENAME
|
String |
SYSTEM_IMAGE_FILENAME
|
Méthodes publiques | |
|---|---|
static
void
|
checkCasClientFlags(Path clientPath, Consumer<Set<String>> flagsConsumerFn)
Vérifie les indicateurs acceptés du client CAS. |
static
Path
|
createUniqueCasLogDir(Path logDirRootPath)
|
static
void
|
ensureCasClientExecutable(Path casClientPath, boolean logMetricsIfNotExecutable)
|
static
String
|
getCasLogFromDir(Path logDirPath)
Lit le fichier journal CAS " |
static
String
|
getCasLogFromDir(Path logDirPath, String clientName, String tag, boolean removeLogDirAfterRead)
Lit le fichier journal CAS à partir du répertoire indiqué. |
static
String
|
getCasLogFromDir(Path logDirPath, String clientName)
Lit le fichier journal CAS " |
static
boolean
|
isChunkedDir(Path path)
Renvoie "true" si le chemin d'accès donné est un répertoire segmenté FastCDC valide. |
static
boolean
|
isUncompressedDeviceImage(Path path)
Renvoie "true" si le chemin d'accès donné correspond à une image d'appareil non compressée valide. |
static
void
|
logCasClientVersion(Path clientPath, Consumer<String> versionHandlerFn)
|
static
void
|
logCasClientVersion(Path clientPath)
|
static
void
|
validateChunkedDir(Path path)
Valide si le chemin d'accès donné est un répertoire segmenté FastCDC valide. |
Constantes
ANDROID_INFO_FILENAME
public static final String ANDROID_INFO_FILENAME
Valeur de constante : "android-info.txt"
CAS_LOG_ROOT_NAME
public static final String CAS_LOG_ROOT_NAME
Valeur de constante : "tf-cas-fuse-log-root"
CHUNKS_DIR_NAME
public static final String CHUNKS_DIR_NAME
Valeur constante : "_chunks"
CHUNKS_INDEX_FILENAME
public static final String CHUNKS_INDEX_FILENAME
Valeur de constante : "_chunks_index.json"
SUPER_IMAGE_FILENAME
public static final String SUPER_IMAGE_FILENAME
Valeur constante : "super.img"
SYSTEM_IMAGE_FILENAME
public static final String SYSTEM_IMAGE_FILENAME
Valeur de constante : "system.img"
Méthodes publiques
checkCasClientFlags
public static void checkCasClientFlags (Path clientPath,
Consumer<Set<String>> flagsConsumerFn)Vérifie les indicateurs acceptés du client CAS.
| Paramètres | |
|---|---|
clientPath |
Path : chemin d'accès au binaire du client CAS. |
flagsConsumerFn |
Consumer : consommateur qui accepte l'ensemble des indicateurs compatibles. |
createUniqueCasLogDir
public static Path createUniqueCasLogDir (Path logDirRootPath)
| Paramètres | |
|---|---|
logDirRootPath |
Path |
| Renvoie | |
|---|---|
Path |
|
| Génère | |
|---|---|
IOException |
|
ensureCasClientExecutable
public static void ensureCasClientExecutable (Path casClientPath,
boolean logMetricsIfNotExecutable)| Paramètres | |
|---|---|
casClientPath |
Path |
logMetricsIfNotExecutable |
boolean |
getCasLogFromDir
public static String getCasLogFromDir (Path logDirPath)
Lit le fichier journal CAS "
| Paramètres | |
|---|---|
logDirPath |
Path : chemin d'accès au répertoire à partir duquel lire le fichier journal CAS. |
| Renvoie | |
|---|---|
String |
Contenu du fichier journal CAS ou valeur "null" si le fichier journal ne peut pas être lu. |
getCasLogFromDir
public static String getCasLogFromDir (Path logDirPath,
String clientName,
String tag,
boolean removeLogDirAfterRead)Lit le fichier journal CAS à partir du répertoire indiqué.
| Paramètres | |
|---|---|
logDirPath |
Path : chemin d'accès au répertoire à partir duquel lire le fichier journal CAS. |
clientName |
String : nom du client CAS. |
tag |
String : tag du fichier journal CAS, comme "INFO", "WARNING", "ERROR", etc. |
removeLogDirAfterRead |
boolean : indique s'il faut supprimer le répertoire du journal après la lecture du fichier journal. |
| Renvoie | |
|---|---|
String |
Contenu du fichier journal du CAS. |
| Génère | |
|---|---|
IOException |
Si le fichier journal CAS ne peut pas être lu. |
getCasLogFromDir
public static String getCasLogFromDir (Path logDirPath,
String clientName)Lit le fichier journal CAS "
| Paramètres | |
|---|---|
logDirPath |
Path : chemin d'accès au répertoire à partir duquel lire le fichier journal CAS. |
clientName |
String : nom du client CAS. |
| Renvoie | |
|---|---|
String |
Contenu du fichier journal CAS ou "" si le fichier journal ne peut pas être lu. |
isChunkedDir
public static boolean isChunkedDir (Path path)
Renvoie "true" si le chemin d'accès donné est un répertoire segmenté FastCDC valide.
| Paramètres | |
|---|---|
path |
Path |
| Renvoie | |
|---|---|
boolean |
|
isUncompressedDeviceImage
public static boolean isUncompressedDeviceImage (Path path)
Renvoie "true" si le chemin d'accès donné correspond à une image d'appareil non compressée valide.
Pour une vérification plus robuste et fiable, vérifiez l'existence de (system.img ou super.img) ET android-info.txt.
system.img/super.img : confirme que les données de l'OS de base sont présentes.
android-info.txt : confirme qu'il s'agit d'un package de compilation officiel avec des métadonnées décrivant l'appareil et la version de compilation.
Cette combinaison est extrêmement peu probable dans un répertoire qui n'est pas une image d'appareil non compressée et qui gère correctement les cas comme la version TV où boot.img est absent.
| Paramètres | |
|---|---|
path |
Path : chemin d'accès absolu à l'image de l'appareil. |
| Renvoie | |
|---|---|
boolean |
Vrai si le chemin d'accès est une image d'appareil non compressée valide, faux dans le cas contraire. |
logCasClientVersion
public static void logCasClientVersion (Path clientPath,
Consumer<String> versionHandlerFn)| Paramètres | |
|---|---|
clientPath |
Path |
versionHandlerFn |
Consumer |
logCasClientVersion
public static void logCasClientVersion (Path clientPath)
| Paramètres | |
|---|---|
clientPath |
Path |
validateChunkedDir
public static void validateChunkedDir (Path path)
Valide si le chemin d'accès donné est un répertoire segmenté FastCDC valide.
device_image.zip/
_chunks/
_chunks_index.json
chunk1.img
_chunks_index.json
| Paramètres | |
|---|---|
path |
Path : chemin d'accès au répertoire segmenté. |
| Génère | |
|---|---|
IOException |
Si le chemin n'est pas un répertoire segmenté FastCDC valide. |