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 : 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)
設定マップへのオン/オフ設定の追加を行うヘルパー メソッド。
パラメータ | |
---|---|
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 |
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)
このメソッドは非推奨です。
代わりに 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 |
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 |