デバイス設定

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 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 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)

単体テスト用に公開

田畑

飛行機モード

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

イーサネット

protected BinaryState mEthernet

mForceSkipRunCommands

protected boolean mForceSkipRunCommands

mForceSkipSettings

protected boolean mForceSkipSettings

mForceSkipSystemProps

protected boolean mForceSkipSystemProps

mGlobalSettings

protected MultiMap<String, String> mGlobalSettings

mInstallNonMarketApps

protected BinaryState mInstallNonMarketApps

mLocalDataFile

protected File mLocalDataFile

mLocationGps

protected BinaryState mLocationGps

mロケーションネットワーク

protected BinaryState mLocationNetwork

mMinExternalStorageKb

protected long mMinExternalStorageKb

mNfc

protected BinaryState mNfc

mNotificationLed

protected BinaryState mNotificationLed

mOptimizedPropertySetting

protected boolean mOptimizedPropertySetting

m前のプロパティ

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

mスクリーンセーバー

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

mタイムゾーン

protected String mTimezone

mTriggerMediaMounted

protected boolean mTriggerMediaMounted

mWakeGesture

protected BinaryState mWakeGesture

無線LAN

protected BinaryState mWifi

mWifiPsk

protected String mWifiPsk

mWifiScanAlwaysEnabled

protected BinaryState mWifiScanAlwaysEnabled

mWifiSsid

protected String mWifiSsid

mWifiSsidToPsk

protected  mWifiSsidToPsk

mWifiウォッチドッグ

protected BinaryState mWifiWatchdog

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

デバイス設定

public DeviceSetup ()

公開メソッド

設定を変更する

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競合がある場合

プロセスオプション

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

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

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

プロパティの設定

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