TombstoneUtils

public class TombstoneUtils
extends Object

java.lang.Object
   ↳ com.android.sts.common.util.TombstoneUtils


Contains helper functions and shared constants for crash parsing.

Summary

Nested classes

class TombstoneUtils.Config

 

class TombstoneUtils.Signals

 

Public constructors

TombstoneUtils()

Public methods

static void assertNoSecurityCrashes(List<TombstoneProtos.Tombstone> tombstones, TombstoneUtils.Config config)
static Optional<TombstoneProtos.Thread> getMainThread(TombstoneProtos.Tombstone tombstone)
static Optional<String> getProcessFilename(TombstoneProtos.Tombstone tombstone)

returns the filename of the process.

static List<TombstoneProtos.Tombstone> getSecurityCrashes(List<TombstoneProtos.Tombstone> tombstones, TombstoneUtils.Config config)
static boolean isSecurityCrash(TombstoneProtos.Tombstone tombstone, TombstoneUtils.Config config)

Determines if a tombstone is likely to be security-related against the given configuration.

static AutoCloseable withAssertNoSecurityCrashes(ITestDevice device, TombstoneUtils.Config config)

Public constructors

TombstoneUtils

public TombstoneUtils ()

Public methods

assertNoSecurityCrashes

public static void assertNoSecurityCrashes (List<TombstoneProtos.Tombstone> tombstones, 
                TombstoneUtils.Config config)

Parameters
tombstones List

config TombstoneUtils.Config

getMainThread

public static Optional<TombstoneProtos.Thread> getMainThread (TombstoneProtos.Tombstone tombstone)

Parameters
tombstone TombstoneProtos.Tombstone

Returns
Optional<TombstoneProtos.Thread>

getProcessFilename

public static Optional<String> getProcessFilename (TombstoneProtos.Tombstone tombstone)

returns the filename of the process. e.g. "/system/bin/mediaserver" returns "mediaserver"

Parameters
tombstone TombstoneProtos.Tombstone

Returns
Optional<String>

getSecurityCrashes

public static List<TombstoneProtos.Tombstone> getSecurityCrashes (List<TombstoneProtos.Tombstone> tombstones, 
                TombstoneUtils.Config config)

Parameters
tombstones List: a list of tombstones to check

config TombstoneUtils.Config: crash detection configuration object

Returns
List<TombstoneProtos.Tombstone> a list of tombstones that are security-related

isSecurityCrash

public static boolean isSecurityCrash (TombstoneProtos.Tombstone tombstone, 
                TombstoneUtils.Config config)

Determines if a tombstone is likely to be security-related against the given configuration.

Parameters
tombstone TombstoneProtos.Tombstone: the tombstone to check

config TombstoneUtils.Config: crash detection configuration object

Returns
boolean if the tombstone is security-related

withAssertNoSecurityCrashes

public static AutoCloseable withAssertNoSecurityCrashes (ITestDevice device, 
                TombstoneUtils.Config config)

Parameters
device ITestDevice

config TombstoneUtils.Config

Returns
AutoCloseable

Throws
DeviceNotAvailableException