DeviceSetup
public
class
DeviceSetup
extends BaseTargetPreparer
implements
IExternalDependency
java.lang.Object | ||
↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
↳ | com.android.tradefed.targetprep.DeviceSetup |
제공된 Option
를 기반으로 테스트를 위해 기기를 구성하는 ITargetPreparer
입니다.
'adb root'가 가능한 기기(일반적으로 userdebug 빌드 유형)가 필요합니다.
새 빌드가 플래시된 후에 실행해야 합니다.
참고: 이 준비 도구는 연속 테스트 실험실용이며 테스트 대상 기기가 다음 실행 전에 플래시 및 삭제된다고 가정합니다. 따라서 해체 중에 최소한의 정리 작업을 실행하며 테스트 모듈에서는 사용하면 안 됩니다.
요약
공개 생성자 | |
---|---|
DeviceSetup()
|
공개 메서드 | |
---|---|
void
|
changeSettings(ITestDevice device)
기기에서 설정을 변경합니다. |
|
getDependencies()
|
ITestDevice
|
getDevice(TestInformation testInfo)
|
boolean
|
isForceSkipSystemProps()
|
void
|
processDeprecatedOptions(ITestDevice device)
지원 중단된 옵션을 처리하여 현재 사용 중인 옵션으로 변환합니다. |
void
|
processOptions(ITestDevice device)
모든 |
static
void
|
setCommandForBinaryState(BinaryState state,
기기에서 실행할 켜기/끄기 실행 명령어를 추가하는 도우미 메서드입니다. |
void
|
setGlobalSetting(String key, String value)
단위 테스트용으로 노출됨 |
void
|
setSecureSetting(String key, String value)
단위 테스트용으로 노출됨 |
static
void
|
setSettingForBinaryState(BinaryState state, MultiMap<String, String> settingsMap, String setting, String onValue, String offValue)
설정 맵에 켜기/끄기 설정을 추가하는 도우미 메서드입니다. |
void
|
setSystemSetting(String key, String value)
단위 테스트용으로 노출됨 |
void
|
setUp(TestInformation testInfo)
|
void
|
tearDown(TestInformation testInfo, Throwable e)
|
보호된 메서드 | |
---|---|
void
|
setAirplaneMode(BinaryState airplaneMode)
단위 테스트용으로 노출됨 |
void
|
setAutoRotate(BinaryState autoRotate)
단위 테스트용으로 노출됨 |
void
|
setAutoUpdateTime(BinaryState autoUpdateTime)
단위 테스트용으로 노출됨 |
void
|
setAutoUpdateTimezone(BinaryState autoUpdateTimezone)
단위 테스트용으로 노출됨 |
void
|
setBatterySaver(BinaryState batterySaver)
단위 테스트용으로 노출됨 |
void
|
setBatterySaverTrigger(Integer batterySaverTrigger)
단위 테스트용으로 노출됨 |
void
|
setBluetooth(BinaryState bluetooth)
단위 테스트용으로 노출됨 |
void
|
setCell(BinaryState cell)
|
void
|
setCellAutoSetting(BinaryState cellAutoSetting)
|
void
|
setData(BinaryState data)
|
void
|
setDefaultSimData(Integer defaultSimData)
단위 테스트용으로 노출됨 |
void
|
setDefaultSimSms(Integer defaultSimSms)
단위 테스트용으로 노출됨 |
void
|
setDefaultSimVoice(Integer defaultSimVoice)
단위 테스트용으로 노출됨 |
void
|
setDeprecatedAudioSilent(boolean silent)
이 메서드는 지원 중단되었습니다.
대신 |
void
|
setDeprecatedMinExternalStoreSpace(long storeSpace)
이 메서드는 지원 중단되었습니다.
대신 |
void
|
setDeprecatedSetProp(String prop)
이 메서드는 지원 중단되었습니다.
대신 |
void
|
setDisableAudio(boolean disable)
단위 테스트용으로 노출됨 |
void
|
setDisableCwWifiMediator(BinaryState disableCwWifiMediator)
|
void
|
setDisableDalvikVerifier(boolean disableDalvikVerifier)
단위 테스트용으로 노출됨 |
void
|
setDisableDialing(boolean disableDialing)
단위 테스트용으로 노출됨 |
void
|
setDisableDoze(boolean disableDoze)
단위 테스트용으로 노출됨 |
void
|
setEnableFullBatteryStatsHistory(boolean enableFullBatteryStatsHistory)
단위 테스트용으로 노출됨 |
void
|
setEthernet(BinaryState ethernet)
단위 테스트용으로 노출됨 |
void
|
setForceRootSetup(boolean force)
|
void
|
setForceSkipSystemProps(boolean force)
단위 테스트용으로 노출됨 |
void
|
setInstallNonMarketApps(BinaryState installNonMarketApps)
단위 테스트용으로 노출됨 |
void
|
setLocalDataPath(File path)
단위 테스트용으로 노출됨 |
void
|
setLocationGps(BinaryState locationGps)
단위 테스트용으로 노출됨 |
void
|
setLocationNetwork(BinaryState locationNetwork)
단위 테스트용으로 노출됨 |
void
|
setMinExternalStorageKb(long storageKb)
단위 테스트용으로 노출됨 |
void
|
setNfc(BinaryState nfc)
단위 테스트용으로 노출됨 |
void
|
setNotificationLed(BinaryState notificationLed)
단위 테스트용으로 노출됨 |
void
|
setProperty(String key, String value)
단위 테스트용으로 노출됨 |
void
|
setRestoreProperties(boolean restoreProperties)
단위 테스트용으로 노출됨 |
void
|
setRestoreSettings(boolean restoreSettings)
단위 테스트용으로 노출됨 |
void
|
setScreenAdaptiveBrightness(BinaryState screenAdaptiveBrightness)
단위 테스트용으로 노출됨 |
void
|
setScreenAlwaysOn(BinaryState screenAlwaysOn)
단위 테스트용으로 노출됨 |
void
|
setScreenAmbientMode(BinaryState screenAmbientMode)
단위 테스트용으로 노출됨 |
void
|
setScreenBrightness(Integer screenBrightness)
단위 테스트용으로 노출됨 |
void
|
setScreenSaver(BinaryState screenSaver)
단위 테스트용으로 노출됨 |
void
|
setScreenTimeoutSecs(Long screenTimeoutSecs)
단위 테스트용으로 노출됨 |
void
|
setTestHarness(boolean setTestHarness)
단위 테스트용으로 노출됨 |
void
|
setTimezone(String timezone)
단위 테스트용으로 노출됨 |
void
|
setTriggerMediaMounted(boolean triggerMediaMounted)
단위 테스트용으로 노출됨 |
void
|
setWakeGesture(BinaryState wakeGesture)
단위 테스트용으로 노출됨 |
void
|
setWifi(BinaryState wifi)
단위 테스트용으로 노출됨 |
void
|
setWifiNetwork(String wifiNetwork)
단위 테스트용으로 노출됨 |
void
|
setWifiPsk(String wifiPsk)
|
void
|
setWifiScanAlwaysEnabled(BinaryState wifiScanAlwaysEnabled)
단위 테스트용으로 노출됨 |
void
|
setWifiSsidToPsk(
|
void
|
setWifiWatchdog(BinaryState wifiWatchdog)
단위 테스트용으로 노출됨 |
필드
mBatterySaverTrigger
protected Integer mBatterySaverTrigger
mDefaultSimData
protected Integer mDefaultSimData
mDefaultSimSms
protected Integer mDefaultSimSms
mDefaultSimVoice
protected Integer mDefaultSimVoice
mDisableAudio
protected boolean mDisableAudio
mDisableDalvikVerifier
protected boolean mDisableDalvikVerifier
mDisableDialing
protected boolean mDisableDialing
mDisableDoze
protected boolean mDisableDoze
mEnableFullBatteryStatsHistory
protected boolean mEnableFullBatteryStatsHistory
mForceSkipRunCommands
protected boolean mForceSkipRunCommands
mForceSkipSettings
protected boolean mForceSkipSettings
mForceSkipSystemProps
protected boolean mForceSkipSystemProps
mLocalDataFile
protected File mLocalDataFile
mMinExternalStorageKb
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
mScreenBrightness
protected Integer mScreenBrightness
mScreenTimeoutSecs
protected Long mScreenTimeoutSecs
mSetProps
protectedmSetProps
mSetTestHarness
protected boolean mSetTestHarness
mTimezone
protected String mTimezone
mTriggerMediaMounted
protected boolean mTriggerMediaMounted
mWifiPsk
protected String mWifiPsk
mWifiSsid
protected String mWifiSsid
mWifiSsidToPsk
protectedmWifiSsidToPsk
공개 생성자
DeviceSetup
public DeviceSetup ()
공개 메서드
changeSettings
public void changeSettings (ITestDevice device)
기기에서 설정을 변경합니다.
하위 클래스가 재정의할 수 있도록 노출됩니다.
매개변수 | |
---|---|
device |
ITestDevice : ITestDevice |
생성 값 | |
---|---|
DeviceNotAvailableException |
기기를 사용할 수 없는 경우 |
TargetSetupError |
설정을 설정하는 중에 오류가 발생한 경우 |
getDependencies
publicgetDependencies ()
반환 값 | |
---|---|
|
getDevice
public ITestDevice getDevice (TestInformation testInfo)
매개변수 | |
---|---|
testInfo |
TestInformation |
반환 값 | |
---|---|
ITestDevice |
isForceSkipSystemProps
public boolean isForceSkipSystemProps ()
반환 값 | |
---|---|
boolean |
processDeprecatedOptions
public void processDeprecatedOptions (ITestDevice device)
지원 중단된 옵션을 처리하여 현재 사용 중인 옵션으로 변환합니다.
이 메서드는 다른 처리 메서드보다 먼저 실행해야 합니다. 지원 중단된 옵션이 지정된 지원 중단되지 않은 옵션을 재정의하는 경우 TargetSetupError
이 발생합니다.
매개변수 | |
---|---|
device |
ITestDevice |
생성 값 | |
---|---|
TargetSetupError |
충돌이 있는 경우 |
processOptions
public void processOptions (ITestDevice device)
모든 Option
를 처리하여 시스템 속성, 설정 또는 실행 명령어로 변환합니다.
현재 기기에서 명령어를 실행하지 않습니다.
하위 클래스가 이를 재정의할 수 있도록 노출됩니다.
매개변수 | |
---|---|
device |
ITestDevice : ITestDevice |
생성 값 | |
---|---|
DeviceNotAvailableException |
기기를 사용할 수 없는 경우 |
TargetSetupError |
Option 가 충돌하는 경우 |
setCommandForBinaryState
public static void setCommandForBinaryState (BinaryState state,commands, String onCommand, String offCommand)
기기에서 실행할 켜기/끄기 실행 명령어를 추가하는 도우미 메서드입니다.
매개변수 | |
---|---|
state |
BinaryState : BinaryState |
commands |
: on 또는 off 명령어를 추가할 명령어 목록입니다. |
onCommand |
String : 켜져 있으면 실행할 명령어입니다. 명령어가 null 인 경우 무시됩니다. |
offCommand |
String : OFF인 경우 실행할 명령어입니다. 명령어가 null 인 경우 무시됩니다. |
setGlobalSetting
public void setGlobalSetting (String key, String value)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
key |
String |
value |
String |
setSecureSetting
public void setSecureSetting (String key, String value)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
key |
String |
value |
String |
setSettingForBinaryState
public static void setSettingForBinaryState (BinaryState state, MultiMap<String, String> settingsMap, String setting, String onValue, String offValue)
설정 맵에 켜기/끄기 설정을 추가하는 도우미 메서드입니다.
매개변수 | |
---|---|
state |
BinaryState : BinaryState |
settingsMap |
MultiMap : 설정을 저장하는 데 사용되는 MultiMap 입니다. |
setting |
String : 설정 키 |
onValue |
String : 켜져 있으면 값 |
offValue |
String : OFF인 경우의 값 |
setSystemSetting
public void setSystemSetting (String key, String value)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
key |
String |
value |
String |
setUp
public void setUp (TestInformation testInfo)
매개변수 | |
---|---|
testInfo |
TestInformation |
생성 값 | |
---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
tearDown
public void tearDown (TestInformation testInfo, Throwable e)
매개변수 | |
---|---|
testInfo |
TestInformation |
e |
Throwable |
생성 값 | |
---|---|
DeviceNotAvailableException |
보호된 메서드
setAirplaneMode
protected void setAirplaneMode (BinaryState airplaneMode)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
airplaneMode |
BinaryState |
setAutoRotate
protected void setAutoRotate (BinaryState autoRotate)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
autoRotate |
BinaryState |
setAutoUpdateTime
protected void setAutoUpdateTime (BinaryState autoUpdateTime)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
autoUpdateTime |
BinaryState |
setAutoUpdateTimezone
protected void setAutoUpdateTimezone (BinaryState autoUpdateTimezone)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
autoUpdateTimezone |
BinaryState |
setBatterySaver
protected void setBatterySaver (BinaryState batterySaver)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
batterySaver |
BinaryState |
setBatterySaverTrigger
protected void setBatterySaverTrigger (Integer batterySaverTrigger)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
batterySaverTrigger |
Integer |
setBluetooth
protected void setBluetooth (BinaryState bluetooth)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
bluetooth |
BinaryState |
setCellAutoSetting
protected void setCellAutoSetting (BinaryState cellAutoSetting)
매개변수 | |
---|---|
cellAutoSetting |
BinaryState |
setDefaultSimData
protected void setDefaultSimData (Integer defaultSimData)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
defaultSimData |
Integer |
setDefaultSimSms
protected void setDefaultSimSms (Integer defaultSimSms)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
defaultSimSms |
Integer |
setDefaultSimVoice
protected void setDefaultSimVoice (Integer defaultSimVoice)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
defaultSimVoice |
Integer |
setDeprecatedAudioSilent
protected void setDeprecatedAudioSilent (boolean silent)
이 메서드는 지원 중단되었습니다.
instead.setDisableAudio(boolean)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
silent |
boolean |
setDeprecatedMinExternalStoreSpace
protected void setDeprecatedMinExternalStoreSpace (long storeSpace)
이 메서드는 지원 중단되었습니다.
instead.setMinExternalStorageKb(long)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
storeSpace |
long |
setDeprecatedSetProp
protected void setDeprecatedSetProp (String prop)
이 메서드는 지원 중단되었습니다.
instead.setProperty(String, String)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
prop |
String |
setDisableAudio
protected void setDisableAudio (boolean disable)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
disable |
boolean |
setDisableCwWifiMediator
protected void setDisableCwWifiMediator (BinaryState disableCwWifiMediator)
매개변수 | |
---|---|
disableCwWifiMediator |
BinaryState |
setDisableDalvikVerifier
protected void setDisableDalvikVerifier (boolean disableDalvikVerifier)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
disableDalvikVerifier |
boolean |
setDisableDialing
protected void setDisableDialing (boolean disableDialing)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
disableDialing |
boolean |
setDisableDoze
protected void setDisableDoze (boolean disableDoze)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
disableDoze |
boolean |
setEnableFullBatteryStatsHistory
protected void setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
enableFullBatteryStatsHistory |
boolean |
setEthernet
protected void setEthernet (BinaryState ethernet)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
ethernet |
BinaryState |
setForceRootSetup
protected void setForceRootSetup (boolean force)
매개변수 | |
---|---|
force |
boolean |
setForceSkipSystemProps
protected void setForceSkipSystemProps (boolean force)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
force |
boolean |
setInstallNonMarketApps
protected void setInstallNonMarketApps (BinaryState installNonMarketApps)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
installNonMarketApps |
BinaryState |
setLocalDataPath
protected void setLocalDataPath (File path)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
path |
File |
setLocationGps
protected void setLocationGps (BinaryState locationGps)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
locationGps |
BinaryState |
setLocationNetwork
protected void setLocationNetwork (BinaryState locationNetwork)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
locationNetwork |
BinaryState |
setMinExternalStorageKb
protected void setMinExternalStorageKb (long storageKb)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
storageKb |
long |
setNotificationLed
protected void setNotificationLed (BinaryState notificationLed)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
notificationLed |
BinaryState |
setProperty
protected void setProperty (String key, String value)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
key |
String |
value |
String |
setRestoreProperties
protected void setRestoreProperties (boolean restoreProperties)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
restoreProperties |
boolean |
setRestoreSettings
protected void setRestoreSettings (boolean restoreSettings)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
restoreSettings |
boolean |
setScreenAdaptiveBrightness
protected void setScreenAdaptiveBrightness (BinaryState screenAdaptiveBrightness)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenAdaptiveBrightness |
BinaryState |
setScreenAlwaysOn
protected void setScreenAlwaysOn (BinaryState screenAlwaysOn)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenAlwaysOn |
BinaryState |
setScreenAmbientMode
protected void setScreenAmbientMode (BinaryState screenAmbientMode)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenAmbientMode |
BinaryState |
setScreenBrightness
protected void setScreenBrightness (Integer screenBrightness)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenBrightness |
Integer |
setScreenSaver
protected void setScreenSaver (BinaryState screenSaver)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenSaver |
BinaryState |
setScreenTimeoutSecs
protected void setScreenTimeoutSecs (Long screenTimeoutSecs)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
screenTimeoutSecs |
Long |
setTestHarness
protected void setTestHarness (boolean setTestHarness)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
setTestHarness |
boolean |
setTimezone
protected void setTimezone (String timezone)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
timezone |
String |
setTriggerMediaMounted
protected void setTriggerMediaMounted (boolean triggerMediaMounted)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
triggerMediaMounted |
boolean |
setWakeGesture
protected void setWakeGesture (BinaryState wakeGesture)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
wakeGesture |
BinaryState |
setWifiNetwork
protected void setWifiNetwork (String wifiNetwork)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
wifiNetwork |
String |
setWifiPsk
protected void setWifiPsk (String wifiPsk)
매개변수 | |
---|---|
wifiPsk |
String |
setWifiScanAlwaysEnabled
protected void setWifiScanAlwaysEnabled (BinaryState wifiScanAlwaysEnabled)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
wifiScanAlwaysEnabled |
BinaryState |
setWifiSsidToPsk
protected void setWifiSsidToPsk (wifiSssidToPsk)
매개변수 | |
---|---|
wifiSssidToPsk |
|
setWifiWatchdog
protected void setWifiWatchdog (BinaryState wifiWatchdog)
단위 테스트용으로 노출됨
매개변수 | |
---|---|
wifiWatchdog |
BinaryState |