장치 설정

public class DeviceSetup
extends BaseTargetPreparer implements IExternalDependency

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.DeviceSetup


제공된 Option 을 기반으로 테스트할 장치를 구성하는 ITargetPreparer 입니다.

'adb 루트'가 가능한 장치(일반적으로 userdebug 빌드 유형)가 필요합니다.

새 빌드가 플래시된 후에 수행되어야 합니다.

참고: 이 준비 도구는 지속적인 테스트 실험실을 위한 것이며 테스트 중인 장치가 다음 실행 전에 플래시되고 지워지는 것으로 가정합니다. 따라서 분해 중에 최소한의 정리만 수행하므로 테스트 모듈에서 사용하면 안 됩니다.

요약

필드

protected BinaryState mAirplaneMode

protected BinaryState mAutoRotate

protected BinaryState mAutoUpdateTime

protected BinaryState mAutoUpdateTimezone

protected BinaryState mBatterySaver

protected Integer mBatterySaverTrigger

protected BinaryState mBluetooth

protected BinaryState mCell

protected BinaryState mCellAutoSetting

protected BinaryState mData

protected Integer mDefaultSimData

protected Integer mDefaultSimSms

protected Integer mDefaultSimVoice

protected boolean mDisableAudio

protected BinaryState mDisableCwWifiMediator

protected boolean mDisableDalvikVerifier

protected boolean mDisableDialing

protected boolean mDisableDoze

protected boolean mEnableFullBatteryStatsHistory

protected BinaryState mEthernet

protected boolean mForceSkipRunCommands

protected boolean mForceSkipSettings

protected boolean mForceSkipSystemProps

protected MultiMap <String, String> mGlobalSettings

protected BinaryState mHideErrorDialogs

protected BinaryState mInstallNonMarketApps

protected File mLocalDataFile

protected BinaryState mLocationGps

protected BinaryState mLocationNetwork

protected long mMinExternalStorageKb

protected BinaryState mNfc

protected BinaryState mNotificationLed

protected boolean mOptimizedPropertySetting

protected File mPreviousProperties

protected String mRemoteDataPath

protected boolean mRestoreProperties

protected boolean mRestoreSettings

protected mRunCommandAfterSettings

protected mRunCommandBeforeSettings

protected BinaryState mScreenAdaptiveBrightness

protected BinaryState mScreenAlwaysOn

protected BinaryState mScreenAmbientMode

protected Integer mScreenBrightness

protected BinaryState mScreenSaver

protected Long mScreenTimeoutSecs

protected MultiMap <String, String> mSecureSettings

protected mSetProps

protected boolean mSetTestHarness

protected BinaryState mSyncTimezoneWithHost

protected MultiMap <String, String> mSystemSettings

protected String mTimezone

protected boolean mTriggerMediaMounted

protected BinaryState mWakeGesture

protected BinaryState mWifi

protected String mWifiPsk

protected BinaryState mWifiScanAlwaysEnabled

protected String mWifiSsid

protected mWifiSsidToPsk

protected BinaryState mWifiWatchdog

공개 생성자

DeviceSetup ()

공개 메소드

void changeSettings ( ITestDevice device)

장치의 설정을 변경합니다.

getDependencies ()
ITestDevice getDevice ( TestInformation testInfo)
boolean isForceSkipSystemProps ()
void processDeprecatedOptions ( ITestDevice device)

더 이상 사용되지 않는 옵션을 현재 사용되는 옵션으로 변환하여 처리합니다.

void processOptions ( ITestDevice device)

모든 Option 을 처리하고 이를 시스템 소품, 설정 또는 실행 명령으로 전환합니다.

static void setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand) setCommandForBinaryState ( BinaryState state, commands, String onCommand, String offCommand)

장치에서 실행할 ON/OFF 실행 명령을 추가하는 도우미 메서드입니다.

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)

설정 맵에 ON/OFF 설정을 추가하는 도우미 메서드입니다.

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)

이 방법은 더 이상 사용되지 않습니다. 대신 setDisableAudio(boolean) 사용하세요.

