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 ビルドタイプ)が必要です。

新しいビルドがフラッシュされたに行う必要があります。

注: この準備ツールは継続的テストラボを対象としており、テスト対象デバイスが次の実行前にフラッシュされ、ワイプされることを前提としています。そのため、破棄時に行うクリーンアップは最小限であり、テスト モジュールでは使用しないでください。

概要

フィールド

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)

デバイスで実行されるオン/オフ実行コマンドを追加するヘルパー メソッド。

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)

このメソッドは非推奨です。 代わりに 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)
void setWifiWatchdog(BinaryState wifiWatchdog)

単体テスト用に公開

フィールド

mAirplaneMode

protected BinaryState mAirplaneMode

mAutoRotate

protected BinaryState mAutoRotate

mAutoUpdateTime

protected BinaryState mAutoUpdateTime

mAutoUpdateTimezone

protected BinaryState mAutoUpdateTimezone

mBatterySaver

protected BinaryState mBatterySaver

mBatterySaverTrigger

protected Integer mBatterySaverTrigger

mBluetooth

protected BinaryState mBluetooth

mCell

protected BinaryState mCell

mCellAutoSetting

protected BinaryState mCellAutoSetting

mData

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

mDisableDialing

protected boolean mDisableDialing

mDisableDoze

protected boolean mDisableDoze

mEnableFullBatteryStatsHistory

protected boolean mEnableFullBatteryStatsHistory

mEthernet

protected BinaryState mEthernet

mForceSkipRunCommands

protected boolean mForceSkipRunCommands

mForceSkipSettings

protected boolean mForceSkipSettings

mForceSkipSystemProps

protected boolean mForceSkipSystemProps

mGlobalSettings

protected MultiMap<String, String> mGlobalSettings

mHideErrorDialogs

protected BinaryState mHideErrorDialogs

mInstallNonMarketApps

protected BinaryState mInstallNonMarketApps

mLocalDataFile

protected File mLocalDataFile

mLocationGps

protected BinaryState mLocationGps

mLocationNetwork

protected BinaryState mLocationNetwork

mMinExternalStorageKb

protected long mMinExternalStorageKb

mNfc

protected BinaryState mNfc

mNotificationLed

protected BinaryState mNotificationLed

mOptimizedPropertySetting

protected boolean mOptimizedPropertySetting

mPreviousProperties

protected File mPreviousProperties

mRemoteDataPath

protected String mRemoteDataPath

mRestoreProperties

protected boolean mRestoreProperties

mRestoreSettings

protected boolean mRestoreSettings

mRunCommandAfterSettings

protected  mRunCommandAfterSettings

mRunCommandBeforeSettings

protected  mRunCommandBeforeSettings

mScreenAdaptiveBrightness

protected BinaryState mScreenAdaptiveBrightness

mScreenAlwaysOn

protected BinaryState mScreenAlwaysOn

mScreenAmbientMode

protected BinaryState mScreenAmbientMode

mScreenBrightness

protected Integer mScreenBrightness

mScreenSaver

protected BinaryState mScreenSaver

mScreenTimeoutSecs

protected Long mScreenTimeoutSecs

mSecureSettings

protected MultiMap<String, String> mSecureSettings

mSetProps

protected  mSetProps

mSetTestHarness

protected boolean mSetTestHarness

mSyncTimezoneWithHost

protected BinaryState mSyncTimezoneWithHost

mSystemSettings

protected MultiMap<String, String> mSystemSettings

mTimezone

protected String mTimezone

mTriggerMediaMounted

protected boolean mTriggerMediaMounted

mWakeGesture

protected BinaryState mWakeGesture

mWifi

protected BinaryState mWifi

mWifiPsk

protected String mWifiPsk

mWifiScanAlwaysEnabled

protected BinaryState mWifiScanAlwaysEnabled

mWifiSsid

protected String mWifiSsid

mWifiSsidToPsk

protected  mWifiSsidToPsk

mWifiWatchdog

protected BinaryState mWifiWatchdog

パブリック コンストラクタ

DeviceSetup

public DeviceSetup ()

パブリック メソッド

changeSettings

public void changeSettings (ITestDevice device)

デバイスの設定を変更します。

子クラスがオーバーライドできるように公開されています。

パラメータ
device ITestDevice: ITestDevice

例外
DeviceNotAvailableException デバイスが利用できない場合
TargetSetupError 設定の設定中にエラーが発生した場合

getDependencies

public  getDependencies ()

戻り値

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

setCell

protected void setCell (BinaryState cell)

パラメータ
cell BinaryState

setCellAutoSetting

protected void setCellAutoSetting (BinaryState cellAutoSetting)

パラメータ
cellAutoSetting BinaryState

setData

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

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

setNfc

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

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

setWifi

protected void setWifi (BinaryState wifi)

単体テスト用に公開されている

パラメータ
wifi 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