DeviceSetup
public
class
DeviceSetup
extends BaseTargetPreparer
implements
IExternalDependency
| java.lang.Object | ||
| ↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
| ↳ | com.android.tradefed.targetprep.DeviceSetup | |
提供された Option に基づいてテスト用にデバイスを構成する ITargetPreparer。
通常は userdebug ビルドタイプで、adb root が可能なデバイスが必要です。
新しいビルドのフラッシュ後に実行する必要があります。
注: この準備ツールは継続的テストラボを対象としており、テスト対象デバイスは次の実行前にフラッシュされ、ワイプされることを前提としています。そのため、ティアダウン時に最小限のクリーンアップしか行わず、テスト モジュールで使用すべきではありません。
概要
パブリック コンストラクタ | |
|---|---|
DeviceSetup()
|
|
パブリック メソッド | |
|---|---|
void
|
changeSettings(ITestDevice device)
デバイスの設定を変更します。 |
Set<ExternalDependency>
|
getDependencies()
|
ITestDevice
|
getDevice(TestInformation testInfo)
|
boolean
|
isForceSkipSystemProps()
|
void
|
processDeprecatedOptions(ITestDevice device)
非推奨のオプションを処理し、現在使用されているオプションに変換します。 |
void
|
processOptions(ITestDevice device)
すべての |
static
void
|
setCommandForBinaryState(BinaryState state, List<String> commands, String onCommand, String offCommand)
デバイスで実行されるオン/オフの実行コマンドを追加するヘルパー メソッド。 |
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(Map<String, String> wifiSssidToPsk)
|
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
protected List<String> mRunCommandAfterSettings
mRunCommandBeforeSettings
protected List<String> mRunCommandBeforeSettings
mScreenBrightness
protected Integer mScreenBrightness
mScreenTimeoutSecs
protected Long mScreenTimeoutSecs
mSetProps
protected Map<String, String> mSetProps
mSetTestHarness
protected boolean mSetTestHarness
mTimezone
protected String mTimezone
mTriggerMediaMounted
protected boolean mTriggerMediaMounted
mWifiPsk
protected String mWifiPsk
mWifiSsid
protected String mWifiSsid
mWifiSsidToPsk
protected Map<String, String> mWifiSsidToPsk
パブリック コンストラクタ
DeviceSetup
public DeviceSetup ()
パブリック メソッド
changeSettings
public void changeSettings (ITestDevice device)
デバイスの設定を変更します。
子クラスがオーバーライドできるように公開されています。
| パラメータ | |
|---|---|
device |
ITestDevice: ITestDevice |
| 例外 | |
|---|---|
DeviceNotAvailableException |
デバイスが利用できない場合 |
TargetSetupError |
設定の設定に失敗した場合 |
getDependencies
public Set<ExternalDependency> getDependencies ()
| 戻り値 | |
|---|---|
Set<ExternalDependency> |
|
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, List<String> commands, String onCommand, String offCommand)
デバイスで実行されるオン/オフの実行コマンドを追加するヘルパー メソッド。
| パラメータ | |
|---|---|
state |
BinaryState: BinaryState |
commands |
List: オンまたはオフのコマンドを追加するコマンドのリスト。 |
onCommand |
String: ON の場合に実行するコマンド。コマンドが null の場合は無視されます。 |
offCommand |
String: オフの場合に実行するコマンド。コマンドが 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: オフの場合の値 |
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 |
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 (Map<String, String> wifiSssidToPsk)
| パラメータ | |
|---|---|
wifiSssidToPsk |
Map |
setWifiWatchdog
protected void setWifiWatchdog (BinaryState wifiWatchdog)
単体テスト用に公開
| パラメータ | |
|---|---|
wifiWatchdog |
BinaryState |