void setDeprecatedMinExternalStoreSpace (long storeSpace)

이 방법은 더 이상 사용되지 않습니다. 대신 setMinExternalStorageKb(long) 사용하세요.

void setDeprecatedSetProp (String prop)

이 방법은 더 이상 사용되지 않습니다. 대신 setProperty(String, String) 사용하세요.

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 ( wifiSssidToPsk) setWifiSsidToPsk ( wifiSssidToPsk)
void setWifiWatchdog ( BinaryState wifiWatchdog)

단위 테스트를 위해 노출됨

필드

m비행기 모드

protected BinaryState mAirplaneMode

m자동 회전

protected BinaryState mAutoRotate

m자동 업데이트 시간

protected BinaryState mAutoUpdateTime

mAutoUpdateTimezone

protected BinaryState mAutoUpdateTimezone

mBatterySaver

protected BinaryState mBatterySaver

mBatterySaver트리거

protected Integer mBatterySaverTrigger

m블루투스

protected BinaryState mBluetooth

엠셀

protected BinaryState mCell

mCell자동설정

protected BinaryState mCellAutoSetting

m데이터

protected BinaryState mData

mDefaultSimData

protected Integer mDefaultSimData

mDefaultSimSms

protected Integer mDefaultSimSms

mDefaultSimVoice

protected Integer mDefaultSimVoice

mDisableAudio

protected boolean mDisableAudio

mDisableCwWifiMediator

protected BinaryState mDisableCwWifiMediator

mDisableDalvikVerifier

protected boolean mDisableDalvikVerifier

mDisable다이얼링

protected boolean mDisableDialing

mDisableDoze

protected boolean mDisableDoze

mEnableFullBatteryStatsHistory

protected boolean mEnableFullBatteryStatsHistory

이더넷

protected BinaryState mEthernet

mForceSkipRun명령

protected boolean mForceSkipRunCommands

mForceSkip설정

protected boolean mForceSkipSettings

mForceSkipSystemProps

protected boolean mForceSkipSystemProps

m글로벌 설정

protected MultiMap<String, String> mGlobalSettings

mHideErrorDialogs

protected BinaryState mHideErrorDialogs

mInstallNonMarketApps

protected BinaryState mInstallNonMarketApps

mLLocalData파일

protected File mLocalDataFile

mL위치Gps

protected BinaryState mLocationGps

M위치네트워크

protected BinaryState mLocationNetwork

mMin외부 스토리지Kb

protected long mMinExternalStorageKb

mNFC

protected BinaryState mNfc

m알림 주도

protected BinaryState mNotificationLed

mOptimizedPropertySetting

protected boolean mOptimizedPropertySetting

m이전속성

protected File mPreviousProperties

mRemoteDataPath

protected String mRemoteDataPath

mRestore속성

protected boolean mRestoreProperties

m복원설정

protected boolean mRestoreSettings

mRunCommandAfterSettings

protected  mRunCommandAfterSettings

mRunCommandBefore설정

protected  mRunCommandBeforeSettings

mScreenAdaptiveBrightness

protected BinaryState mScreenAdaptiveBrightness

m화면항상 켜짐

protected BinaryState mScreenAlwaysOn

m화면주변 모드

protected BinaryState mScreenAmbientMode

m화면 밝기

protected Integer mScreenBrightness

m화면보호기

protected BinaryState mScreenSaver

mScreenTimeoutSecs

protected Long mScreenTimeoutSecs

m보안설정

protected MultiMap<String, String> mSecureSettings

mSetProps

protected  mSetProps

mSetTestHarness

protected boolean mSetTestHarness

mSyncTimezoneWithHost

protected BinaryState mSyncTimezoneWithHost

m시스템 설정

protected MultiMap<String, String> mSystemSettings

m시간대

protected String mTimezone

mTriggerMedia마운트됨

protected boolean mTriggerMediaMounted

mWakeGesture

protected BinaryState mWakeGesture

m와이파이

protected BinaryState mWifi

m와이파이Psk

protected String mWifiPsk

mWifiScanAlwaysEnabled

protected BinaryState mWifiScanAlwaysEnabled

