Configurazione dispositivo
public class DeviceSetup
extends BaseTargetPreparer
implements IExternalDependency
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceSetup |
Un ITargetPreparer
che configura un dispositivo per il test in base alle Option
fornite.
Richiede un dispositivo in cui sia possibile "adb root", in genere un tipo di build userdebug.
Dovrebbe essere eseguito dopo il flashing di una nuova build.
Nota: questo preparatore è pensato per laboratori di test continui e presuppone che il dispositivo in prova verrà flashato e cancellato prima dell'esecuzione successiva. Pertanto, esegue una pulizia minima durante lo smontaggio e non dovrebbe essere utilizzato in un modulo di test.
Riepilogo
Costruttori pubblici | |
---|---|
DeviceSetup () |
Metodi pubblici | |
---|---|
void | changeSettings ( ITestDevice device) Modificare le impostazioni sul dispositivo. |
getDependencies () | |
ITestDevice | getDevice ( TestInformation testInfo) |
boolean | isForceSkipSystemProps () |
void | processDeprecatedOptions ( ITestDevice device) Elabora le opzioni deprecate convertendole nelle opzioni attualmente utilizzate. |
void | processOptions ( ITestDevice device) Elabora tutte le |
static void | setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand) setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand) Metodo di supporto per aggiungere un comando di esecuzione ON/OFF da eseguire sul dispositivo. |
void | setGlobalSetting (String key, String value) Esposto per test unitari |
void | setSecureSetting (String key, String value) Esposto per test unitari |
static void | setSettingForBinaryState ( BinaryState state, MultiMap <String, String> settingsMap, String setting, String onValue, String offValue) Metodo di supporto per aggiungere un'impostazione ON/OFF a una mappa delle impostazioni. |
void | setSystemSetting (String key, String value) Esposto per test unitari |
void | setUp ( TestInformation testInfo) |
void | tearDown ( TestInformation testInfo, Throwable e)
|
Metodi protetti | |
---|---|
void | setAirplaneMode ( BinaryState airplaneMode) Esposto per test unitari |
void | setAutoRotate ( BinaryState autoRotate) Esposto per test unitari |
void | setAutoUpdateTime ( BinaryState autoUpdateTime) Esposto per test unitari |
void | setAutoUpdateTimezone ( BinaryState autoUpdateTimezone) Esposto per test unitari |
void | setBatterySaver ( BinaryState batterySaver) Esposto per test unitari |
void | setBatterySaverTrigger (Integer batterySaverTrigger) Esposto per test unitari |
void | setBluetooth ( BinaryState bluetooth) Esposto per test unitari |
void | setCell ( BinaryState cell) |
void | setCellAutoSetting ( BinaryState cellAutoSetting) |
void | setData ( BinaryState data) |
void | setDefaultSimData (Integer defaultSimData) Esposto per test unitari |
void | setDefaultSimSms (Integer defaultSimSms) Esposto per test unitari |
void | setDefaultSimVoice (Integer defaultSimVoice) Esposto per test unitari |
void | setDeprecatedAudioSilent (boolean silent) Questo metodo è deprecato. utilizzare invece |
void | setDeprecatedMinExternalStoreSpace (long storeSpace) Questo metodo è deprecato. utilizzare invece |
void | setDeprecatedSetProp (String prop) Questo metodo è deprecato. utilizzare invece |
void | setDisableAudio (boolean disable) Esposto per test unitari |
void | setDisableCwWifiMediator ( BinaryState disableCwWifiMediator) |
void | setDisableDalvikVerifier (boolean disableDalvikVerifier) Esposto per test unitari |
void | setDisableDialing (boolean disableDialing) Esposto per test unitari |
void | setDisableDoze (boolean disableDoze) Esposto per test unitari |
void | setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory) Esposto per test unitari |
void | setEthernet ( BinaryState ethernet) Esposto per test unitari |
void | setForceSkipSystemProps (boolean force) Esposto per test unitari |
void | setInstallNonMarketApps ( BinaryState installNonMarketApps) Esposto per test unitari |
void | setLocalDataPath (File path) Esposto per test unitari |
void | setLocationGps ( BinaryState locationGps) Esposto per test unitari |
void | setLocationNetwork ( BinaryState locationNetwork) Esposto per test unitari |
void | setMinExternalStorageKb (long storageKb) Esposto per test unitari |
void | setNfc ( BinaryState nfc) Esposto per test unitari |
void | setNotificationLed ( BinaryState notificationLed) Esposto per test unitari |
void | setProperty (String key, String value) Esposto per test unitari |
void | setRestoreProperties (boolean restoreProperties) Esposto per test unitari |
void | setRestoreSettings (boolean restoreSettings) Esposto per test unitari |
void | setScreenAdaptiveBrightness ( BinaryState screenAdaptiveBrightness) Esposto per test unitari |
void | setScreenAlwaysOn ( BinaryState screenAlwaysOn) Esposto per test unitari |
void | setScreenAmbientMode ( BinaryState screenAmbientMode) Esposto per test unitari |
void | setScreenBrightness (Integer screenBrightness) Esposto per test unitari |
void | setScreenSaver ( BinaryState screenSaver) Esposto per test unitari |
void | setScreenTimeoutSecs (Long screenTimeoutSecs) Esposto per test unitari |
void | setTestHarness (boolean setTestHarness) Esposto per test unitari |
void | setTimezone (String timezone) Esposto per test unitari |
void | setTriggerMediaMounted (boolean triggerMediaMounted) Esposto per test unitari |
void | setWakeGesture ( BinaryState wakeGesture) Esposto per test unitari |
void | setWifi ( BinaryState wifi) Esposto per test unitari |
void | setWifiNetwork (String wifiNetwork) Esposto per test unitari |
void | setWifiPsk (String wifiPsk) |
void | setWifiScanAlwaysEnabled ( BinaryState wifiScanAlwaysEnabled) Esposto per test unitari |
void | setWifiSsidToPsk ( wifiSssidToPsk) setWifiSsidToPsk ( wifiSssidToPsk) |
void | setWifiWatchdog ( BinaryState wifiWatchdog) Esposto per test unitari |
Campi
mBatterySaverTrigger
protected Integer mBatterySaverTrigger
mBluetooth
protected BinaryState mBluetooth
mCellAutoSetting
protected BinaryState mCellAutoSetting
mDefaultSimData
protected Integer mDefaultSimData
mDefaultSimSms
protected Integer mDefaultSimSms
mDefaultSimVoice
protected Integer mDefaultSimVoice
mDisabilita audio
protected boolean mDisableAudio
mDisableDalvikVerifier
protected boolean mDisableDalvikVerifier
mDisabilita composizione
protected boolean mDisableDialing
mDisabilitaDoze
protected boolean mDisableDoze
mAbilita cronologia statistiche batteria completa
protected boolean mEnableFullBatteryStatsHistory
mForceSkipRunCommands
protected boolean mForceSkipRunCommands
mForceSkipSettings
protected boolean mForceSkipSettings
mForceSkipSystemProps
protected boolean mForceSkipSystemProps
mLocalDataFile
protected File mLocalDataFile
mMinArchiviazione esternaKb
protected long mMinExternalStorageKb
mOptimizedPropertySetting
protected boolean mOptimizedPropertySetting
mPreviousProperties
protected File mPreviousProperties
mRemoteDataPath
protected String mRemoteDataPath
mRestoreProperties
protected boolean mRestoreProperties
mRestoreSettings
protected boolean mRestoreSettings
mRunCommandAfterSettings
protectedmRunCommandAfterSettings
mRunCommandBeforeSettings
protectedmRunCommandBeforeSettings
mLuminositàschermo
protected Integer mScreenBrightness
mScreenTimeoutSec
protected Long mScreenTimeoutSecs
mSetProps
protectedmSetProps
mSetTestHarness
protected boolean mSetTestHarness
mTimezone
protected String mTimezone
mTriggerMediaMounted
protected boolean mTriggerMediaMounted
mWakeGesture
protected BinaryState mWakeGesture
mWifiPsk
protected String mWifiPsk
mWifiSsid
protected String mWifiSsid
mWifiSsidToPsk
protectedmWifiSsidToPsk
Costruttori pubblici
Configurazione dispositivo
public DeviceSetup ()
Metodi pubblici
cambia impostazioni
public void changeSettings (ITestDevice device)
Modificare le impostazioni sul dispositivo.
Esposto in modo che le lezioni per bambini possano sovrascrivere.
Parametri | |
---|---|
device | ITestDevice : ITestDevice |
Lancia | |
---|---|
DeviceNotAvailableException | se il dispositivo non è disponibile |
TargetSetupError | se si è verificato un errore durante la configurazione delle impostazioni |
getDependencies
publicgetDependencies ()
ritorna | |
---|---|
getDevice
public ITestDevice getDevice (TestInformation testInfo)
Parametri | |
---|---|
testInfo | TestInformation |
ritorna | |
---|---|
ITestDevice |
isForceSkipSystemProps
public boolean isForceSkipSystemProps ()
ritorna | |
---|---|
boolean |
processDeprecatedOptions
public void processDeprecatedOptions (ITestDevice device)
Elabora le opzioni deprecate convertendole nelle opzioni attualmente utilizzate.
Questo metodo deve essere eseguito prima di qualsiasi altro metodo di elaborazione. Genera un TargetSetupError
se l'opzione deprecata sovrascrive un'opzione non deprecata specificata.
Parametri | |
---|---|
device | ITestDevice |
Lancia | |
---|---|
TargetSetupError | se c'è un conflitto |
processOptions
public void processOptions (ITestDevice device)
Elabora tutte le Option
e trasformale in oggetti di scena, impostazioni o comandi di esecuzione del sistema. Al momento non esegue alcun comando sul dispositivo.
Esposto in modo che le classi per bambini possano prevalere su questo.
Parametri | |
---|---|
device | ITestDevice : ITestDevice |
Lancia | |
---|---|
DeviceNotAvailableException | se il dispositivo non è disponibile |
TargetSetupError | se l' Option è in conflitto |
setCommandForBinaryState
public static void setCommandForBinaryState (BinaryState state,commands, String onCommand, String offCommand)
Metodo di supporto per aggiungere un comando di esecuzione ON/OFF da eseguire sul dispositivo.
Parametri | |
---|---|
state | BinaryState : Lo BinaryState |
commands | |
onCommand | String : il comando da eseguire se attivo. Ignorato se il comando è null |
offCommand | String : il comando da eseguire se OFF. Ignorato se il comando è null |
setGlobalSetting
public void setGlobalSetting (String key, String value)
Esposto per test unitari
Parametri | |
---|---|
key | String |
value | String |
setSecureSetting
public void setSecureSetting (String key, String value)
Esposto per test unitari
Parametri | |
---|---|
key | String |
value | String |
setSettingForBinaryState
public static void setSettingForBinaryState (BinaryState state, MultiMap<String, String> settingsMap, String setting, String onValue, String offValue)
Metodo di supporto per aggiungere un'impostazione ON/OFF a una mappa delle impostazioni.
Parametri | |
---|---|
state | BinaryState : Lo BinaryState |
settingsMap | MultiMap : la MultiMap utilizzata per memorizzare le impostazioni. |
setting | String : la chiave di impostazione |
onValue | String : il valore se ON |
offValue | String : il valore se OFF |
setImpostazionesistema
public void setSystemSetting (String key, String value)
Esposto per test unitari
Parametri | |
---|---|
key | String |
value | String |
impostare
public void setUp (TestInformation testInfo)
Parametri | |
---|---|
testInfo | TestInformation |
Lancia | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
demolire
public void tearDown (TestInformation testInfo, Throwable e)
Parametri | |
---|---|
testInfo | TestInformation |
e | Throwable |
Lancia | |
---|---|
DeviceNotAvailableException |
Metodi protetti
setModalitàaereo
protected void setAirplaneMode (BinaryState airplaneMode)
Esposto per test unitari
Parametri | |
---|---|
airplaneMode | BinaryState |
setAutoRotate
protected void setAutoRotate (BinaryState autoRotate)
Esposto per test unitari
Parametri | |
---|---|
autoRotate | BinaryState |
setAutoUpdateTime
protected void setAutoUpdateTime (BinaryState autoUpdateTime)
Esposto per test unitari
Parametri | |
---|---|
autoUpdateTime | BinaryState |
setAutoUpdateTimezone
protected void setAutoUpdateTimezone (BinaryState autoUpdateTimezone)
Esposto per test unitari
Parametri | |
---|---|
autoUpdateTimezone | BinaryState |
setBatterySaver
protected void setBatterySaver (BinaryState batterySaver)
Esposto per test unitari
Parametri | |
---|---|
batterySaver | BinaryState |
setBatterySaverTrigger
protected void setBatterySaverTrigger (Integer batterySaverTrigger)
Esposto per test unitari
Parametri | |
---|---|
batterySaverTrigger | Integer |
setBluetooth
protected void setBluetooth (BinaryState bluetooth)
Esposto per test unitari
Parametri | |
---|---|
bluetooth | BinaryState |
setCellAutoSetting
protected void setCellAutoSetting (BinaryState cellAutoSetting)
Parametri | |
---|---|
cellAutoSetting | BinaryState |
setDefaultSimData
protected void setDefaultSimData (Integer defaultSimData)
Esposto per test unitari
Parametri | |
---|---|
defaultSimData | Integer |
setDefaultSimSms
protected void setDefaultSimSms (Integer defaultSimSms)
Esposto per test unitari
Parametri | |
---|---|
defaultSimSms | Integer |
setDefaultSimVoice
protected void setDefaultSimVoice (Integer defaultSimVoice)
Esposto per test unitari
Parametri | |
---|---|
defaultSimVoice | Integer |
setDeprecatedAudioSilent
protected void setDeprecatedAudioSilent (boolean silent)
Questo metodo è deprecato.
utilizzare invece setDisableAudio(boolean)
.
Esposto per test unitari
Parametri | |
---|---|
silent | boolean |
setDeprecatedMinExternalStoreSpace
protected void setDeprecatedMinExternalStoreSpace (long storeSpace)
Questo metodo è deprecato.
utilizzare invece setMinExternalStorageKb(long)
.
Esposto per test unitari
Parametri | |
---|---|
storeSpace | long |
setDeprecatedSetProp
protected void setDeprecatedSetProp (String prop)
Questo metodo è deprecato.
utilizzare invece setProperty(String, String)
.
Esposto per test unitari
Parametri | |
---|---|
prop | String |
setDisableAudio
protected void setDisableAudio (boolean disable)
Esposto per test unitari
Parametri | |
---|---|
disable | boolean |
setDisableCwWifiMediator
protected void setDisableCwWifiMediator (BinaryState disableCwWifiMediator)
Parametri | |
---|---|
disableCwWifiMediator | BinaryState |
setDisableDalvikVerifier
protected void setDisableDalvikVerifier (boolean disableDalvikVerifier)
Esposto per test unitari
Parametri | |
---|---|
disableDalvikVerifier | boolean |
setDisableDialing
protected void setDisableDialing (boolean disableDialing)
Esposto per test unitari
Parametri | |
---|---|
disableDialing | boolean |
setDisableDoze
protected void setDisableDoze (boolean disableDoze)
Esposto per test unitari
Parametri | |
---|---|
disableDoze | boolean |
setEnableFullBatteryStatsHistory
protected void setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory)
Esposto per test unitari
Parametri | |
---|---|
enableFullBatteryStatsHistory | boolean |
setEthernet
protected void setEthernet (BinaryState ethernet)
Esposto per test unitari
Parametri | |
---|---|
ethernet | BinaryState |
setForceSkipSystemProps
protected void setForceSkipSystemProps (boolean force)
Esposto per test unitari
Parametri | |
---|---|
force | boolean |
setInstallNonMarketApps
protected void setInstallNonMarketApps (BinaryState installNonMarketApps)
Esposto per test unitari
Parametri | |
---|---|
installNonMarketApps | BinaryState |
setLocalDataPath
protected void setLocalDataPath (File path)
Esposto per test unitari
Parametri | |
---|---|
path | File |
setLocationGps
protected void setLocationGps (BinaryState locationGps)
Esposto per test unitari
Parametri | |
---|---|
locationGps | BinaryState |
setLocationNetwork
protected void setLocationNetwork (BinaryState locationNetwork)
Esposto per test unitari
Parametri | |
---|---|
locationNetwork | BinaryState |
setMinExternalStorageKb
protected void setMinExternalStorageKb (long storageKb)
Esposto per test unitari
Parametri | |
---|---|
storageKb | long |
setNotificationLed
protected void setNotificationLed (BinaryState notificationLed)
Esposto per test unitari
Parametri | |
---|---|
notificationLed | BinaryState |
setProperty
protected void setProperty (String key, String value)
Esposto per test unitari
Parametri | |
---|---|
key | String |
value | String |
setRestoreProperties
protected void setRestoreProperties (boolean restoreProperties)
Esposto per test unitari
Parametri | |
---|---|
restoreProperties | boolean |
setRestoreSettings
protected void setRestoreSettings (boolean restoreSettings)
Esposto per test unitari
Parametri | |
---|---|
restoreSettings | boolean |
setScreenAdaptiveBrightness
protected void setScreenAdaptiveBrightness (BinaryState screenAdaptiveBrightness)
Esposto per test unitari
Parametri | |
---|---|
screenAdaptiveBrightness | BinaryState |
setScreenAlwaysOn
protected void setScreenAlwaysOn (BinaryState screenAlwaysOn)
Esposto per test unitari
Parametri | |
---|---|
screenAlwaysOn | BinaryState |
setScreenAmbientMode
protected void setScreenAmbientMode (BinaryState screenAmbientMode)
Esposto per test unitari
Parametri | |
---|---|
screenAmbientMode | BinaryState |
setLuminositàschermo
protected void setScreenBrightness (Integer screenBrightness)
Esposto per test unitari
Parametri | |
---|---|
screenBrightness | Integer |
setScreenSaver
protected void setScreenSaver (BinaryState screenSaver)
Esposto per test unitari
Parametri | |
---|---|
screenSaver | BinaryState |
setScreenTimeoutSec
protected void setScreenTimeoutSecs (Long screenTimeoutSecs)
Esposto per test unitari
Parametri | |
---|---|
screenTimeoutSecs | Long |
setTestHarness
protected void setTestHarness (boolean setTestHarness)
Esposto per test unitari
Parametri | |
---|---|
setTestHarness | boolean |
setTimezone
protected void setTimezone (String timezone)
Esposto per test unitari
Parametri | |
---|---|
timezone | String |
setTriggerMediaMounted
protected void setTriggerMediaMounted (boolean triggerMediaMounted)
Esposto per test unitari
Parametri | |
---|---|
triggerMediaMounted | boolean |
setWakeGesture
protected void setWakeGesture (BinaryState wakeGesture)
Esposto per test unitari
Parametri | |
---|---|
wakeGesture | BinaryState |
setWifi
protected void setWifi (BinaryState wifi)
Esposto per test unitari
Parametri | |
---|---|
wifi | BinaryState |
setWiFiNetwork
protected void setWifiNetwork (String wifiNetwork)
Esposto per test unitari
Parametri | |
---|---|
wifiNetwork | String |
setWifiPsk
protected void setWifiPsk (String wifiPsk)
Parametri | |
---|---|
wifiPsk | String |
setWifiScanAlwaysEnabled
protected void setWifiScanAlwaysEnabled (BinaryState wifiScanAlwaysEnabled)
Esposto per test unitari
Parametri | |
---|---|
wifiScanAlwaysEnabled | BinaryState |
setWifiSsidToPsk
protected void setWifiSsidToPsk (wifiSssidToPsk)
Parametri | |
---|---|
wifiSssidToPsk |
setWiFiWatchdog
protected void setWifiWatchdog (BinaryState wifiWatchdog)
Esposto per test unitari
Parametri | |
---|---|
wifiWatchdog | BinaryState |