public class DefaultProperties
extends java.lang.Object
HoodAPI.createPropertyEntry(CharSequence, DynamicValue)
type page entries.Constructor and Description |
---|
DefaultProperties() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<PageEntry<?>> |
createDetailedDeviceInfo(android.app.Activity activity)
Additional device info
|
static java.util.List<PageEntry<?>> |
createFromMap(java.util.Map<?,?> hashMap)
Converts an arbitrary map to page-entries.
|
static Section.HeaderSection |
createInternalProcessDebugInfo(android.content.Context context)
Very technical memory & classloader process states - this data is usually very volatile
|
static java.util.List<PageEntry<?>> |
createPropertiesEntries(java.util.Properties properties)
Converts a
Properties object to page-entries |
static Section.HeaderSection |
createSectionAndroidDebugSettings(android.content.Context context) |
static Section.HeaderSection |
createSectionAppVersionInfoFromBuildConfig(java.lang.Class<?> buildConfig)
Traverses the static fields of given class (which must be of Type BuildConfig) and parses the main
fields that is create by the android gradle plugin (ie. version, app_id, etc.)
|
static Section.HeaderSection |
createSectionBasicDeviceInfo()
Returns entries of some basic device data like model number and sdk version.
|
static Section.HeaderSection |
createSectionBatteryInfo(android.content.Context context)
Creates a section with current battery status and health
|
static Section.HeaderSection |
createSectionConnectivityStatusInfo(android.content.Context context)
Get current state of various connectivity adapters (network, wifi, bt, nfc,...).
|
static Section.HeaderSection |
createSectionConnectivityStatusInfo(android.content.Context context,
boolean includeNetworkState,
boolean includeWifiState,
boolean includeBtState,
boolean includeNfcState)
|
static Section.HeaderSection |
createSectionRuntimePermissions(android.app.Activity activity,
java.util.List<java.lang.String> androidPermissions)
Returns for each provided permission a page-entry containing the current dynamic state (granted, denied, etc.) including click
actions to request the permission.
|
static Section.HeaderSection |
createSectionSourceControlAndCI(java.lang.String scmRev,
java.lang.String scmBranch,
java.lang.String scmCommitDate,
java.lang.String ciBuildId,
java.lang.String ciBuildJob,
java.lang.String ciBuildTime)
Convenience to create a CI and source control section.
|
static Section.HeaderSection |
createSectionStrictMode()
Adds info for current
StrictMode config. |
static Section.HeaderSection |
createSectionTelephonyManger(android.content.Context context)
Returns a list of the most important
TelephonyManager states and ids. |
static java.util.List<PageEntry<?>> |
createStaticFieldsInfo(java.lang.Class<?> clazz)
Traverses the static fields of given arbitrary class.
|
static java.util.List<PageEntry<?>> |
createSystemFeatureInfo(android.content.Context context,
java.util.Map<java.lang.CharSequence,java.lang.String> labelSystemFeatureMap)
Convince feature to add state of multiple system features.
|
public static Section.HeaderSection createSectionBasicDeviceInfo()
public static java.util.List<PageEntry<?>> createDetailedDeviceInfo(android.app.Activity activity)
activity
- can be null, but will just return an empty listpublic static Section.HeaderSection createInternalProcessDebugInfo(android.content.Context context)
context
- public static java.util.List<PageEntry<?>> createStaticFieldsInfo(java.lang.Class<?> clazz)
NOTE: this uses reflection to traverse to class, so if you want to keep it after proguard, use a keep rule like:
-keep public class your.package.name.BuildConfig { public *;}
clazz
- the BuildConfig.java class you want the infopublic static Section.HeaderSection createSectionAppVersionInfoFromBuildConfig(java.lang.Class<?> buildConfig)
-keep public class your.package.name.BuildConfig { public *;}
buildConfig
- the BuildConfig.java class you want the infopublic static Section.HeaderSection createSectionRuntimePermissions(android.app.Activity activity, java.util.List<java.lang.String> androidPermissions)
activity
- can be null, but will just return an empty listandroidPermissions
- see Manifest.permission
public static Section.HeaderSection createSectionConnectivityStatusInfo(android.content.Context context)
DeviceStatusUtil.getNetworkConnectivityState(Context)
.
Click action is opening the system settings for each adapter.
context
- can be null, but will just return an empty listpublic static Section.HeaderSection createSectionConnectivityStatusInfo(android.content.Context context, boolean includeNetworkState, boolean includeWifiState, boolean includeBtState, boolean includeNfcState)
context
- can be null, but will just return an empty listincludeNetworkState
- if network state should be includedincludeWifiState
- if wifi state should be includedincludeBtState
- if bluetooth state should be includedincludeNfcState
- if nfc state should be includedpublic static java.util.List<PageEntry<?>> createSystemFeatureInfo(android.content.Context context, java.util.Map<java.lang.CharSequence,java.lang.String> labelSystemFeatureMap)
PackageManager.hasSystemFeature(String)
call.
See https://developer.android.com/guide/topics/manifest/uses-feature-element.html#features-reference for available system features.
context
- can be null, but will just return an empty listlabelSystemFeatureMap
- a map which has ui labels as key and android system feature string
(as returned as name by PackageManager.getSystemAvailableFeatures()
) as valuepublic static Section.HeaderSection createSectionTelephonyManger(android.content.Context context)
TelephonyManager
states and ids. Will only
work if the app has the Manifest.permission#READ_PHONE_STATE
permission or just
returns an empty list.context
- can be null, but will just return an empty listpublic static Section.HeaderSection createSectionStrictMode()
StrictMode
config. Currently only shows the bitmask used to
store the policies states. Unfortunately there is not much public API to examine StrictModepublic static Section.HeaderSection createSectionAndroidDebugSettings(android.content.Context context)
public static Section.HeaderSection createSectionSourceControlAndCI(java.lang.String scmRev, java.lang.String scmBranch, java.lang.String scmCommitDate, java.lang.String ciBuildId, java.lang.String ciBuildJob, java.lang.String ciBuildTime)
scmRev
- git hash e.g. "git log -1 --format=%H"scmBranch
- git branch e.g. "git rev-parse --abbrev-ref HEAD"ciBuildId
- build numberciBuildJob
- job nameciBuildTime
- time on ci serverpublic static Section.HeaderSection createSectionBatteryInfo(android.content.Context context)
context
- can be null, but will just return an empty sectionpublic static java.util.List<PageEntry<?>> createPropertiesEntries(java.util.Properties properties)
Properties
object to page-entriesproperties
- public static java.util.List<PageEntry<?>> createFromMap(java.util.Map<?,?> hashMap)
Object.toString()
on the contained objects.hashMap
-