mWifiSsid

protected String mWifiSsid

mWifiSsidToPsk

protected  mWifiSsidToPsk

m와이파이워치독

protected BinaryState mWifiWatchdog

공개 생성자

장치 설정

public DeviceSetup ()

공개 메소드

설정 변경

public void changeSettings (ITestDevice device)

장치의 설정을 변경합니다.

하위 클래스가 재정의될 수 있도록 노출됩니다.

매개변수
device ITestDevice : ITestDevice

던지기
DeviceNotAvailableException 장치를 사용할 수 없는 경우
TargetSetupError 설정을 하는 데 실패한 경우

getDependency

public  getDependencies ()

보고

getDevice

public ITestDevice getDevice (TestInformation testInfo)

매개변수
testInfo TestInformation

보고
ITestDevice

isForceSkipSystemProps

public boolean isForceSkipSystemProps ()

보고
boolean

processDeprecated옵션

public void processDeprecatedOptions (ITestDevice device)

더 이상 사용되지 않는 옵션을 현재 사용되는 옵션으로 변환하여 처리합니다.

이 방법은 다른 처리 방법보다 먼저 실행되어야 합니다. 더 이상 사용되지 않는 옵션이 더 이상 사용되지 않는 지정된 옵션을 재정의하는 경우 TargetSetupError 발생합니다.

매개변수
device ITestDevice

던지기
TargetSetupError 갈등이 있는 경우

프로세스옵션

public void processOptions (ITestDevice device)

모든 Option 을 처리하고 이를 시스템 소품, 설정 또는 실행 명령으로 전환합니다. 현재는 장치에서 어떤 명령도 실행하지 않습니다.

하위 클래스가 이를 재정의할 수 있도록 노출됩니다.

매개변수
device ITestDevice : ITestDevice

던지기
DeviceNotAvailableException 장치를 사용할 수 없는 경우
TargetSetupError Option 이 충돌하는 경우

setCommandForBinaryState

public static void setCommandForBinaryState (BinaryState state, 
                 commands, 
                String onCommand, 
                String offCommand)

장치에서 실행할 ON/OFF 실행 명령을 추가하는 도우미 메서드입니다.

매개변수
state BinaryState : BinaryState

commands : on 또는 off 명령을 추가할 명령 목록입니다.

onCommand String : ON일 때 실행할 명령입니다. 명령이 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)

설정 맵에 ON/OFF 설정을 추가하는 도우미 메서드입니다.

매개변수
state BinaryState : BinaryState

settingsMap MultiMap : 설정을 저장하는 데 사용되는 MultiMap .

setting String : 설정 키

onValue String : ON일 때의 값

offValue String : OFF일 때의 값

setSystemSetting

public void setSystemSetting (String key, 
                String value)

단위 테스트를 위해 노출됨

매개변수
key String

value String

설정

public void setUp (TestInformation testInfo)

매개변수
testInfo TestInformation

던지기
BuildError
DeviceNotAvailableException
TargetSetupError

분해

public void tearDown (TestInformation testInfo, 
                Throwable e)

매개변수
testInfo TestInformation

e Throwable

던지기
DeviceNotAvailableException

보호된 방법

setAirplaneMode

protected void setAirplaneMode (BinaryState airplaneMode)

단위 테스트를 위해 노출됨

매개변수
airplaneMode BinaryState

자동 회전 설정

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

setBatterySaver트리거

protected void setBatterySaverTrigger (Integer batterySaverTrigger)

단위 테스트를 위해 노출됨

매개변수
batterySaverTrigger Integer

블루투스 설정

protected void setBluetooth (BinaryState bluetooth)

단위 테스트를 위해 노출됨

매개변수
bluetooth BinaryState

세트셀

protected void setCell (BinaryState cell)

매개변수
cell BinaryState

setCellAutoSetting

protected void setCellAutoSetting (BinaryState cellAutoSetting)

매개변수
cellAutoSetting BinaryState

데이터 세트

protected void setData (BinaryState data)

매개변수
data 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)

이 방법은 더 이상 사용되지 않습니다.
대신 setDisableAudio(boolean) 사용하세요.

단위 테스트를 위해 노출됨

매개변수
silent boolean

setDeprecatedMinExternalStoreSpace

protected void setDeprecatedMinExternalStoreSpace (long storeSpace)

이 방법은 더 이상 사용되지 않습니다.
대신 setMinExternalStorageKb(long) 사용하세요.

단위 테스트를 위해 노출됨

매개변수
storeSpace long

setDeprecatedSetProp

protected void setDeprecatedSetProp (String prop)

이 방법은 더 이상 사용되지 않습니다.
대신 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

setDisable다이얼링

protected void setDisableDialing (boolean disableDialing)

단위 테스트를 위해 노출됨

매개변수
disableDialing boolean

setDisableDoze

protected void setDisableDoze (boolean disableDoze)

단위 테스트를 위해 노출됨

매개변수
disableDoze boolean

setEnableFullBatteryStatsHistory

protected void setEnableFullBatteryStatsHistory (boolean enableFullBatteryStatsHistory)

단위 테스트를 위해 노출됨

매개변수
enableFullBatteryStatsHistory boolean

이더넷 설정

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

setLocation네트워크

protected void setLocationNetwork (BinaryState locationNetwork)

단위 테스트를 위해 노출됨

매개변수
locationNetwork BinaryState

setMinExternalStorageKb

protected void setMinExternalStorageKb (long storageKb)

단위 테스트를 위해 노출됨

매개변수
storageKb long

Nfc 설정

protected void setNfc (BinaryState nfc)

단위 테스트를 위해 노출됨

매개변수
nfc BinaryState

setNotificationLed

protected void setNotificationLed (BinaryState notificationLed)

단위 테스트를 위해 노출됨

매개변수
notificationLed BinaryState

setProperty

protected void setProperty (String key, 
                String value)

단위 테스트를 위해 노출됨

매개변수
key String

value String

setRestore속성

protected void setRestoreProperties (boolean restoreProperties)

단위 테스트를 위해 노출됨

매개변수
restoreProperties boolean

setRestore설정

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

화면 보호기 설정

protected void setScreenSaver (BinaryState screenSaver)

단위 테스트를 위해 노출됨

매개변수
screenSaver BinaryState

setScreenTimeoutSecs

protected void setScreenTimeoutSecs (Long screenTimeoutSecs)

단위 테스트를 위해 노출됨

매개변수
screenTimeoutSecs Long

setTestHarness

protected void setTestHarness (boolean setTestHarness)

단위 테스트를 위해 노출됨

매개변수
setTestHarness boolean

시간대 설정

protected void setTimezone (String timezone)

단위 테스트를 위해 노출됨

매개변수
timezone String

setTriggerMediaMounted

protected void setTriggerMediaMounted (boolean triggerMediaMounted)

단위 테스트를 위해 노출됨

매개변수
triggerMediaMounted boolean

setWakeGesture

protected void setWakeGesture (BinaryState wakeGesture)

단위 테스트를 위해 노출됨

매개변수
wakeGesture BinaryState

Wi-Fi 설정

protected void setWifi (BinaryState wifi)

단위 테스트를 위해 노출됨

매개변수
wifi BinaryState

Wi-Fi네트워크 설정

protected void setWifiNetwork (String wifiNetwork)

단위 테스트를 위해 노출됨

매개변수
wifiNetwork String

Wi-FiPsk 설정

protected void setWifiPsk (String wifiPsk)

매개변수
wifiPsk String

setWifiScanAlwaysEnabled

protected void setWifiScanAlwaysEnabled (BinaryState wifiScanAlwaysEnabled)

단위 테스트를 위해 노출됨

매개변수
wifiScanAlwaysEnabled BinaryState

setWifiSsidToPsk

protected void setWifiSsidToPsk ( wifiSssidToPsk)

매개변수
wifiSssidToPsk

Wi-FiWatchdog 설정

protected void setWifiWatchdog (BinaryState wifiWatchdog)

단위 테스트를 위해 노출됨

매개변수
wifiWatchdog BinaryState