নেটিভ ডিভাইস
public class NativeDevice
extends Object
implements IManagedTestDevice , IConfigurationReceiver , ITestLoggerReceiver
java.lang.অবজেক্ট | |
↳ | com.android.tradefed.device.NativeDevice |
একটি ITestDevice
নন-ফুল স্ট্যাক অ্যান্ড্রয়েড ডিভাইসের ডিফল্ট বাস্তবায়ন।
সারসংক্ষেপ
নেস্টেড ক্লাস | |
---|---|
class | NativeDevice.AdbAction একটি OS 'adb....' কমান্ড চালানোর জন্য একটি |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction একটি ডিভাইস রিবুট করার জন্য |
ধ্রুবক | |
---|---|
int | INVALID_USER_ID যেকোন অবৈধ/পাওয়া যায়নি ব্যবহারকারী আইডির জন্য মান ফেরত: UserHandle -10000 মানকে সংজ্ঞায়িত করেছে |
long | MAX_HOST_DEVICE_TIME_OFFSET |
int | MAX_RETRY_ATTEMPTS কমান্ড পুনঃপ্রচেষ্টার ডিফল্ট সংখ্যা সঞ্চালনের জন্য |
ক্ষেত্র | |
---|---|
protected static final String | SD_CARD |
protected static final String | STORAGE_EMULATED |
protected TestDeviceOptions | mOptions |
protected final IDeviceStateMonitor | mStateMonitor
|
পাবলিক কনস্ট্রাক্টর | |
---|---|
NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor) একটি |
পাবলিক পদ্ধতি | |
---|---|
void | batchPrefetchStartupBuildProps () প্রতিটির জন্য 'adb getprop' কল করার পরিবর্তে আমাদের প্রয়োজনীয় সমস্ত প্রপস প্রিফেচ করে মাইক্রো অপ্টিমাইজেশান (প্রায় 400 মিলি)। |
boolean | canSwitchToHeadlessSystemUser () হেডলেস সিস্টেম ব্যবহারকারীর কাছে স্যুইচ করার অনুমতি আছে কিনা তা ফেরত দেয়। |
boolean | checkApiLevelAgainstNextRelease (int strictMinLevel) একটি ন্যূনতম সমর্থিত স্তরে একটি বৈশিষ্ট্য বর্তমানে সমর্থিত কিনা তা পরীক্ষা করুন। |
boolean | checkConnectivity () ডিভাইসের নেটওয়ার্ক সংযোগ আছে কিনা পরীক্ষা করুন। |
boolean | clearErrorDialogs () ডিভাইস UI-তে বর্তমানে প্রদর্শিত কোনো ত্রুটি ডায়ালগ খারিজ করার চেষ্টা করুন। |
void | clearLastConnectedWifiNetwork () শেষ সংযুক্ত ওয়াইফাই নেটওয়ার্ক সাফ করে। |
void | clearLogcat () কোনো জমে থাকা লগক্যাট ডেটা মুছে দেয়। |
boolean | connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে। |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk) একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে। |
boolean | connectToWifiNetwork ( wifiSsidToPsk) connectToWifiNetwork ( wifiSsidToPsk) একটি wifi network.f এর সাথে সংযোগ করে |
boolean | connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid) একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে। |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid) |
boolean | connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk) |
int | createUser (String name, boolean guest, boolean ephemeral) একটি প্রদত্ত নাম এবং প্রদত্ত পতাকা সহ একটি ব্যবহারকারী তৈরি করুন৷ |
int | createUser (String name, boolean guest, boolean ephemeral, boolean forTesting) একটি প্রদত্ত নাম এবং প্রদত্ত পতাকা সহ একটি ব্যবহারকারী তৈরি করুন৷ |
int | createUser (String name) একটি প্রদত্ত নাম এবং ডিফল্ট পতাকা 0 সহ একটি ব্যবহারকারী তৈরি করুন৷ |
int | createUserNoThrow (String name) একটি প্রদত্ত নাম এবং ডিফল্ট পতাকা 0 সহ একটি ব্যবহারকারী তৈরি করুন৷ |
void | deleteFile (String deviceFilePath) ডিভাইসে একটি ফাইল বা ডিরেক্টরি মুছে ফেলার জন্য সহায়ক পদ্ধতি। |
void | deregisterDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) নিবন্ধিত |
boolean | deviceSoftRestarted ( ProcessInfo prevSystemServerProcess) পূর্ববর্তী system_server |
boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) ডিভাইস থেকে ইউটিসি সময় থেকে যুগ থেকে ডিভাইস সফ্ট-রিস্টার্ট হয়েছে কিনা এবং এর |
boolean | disableAdbRoot () অ্যাডবি রুট বন্ধ করে। |
void | disableKeyguard () কীগার্ড নিষ্ক্রিয় করার প্রচেষ্টা। |
boolean | disableNetworkMonitor () ডিভাইসে নেটওয়ার্ক পর্যবেক্ষণ অক্ষম করে। |
boolean | disconnectFromWifi () একটি ওয়াইফাই নেটওয়ার্ক থেকে সংযোগ বিচ্ছিন্ন হয়। |
boolean | doesFileExist (String deviceFilePath, int userId) একটি প্রদত্ত ব্যবহারকারীর জন্য ডিভাইসে ফাইল বিদ্যমান কিনা তা নির্ধারণ করতে সাহায্যকারী পদ্ধতি। |
boolean | doesFileExist (String deviceFilePath) ডিভাইসে ফাইল আছে কিনা তা নির্ধারণ করতে সহায়ক পদ্ধতি। |
File | dumpHeap (String process, String devicePath) সিস্টেম_সার্ভার থেকে গাদা ডাম্প করার চেষ্টা করুন। |
boolean | enableAdbRoot () অ্যাডবি রুট চালু করে। |
boolean | enableNetworkMonitor () ডিভাইসে নেটওয়ার্ক পর্যবেক্ষণ সক্ষম করে। |
String | executeAdbCommand (long timeout, String... cmdArgs) সহায়ক পদ্ধতি যা একটি নির্দিষ্ট সময়সীমার সাথে একটি সিস্টেম কমান্ড হিসাবে একটি adb কমান্ড কার্যকর করে। |
String | executeAdbCommand (long timeout, envMap, String... cmdArgs) executeAdbCommand (long timeout, envMap, String... cmdArgs) সহায়ক পদ্ধতি যা একটি নির্দিষ্ট সময়সীমার সাথে একটি সিস্টেম কমান্ড হিসাবে একটি adb কমান্ড কার্যকর করে। |
String | executeAdbCommand (String... cmdArgs) সহায়ক পদ্ধতি যা একটি adb কমান্ডকে সিস্টেম কমান্ড হিসাবে কার্যকর করে। |
CommandResult | executeFastbootCommand (String... cmdArgs) হেল্পার পদ্ধতি যা 2 মিনিটের ডিফল্ট টাইমআউট সহ একটি সিস্টেম কমান্ড হিসাবে একটি ফাস্টবুট কমান্ড কার্যকর করে। |
CommandResult | executeFastbootCommand (long timeout, String... cmdArgs) সহায়ক পদ্ধতি যা একটি সিস্টেম কমান্ড হিসাবে একটি ফাস্টবুট কমান্ড কার্যকর করে। |
CommandResult | executeLongFastbootCommand (String... cmdArgs) হেল্পার পদ্ধতি যা একটি দীর্ঘ চলমান ফাস্টবুট কমান্ডকে সিস্টেম কমান্ড হিসাবে কার্যকর করে। |
CommandResult | executeLongFastbootCommand ( envVarMap, String... cmdArgs) executeLongFastbootCommand ( envVarMap, String... cmdArgs) হেল্পার পদ্ধতি যা সিস্টেম এনভায়রনমেন্ট ভেরিয়েবল সহ একটি সিস্টেম কমান্ড হিসাবে একটি দীর্ঘ চলমান ফাস্টবুট কমান্ড কার্যকর করে। |
String | executeShellCommand (String command) সাহায্যকারী পদ্ধতি যা একটি adb শেল কমান্ড কার্যকর করে এবং |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
void | executeShellCommand (String command, IShellOutputReceiver receiver) প্রদত্ত adb শেল কমান্ড কার্যকর করে, কমান্ড ব্যর্থ হলে একাধিকবার পুনরায় চেষ্টা করে। |
CommandResult | executeShellV2Command (String cmd) হেল্পার পদ্ধতি যা একটি adb শেল কমান্ড কার্যকর করে এবং কমান্ড স্ট্যাটাস আউটপুট, stdout এবং stderr সহ সঠিকভাবে |
CommandResult | executeShellV2Command (String cmd, OutputStream pipeToOutput) হেল্পার পদ্ধতি যা একটি adb শেল কমান্ড কার্যকর করে এবং কমান্ড স্ট্যাটাস আউটপুট এবং stderr এর সাথে সঠিকভাবে |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput) হেল্পার পদ্ধতি যা একটি adb শেল কমান্ড কার্যকর করে এবং কমান্ড স্ট্যাটাস আউটপুট, stdout এবং stderr সহ সঠিকভাবে |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
CommandResult | executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
CommandResult | executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) কমান্ড আচরণ নিয়ন্ত্রণ করতে আরো পরামিতি সহ একটি adb শেল কমান্ড কার্যকর করে। |
CommandResult | fastbootWipePartition (String partition) সাহায্যকারী পদ্ধতি যা ডিভাইসের জন্য একটি পার্টিশন মুছে দেয়। |
getActiveApexes () ডিভাইসে সক্রিয় APEXes সম্পর্কে তথ্য আনুন। | |
getAllSettings (String namespace) অনুরোধ করা নামস্থানের মূল মান জোড়া ফেরত দিন। | |
DeviceAllocationState | getAllocationState () ডিভাইসের বর্তমান বরাদ্দ অবস্থা ফেরত দিন |
String | getAndroidId (int userId) একটি userId-এর সাথে যুক্ত android-আইডি খুঁজুন এবং ফেরত দিন, যদি না পাওয়া যায় তাহলে শূন্য। |
getAndroidIds () ব্যবহারকারী আইডিগুলির সাথে মিলে যাওয়া অ্যান্ড্রয়েড আইডিগুলির একটি মানচিত্র তৈরি করুন৷ | |
int | getApiLevel () ডিভাইস API লেভেল পান। |
PackageInfo | getAppPackageInfo (String packageName) ডিভাইসে ইনস্টল করা একটি প্যাকেজ সম্পর্কে তথ্য আনুন। |
getAppPackageInfos () ডিভাইসে ইনস্টল করা প্যাকেজের তথ্য আনুন। | |
String | getBasebandVersion () এই ডিভাইসের বেসব্যান্ড (রেডিও) সংস্করণ পেতে সুবিধার পদ্ধতি। |
Integer | getBattery () একটি ডিভাইসের বর্তমান ব্যাটারি স্তর বা ব্যাটারি স্তর অনুপলব্ধ হলে শূন্য প্রদান করে৷ |
boolean | getBooleanProperty (String name, boolean defaultValue) প্রদত্ত সম্পত্তির বুলিয়ান মান প্রদান করে। |
getBootHistory () হেল্পার পদ্ধতি বুট সময় এবং বুট কারণ সহ বুট ইতিহাস মানচিত্র সংগ্রহ করে। | |
getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) হেল্পার মেথড বুট টাইম এবং বুট কারণ সহ বুট হিস্ট্রি ম্যাপ সংগ্রহ করে ডিভাইস থেকে epoch থেকে প্রদত্ত সময় এবং নির্দিষ্ট সময় ইউনিট। | |
String | getBootloaderVersion () এই ডিভাইসের বুটলোডার সংস্করণ পেতে সুবিধার পদ্ধতি। |
InputStreamSource | getBugreport () ডিভাইস থেকে একটি বাগ রিপোর্ট পুনরুদ্ধার করে। |
InputStreamSource | getBugreportz () ডিভাইস থেকে একটি বাগ রিপোর্ট পুনরুদ্ধার করে। |
String | getBuildAlias () ডিভাইসটি বর্তমানে চলমান বিল্ডের উপনাম পুনরুদ্ধার করুন। |
String | getBuildFlavor () ডিভাইসের জন্য বিল্ড ফ্লেভার পুনরুদ্ধার করুন। |
String | getBuildId () ডিভাইসটি বর্তমানে চলমান বিল্ডটি পুনরুদ্ধার করুন। |
String | getBuildSigningKeys () ডিভাইস ইমেজ সাইন ইন করতে ব্যবহৃত কী টাইপ প্রদান করে সাধারণত অ্যান্ড্রয়েড ডিভাইসগুলি টেস্ট-কি (যেমন AOSP-তে) বা রিলিজ-কি (ব্যক্তিগত ডিভাইস নির্মাতাদের দ্বারা নিয়ন্ত্রিত) দিয়ে স্বাক্ষরিত হতে পারে |
DeviceDescriptor | getCachedDeviceDescriptor () ডিভাইসটি বরাদ্দ করা হলে একটি ক্যাশ করা |
DeviceDescriptor | getCachedDeviceDescriptor (boolean shortDescriptor) ডিভাইসটি বরাদ্দ করা হলে একটি ক্যাশ করা |
String[] | getChildren (String path) |
AbstractConnection | getConnection () ডিভাইসের সাথে যুক্ত বর্তমান সংযোগ। |
DeviceFoldableState | getCurrentFoldableState () ডিভাইসের বর্তমান ভাঁজযোগ্য অবস্থা ফেরত দেয় বা কিছু সমস্যা হলে শূন্য করে। |
int | getCurrentUser () বর্তমান চলমান ব্যবহারকারীর আইডি ফেরত দিন। |
String | getDeviceClass () ডিভাইস ক্লাস পান। |
long | getDeviceDate () যুগ থেকে মিলিসেকেন্ডে ডিভাইসের তারিখ ফেরত দিন। |
DeviceDescriptor | getDeviceDescriptor () প্রকৃত ডিভাইস অবজেক্টটি পাস না করে এটিতে তথ্য পেতে ডিভাইসের তথ্য থেকে একটি |
DeviceDescriptor | getDeviceDescriptor (boolean shortDescriptor) প্রকৃত ডিভাইস অবজেক্টটি পাস না করে এটিতে তথ্য পেতে ডিভাইসের তথ্য থেকে একটি |
TestDeviceState | getDeviceState () ডিভাইসের অবস্থা পান। |
long | getDeviceTimeOffset (Date date) ডিভাইস এবং একটি প্রদত্ত |
InputStreamSource | getEmulatorOutput () এমুলেটর stdout এবং stderr এর স্ট্রীম পান |
Process | getEmulatorProcess () এই এমুলেটরের সাথে সম্পর্কিত |
final File | getExecuteShellCommandLog () যে লগটিতে সমস্ত |
long | getExternalStoreFreeSpace () ডিভাইসের বাহ্যিক সঞ্চয়স্থানে খালি স্থানের পরিমাণ নির্ধারণ করতে সহায়ক পদ্ধতি। |
String | getFastbootPath () ফাস্টবুট বাইনারি ব্যবহার করা পথ ফেরত দেয়। |
String | getFastbootProductType () ফাস্টবুট মোডে থাকা অবস্থায় এই ডিভাইসটির পণ্যের ধরন পেতে সুবিধার পদ্ধতি। |
String | getFastbootProductVariant () ফাস্টবুট মোডে থাকা অবস্থায় এই ডিভাইসটির পণ্যের ধরন পেতে সুবিধার পদ্ধতি। |
String | getFastbootSerialNumber () ফাস্টবুট মোড সিরিয়াল নম্বর প্রদান করে। |
String | getFastbootVariable (String variableName) ডিভাইস থেকে প্রদত্ত ফাস্টবুট পরিবর্তনশীল মান পুনরুদ্ধার করুন। |
String | getFastbootVersion () ফাস্টবুট বাইনারি ব্যবহার করা সংস্করণ স্ট্রিং প্রদান করে। |
IFileEntry | getFileEntry (String path) ডিভাইসে একটি দূরবর্তী ফাইলের একটি রেফারেন্স পুনরুদ্ধার করুন। |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) একটি নন-রুট পাথ থেকে |
getFoldableStates () ডিভাইসে ভাঁজযোগ্য অবস্থার তালিকা প্রদান করে। | |
IDevice | getIDevice () সংশ্লিষ্ট ddmlib |
getInstalledPackageNames () ডিভাইসে উপস্থিত অ্যাপ্লিকেশন প্যাকেজের নামগুলি আনুন৷ | |
long | getIntProperty (String name, long defaultValue) ডিভাইস থেকে প্রদত্ত সম্পত্তির পূর্ণসংখ্যা মান প্রদান করে। |
String | getIpAddress () ডিভাইসের আইপি ঠিকানা পায়। |
KeyguardControllerState | getKeyguardState () কীগার্ডের বর্তমান অবস্থা পেতে একটি বস্তু ফেরত দিন বা সমর্থিত না হলে নাল। |
long | getLastExpectedRebootTimeMillis () |
int | getLaunchApiLevel () ডিভাইসের প্রথম চালু API স্তর পান. |
InputStreamSource | getLogcat () লগক্যাট ডেটার একটি স্ন্যাপশট স্ট্রীম ধরে। |
InputStreamSource | getLogcat (int maxBytes) ক্যাপচার করা লগক্যাট ডেটার শেষ |
InputStreamSource | getLogcatDump () ডিভাইসের জন্য বর্তমান লগক্যাটের একটি ডাম্প পান। |
InputStreamSource | getLogcatSince (long date) প্রদত্ত তারিখ থেকে ক্যাপচার করা লগক্যাট ডেটার একটি স্ন্যাপশট স্ট্রীম ধরে। |
String | getMacAddress () ডিভাইসের MAC ঠিকানা ফেরত দেয়, যদি এটি ডিভাইস থেকে অনুসন্ধান করতে ব্যর্থ হয় তাহলে নাল। |
Integer | getMainUserId () প্রধান ব্যবহারকারী আইডি প্রদান করে। |
getMainlineModuleInfo () ডিভাইসে ইনস্টল করা মেইনলাইন মডিউল সম্পর্কে তথ্য পান। | |
int | getMaxNumberOfRunningUsersSupported () একযোগে চলমান ব্যবহারকারীদের সর্বাধিক সংখ্যক সমর্থিত পান। |
int | getMaxNumberOfUsersSupported () সর্বাধিক সংখ্যক সমর্থিত ব্যবহারকারী পান। |
Process | getMicrodroidProcess () |
IDeviceStateMonitor | getMonitor () ডিভাইসের সাথে যুক্ত |
String | getMountPoint (String mountName) একটি মাউন্ট পয়েন্ট প্রদান করে। |
ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) নির্দিষ্ট মাউন্টপয়েন্ট পাথের সাথে সম্পর্কিত একটি |
getMountPointInfo () ডিভাইসে /proc/mounts-এ তথ্যের পার্স করা সংস্করণ প্রদান করে | |
TestDeviceOptions | getOptions () ডিভাইসের জন্য পরীক্ষার বিকল্পগুলি আনুন৷ |
long | getPartitionFreeSpace (String partition) ডিভাইস পার্টিশনে খালি জায়গার পরিমাণ নির্ধারণ করতে সাহায্যকারী পদ্ধতি। |
Integer | getPrimaryUserId () প্রাথমিক ব্যবহারকারী আইডি প্রদান করে। |
ProcessInfo | getProcessByName (String processName) হেল্পার পদ্ধতি "pidof" এবং "stat" কমান্ড চালায় এবং প্রদত্ত প্রক্রিয়ার PID এবং প্রক্রিয়া শুরুর সময় সহ |
String | getProcessPid (String process) কিছু ভুল হয়ে গেলে পরিষেবার পিড বা নাল ফেরত দেয়। |
String | getProductType () এই ডিভাইসের পণ্যের ধরন পেতে সুবিধার পদ্ধতি। |
String | getProductVariant () এই ডিভাইসের পণ্য বৈকল্পিক পেতে সুবিধার পদ্ধতি. |
String | getProperty (String name) ডিভাইস থেকে প্রদত্ত সম্পত্তি মান পুনরুদ্ধার করুন. |
ITestDevice.RecoveryMode | getRecoveryMode () ডিভাইসের জন্য ব্যবহৃত বর্তমান পুনরুদ্ধার মোড পান। |
InputStreamSource | getScreenshot (String format) ডিভাইস থেকে একটি স্ক্রিনশট নেয়। |
InputStreamSource | getScreenshot (long displayId) ডিসপ্লে আইডি দেওয়া ডিভাইস থেকে একটি স্ক্রিনশট নেয়। |
InputStreamSource | getScreenshot (String format, boolean rescale) ডিভাইস থেকে একটি স্ক্রিনশট নেয়। |
InputStreamSource | getScreenshot () ডিভাইস থেকে একটি স্ক্রিনশট নেয়। |
String | getSerialNumber () এই ডিভাইসের সিরিয়াল নম্বর পেতে সুবিধার পদ্ধতি। |
String | getSetting (int userId, String namespace, String key) অনুরোধ করা সেটিং এর মান ফেরত দিন। |
String | getSetting (String namespace, String key) |
String | getSimOperator () সিম কার্ড অপারেটর ফেরত দিন বা উপলভ্য না থাকলে বা ডিভাইস উপলব্ধ না হলে নাল করুন। |
String | getSimState () সিম কার্ডের অবস্থা ফেরত দিন বা উপলভ্য না থাকলে বা ডিভাইসটি উপলভ্য না থাকলে শূন্য করুন। |
getTombstones () ডিভাইস থেকে সমাধির পাথরের তালিকা আনুন এবং ফেরত দিন। | |
long | getTotalMemory () অভ্যন্তরীণ ত্রুটির ক্ষেত্রে বাইটে মোট শারীরিক মেমরির আকার বা -1 প্রদান করে |
getUninstallablePackageNames () আনইনস্টল করা যেতে পারে এমন অ্যাপ্লিকেশন প্যাকেজের নামগুলি আনুন৷ | |
boolean | getUseFastbootErase () ডিভাইসে একটি পার্টিশন মুছতে ফাস্টবুট ইরেজ বা ফাস্টবুট ফর্ম্যাট ব্যবহার করবেন কিনা তা পান। |
int | getUserFlags (int userId) একটি প্রদত্ত ব্যবহারকারীর পতাকা খুঁজুন এবং ফেরত দিন। |
getUserInfos () ডিভাইসে UseId এর | |
int | getUserSerialNumber (int userId) যদি পাওয়া যায় তাহলে userId-এর সাথে যুক্ত সিরিয়াল নম্বরটি ফেরত দিন, অন্য কোনো ক্ষেত্রে -10000। |
IManagedTestDevice.DeviceEventResponse | handleAllocationEvent (DeviceEvent event) প্রদত্ত ডিভাইস ইভেন্টটি প্রক্রিয়া করুন। ডিভাইস ইভেন্ট প্রক্রিয়া করুন, যা এই ডিভাইসটিকে একটি নতুন বরাদ্দ অবস্থায় স্থানান্তর করতে পারে বা নাও করতে পারে। |
boolean | hasFeature (String feature) একটি ডিভাইসে একটি বৈশিষ্ট্য উপলব্ধ কিনা পরীক্ষা করুন. |
String | installPackage (File packageFile, boolean reinstall, String... extraArgs) ডিভাইসে একটি অ্যান্ড্রয়েড প্যাকেজ ইনস্টল করুন। |
String | installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs) ডিভাইসে একটি অ্যান্ড্রয়েড প্যাকেজ ইনস্টল করুন। |
String | installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs) প্রদত্ত ব্যবহারকারীর জন্য ডিভাইসে একটি Android প্যাকেজ ইনস্টল করুন৷ |
String | installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) প্রদত্ত ব্যবহারকারীর জন্য ডিভাইসে একটি Android প্যাকেজ ইনস্টল করুন৷ |
void | invalidatePropertyCache () |
boolean | isAdbRoot () |
boolean | isAdbTcp () |
boolean | isAppEnumerationSupported () ডিভাইসের প্ল্যাটফর্ম অ্যাপ গণনা সমর্থন করে কিনা তা পরীক্ষা করুন |
boolean | isBypassLowTargetSdkBlockSupported () ডিভাইসের প্ল্যাটফর্ম অ্যাপ ইনস্টলে কম লক্ষ্য sdk ব্লক বাইপাস সমর্থন করে কিনা তা পরীক্ষা করুন |
boolean | isDeviceEncrypted () ডিভাইসটি এনক্রিপ্ট করা থাকলে ফেরত দেয়। |
boolean | isDirectory (String path) ডিভাইসের পাথ একটি ডিরেক্টরি হলে True রিটার্ন করুন, অন্যথায় মিথ্যা। |
boolean | isEnableAdbRoot () |
boolean | isEncryptionSupported () ডিভাইসে এনক্রিপশন সমর্থিত হলে ফেরত দেয়। |
boolean | isExecutable (String fullPath) ডিভাইসে ফাইল পাথ একটি এক্সিকিউটেবল ফাইল হলে True ফেরত দেয়, অন্যথায় মিথ্যা। |
boolean | isFastbootEnabled () ডিভাইসের জন্য ফাস্টবুট উপলব্ধ থাকলে ফিরে যান। |
boolean | isHeadless () ডিভাইসটি হেডলেস হলে (স্ক্রিন নেই), অন্যথায় মিথ্যা হলে সত্য ফেরত দিন। |
boolean | isHeadlessSystemUserMode () ডিভাইস হেডলেস সিস্টেম ব্যবহারকারী মোড ব্যবহার করে কিনা তা ফেরত দেয়। |
boolean | isMainUserPermanentAdmin () প্রধান ব্যবহারকারী একজন স্থায়ী প্রশাসক কিনা তা ফেরত দেয় এবং মুছে ফেলা বা অ-প্রশাসক স্থিতিতে ডাউনগ্রেড করা যায় না। |
boolean | isMultiUserSupported () একাধিক ব্যবহারকারী সমর্থিত কিনা তা নির্ধারণ করে। |
boolean | isPackageInstalled (String packageName, String userId) একটি প্রদত্ত প্যাকেজের নাম এবং প্রদত্ত ব্যবহারকারী আইডির জন্য ডিভাইসটি অনুসন্ধান করুন যে এটি বর্তমানে ইনস্টল করা আছে কিনা সেই ব্যবহারকারীর জন্য নয়৷ |
boolean | isPackageInstalled (String packageName) ডিভাইসটি বর্তমানে ইনস্টল করা আছে কিনা তা পরীক্ষা করার জন্য একটি প্রদত্ত প্যাকেজ নামের জন্য অনুসন্ধান করুন৷ |
boolean | isRuntimePermissionSupported () ডিভাইসের প্ল্যাটফর্ম রানটাইম অনুমতি প্রদান সমর্থন করে কিনা তা পরীক্ষা করুন |
boolean | isStateBootloaderOrFastbootd () ডিভাইসটি |
boolean | isUserRunning (int userId) একটি প্রদত্ত ব্যবহারকারী চলমান কিনা পরীক্ষা করুন. |
boolean | isUserSecondary (int userId) নির্দিষ্ট ব্যবহারকারীর ফ্ল্যাগ অনুযায়ী সেকেন্ডারি ব্যবহারকারী কিনা তা ফেরত দিন। |
boolean | isUserVisible (int userId) প্রদত্ত ব্যবহারকারী দৃশ্যমান কিনা তা পরীক্ষা করে। |
boolean | isUserVisibleOnDisplay (int userId, int displayId) প্রদত্ত ব্যবহারকারী প্রদত্ত প্রদর্শনে দৃশ্যমান কিনা তা পরীক্ষা করে। |
boolean | isVisibleBackgroundUsersOnDefaultDisplaySupported () ডিভাইসটি ব্যবহারকারীদের |
boolean | isVisibleBackgroundUsersSupported () ডিভাইস ব্যবহারকারীদের ব্যাকগ্রাউন্ডে দৃশ্যমান শুরু করার অনুমতি দেয় কিনা তা ফেরত দেয়। |
boolean | isWifiEnabled () ওয়াইফাই সক্ষম কিনা পরীক্ষা করুন। |
listDisplayIds () "dumpsys SurfaceFlinger" দ্বারা রিপোর্ট করা ডিভাইসে উপলব্ধ ডিসপ্লে আইডির তালিকা সংগ্রহ করুন। | |
listDisplayIdsForStartingVisibleBackgroundUsers () | |
listUsers () ডিভাইসে ব্যবহারকারীদের তালিকা পায়। | |
boolean | logAnrs ( ITestLogger logger) ডিভাইস থেকে ANR সংগ্রহ করে এবং লগ করে। |
boolean | logBugreport (String dataName, ITestLogger listener) একটি বাগ রিপোর্ট নিতে এবং রিপোর্টারদের কাছে লগ করার জন্য সাহায্যকারী পদ্ধতি। |
void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) ডিভাইসের লগক্যাটে একটি বার্তা লগ করুন। |
void | nonBlockingReboot () ডিভাইস রিবুট করার জন্য একটি কমান্ড ইস্যু করে এবং কমান্ড সম্পূর্ণ হলে এবং যখন ডিভাইসটি আর adb-এর কাছে দৃশ্যমান হয় না তখন ফিরে আসে। |
void | postAdbRootAction () অ্যাডবি রুটের পরে এবং ডিভাইসটি অনলাইনে ফিরে আসার আগে ডিভাইসটির কিছু নির্দিষ্ট পদক্ষেপ নেওয়ার প্রয়োজন হলে ওভাররাইড করুন। |
void | postAdbUnrootAction () অ্যাডবি আনরুট করার পরে এবং ডিভাইসটি অনলাইনে ফিরে আসার আগে ডিভাইসটির কিছু নির্দিষ্ট পদক্ষেপ নেওয়ার প্রয়োজন হলে ওভাররাইড করুন। |
void | postBootSetup () প্রতিটি বুটের পরে পরীক্ষা করার জন্য ডিভাইস কনফিগার করার নির্দেশাবলী সম্পাদন করুন। |
void | postInvocationTearDown (Throwable exception) ডিভাইসের নির্দিষ্ট পরিচ্ছন্নতার জন্য অতিরিক্ত পদক্ষেপ যা আহ্বান সম্পন্ন হওয়ার পরে কার্যকর করা হবে। |
void | preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes) ডিভাইস নির্দিষ্ট প্রয়োজনীয় সেটআপের জন্য অতিরিক্ত পদক্ষেপ যা আমন্ত্রণ প্রবাহের আগে ডিভাইসে কার্যকর করা হবে। |
boolean | pullDir (String deviceFilePath, File localDir) বারবার ডিভাইস থেকে ডিরেক্টরি বিষয়বস্তু টানুন। |
boolean | pullFile (String remoteFilePath, File localFile) ডিভাইস বন্ধ একটি ফাইল পুনরুদ্ধার করে. |
File | pullFile (String remoteFilePath, int userId) ডিভাইস থেকে একটি ফাইল পুনরুদ্ধার করে, এটি একটি স্থানীয় অস্থায়ী |
File | pullFile (String remoteFilePath) ডিভাইস থেকে একটি ফাইল পুনরুদ্ধার করে, এটি একটি স্থানীয় অস্থায়ী |
boolean | pullFile (String remoteFilePath, File localFile, int userId) ডিভাইস বন্ধ একটি ফাইল পুনরুদ্ধার করে. |
String | pullFileContents (String remoteFilePath) ডিভাইস বন্ধ একটি ফাইল পুনরুদ্ধার করে, এবং বিষয়বস্তু ফেরত. |
File | pullFileFromExternal (String remoteFilePath) ডিভাইসের বাহ্যিক সঞ্চয়স্থান থেকে একটি ফাইল পুনরুদ্ধার করার একটি সুবিধাজনক পদ্ধতি, এটি একটি স্থানীয় অস্থায়ী |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) ফিল্টার করা কিছু ডিরেক্টরি বাদ দিয়ে বারবার ডিরেক্টরির বিষয়বস্তু ডিভাইসে পুশ করুন। |
boolean | pushDir (File localFileDir, String deviceFilePath) বারবার ডিভাইসে ডিরেক্টরি বিষয়বস্তু পুশ করুন। |
boolean | pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded) |
boolean | pushFile (File localFile, String remoteFilePath) ডিভাইসে একটি ফাইল পুশ করুন। |
boolean | pushString (String contents, String remoteFilePath) একটি স্ট্রিং থেকে ডিভাইসে তৈরি করা ফাইল পুশ করুন |
void | reboot (String reason) রিবুট জুড়ে প্রদত্ত |
void | reboot () ডিভাইসটিকে অ্যাডবি মোডে রিবুট করুন। |
void | rebootIntoBootloader () ডিভাইসটিকে বুটলোডার মোডে রিবুট করুন। |
void | rebootIntoFastbootd () ডিভাইসটিকে ফাস্টবুট মোডে রিবুট করুন। |
void | rebootIntoRecovery () ডিভাইসটিকে অ্যাডবি রিকভারি মোডে রিবুট করুন। |
void | rebootIntoSideload () ডিভাইসটিকে অ্যাডবি সাইডলোড মোডে রিবুট করুন (মনে রাখবেন যে এটি পুনরুদ্ধারের অধীনে একটি বিশেষ মোড) ডিভাইস সাইডলোড মোডে প্রবেশ না করা পর্যন্ত ব্লক করে |
void | rebootIntoSideload (boolean autoReboot) ডিভাইসটিকে অ্যাডবি সাইডলোড মোডে রিবুট করুন (মনে রাখবেন যে এটি পুনরুদ্ধারের অধীনে একটি বিশেষ মোড) ডিভাইস সাইডলোড মোডে প্রবেশ না করা পর্যন্ত ব্লক করে |
void | rebootUntilOnline () |
void | rebootUntilOnline (String reason) |
void | rebootUserspace () ডিভাইসের শুধুমাত্র ইউজারস্পেস অংশ রিবুট করে। |
void | rebootUserspaceUntilOnline () |
boolean | recoverDevice () ডিভাইস যোগাযোগ পুনরুদ্ধার করার প্রচেষ্টা. |
void | registerDeviceActionReceiver ( IDeviceActionReceiver deviceActionReceiver) এই ডিভাইসের জন্য একটি |
void | remountSystemReadOnly () ডিভাইসে সিস্টেম পার্টিশনটি শুধুমাত্র পড়ার জন্য তৈরি করুন। |
void | remountSystemWritable () ডিভাইসে সিস্টেম পার্টিশন লেখার যোগ্য করুন। |
void | remountVendorReadOnly () শুধুমাত্র পঠনযোগ্য ডিভাইসে বিক্রেতা পার্টিশন করুন। |
void | remountVendorWritable () ডিভাইসে বিক্রেতা পার্টিশন লেখার যোগ্য করুন। |
boolean | removeAdmin (String componentName, int userId) প্রদত্ত ব্যবহারকারীর প্রদত্ত ডিভাইস প্রশাসক সরান এবং সফল হলে |
void | removeOwners () সর্বোত্তম প্রচেষ্টার সাথে সমস্ত বিদ্যমান ডিভাইস প্রোফাইল মালিকদের সরান৷ |
boolean | removeUser (int userId) ডিভাইস থেকে একটি প্রদত্ত ব্যবহারকারী সরান. |
void | resetContentProviderSetup () এটিকে আবার ট্রিগার করার জন্য সামগ্রী প্রদানকারী সেটআপের জন্য পতাকাটি পুনরায় সেট করুন৷ |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) প্যারামিটার হিসাবে পাস করা এক বা একাধিক শ্রোতাদের সাথে |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) ইন্সট্রুমেন্টেশন পরীক্ষা চালায়, এবং ডিভাইস পুনরুদ্ধার প্রদান করে। |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
void | setConfiguration ( IConfiguration configuration) ব্যবহৃত |
final void | setConnectionAvdInfo ( GceAvdInfo avdInfo) |
void | setDate (Date date) ডিভাইসে তারিখ সেট করে দ্রষ্টব্য: ডিভাইসে তারিখ সেট করার জন্য রুট প্রয়োজন |
boolean | setDeviceOwner (String componentName, int userId) প্রদত্ত ব্যবহারকারীর মধ্যে ডিভাইস মালিক হিসাবে একটি ডিভাইস অ্যাডমিন উপাদান সেট করুন। |
void | setDeviceState ( TestDeviceState deviceState) ডিভাইসের অবস্থা আপডেট করুন। |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) এমুলেটরের জন্য আউটপুট লগ করার জন্য |
void | setEmulatorProcess (Process p) |
void | setFastbootEnabled (boolean fastbootEnabled) ডিভাইসের জন্য ফাস্টবুট বিকল্প সেট করুন। |
void | setFastbootPath (String fastbootPath) ফাস্টবুট বাইনারিতে পথ সেট করে যা ব্যবহার করা উচিত। |
void | setIDevice (IDevice newDevice) এই ITestDevice এর সাথে যুক্ত IDevice আপডেট করুন। |
void | setLogStartDelay (int delay) একটি অনলাইন ডিভাইসের জন্য লগক্যাট ক্যাপচার শুরু করার আগে অপেক্ষা করার জন্য ms-এ সময় সেট করে। |
void | setOptions ( TestDeviceOptions options) ডিভাইসের জন্য |
boolean | setProperty (String propKey, String propValue) ডিভাইসে প্রদত্ত সম্পত্তি মান সেট করে। |
void | setRecovery ( IDeviceRecovery recovery) এই ডিভাইসের জন্য ব্যবহার করার জন্য |
void | setRecoveryMode ( ITestDevice.RecoveryMode mode) ডিভাইসের জন্য ব্যবহার করার জন্য বর্তমান পুনরুদ্ধার মোড সেট করুন। |
void | setSetting (String namespace, String key, String value) |
void | setSetting (int userId, String namespace, String key, String value) একটি প্রদত্ত ব্যবহারকারীর নামস্থানে একটি সেটিং মান যোগ করুন। |
void | setTestLogger ( ITestLogger testLogger) |
void | setUseFastbootErase (boolean useFastbootErase) ডিভাইসে একটি পার্টিশন মুছে ফেলার জন্য fastboot ইরেজ বা fastboot বিন্যাস ব্যবহার করবেন কিনা তা সেট করুন। |
void | startLogcat () ব্যাকগ্রাউন্ডে ডিভাইস থেকে লগক্যাট আউটপুট ক্যাপচার করা শুরু করুন। |
boolean | startUser (int userId) প্রদত্ত ব্যবহারকারীকে ব্যাকগ্রাউন্ডে শুরু করে যদি এটি বর্তমানে বন্ধ থাকে। |
boolean | startUser (int userId, boolean waitFlag) প্রদত্ত ব্যবহারকারীকে ব্যাকগ্রাউন্ডে শুরু করে যদি এটি বর্তমানে বন্ধ থাকে। |
boolean | startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag) একটি প্রদত্ত ব্যবহারকারীকে ব্যাকগ্রাউন্ডে শুরু করে, প্রদত্ত ডিসপ্লেতে দৃশ্যমান (অর্থাৎ, ব্যবহারকারীকে সেই ডিসপ্লেতে ক্রিয়াকলাপ চালু করার অনুমতি দেয়)। |
void | stopEmulatorOutput () এমুলেটর আউটপুট বন্ধ করুন এবং মুছুন। |
void | stopLogcat () ডিভাইস থেকে logcat আউটপুট ক্যাপচার করা বন্ধ করুন, এবং বর্তমানে সংরক্ষিত logcat ডেটা বাতিল করুন৷ |
boolean | stopUser (int userId) প্রদত্ত ব্যবহারকারীকে থামায়। |
boolean | stopUser (int userId, boolean waitFlag, boolean forceFlag) প্রদত্ত ব্যবহারকারীকে থামান। |
String | switchToAdbTcp () ডিভাইসটিকে adb-over-tcp মোডে পরিবর্তন করুন। |
boolean | switchToAdbUsb () ইউএসবি মোডে ডিভাইসটি অ্যাডবি-তে স্যুইচ করুন। |
boolean | switchUser (int userId) ডিফল্ট টাইমআউট সহ অন্য ব্যবহারকারী আইডিতে স্যুইচ করুন। |
boolean | switchUser (int userId, long timeout) সময়সীমা হিসাবে প্রদত্ত সময়সীমা সহ অন্য ব্যবহারকারী আইডিতে স্যুইচ করুন। |
boolean | syncFiles (File localFileDir, String deviceFilePath) ডিভাইসে স্থানীয় ফাইল ডিরেক্টরির বিষয়বস্তু ক্রমবর্ধমানভাবে সিঙ্ক করে। |
Bugreport | takeBugreport () একটি বাগরিপোর্ট নিন এবং এটি পরিচালনা করতে একটি |
String | uninstallPackage (String packageName) ডিভাইস থেকে একটি অ্যান্ড্রয়েড প্যাকেজ আনইনস্টল করুন। |
String | uninstallPackageForUser (String packageName, int userId) প্রদত্ত ব্যবহারকারীর জন্য ডিভাইস থেকে একটি Android প্যাকেজ আনইনস্টল করুন৷ |
boolean | unlockDevice () ডিভাইসটি এনক্রিপ্ট করা অবস্থায় থাকলে ডিভাইসটিকে আনলক করে। |
boolean | waitForBootComplete (long timeOut) ডিভাইসের বুট সম্পূর্ণ পতাকা সেট না হওয়া পর্যন্ত ব্লক করে। |
boolean | waitForDeviceAvailable () ডিভাইসটি প্রতিক্রিয়াশীল এবং পরীক্ষার জন্য উপলব্ধ হওয়ার জন্য অপেক্ষা করে। |
boolean | waitForDeviceAvailable (long waitTime) ডিভাইসটি প্রতিক্রিয়াশীল এবং পরীক্ষার জন্য উপলব্ধ হওয়ার জন্য অপেক্ষা করে। |
boolean | waitForDeviceAvailableInRecoverPath (long waitTime) রিকভারি পাথ বিবেচনা না করে ডিভাইসটি প্রতিক্রিয়াশীল এবং উপলব্ধ হওয়ার জন্য অপেক্ষা করে। |
void | waitForDeviceBootloader () ফাস্টবুটের মাধ্যমে ডিভাইসটি দৃশ্যমান না হওয়া পর্যন্ত ব্লক করে। |
boolean | waitForDeviceInRecovery (long waitTime) ডিভাইসটিকে 'adb রিকভারি' অবস্থায় থাকার জন্য ব্লক করে (মনে রাখবেন এটি |
boolean | waitForDeviceInSideload (long waitTime) ডিভাইসটিকে 'adb sideload' অবস্থায় থাকতে ব্লক করে |
boolean | waitForDeviceNotAvailable (long waitTime) ডিভাইসটি উপলব্ধ না হওয়ার জন্য ব্লকগুলি যেমন adb থেকে অনুপস্থিত |
void | waitForDeviceOnline () ডিভাইসটি adb এর মাধ্যমে দৃশ্যমান না হওয়া পর্যন্ত ব্লক করে। |
void | waitForDeviceOnline (long waitTime) ডিভাইসটি adb এর মাধ্যমে দৃশ্যমান না হওয়া পর্যন্ত ব্লক করে। |
boolean | waitForDeviceShell (long waitTime) একটি মৌলিক adb শেল কমান্ডের জন্য ডিভাইস প্রতিক্রিয়াশীল হওয়ার জন্য অপেক্ষা করে। |
সুরক্ষিত পদ্ধতি | |
---|---|
void | addExtraConnectionBuilderArgs ( DefaultConnection.ConnectionBuilder builder) |
String[] | buildAdbShellCommand (String command, boolean forceExitStatusDetection) প্রদত্ত adb শেল কমান্ড সেশন এবং args-এর জন্য OS কমান্ড তৈরি করে |
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) একটি রিবুট ক্রিয়া সম্পাদন করার সময় ব্যবহার করার জন্য একটি |
IRunUtil | createRunUtil () |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) একটি অ্যাডবি রিবুট করুন। |
void | ensureRuntimePermissionSupported () রানটাইম অনুমতি সমর্থিত না হলে ব্যতিক্রম নিক্ষেপ করার জন্য সহায়ক পদ্ধতি |
int | getApiLevelSafe () |
ITestLogger | getLogger () |
IRunUtil | getRunUtil () ব্যবহার করার জন্য |
void | initializeConnection ( IBuildInfo info, MultiMap <String, String> attributes) |
String | internalGetProperty (String propName, String fastbootVar, String description) ডিফল্টরূপে ddmlib ক্যাশে থেকে একটি ডিভাইস প্রপার্টি আনুন এবং ডিভাইসটি Fastboot-এ আছে কি না তার উপর নির্ভর করে `adb shell getprop` অথবা `fastboot getvar`-এ ফিরে যান। |
boolean | isInRebootCallback () রিবুট কলব্যাক বর্তমানে নির্বাহ করা হচ্ছে কি না তা রিটার্ন করে। |
boolean | isNewer (File localFile, IFileEntry entry) স্থানীয় ফাইল রিমোট ফাইলের চেয়ে নতুন হলে |
void | notifyRebootEnded () রিবুট শেষ ইভেন্ট সম্পর্কে সমস্ত |
void | notifyRebootStarted () রিবুট স্টার্ট ইভেন্ট সম্পর্কে সমস্ত |
boolean | performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts) এই ডিভাইসে একটি ক্রিয়া সম্পাদন করে৷ |
void | postAdbReboot () রিবুট করার পরে সম্ভাব্য অতিরিক্ত পদক্ষেপ নেওয়া যেতে পারে। |
void | prePostBootSetup () প্রতিটি ডিভাইস প্রকার (AndroidNativeDevice, TestDevice) নির্দিষ্ট পোস্ট বুট সেটআপের জন্য এই পদ্ধতিটিকে ওভাররাইড করার অনুমতি দেয়৷ |
boolean | pullFileInternal (String remoteFilePath, File localFile) |
void | setClock (Clock clock) ব্যবহার করার জন্য ঘড়ির উদাহরণ সেট করুন। |
void | setMicrodroidProcess (Process process) TestDevice কে microdroid হিসেবে চিহ্নিত করে এবং এর CID সেট করে। |
void | setTestDeviceOptions ( deviceOptions) setTestDeviceOptions ( deviceOptions) |
CommandResult | simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) simpleFastbootCommand (long timeout, envVarMap, String[] fullCmd) এনভায়রনমেন্ট ভেরিয়েবল সহ একটি সাধারণ ফাস্টবুট কমান্ড কার্যকর করে এবং কমান্ডের অবস্থা রিপোর্ট করে। |
CommandResult | simpleFastbootCommand (long timeout, String[] fullCmd) একটি সাধারণ ফাস্টবুট কমান্ড কার্যকর করে এবং কমান্ডের স্থিতি রিপোর্ট করে। |
boolean | waitForDeviceNotAvailable (String operationDesc, long time) ডিভাইসটি অনুপলব্ধ হচ্ছে তা দেখার জন্য অপেক্ষা করুন (এডিবিতে প্রতিবেদন করা বন্ধ করুন)। |
ধ্রুবক
INVALID_USER_ID
public static final int INVALID_USER_ID
যেকোন অবৈধ/পাওয়া যায়নি ব্যবহারকারী আইডির জন্য মান ফেরত: UserHandle -10000 মানকে সংজ্ঞায়িত করেছে
ধ্রুবক মান: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
ধ্রুবক মান: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
কমান্ড পুনঃপ্রচেষ্টার ডিফল্ট সংখ্যা সঞ্চালনের জন্য
ধ্রুবক মান: 2 (0x00000002)
ক্ষেত্র
এসডি কার্ড
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
বিকল্প
protected TestDeviceOptions mOptions
পাবলিক কনস্ট্রাক্টর
নেটিভ ডিভাইস
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
একটি TestDevice
তৈরি করে।
পরামিতি | |
---|---|
device | IDevice : সংশ্লিষ্ট IDevice |
stateMonitor | IDeviceStateMonitor : ব্যবহার করার জন্য IDeviceStateMonitor প্রক্রিয়া |
allocationMonitor | IDeviceMonitor : IDeviceMonitor বরাদ্দের অবস্থার পরিবর্তন সম্পর্কে জানাতে। শূন্য হতে পারে |
পাবলিক পদ্ধতি
batchPrefetchStartupBuildProps
public void batchPrefetchStartupBuildProps ()
প্রতিটির জন্য 'adb getprop' কল করার পরিবর্তে আমাদের প্রয়োজনীয় সমস্ত প্রপস প্রিফেচ করে মাইক্রো অপ্টিমাইজেশান (প্রায় 400 মিলি)। অর্থাত্ সমস্ত বৈশিষ্ট্য আনার জন্য এটি একটি আনার মতো দ্রুত। device.getApiLevel(), checkApiLevelAgainstNextRelease এবং getBuildAlias-এর মতো জিনিসগুলি হুডের নীচে `adb getprop` কল করে৷ আমরা সেগুলিকে এক কলে নিয়ে আসি এবং NativeDevice.setProperty কল করি৷ এমনকি যদি আমরা এটি নাও করি, NativeDevice নিজেই setProperty কল করবে এবং ভবিষ্যতের কলের ফলাফল ক্যাশে করবে। আমরা শুধু একটু আগে এটা করছি. যদি ডিভাইসটি পুনরুদ্ধার করা হয় বা প্রপগুলি আনার সময় অন্যান্য ত্রুটি থাকে তবে আমরা সেগুলিকে উপেক্ষা করি৷
ক্যান সুইচ টু হেডলেস সিস্টেম ব্যবহারকারী
public boolean canSwitchToHeadlessSystemUser ()
হেডলেস সিস্টেম ব্যবহারকারীর কাছে স্যুইচ করার অনুমতি আছে কিনা তা ফেরত দেয়।
রিটার্নস | |
---|---|
boolean |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
CheckApiLevel AgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
একটি ন্যূনতম সমর্থিত স্তরে একটি বৈশিষ্ট্য বর্তমানে সমর্থিত কিনা তা পরীক্ষা করুন। API স্তর উত্থাপিত হওয়ার আগে এই পদ্ধতিটি এখনও অপ্রকাশিত বৈশিষ্ট্যগুলিকে বিবেচনা করে।
পরামিতি | |
---|---|
strictMinLevel | int : বৈশিষ্ট্যটিকে সমর্থন করে এমন কঠোর ন্যূনতম সম্ভাব্য স্তর। |
রিটার্নস | |
---|---|
boolean | সত্য যদি স্তর সমর্থিত হয়. অন্যথায় মিথ্যা। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
সংযোগ পরীক্ষা করুন
public boolean checkConnectivity ()
ডিভাইসের নেটওয়ার্ক সংযোগ আছে কিনা পরীক্ষা করুন।
রিটার্নস | |
---|---|
boolean | true যদি ডিভাইসের একটি কার্যকরী নেটওয়ার্ক সংযোগ থাকে, তাহলে false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
সাফ ত্রুটি ডায়ালগ
public boolean clearErrorDialogs ()
ডিভাইস UI-তে বর্তমানে প্রদর্শিত কোনো ত্রুটি ডায়ালগ খারিজ করার চেষ্টা করুন।
রিটার্নস | |
---|---|
boolean | কোনো ডায়ালগ উপস্থিত না থাকলে বা ডায়ালগ সফলভাবে সাফ করা হলে true । অন্যথায় false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
সাফ লাস্টকানেক্টেডওয়াইফাই নেটওয়ার্ক
public void clearLastConnectedWifiNetwork ()
শেষ সংযুক্ত ওয়াইফাই নেটওয়ার্ক সাফ করে। ডিভাইস রিবুট করার পরে পূর্ববর্তী পরীক্ষায় ব্যবহৃত ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ এড়াতে একটি নতুন আহ্বান শুরু করার সময় এটি বলা উচিত।
clearLogcat
public void clearLogcat ()
কোনো জমে থাকা লগক্যাট ডেটা মুছে দেয়।
এটি সেই ক্ষেত্রে উপযোগী যখন আপনি নিশ্চিত করতে চান যেITestDevice#getLogcat()
শুধুমাত্র একটি নির্দিষ্ট বিন্দুর পরে উত্পাদিত লগ ডেটা ফেরত দেয় (যেমন একটি নতুন ডিভাইস বিল্ড ফ্ল্যাশ করার পরে, ইত্যাদি)। connectToWifiNetwork
public boolean connectToWifiNetwork (wifiSsidToPsk, boolean scanSsid)
একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে।
wifiSsidToPsk মানচিত্রে প্রদত্ত ওয়াইফাই নেটওয়ার্কগুলির একটির সাথে একটি সফল সংযোগ তৈরি না হওয়া পর্যন্ত wifi চালু করে এবং ব্লক করে। একবার একটি সংযোগ তৈরি হয়ে গেলে, ITestDevice#disconnectFromWifi()
বা ITestDevice#clearLastConnectedWifiNetwork()
কল না হওয়া পর্যন্ত প্রতিবার রিবুট করার পরে সংযোগটি পুনরুদ্ধার করার চেষ্টা করবে।
পরামিতি | |
---|---|
wifiSsidToPsk | |
scanSsid | boolean : এই নেটওয়ার্কের জন্য লুকানো SSID-এর জন্য স্ক্যান করতে হবে কিনা। |
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে।
নির্দিষ্ট ওয়াইফাই নেটওয়ার্কে সফল সংযোগ না হওয়া পর্যন্ত ওয়াইফাই চালু করে এবং ব্লক করে। একবার একটি সংযোগ তৈরি হয়ে গেলে,ITestDevice#disconnectFromWifi()
বা ITestDevice#clearLastConnectedWifiNetwork()
কল না হওয়া পর্যন্ত প্রতিবার রিবুট করার পরে সংযোগটি পুনরুদ্ধার করার চেষ্টা করবে।পরামিতি | |
---|---|
wifiSsid | String : ওয়াইফাই ssid এর সাথে সংযোগ করতে হবে |
wifiPsk | String : PSK পাসফ্রেজ বা এনক্রিপ্ট না থাকলে নাল |
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (wifiSsidToPsk)
একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে।
wifiSsidToPsk মানচিত্রে প্রদত্ত ওয়াইফাই নেটওয়ার্কগুলির একটির সাথে একটি সফল সংযোগ তৈরি না হওয়া পর্যন্ত wifi চালু করে এবং ব্লক করে। একবার একটি সংযোগ তৈরি হয়ে গেলে, ITestDevice#disconnectFromWifi()
বা ITestDevice#clearLastConnectedWifiNetwork()
বলা না হওয়া পর্যন্ত প্রতিবার রিবুট করার পরে সংযোগটি পুনরুদ্ধার করার চেষ্টা করবে।
পরামিতি | |
---|---|
wifiSsidToPsk |
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
একটি ওয়াইফাই নেটওয়ার্কের সাথে সংযোগ করে।
নির্দিষ্ট ওয়াইফাই নেটওয়ার্কে সফল সংযোগ না হওয়া পর্যন্ত ওয়াইফাই চালু করে এবং ব্লক করে। একবার একটি সংযোগ তৈরি হয়ে গেলে,ITestDevice#disconnectFromWifi()
বা ITestDevice#clearLastConnectedWifiNetwork()
কল না হওয়া পর্যন্ত প্রতিবার রিবুট করার পরে সংযোগটি পুনরুদ্ধার করার চেষ্টা করবে।পরামিতি | |
---|---|
wifiSsid | String : ওয়াইফাই ssid এর সাথে সংযোগ করতে হবে |
wifiPsk | String : PSK পাসফ্রেজ বা এনক্রিপ্ট না থাকলে নাল |
scanSsid | boolean : এই নেটওয়ার্কের জন্য লুকানো SSID স্ক্যান করতে হবে কিনা। |
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
connectToWifiNetwork(String, String)
এর একটি বৈকল্পিক যা ডিভাইসে বর্তমানে নেটওয়ার্ক সংযোগ না থাকলেই সংযোগ করে।
পরামিতি | |
---|---|
scanSsid | boolean : এই নেটওয়ার্কের জন্য লুকানো SSID স্ক্যান করতে হবে কিনা |
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
connectToWifiNetwork(String, String)
এর একটি বৈকল্পিক যা ডিভাইসে বর্তমানে নেটওয়ার্ক সংযোগ না থাকলেই সংযোগ করে।
রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্কে সফলভাবে সংযুক্ত হলে true । অন্যথায় false |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ব্যবহারকারী তৈরি করুন
public int createUser (String name, boolean guest, boolean ephemeral)
একটি প্রদত্ত নাম এবং প্রদত্ত পতাকা সহ একটি ব্যবহারকারী তৈরি করুন৷
পরামিতি | |
---|---|
name | String : ডিভাইসে তৈরি করা ব্যবহারকারীর |
guest | boolean : তৈরির সময় ব্যবহারকারীর পতাকা --অতিথি সক্রিয় করুন |
ephemeral | boolean : সৃষ্টির সময় ব্যবহারকারীর পতাকা -- ক্ষণস্থায়ী সক্ষম করুন |
রিটার্নস | |
---|---|
int | তৈরি করা ব্যবহারকারীর আইডি |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ব্যবহারকারী তৈরি করুন
public int createUser (String name, boolean guest, boolean ephemeral, boolean forTesting)
একটি প্রদত্ত নাম এবং প্রদত্ত পতাকা সহ একটি ব্যবহারকারী তৈরি করুন৷
পরামিতি | |
---|---|
name | String : ডিভাইসে তৈরি করা ব্যবহারকারীর |
guest | boolean : তৈরির সময় ব্যবহারকারীর পতাকা --অতিথি সক্রিয় করুন |
ephemeral | boolean : সৃষ্টির সময় ব্যবহারকারীর পতাকা -- ক্ষণস্থায়ী সক্ষম করুন |
forTesting | boolean : তৈরির সময় পরীক্ষার পতাকা --ফর-পরীক্ষা সক্ষম করুন |
রিটার্নস | |
---|---|
int | তৈরি করা ব্যবহারকারীর আইডি |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ব্যবহারকারী তৈরি করুন
public int createUser (String name)
একটি প্রদত্ত নাম এবং ডিফল্ট পতাকা 0 সহ একটি ব্যবহারকারী তৈরি করুন৷
পরামিতি | |
---|---|
name | String : ডিভাইসে তৈরি করা ব্যবহারকারীর |
রিটার্নস | |
---|---|
int | তৈরি করা ব্যবহারকারী আইডির জন্য পূর্ণসংখ্যা |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
একটি প্রদত্ত নাম এবং ডিফল্ট পতাকা 0 সহ একটি ব্যবহারকারী তৈরি করুন৷
পরামিতি | |
---|---|
name | String : ডিভাইসে তৈরি করা ব্যবহারকারীর |
রিটার্নস | |
---|---|
int | ব্যবহারকারী আইডির জন্য পূর্ণসংখ্যা বা ত্রুটির জন্য -1। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
নথিপত্র মুছে দাও
public void deleteFile (String deviceFilePath)
ডিভাইসে একটি ফাইল বা ডিরেক্টরি মুছে ফেলার জন্য সহায়ক পদ্ধতি।
পরামিতি | |
---|---|
deviceFilePath | String : ডিভাইসে ফাইলের পরম পথ। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
deregisterDeviceActionReceiver
public void deregisterDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
নিবন্ধিত IDeviceActionReceiver
সরিয়ে দেয়।
পরামিতি | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : একটি IDeviceActionReceiver যা সরানো হবে। |
ডিভাইস সফট রিস্টার্ট হয়েছে
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
পূর্ববর্তী system_server ProcessInfo
এর সাথে বর্তমান system_server তুলনা করে ডিভাইস সফট-রিস্টার্ট হয়েছে কিনা তা পরীক্ষা করার জন্য সহায়ক পদ্ধতি। ProcessInfo
পেতে getProcessByName(String)
ব্যবহার করুন।
পরামিতি | |
---|---|
prevSystemServerProcess | ProcessInfo : পূর্ববর্তী system_server প্রক্রিয়া ProcessInfo । |
রিটার্নস | |
---|---|
boolean | ডিভাইস সফট-রিস্টার্ট হলে true |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ডিভাইস সফট রিস্টার্ট হয়েছে
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
ডিভাইস থেকে ইউটিসি সময় থেকে যুগ থেকে ডিভাইস সফ্ট-রিস্টার্ট হয়েছে কিনা এবং এর ERROR(/TimeUnit)
পরীক্ষা করার জন্য সহায়ক পদ্ধতি। সফ্ট-রিস্টার্ট বলতে একটি ডিভাইস হার্ড রিবুটের বাইরে সিস্টেম_সার্ভার পুনরায় চালু করাকে বোঝায় (উদাহরণস্বরূপ: রিবুট অনুরোধ করা হয়েছে)। মিলিসেকেন্ডে বর্তমান ডিভাইস utcEpochTime getDeviceDate()
পদ্ধতি দ্বারা প্রাপ্ত করা যেতে পারে।
পরামিতি | |
---|---|
utcEpochTime | long : যুগের পর থেকে ডিভাইসের সময় দ্বিতীয়। |
timeUnit | TimeUnit : প্রদত্ত utcEpochTime এর জন্য সময় ইউনিট TimeUnit । |
রিটার্নস | |
---|---|
boolean | ডিভাইস সফট-রিস্টার্ট হলে true |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
অক্ষমAdbRoot
public boolean disableAdbRoot ()
অ্যাডবি রুট বন্ধ করে।
অ্যাডবি রুট অক্ষম করলে ডিভাইসটি অ্যাডবি থেকে সংযোগ বিচ্ছিন্ন হতে পারে। ডিভাইসটি উপলব্ধ না হওয়া পর্যন্ত এই পদ্ধতিটি ব্লক করা হবে।রিটার্নস | |
---|---|
boolean | সফল হলে true । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
নিষ্ক্রিয় কীগার্ড
public void disableKeyguard ()
কীগার্ড নিষ্ক্রিয় করার প্রচেষ্টা।
প্রথমে ইনপুট প্রেরণের জন্য প্রস্তুত হওয়ার জন্য অপেক্ষা করুন, এটি একই সময়ে ঘটে যখন ডিভাইসটি BOOT_COMPLETE রিপোর্ট করে, দৃশ্যত অ্যাসিঙ্ক্রোনাসভাবে, কারণ বর্তমান ফ্রেমওয়ার্ক বাস্তবায়নের মাঝে মাঝে রেস অবস্থা থাকে৷ তারপরে কীগার্ডকে বরখাস্ত করার জন্য কমান্ড পাঠানো হয় (শুধুমাত্র অ-সুরক্ষিতগুলিতে কাজ করে)
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
নিষ্ক্রিয় নেটওয়ার্ক মনিটর
public boolean disableNetworkMonitor ()
ডিভাইসে নেটওয়ার্ক পর্যবেক্ষণ অক্ষম করে।
রিটার্নস | |
---|---|
boolean | true যদি মনিটরিং সফলভাবে নিষ্ক্রিয় করা হয়। এটি ব্যর্থ হলে false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
Wifi থেকে সংযোগ বিচ্ছিন্ন করুন
public boolean disconnectFromWifi ()
একটি ওয়াইফাই নেটওয়ার্ক থেকে সংযোগ বিচ্ছিন্ন হয়।
পরিচিত নেটওয়ার্ক তালিকা থেকে সমস্ত নেটওয়ার্ক মুছে দেয় এবং ওয়াইফাই অক্ষম করে।রিটার্নস | |
---|---|
boolean | ওয়াইফাই নেটওয়ার্ক থেকে সফলভাবে সংযোগ বিচ্ছিন্ন হলে true । সংযোগ বিচ্ছিন্ন ব্যর্থ হলে false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ফাইলের অস্তিত্ব নেই
public boolean doesFileExist (String deviceFilePath, int userId)
একটি প্রদত্ত ব্যবহারকারীর জন্য ডিভাইসে ফাইল বিদ্যমান কিনা তা নির্ধারণ করতে সাহায্যকারী পদ্ধতি।
পরামিতি | |
---|---|
deviceFilePath | String : পরীক্ষা করার জন্য ডিভাইসে ফাইলের পরম পথ |
userId | int : ব্যবহারকারী আইডি যার বিরুদ্ধে ফাইলের অস্তিত্ব পরীক্ষা করতে হবে |
রিটার্নস | |
---|---|
boolean | ফাইল বিদ্যমান থাকলে true , অন্যথায় false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ফাইলের অস্তিত্ব নেই
public boolean doesFileExist (String deviceFilePath)
ডিভাইসে ফাইল আছে কিনা তা নির্ধারণ করতে সহায়ক পদ্ধতি।
পরামিতি | |
---|---|
deviceFilePath | String : পরীক্ষা করার জন্য ডিভাইসে ফাইলের পরম পথ |
রিটার্নস | |
---|---|
boolean | ফাইল বিদ্যমান থাকলে true , অন্যথায় false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ডাম্পহিপ
public File dumpHeap (String process, String devicePath)
সিস্টেম_সার্ভার থেকে গাদা ডাম্প করার চেষ্টা করুন। ডাম্প করা ফাইলটি পরিষ্কার করার দায়িত্ব কলারের।
পরামিতি | |
---|---|
process | String : ডাম্পহিপ চালু করার জন্য ডিভাইস প্রক্রিয়ার নাম। |
devicePath | String : ডিভাইসের পাথ যেখানে ডাম্প রাখতে হবে। এটি এমন একটি অবস্থান হতে হবে যেখানে অনুমতি এটির অনুমতি দেয়৷ |
রিটার্নস | |
---|---|
File | প্রতিবেদনটি সমন্বিত ERROR(/File) ৷ কিছু ব্যর্থ হলে শূন্য. |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
অ্যাডবিরুট সক্ষম করুন
public boolean enableAdbRoot ()
অ্যাডবি রুট চালু করে। যদি "সক্ষম-রুট" সেটিং "মিথ্যা" হয়, তাহলে একটি বার্তা লগ করবে এবং রুট সক্রিয় না করেই ফিরে আসবে৷
অ্যাডবি রুট সক্রিয় করার ফলে ডিভাইসটি অ্যাডবি থেকে সংযোগ বিচ্ছিন্ন হতে পারে। ডিভাইসটি উপলব্ধ না হওয়া পর্যন্ত এই পদ্ধতিটি ব্লক করা হবে।রিটার্নস | |
---|---|
boolean | সফল হলে true । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
নেটওয়ার্ক মনিটর সক্ষম করুন
public boolean enableNetworkMonitor ()
ডিভাইসে নেটওয়ার্ক পর্যবেক্ষণ সক্ষম করে।
রিটার্নস | |
---|---|
boolean | true যদি মনিটরিং সফলভাবে সক্ষম হয়। এটি ব্যর্থ হলে false । |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
চালানAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
সহায়ক পদ্ধতি যা একটি নির্দিষ্ট সময়সীমার সাথে একটি সিস্টেম কমান্ড হিসাবে একটি adb কমান্ড কার্যকর করে।
executeShellCommand(String)
যেখানে সম্ভব সেখানে ব্যবহার করা উচিত, কারণ সেই পদ্ধতিটি আরও ভাল ব্যর্থতা সনাক্তকরণ এবং কর্মক্ষমতা প্রদান করে।
পরামিতি | |
---|---|
timeout | long : ডিভাইসটিকে প্রতিক্রিয়াহীন বলে বিবেচিত হওয়ার আগে মিলিসেকেন্ডে সময়, টাইমআউটের জন্য 0L |
cmdArgs | String : চালানোর জন্য adb কমান্ড এবং আর্গুমেন্ট |
রিটার্নস | |
---|---|
String | কমান্ড থেকে stdout. null যদি কমান্ড কার্যকর করতে ব্যর্থ হয়। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
চালানAdbCommand
public String executeAdbCommand (long timeout,envMap, String... cmdArgs)
সহায়ক পদ্ধতি যা একটি নির্দিষ্ট সময়সীমার সাথে একটি সিস্টেম কমান্ড হিসাবে একটি adb কমান্ড কার্যকর করে।
executeShellCommand(String)
যেখানে সম্ভব সেখানে ব্যবহার করা উচিত, কারণ সেই পদ্ধতিটি আরও ভাল ব্যর্থতা সনাক্তকরণ এবং কর্মক্ষমতা প্রদান করে।
পরামিতি | |
---|---|
timeout | long : ডিভাইসটিকে প্রতিক্রিয়াহীন বলে বিবেচিত হওয়ার আগে মিলিসেকেন্ডে সময়, টাইমআউটের জন্য 0L |
envMap | |
cmdArgs | String : চালানোর জন্য adb কমান্ড এবং আর্গুমেন্ট |
রিটার্নস | |
---|---|
String | কমান্ড থেকে stdout. null যদি কমান্ড কার্যকর করতে ব্যর্থ হয়। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
চালানAdbCommand
public String executeAdbCommand (String... cmdArgs)
সহায়ক পদ্ধতি যা একটি adb কমান্ডকে সিস্টেম কমান্ড হিসাবে কার্যকর করে।
executeShellCommand(String)
যেখানে সম্ভব সেখানে ব্যবহার করা উচিত, কারণ সেই পদ্ধতিটি আরও ভাল ব্যর্থতা সনাক্তকরণ এবং কর্মক্ষমতা প্রদান করে।পরামিতি | |
---|---|
cmdArgs | String : চালানোর জন্য adb কমান্ড এবং আর্গুমেন্ট |
রিটার্নস | |
---|---|
String | কমান্ড থেকে stdout. null যদি কমান্ড কার্যকর করতে ব্যর্থ হয়। |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
ফাস্টবুটকমান্ড চালান
public CommandResult executeFastbootCommand (String... cmdArgs)
হেল্পার পদ্ধতি যা 2 মিনিটের ডিফল্ট টাইমআউট সহ একটি সিস্টেম কমান্ড হিসাবে একটি ফাস্টবুট কমান্ড কার্যকর করে।
ডিভাইসটি ইতিমধ্যেই ফাস্টবুট মোডে থাকা অবস্থায় ব্যবহার করা প্রত্যাশিত৷
পরামিতি | |
---|---|
cmdArgs | String : রান করার জন্য ফাস্টবুট কমান্ড এবং আর্গুমেন্ট |
রিটার্নস | |
---|---|
CommandResult | কমান্ডের আউটপুট ধারণকারী CommandResult |
নিক্ষেপ করে | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Helper method which executes a fastboot command as a system command.
Expected to be used when device is already in fastboot mode.পরামিতি | |
---|---|
timeout | long : the time in milliseconds before the command expire |
cmdArgs | String : the fastboot command and arguments to run |
Returns | |
---|---|
CommandResult | the CommandResult containing output of command |
Throws | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Helper method which executes a long running fastboot command as a system command.
Identical toexecuteFastbootCommand(String)
except uses a longer timeout.পরামিতি | |
---|---|
cmdArgs | String : the fastboot command and arguments to run |
Returns | |
---|---|
CommandResult | the CommandResult containing output of command |
Throws | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (envVarMap, String... cmdArgs)
Helper method which executes a long running fastboot command as a system command with system environment variables.
Identical to executeFastbootCommand(String)
except uses a longer timeout.
পরামিতি | |
---|---|
envVarMap | |
cmdArgs | String : the fastboot command and arguments to run |
Returns | |
---|---|
CommandResult | the CommandResult containing output of command |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public String executeShellCommand (String command)
Helper method which executes a adb shell command and returns output as a String
.
পরামিতি | |
---|---|
command | String : the adb shell command to run |
Returns | |
---|---|
String | the shell output |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
maxTimeToOutputShellResponse | long : the maximum amount of time during which the command is allowed to not output any response; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
maxTimeToOutputShellResponse | long : the maximum amount of time during which the command is allowed to not output any response; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Executes the given adb shell command, retrying multiple times if command fails.
A simpler form ofexecuteShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
with default values.পরামিতি | |
---|---|
command | String : the adb shell command to run |
receiver | IShellOutputReceiver : the IShellOutputReceiver to direct shell output to. |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Helper method which executes a adb shell command and returns the results as a CommandResult
properly populated with the command status output, stdout and stderr.
পরামিতি | |
---|---|
cmd | String : The command that should be run. |
Returns | |
---|---|
CommandResult | The result in CommandResult . |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Helper method which executes an adb shell command and returns the results as a CommandResult
properly populated with the command status output and stderr. stdout is directed to the specified stream.
পরামিতি | |
---|---|
cmd | String : The command that should be run. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
Returns | |
---|---|
CommandResult | The result in CommandResult . |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Helper method which executes an adb shell command and returns the results as a CommandResult
properly populated with the command status output, stdout and stderr.
পরামিতি | |
---|---|
cmd | String : The command that should be run. |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
Returns | |
---|---|
CommandResult | The result in CommandResult . |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
cmd | String : the adb shell command to run |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
Returns | |
---|---|
CommandResult |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
cmd | String : the adb shell command to run |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
Returns | |
---|---|
CommandResult |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
cmd | String : the adb shell command to run |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
Returns | |
---|---|
CommandResult |
Throws | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Executes a adb shell command, with more parameters to control command behavior.
পরামিতি | |
---|---|
cmd | String : the adb shell command to run |
pipeAsInput | File : A ERROR(/File) that will be piped as input to the command, or null. |
pipeToOutput | OutputStream : ERROR(/OutputStream) where the std output will be redirected, or null. |
pipeToError | OutputStream : ERROR(/OutputStream) where the std error will be redirected, or null. |
maxTimeoutForCommand | long : the maximum timeout for the command to complete; unit as specified in timeUnit |
timeUnit | TimeUnit : unit for maxTimeToOutputShellResponse |
retryAttempts | int : the maximum number of times to retry command if it fails due to a exception. DeviceNotResponsiveException will be thrown if retryAttempts are performed without success. |
Returns | |
---|---|
CommandResult |
Throws | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Helper method which wipes a partition for the device.
IfgetUseFastbootErase()
is true
, then fastboot erase will be used to wipe the partition. The device must then create a filesystem the next time the device boots. Otherwise, fastboot format is used which will create a new filesystem on the device. Expected to be used when device is already in fastboot mode.পরামিতি | |
---|---|
partition | String : the partition to wipe |
Returns | |
---|---|
CommandResult | the CommandResult containing output of command |
Throws | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Fetch the information about APEXes activated on the device.
Returns | |
---|---|
ERROR(/Set) of ApexInfo currently activated on the device |
Throws | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Return key value pairs of requested namespace.
পরামিতি | |
---|---|
namespace | String : must be one of {"system", "secure", "global"} |
Returns | |
---|---|
the map of key value pairs. Null if namespace is not supported. |
Throws | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Return the current allocation state of device
Returns | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Find and return the android-id associated to a userId, null if not found.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
String |
Throws | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Create a Map of android ids found matching user ids. There is no insurance that each user id will found an android id associated in this function so some user ids may match null.
Returns | |
---|---|
Map of android ids found matching user ids. |
Throws | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Get the device API Level. Defaults to UNKNOWN_API_LEVEL
.
Returns | |
---|---|
int | an integer indicating the API Level of device |
Throws | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Fetch information about a package installed on device.
পরামিতি | |
---|---|
packageName | String |
Returns | |
---|---|
PackageInfo | the PackageInfo or null if information could not be retrieved |
Throws | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Fetch information of packages installed on the device.
Returns | |
---|---|
ERROR(/List) of PackageInfo s installed on the device. |
Throws | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Convenience method to get baseband (radio) version of this device. Getting the radio version is device specific, so it might not return the correct information for all devices. This method relies on the gsm.version.baseband propery to return the correct version information. This is not accurate for some CDMA devices and the version returned here might not match the version reported from fastboot and might not return the version for the CDMA radio. TL;DR this method only reports accurate version if the gsm.version.baseband property is the same as the version returned by fastboot getvar version-baseband
.
Returns | |
---|---|
String | the String baseband version or null if it cannot be determined (device has no radio or version string cannot be read) |
Throws | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Returns the current battery level of a device or Null if battery level unavailable.
Returns | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Returns boolean value of the given property.
পরামিতি | |
---|---|
name | String : the property name |
defaultValue | boolean : default value to return if property is empty or doesn't exist. |
Returns | |
---|---|
boolean | true if the property has value "1" , "y" , "yes" , "on" , or "true" , false if the property has value of "0" , "n" , "no" , "off" , "false" , or defaultValue otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Helper method collects the boot history map with boot time and boot reason.
Returns | |
---|---|
Map of boot time (UTC time in second since Epoch) and boot reason |
Throws | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Helper method collects the boot history map with boot time and boot reason since the given time since epoch from device and the time unit specified. The current device utcEpochTime in Millisecond can be obtained by method getDeviceDate()
.
পরামিতি | |
---|---|
utcEpochTime | long : the device time since Epoch. |
timeUnit | TimeUnit : the time unit TimeUnit . |
Returns | |
---|---|
Map of boot time (UTC time in second since Epoch) and boot reason |
Throws | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Convenience method to get the bootloader version of this device.
Will attempt to retrieve bootloader version from the device's current state. (ie if device is in fastboot mode, it will attempt to retrieve version from fastboot)Returns | |
---|---|
String | the String bootloader version or null if it cannot be found |
Throws | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Retrieves a bugreport from the device.
The implementation of this is guaranteed to continue to work on a device without an sdcard (or where the sdcard is not yet mounted).
Returns | |
---|---|
InputStreamSource | An InputStreamSource which will produce the bugreport contents on demand. In case of failure, the InputStreamSource will produce an empty ERROR(/InputStream) . |
getBugreportz
public InputStreamSource getBugreportz ()
Retrieves a bugreportz from the device. Zip format bugreport contains the main bugreport and other log files that are useful for debugging.
Only supported for 'adb version' > 1.0.36
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the zip file containing the bugreportz, return null in case of failure. |
getBuildAlias
public String getBuildAlias ()
Retrieve the alias of the build that the device is currently running.
Build alias is usually a more readable string than build id (typically a number for Nexus builds). For example, final Android 4.2 release has build alias JDQ39, and build id 573038
Returns | |
---|---|
String | the build alias or fall back to build id if it could not be retrieved |
Throws | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Retrieve the build flavor for the device.
Returns | |
---|---|
String | the build flavor or null if it could not be retrieved |
Throws | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Retrieve the build the device is currently running.
Returns | |
---|---|
String | the build id or IBuildInfo#UNKNOWN_BUILD_ID if it could not be retrieved |
Throws | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Returns the key type used to sign the device image
Typically Android devices may be signed with test-keys (like in AOSP) or release-keys (controlled by individual device manufacturers)
Returns | |
---|---|
String | The signing key if found, null otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Returns a cached DeviceDescriptor
if the device is allocated, otherwise returns the current DeviceDescriptor
.
Returns | |
---|---|
DeviceDescriptor |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
Returns a cached DeviceDescriptor
if the device is allocated, otherwise returns the current DeviceDescriptor
.
পরামিতি | |
---|---|
shortDescriptor | boolean : Whether or not to limit descriptor to bare minimum info |
Returns | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Alternative to using IFileEntry
that sometimes won't work because of permissions.
পরামিতি | |
---|---|
path | String : is the path on the device where to do the search |
Returns | |
---|---|
String[] | Array of string containing all the file in a path on the device. |
Throws | |
---|---|
DeviceNotAvailableException |
getConnection
public AbstractConnection getConnection ()
The current connection associated with the device.
Returns | |
---|---|
AbstractConnection |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Returns the current foldable state of the device or null if some issues occurred.
Returns | |
---|---|
DeviceFoldableState |
Throws | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Return the id of the current running user. In case of error, return -10000.
Returns | |
---|---|
int |
Throws | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Get the device class.
Returns | |
---|---|
String | the String device class. |
getDeviceDate
public long getDeviceDate ()
Return the date of the device in millisecond since epoch.
Returns | |
---|---|
long | the date of the device in epoch format. |
Throws | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Return a DeviceDescriptor
from the device information to get info on it without passing the actual device object.
Returns | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
Return a DeviceDescriptor
from the device information to get info on it without passing the actual device object.
পরামিতি | |
---|---|
shortDescriptor | boolean : Whether or not to limit descriptor to bare minimum info |
Returns | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Get the device's state.
Returns | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Helper to get the time difference between the device and a given ERROR(/Date)
. Use Epoch time internally.
পরামিতি | |
---|---|
date | Date |
Returns | |
---|---|
long | the difference in milliseconds |
Throws | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Get the stream of emulator stdout and stderr
Returns | |
---|---|
InputStreamSource | emulator output |
getEmulatorProcess
public Process getEmulatorProcess ()
Return the Process
corresponding to this emulator.
Returns | |
---|---|
Process | the Process or null |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
The log that contains all the executeShellCommand(String)
logs.
Returns | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Helper method to determine amount of free space on device external storage.
Returns | |
---|---|
long | the amount of free space in KB |
Throws | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Returns the path of the fastboot binary being used. Still requires isFastbootEnabled()
to be true, to have fastboot functions enabled.
Returns | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Convenience method to get the product type of this device when its in fastboot mode.
This method should only be used if device should be in fastboot. Its a bit safer variant than the genericgetProductType()
method in this case, because ITestDevice will know to recover device into fastboot if device is in incorrect state or is unresponsive.Returns | |
---|---|
String | the String product type name or null if it cannot be determined |
Throws | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Convenience method to get the product type of this device when its in fastboot mode.
This method should only be used if device should be in fastboot. Its a bit safer variant than the genericgetProductType()
method in this case, because ITestDevice will know to recover device into fastboot if device is in incorrect state or is unresponsive.Returns | |
---|---|
String | the String product type name or null if it cannot be determined |
Throws | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Returns the fastboot mode serial number.
Returns | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Retrieve the given fastboot variable value from the device.
পরামিতি | |
---|---|
variableName | String : the variable name |
Returns | |
---|---|
String | the property value or null if it does not exist |
Throws | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Returns the version string of the fastboot binary being used. Or null if something goes wrong.
Returns | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Retrieve a reference to a remote file on device.
পরামিতি | |
---|---|
path | String : the file path to retrieve. Can be an absolute path or path relative to '/'. (ie both "/system" and "system" syntax is supported) |
Returns | |
---|---|
IFileEntry | the IFileEntry or null if file at given path cannot be found |
Throws | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Unofficial helper to get a FileEntry
from a non-root path. FIXME: Refactor the FileEntry system to have it available from any path. (even non root).
পরামিতি | |
---|---|
entry | FileListingService.FileEntry : a FileEntry not necessarily root as Ddmlib requires. |
Returns | |
---|---|
IFileEntry | a FileEntryWrapper representing the FileEntry. |
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Returns the list of foldable states on the device. Can be obtained with "cmd device_state print-states".
Returns | |
---|---|
Throws | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Returns a reference to the associated ddmlib IDevice
.
IDevice
may be allocated by DDMS each time the device disconnects and reconnects from adb. Thus callers should not keep a reference to the IDevice
, because that reference may become stale.Returns | |
---|---|
IDevice | the IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Fetch the application package names present on the device.
Returns | |
---|---|
ERROR(/Set) of String package names currently installed on the device. |
Throws | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Returns integer value of the given property from the device.
পরামিতি | |
---|---|
name | String : the property name |
defaultValue | long : default value to return if property is empty or doesn't exist. |
Returns | |
---|---|
long | the property value or defaultValue if the property is empty, doesn't exist, or doesn't have an integer value. |
Throws | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Gets the device's IP address.
Returns | |
---|---|
String | the device's IP address, or null if device has no IP address |
Throws | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Return an object to get the current state of the keyguard or null if not supported.
Returns | |
---|---|
KeyguardControllerState | a KeyguardControllerState containing a snapshot of the state of the keyguard and returns Null if the Keyguard query is not supported. |
Throws | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Returns the last time Tradefed APIs triggered a reboot in milliseconds since EPOCH as returned by System.currentTimeMillis()
.
Returns | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Get the device's first launched API Level. Defaults to UNKNOWN_API_LEVEL
.
Returns | |
---|---|
int | an integer indicating the first launched API Level of device |
Throws | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Grabs a snapshot stream of the logcat data.
Works in two modes:
TestDeviceOptions.getMaxLogcatDataSize()
bytes of the current contents of the background logcat captureReturns | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Grabs a snapshot stream of the last maxBytes
of captured logcat data.
Useful for cases when you want to capture frequent snapshots of the captured logcat data without incurring the potentially big disk space penalty of getting the entire getLogcat()
snapshot.
পরামিতি | |
---|---|
maxBytes | int : the maximum amount of data to return. Should be an amount that can comfortably fit in memory |
Returns | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Get a dump of the current logcat for device. Unlike getLogcat()
, this method will always return a static dump of the logcat.
Has the disadvantage that nothing will be returned if device is not reachable.
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the logcat data. An empty stream is returned if fail to capture logcat data. |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Grabs a snapshot stream of captured logcat data starting the date provided. The time on the device should be used getDeviceDate()
.
পরামিতি | |
---|---|
date | long : in millisecond since epoch format of when to start the snapshot until present. (can be be obtained using 'date +%s') |
Returns | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Returns the MAC address of the device, null if it fails to query from the device.
Returns | |
---|---|
String |
getMainUserId
public Integer getMainUserId ()
Returns the main user id.
Returns | |
---|---|
Integer | the userId of the main user if there is one, and null if there is no main user. |
Throws | |
---|---|
DeviceNotAvailableException |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Get the information about the mainline modules installed on the device.
Returns | |
---|---|
ERROR(/Set) of String mainline modules currently installed on the device. |
Throws | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Get the maximum number of supported simultaneously running users. Defaults to 0.
Returns | |
---|---|
int | an integer indicating the number of simultaneously running users |
Throws | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Get the maximum number of supported users. Defaults to 0.
Returns | |
---|---|
int | an integer indicating the number of supported users |
Throws | |
---|---|
DeviceNotAvailableException |
getMicrodroidProcess
public Process getMicrodroidProcess ()
Returns | |
---|---|
Process | Returns the Process of the Microdroid VM. If TestDevice is not a Microdroid, returns null. |
getMonitor
public IDeviceStateMonitor getMonitor ()
Return the IDeviceStateMonitor
associated with device.
Returns | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Returns a mount point.
Queries the device directly if the cached info inIDevice
is not available. TODO: move this behavior to IDevice#getMountPoint(String)
পরামিতি | |
---|---|
mountName | String : the name of the mount point |
Returns | |
---|---|
String | the mount point or null |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Returns a MountPointInfo
corresponding to the specified mountpoint path, or null
if that path has nothing mounted or otherwise does not appear in /proc/mounts as a mountpoint.
পরামিতি | |
---|---|
mountpoint | String |
Returns | |
---|---|
ITestDevice.MountPointInfo | A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
Throws | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Returns a parsed version of the information in /proc/mounts on the device
Returns | |
---|---|
A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
Throws | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Fetch the test options for the device.
Returns | |
---|---|
TestDeviceOptions | TestDeviceOptions related to the device under test. |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Helper method to determine amount of free space on device partition.
পরামিতি | |
---|---|
partition | String |
Returns | |
---|---|
long | the amount of free space in KB |
Throws | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
Returns the primary user id.
Returns | |
---|---|
Integer | the userId of the primary user if there is one, and null if there is no primary user. |
Throws | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Helper method runs the "pidof" and "stat" command and returns ProcessInfo
object with PID and process start time of the given process.
পরামিতি | |
---|---|
processName | String : the proces name String. |
Returns | |
---|---|
ProcessInfo | ProcessInfo of given processName |
Throws | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Returns the pid of the service or null if something went wrong.
পরামিতি | |
---|---|
process | String : The proces name String. |
Returns | |
---|---|
String |
Throws | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Convenience method to get the product type of this device.
This method will work if device is in either adb or fastboot mode.Returns | |
---|---|
String | the String product type name. Will not be null |
Throws | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Convenience method to get the product variant of this device.
This method will work if device is in either adb or fastboot mode.Returns | |
---|---|
String | the String product variant name or null if it cannot be determined |
Throws | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Retrieve the given property value from the device.
পরামিতি | |
---|---|
name | String : the property name |
Returns | |
---|---|
String | the property value or null if it does not exist |
Throws | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Get the current recovery mode used for the device.
Returns | |
---|---|
ITestDevice.RecoveryMode | the current recovery mode used for the device. |
getScreenshot
public InputStreamSource getScreenshot (String format)
Grabs a screenshot from the device. Recommended to use getScreenshot(format) instead with JPEG encoding for smaller size
পরামিতি | |
---|---|
format | String : supported PNG, JPEG |
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
Throws | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Grabs a screenshot from the device given display id. Format is PNG.
TODO: extend the implementations above to support 'format' and 'rescale'
পরামিতি | |
---|---|
displayId | long : the display id of the screen to get screenshot from. |
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
Throws | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Grabs a screenshot from the device. Recommended to use getScreenshot(String)
instead with JPEG encoding for smaller size.
পরামিতি | |
---|---|
format | String : supported PNG, JPEG |
rescale | boolean : if screenshot should be rescaled to reduce the size of resulting image |
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in format, or null if the screenshot was not successful. |
Throws | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Grabs a screenshot from the device.
Returns | |
---|---|
InputStreamSource | a InputStreamSource of the screenshot in png format, or null if the screenshot was not successful. |
Throws | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Convenience method to get serial number of this device.
Returns | |
---|---|
String | the String serial number |
getSetting
public String getSetting (int userId, String namespace, String key)
Return the value of the requested setting. namespace must be one of: {"system", "secure", "global"}
পরামিতি | |
---|---|
userId | int |
namespace | String |
key | String |
Returns | |
---|---|
String | the value associated with the namespace:key of a user. Null if not found. |
Throws | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
See getSetting(int, String, String)
and performed on system user.
পরামিতি | |
---|---|
namespace | String |
key | String |
Returns | |
---|---|
String |
Throws | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Return the SIM card operator or null if not available or if device is not available.
Returns | |
---|---|
String |
getSimState
public String getSimState ()
Return the SIM card state or null if not available or device is not available.
Returns | |
---|---|
String |
getTombstones
publicgetTombstones ()
Fetch and return the list of tombstones from the devices. Requires root.
method is best-effort so if one tombstone fails to be pulled for any reason it will be missing from the list. Only a DeviceNotAvailableException
will terminate the method early.
Returns | |
---|---|
A list of tombstone files, empty if no tombstone. |
Throws | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Returns total physical memory size in bytes or -1 in case of internal error
Returns | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Fetch the application package names that can be uninstalled. This is presently defined as non-system packages, and updated system packages.
Returns | |
---|---|
ERROR(/Set) of uninstallable String package names currently installed on the device. |
Throws | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public boolean getUseFastbootErase ()
Get whether to use fastboot erase or fastboot format to wipe a partition on the device.
Returns | |
---|---|
boolean | true if fastboot erase will be used or false if fastboot format will be used. |
getUserFlags
public int getUserFlags (int userId)
Find and return the flags of a given user. Flags are defined in "android.content.pm.UserInfo" class in Android Open Source Project.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
int | the flags associated with the userId provided if found, -10000 in any other cases. |
Throws | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Gets the Map of useId to UserInfo
on the device. Will throw DeviceRuntimeException
if output from device is not as expected.
Returns | |
---|---|
the list of UserInfo objects. |
Throws | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Return the serial number associated to the userId if found, -10000 in any other cases.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
int |
Throws | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Process the given DeviceEvent. May transition device to new state. Will inform the IDeviceMonitor
of any state transitions.
Process the DeviceEvent, which may or may not transition this device to a new allocation state.
পরামিতি | |
---|---|
event | DeviceEvent |
Returns | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Check if a feature is available on a device.
পরামিতি | |
---|---|
feature | String : which format should be "feature: |
Returns | |
---|---|
boolean | True if feature is found, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Install an Android package on device.
পরামিতি | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Install an Android package on device.
Note: Only use cases that requires explicit control of granting runtime permission at install time should call this function.
পরামিতি | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
grantPermissions | boolean : if all runtime permissions should be granted at install time |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Install an Android package on device for a given user.
পরামিতি | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
userId | int : the integer user id to install for. |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Install an Android package on device for a given user.
Note: Only use cases that requires explicit control of granting runtime permission at install time should call this function.
পরামিতি | |
---|---|
packageFile | File : the apk file to install |
reinstall | boolean : true if a reinstall should be performed |
grantPermissions | boolean : if all runtime permissions should be granted at install time |
userId | int : the integer user id to install for. |
extraArgs | String : optional extra arguments to pass. See 'adb shell pm -h' for available options. |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
invalidatePropertyCache
public void invalidatePropertyCache ()
isAdbTcp
public boolean isAdbTcp ()
Returns | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Check whether platform on device supports app enumeration
Returns | |
---|---|
boolean | True if app enumeration is supported, false otherwise |
Throws | |
---|---|
DeviceNotAvailableException |
isBypassLowTargetSdkBlockSupported
public boolean isBypassLowTargetSdkBlockSupported ()
Check whether platform on device supports bypassing low target sdk block on app installs
Returns | |
---|---|
boolean | True if bypass low target sdk block is supported, false otherwise |
Throws | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Returns if the device is encrypted.
Returns | |
---|---|
boolean | true if the device is encrypted. |
Throws | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Return True if the path on the device is a directory, false otherwise.
পরামিতি | |
---|---|
path | String |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Returns | |
---|---|
boolean | true if adb root should be enabled on device |
isEncryptionSupported
public boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
Returns | |
---|---|
boolean | true if the device supports encryption. |
Throws | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Returns True if the file path on the device is an executable file, false otherwise.
পরামিতি | |
---|---|
fullPath | String |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Return if fastboot is available for the device.
Returns | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Return true if the device is headless (no screen), false otherwise.
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isHeadlessSystemUserMode
public boolean isHeadlessSystemUserMode ()
Returns whether the device uses headless system user mode.
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isMainUserPermanentAdmin
public boolean isMainUserPermanentAdmin ()
Returns whether the main user is a permanent admin and can't be deleted or downgraded to non-admin status.
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Determines if multi user is supported.
Returns | |
---|---|
boolean | true if multi user is supported, false otherwise |
Throws | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Query the device for a given package name and given user id to check if it's currently installed or not for that user.
পরামিতি | |
---|---|
packageName | String : the package we are checking if it's installed. |
userId | String : The user id we are checking the package is installed for. If null, primary user zero will be used. |
Returns | |
---|---|
boolean | True if the package is reported as installed. False otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Query the device for a given package name to check if it's currently installed or not.
পরামিতি | |
---|---|
packageName | String |
Returns | |
---|---|
boolean | True if the package is reported as installed. False otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Check whether platform on device supports runtime permission granting
Returns | |
---|---|
boolean | True if runtime permission are supported, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Returns true if device is in TestDeviceState#FASTBOOT
or TestDeviceState.FASTBOOTD
.
Returns | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Check if a given user is running.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
boolean | True if the user is running, false in every other cases. |
Throws | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Return whether the specified user is a secondary user according to it's flags.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
boolean | true if the user is secondary, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
isUserVisible
public boolean isUserVisible (int userId)
Checks if the given user is visible.
A "visible" user is a user that is interacting with the "human" user and hence is able to launch launch activities (typically in the default display).
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isUserVisibleOnDisplay
public boolean isUserVisibleOnDisplay (int userId, int displayId)
Checks if the given user is visible in the given display.
A "visible" user is a user that is interacting with the "human" user and hence is able to launch launch activities in that display.
পরামিতি | |
---|---|
userId | int |
displayId | int |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isVisibleBackgroundUsersOnDefaultDisplaySupported
public boolean isVisibleBackgroundUsersOnDefaultDisplaySupported ()
Returns whether the device allow users to be started visible in the background in the ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
.
If it does, you could call startVisibleBackgroundUser(int, int, boolean)
, passing a display returned by listDisplayIdsForStartingVisibleBackgroundUsers()
(which should include ERROR(/java.android.view.Display#DEFAULT_DISPLAY)
).
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isVisibleBackgroundUsersSupported
public boolean isVisibleBackgroundUsersSupported ()
Returns whether the device allow users to be started visible in the background.
If it does, you could call startVisibleBackgroundUser(int, int, boolean)
, passing a display returned by listDisplayIdsForStartingVisibleBackgroundUsers()
.
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Test if wifi is enabled.
Checks if wifi is enabled on device. Useful for asserting wifi status before tests that shouldn't run with wifi, eg mobile data tests.Returns | |
---|---|
boolean | true if wifi is enabled. false if disabled |
Throws | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Collect the list of available displays id on the device as reported by "dumpsys SurfaceFlinger".
Returns | |
---|---|
The list of displays. Default always returns the default display 0. |
Throws | |
---|---|
DeviceNotAvailableException |
listDisplayIdsForStartingVisibleBackgroundUsers
publiclistDisplayIdsForStartingVisibleBackgroundUsers ()
Gets the list of displays that can be used to start a user visible in the background
.
Returns | |
---|---|
Throws | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Gets the list of users on the device. Will throw DeviceRuntimeException
if output from device is not as expected.
Returns | |
---|---|
the list of user ids. |
Throws | |
---|---|
DeviceNotAvailableException |
logAnrs
public boolean logAnrs (ITestLogger logger)
Collects and log ANRs from the device.
পরামিতি | |
---|---|
logger | ITestLogger : an ITestLogger to log the ANRs. |
Returns | |
---|---|
boolean | True if the logging was successful, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Helper method to take a bugreport and log it to the reporters.
পরামিতি | |
---|---|
dataName | String : name under which the bugreport will be reported. |
listener | ITestLogger : an ITestLogger to log the bugreport. |
Returns | |
---|---|
boolean | True if the logging was successful, false otherwise. |
logOnDevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Log a message in the logcat of the device. This is a safe call that will not throw even if the logging fails.
পরামিতি | |
---|---|
tag | String : The tag under which we log our message in the logcat. |
level | Log.LogLevel : The debug level of the message in the logcat. |
format | String : The message format. |
args | Object : the args to be replaced via String.format(). |
nonBlockingReboot
public void nonBlockingReboot ()
Issues a command to reboot device and returns on command complete and when device is no longer visible to adb.
Throws | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Override if the device needs some specific actions to be taken after adb root and before the device is back online. Default implementation doesn't include any addition actions. adb root is not guaranteed to be enabled at this stage.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Override if the device needs some specific actions to be taken after adb unroot and before the device is back online. Default implementation doesn't include any additional actions. adb root is not guaranteed to be disabled at this stage.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Perform instructions to configure device for testing that after every boot.
Should be called after device is fully booted/available In normal circumstances this method doesn't need to be called explicitly, as implementations should perform these steps automatically when performing a reboot. Where it may need to be called is when device reboots due to other events (eg when a fastboot update command has completed)Throws | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Extra steps for device specific required clean up that will be executed after the invocation is done.
পরামিতি | |
---|---|
exception | Throwable : if any, the final exception raised by the invocation failure. |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Extra steps for device specific required setup that will be executed on the device prior to the invocation flow.
পরামিতি | |
---|---|
info | IBuildInfo : The IBuildInfo of the device. |
attributes | MultiMap : The attributes stored in the invocation context |
Throws | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Recursively pull directory contents from device.
পরামিতি | |
---|---|
deviceFilePath | String : the absolute file path of the remote source |
localDir | File : the local directory to pull files into |
Returns | |
---|---|
boolean | true if file was pulled successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Retrieves a file off device.
পরামিতি | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
localFile | File : the local file to store contents in. If non-empty, contents will be replaced. |
Returns | |
---|---|
boolean | true if file was retrieved successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath, int userId)
Retrieves a file off device, stores it in a local temporary ERROR(/File)
, and returns that File
.
পরামিতি | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
userId | int : The user id to pull from |
Returns | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
Throws | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath)
Retrieves a file off device, stores it in a local temporary ERROR(/File)
, and returns that File
.
পরামিতি | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
Returns | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
Throws | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile, int userId)
Retrieves a file off device.
পরামিতি | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
localFile | File : the local file to store contents in. If non-empty, contents will be replaced. |
userId | int : The user id to pull from |
Returns | |
---|---|
boolean | true if file was retrieved successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Retrieves a file off device, and returns the contents.
পরামিতি | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
Returns | |
---|---|
String | A String containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
Throws | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
A convenience method to retrieve a file from the device's external storage, stores it in a local temporary ERROR(/File)
, and return a reference to that File
.
পরামিতি | |
---|---|
remoteFilePath | String : the path to file on device, relative to the device's external storage mountpoint |
Returns | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
Throws | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Recursively push directory contents to device while excluding some directories that are filtered.
পরামিতি | |
---|---|
localFileDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
excludedDirectories |
Returns | |
---|---|
boolean | true if file was pushed successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Recursively push directory contents to device.
পরামিতি | |
---|---|
localFileDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
Returns | |
---|---|
boolean | true if file was pushed successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath, boolean evaluateContentProviderNeeded)
Variant of pushFile(File, String)
which can optionally consider evaluating the need for the content provider.
পরামিতি | |
---|---|
localFile | File : the local file to push |
remoteFilePath | String : the remote destination absolute file path |
evaluateContentProviderNeeded | boolean : whether to check if we need the content provider |
Returns | |
---|---|
boolean | true if file was pushed successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Push a file to device. By default using a content provider.
পরামিতি | |
---|---|
localFile | File : the local file to push |
remoteFilePath | String : the remote destination absolute file path |
Returns | |
---|---|
boolean | true if file was pushed successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Push file created from a string to device
পরামিতি | |
---|---|
contents | String : the contents of the file to push |
remoteFilePath | String : the remote destination absolute file path |
Returns | |
---|---|
boolean | true if string was pushed successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
reboot
public void reboot (String reason)
Reboots the device into adb mode with given reason
to be persisted across reboot.
Blocks until device becomes available.
Last reboot reason can be obtained by querying sys.boot.reason
propety.
পরামিতি | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
Throws | |
---|---|
DeviceNotAvailableException |
reboot
public void reboot ()
Reboots the device into adb mode.
Blocks until device becomes available.Throws | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Reboots the device into bootloader mode.
Blocks until device is in bootloader mode.Throws | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Reboots the device into fastbootd mode.
Blocks until device is in fastbootd mode.
Throws | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Reboots the device into adb recovery mode.
Blocks until device enters recoveryThrows | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
Throws | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
পরামিতি | |
---|---|
autoReboot | boolean : whether to automatically reboot the device after sideload |
Throws | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
An alternate to reboot()
that only blocks until device is online ie visible to adb.
Throws | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
An alternate to reboot()
that only blocks until device is online ie visible to adb.
পরামিতি | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
Throws | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Reboots only userspace part of device.
Blocks until device becomes available.
WARNING. Userspace reboot is currently under active development, use it on your own risk.
Throws | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
An alternate to rebootUserspace()
()} that only blocks until device is online ie visible to adb.
Throws | |
---|---|
DeviceNotAvailableException |
recoverDevice
public boolean recoverDevice ()
Attempts to recover device communication.
Returns | |
---|---|
boolean | True if recovery attempted and successful, returns False if recovery was skipped |
Throws | |
---|---|
DeviceNotAvailableException | if device is no longer available |
registerDeviceActionReceiver
public void registerDeviceActionReceiver (IDeviceActionReceiver deviceActionReceiver)
Registers a IDeviceActionReceiver
for this device.
All registered IDeviceActionReceiver
s will be notified before a device action starts and after the device action ends.
পরামিতি | |
---|---|
deviceActionReceiver | IDeviceActionReceiver : A IDeviceActionReceiver which will be registered. |
remountSystemReadOnly
public void remountSystemReadOnly ()
Make the system partition on the device read-only. May reboot the device.
Throws | |
---|---|
DeviceNotAvailableException |
remountSystemWritable
public void remountSystemWritable ()
Make the system partition on the device writable. May reboot the device.
Throws | |
---|---|
DeviceNotAvailableException |
remountVendorReadOnly
public void remountVendorReadOnly ()
Make the vendor partition on the device read-only. May reboot the device.
Throws | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
Throws | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Remove given device admin in given user and return true
if it is successful, false
otherwise.
পরামিতি | |
---|---|
componentName | String : of device admin to be removed. |
userId | int : of user that the device admin lives in. |
Returns | |
---|---|
boolean | True if it is successful, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Remove all existing device profile owners with the best effort.
Throws | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Remove a given user from the device.
পরামিতি | |
---|---|
userId | int : of the user to remove |
Returns | |
---|---|
boolean | true if we were successful in removing the user, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Reset the flag for content provider setup in order to trigger it again.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Convenience method for performing ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection))
with one or more listeners passed as parameters.
পরামিতি | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners | ITestLifeCycleReceiver : the test result listener(s) |
Returns | |
---|---|
boolean | true if test command completed. false if it failed to complete, but recovery succeeded |
Throws | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Runs instrumentation tests, and provides device recovery.
If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.
If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.
পরামিতি | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners |
Returns | |
---|---|
boolean | true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded |
Throws | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Same as ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection))
but runs the test for the given user.
পরামিতি | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Same as ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...)
but runs the test for a given user.
পরামিতি | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Injects the IConfiguration
in use.
পরামিতি | |
---|---|
configuration | IConfiguration |
setConnectionAvdInfo
public final void setConnectionAvdInfo (GceAvdInfo avdInfo)
পরামিতি | |
---|---|
avdInfo | GceAvdInfo |
setDate
public void setDate (Date date)
Sets the date on device
Note: setting date on device requires root
পরামিতি | |
---|---|
date | Date : specify a particular date; will use host date if null |
Throws | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Set a device admin component as device owner in given user.
পরামিতি | |
---|---|
componentName | String : of device admin to be device owner. |
userId | int : of the user that the device owner lives in. |
Returns | |
---|---|
boolean | True if it is successful, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Update the device's state.
পরামিতি | |
---|---|
deviceState | TestDeviceState : the TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
For emulator set SizeLimitedOutputStream
to log output
পরামিতি | |
---|---|
output | SizeLimitedOutputStream : to log the output |
setEmulatorProcess
public void setEmulatorProcess (Process p)
Sets the Process
, when this device is an emulator.
পরামিতি | |
---|---|
p | Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Set the fastboot option for the device. Should be set when device is first allocated.
পরামিতি | |
---|---|
fastbootEnabled | boolean : whether fastboot is available for the device or not |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Sets the path to the fastboot binary that should be used. Still requires isFastbootEnabled()
to be true, to have fastboot functions enabled.
পরামিতি | |
---|---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Update the IDevice associated with this ITestDevice.
The new IDevice must refer the same physical device as the current reference. This method will be called if DDMS has allocated a new IDeviceপরামিতি | |
---|---|
newDevice | IDevice : the IDevice |
setLogStartDelay
public void setLogStartDelay (int delay)
Sets the time in ms to wait before starting logcat capture for a online device.
পরামিতি | |
---|---|
delay | int : the delay in ms |
setOptions
public void setOptions (TestDeviceOptions options)
Set the TestDeviceOptions
for the device
পরামিতি | |
---|---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Sets the given property value on the device. Requires adb root is true.
পরামিতি | |
---|---|
propKey | String : The key targeted to be set. |
propValue | String : The property value to be set. |
Returns | |
---|---|
boolean | returns True if the setprop command was successful, False otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Set the IDeviceRecovery
to use for this device. Should be set when device is first allocated.
পরামিতি | |
---|---|
recovery | IDeviceRecovery : the IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Set the current recovery mode to use for the device.
Used to control what recovery method to use when a device communication problem is encountered. Its recommended to only use this method sparingly when needed (for example, when framework is down, etcপরামিতি | |
---|---|
mode | ITestDevice.RecoveryMode : whether 'recover till online only' mode should be on or not. |
setSetting
public void setSetting (String namespace, String key, String value)
See setSetting(int, String, String, String)
and performed on system user.
পরামিতি | |
---|---|
namespace | String |
key | String |
value | String |
Throws | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Add a setting value to the namespace of a given user. Some settings will only be available after a reboot. namespace must be one of: {"system", "secure", "global"}
পরামিতি | |
---|---|
userId | int |
namespace | String |
key | String |
value | String |
Throws | |
---|---|
DeviceNotAvailableException |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
Injects the ITestLogger
instance
পরামিতি | |
---|---|
testLogger | ITestLogger |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Set whether to use fastboot erase or fastboot format to wipe a partition on the device.
পরামিতি | |
---|---|
useFastbootErase | boolean : true if fastboot erase should be used or false if fastboot format should be used. |
startLogcat
public void startLogcat ()
Start capturing logcat output from device in the background.
Will have no effect if logcat output is already being captured. Data can be later retrieved via getLogcat. When the device is no longer in use,stopLogcat()
must be called. startLogcat()
and stopLogcat()
do not normally need to be called when within a TF invocation context, as the TF framework will start and stop logcat.startUser
public boolean startUser (int userId)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP.
পরামিতি | |
---|---|
userId | int : of the user to start in the background |
Returns | |
---|---|
boolean | true if the user was successfully started in the background. |
Throws | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Starts a given user in the background if it is currently stopped. If the user is already running in the background, this method is a NOOP. Possible to provide extra flag to wait for the operation to have effect.
পরামিতি | |
---|---|
userId | int : of the user to start in the background |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
Returns | |
---|---|
boolean | true if the user was successfully started in the background. |
Throws | |
---|---|
DeviceNotAvailableException |
startVisibleBackgroundUser
public boolean startVisibleBackgroundUser (int userId, int displayId, boolean waitFlag)
Starts a given user in the background, visible in the given display (ie, allowing the user to launch activities in that display).
NOTE: this command doesn't check if the user exists, display is available, device supports such feature
, etc.
পরামিতি | |
---|---|
userId | int : of the user to start in the background |
displayId | int : display to start user visible on |
waitFlag | boolean : will make the command wait until user is started and unlocked. |
Returns | |
---|---|
boolean | true if the user was successfully started visible in the background. |
Throws | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
Close and delete the emulator output.
stopLogcat
public void stopLogcat ()
Stop capturing logcat output from device, and discard currently saved logcat data.
Will have no effect if logcat output is not being captured.stopUser
public boolean stopUser (int userId)
Stops a given user. If the user is already stopped, this method is a NOOP. Cannot stop current and system user.
পরামিতি | |
---|---|
userId | int : of the user to stop. |
Returns | |
---|---|
boolean | true if the user was successfully stopped. |
Throws | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Stop a given user. Possible to provide extra flags to wait for the operation to have effect, and force terminate the user. Cannot stop current and system user.
পরামিতি | |
---|---|
userId | int : of the user to stop. |
waitFlag | boolean : will make the command wait until user is stopped. |
forceFlag | boolean : will force stop the user. |
Returns | |
---|---|
boolean | true if the user was successfully stopped. |
Throws | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Switch device to adb-over-tcp mode.
Returns | |
---|---|
String | the tcp serial number or null if device could not be switched |
Throws | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Switch device to adb over usb mode.
Returns | |
---|---|
boolean | true if switch was successful, false otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Switch to another userId with a default timeout. switchUser(int, long)
.
পরামিতি | |
---|---|
userId | int |
Returns | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Switch to another userId with the provided timeout as deadline. Attempt to disable keyguard after user change is successful.
পরামিতি | |
---|---|
userId | int |
timeout | long : to wait before returning false for switch-user failed. |
Returns | |
---|---|
boolean | True if the new userId matches the userId provider. False otherwise. |
Throws | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Incrementally syncs the contents of a local file directory to device.
Decides which files to push by comparing timestamps of local files with their remote equivalents. Only 'newer' or non-existent files will be pushed to device. Thus overhead should be relatively small if file set on device is already up to date. Hidden files (with names starting with ".") will be ignored. Example usage: syncFiles("/tmp/files", "/sdcard") will created a /sdcard/files directory if it doesn't already exist, and recursively push the /tmp/files contents to /sdcard/files.পরামিতি | |
---|---|
localFileDir | File : the local file directory containing files to recursively push. |
deviceFilePath | String : the remote destination absolute file path root. All directories in thos file path must be readable. ie pushing to /data/local/tmp when adb is not root will fail |
Returns | |
---|---|
boolean | true if files were synced successfully. অন্যথায় false । |
Throws | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Take a bugreport and returns it inside a Bugreport
object to handle it. Return null in case of issue. File referenced in the Bugreport object need to be cleaned via Bugreport.close()
.
Returns | |
---|---|
Bugreport |
uninstallPackage
public String uninstallPackage (String packageName)
Uninstall an Android package from device.
পরামিতি | |
---|---|
packageName | String : the Android package to uninstall |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Uninstall an Android package from device for a given user.
পরামিতি | |
---|---|
packageName | String : the Android package to uninstall |
userId | int : the integer user id to uninstall for. |
Returns | |
---|---|
String | a String with an error code, or null if success. |
Throws | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Unlocks the device if the device is in an encrypted state.
This method may restart the framework but will not callpostBootSetup()
. Therefore, the device might not be fully ready to be tested when this method returns.Returns | |
---|---|
boolean | true if successful or if the device is unencrypted. |
Throws | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Blocks until the device's boot complete flag is set.
পরামিতি | |
---|---|
timeOut | long : time in msecs to wait for the flag to be set |
Returns | |
---|---|
boolean | true if device's boot complete flag is set within the timeout |
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public boolean waitForDeviceAvailable ()
Waits for the device to be responsive and available for testing. Uses default timeout.
Returns | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public boolean waitForDeviceAvailable (long waitTime)
Waits for the device to be responsive and available for testing.
পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Returns | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailableInRecoverPath
public boolean waitForDeviceAvailableInRecoverPath (long waitTime)
Waits for the device to be responsive and available without considering recovery path.
পরামিতি | |
---|---|
waitTime | long |
Returns | |
---|---|
boolean | True if device is available, False if unavailable. |
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceBootloader
public void waitForDeviceBootloader ()
Blocks until device is visible via fastboot. Use default timeout.
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Blocks for the device to be in the 'adb recovery' state (note this is distinct from IDeviceRecovery
).
পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Returns | |
---|---|
boolean | true if device boots into recovery before time expires. false otherwise |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Blocks for the device to be in the 'adb sideload' state
পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Returns | |
---|---|
boolean | true if device boots into sideload before time expires. false otherwise |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Blocks for the device to be not available ie missing from adb
পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Returns | |
---|---|
boolean | true if device becomes not available before time expires. false otherwise |
waitForDeviceOnline
public void waitForDeviceOnline ()
Blocks until device is visible via adb. Uses default timeout
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Blocks until device is visible via adb.
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Throws | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Waits for device to be responsive to a basic adb shell command.
পরামিতি | |
---|---|
waitTime | long : the time in ms to wait |
Returns | |
---|---|
boolean | true if device becomes responsive before waitTime elapses. |
Protected methods
addExtraConnectionBuilderArgs
protected void addExtraConnectionBuilderArgs (DefaultConnection.ConnectionBuilder builder)
পরামিতি | |
---|---|
builder | DefaultConnection.ConnectionBuilder |
buildAdbShellCommand
protected String[] buildAdbShellCommand (String command, boolean forceExitStatusDetection)
Builds the OS command for the given adb shell command session and args
পরামিতি | |
---|---|
command | String |
forceExitStatusDetection | boolean |
Returns | |
---|---|
String[] |
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
পরামিতি | |
---|---|
feature | String |
strictMinLevel | int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Create a RebootDeviceAction
to be used when performing a reboot action.
পরামিতি | |
---|---|
rebootMode | NativeDevice.RebootMode : a mode of this reboot. |
reason | String : for this reboot. |
Returns | |
---|---|
NativeDevice.RebootDeviceAction | the created RebootDeviceAction . |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Perform a adb reboot.
পরামিতি | |
---|---|
rebootMode | NativeDevice.RebootMode : a mode of this reboot. |
reason | String : for this reboot. |
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
helper method to throw exception if runtime permission isn't supported
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getApiLevelSafe
protected int getApiLevelSafe ()
Returns | |
---|---|
int |
initializeConnection
protected void initializeConnection (IBuildInfo info, MultiMap<String, String> attributes)
পরামিতি | |
---|---|
info | IBuildInfo |
attributes | MultiMap |
Throws | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Fetch a device property, from the ddmlib cache by default, and falling back to either `adb shell getprop` or `fastboot getvar` depending on whether the device is in Fastboot or not.
পরামিতি | |
---|---|
propName | String : The name of the device property as returned by `adb shell getprop` |
fastbootVar | String : The name of the equivalent fastboot variable to query. if null , fastboot query will not be attempted |
description | String : A simple description of the variable. First letter should be capitalized. |
Returns | |
---|---|
String | A string, possibly null or empty, containing the value of the given property |
Throws | |
---|---|
DeviceNotAvailableException |
isInRebootCallback
protected boolean isInRebootCallback ()
Returns whether reboot callbacks is currently being executed or not. All public api's for reboot should be disabled if true.
Returns | |
---|---|
boolean |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Return true
if local file is newer than remote file. IFileEntry
being accurate to the minute, in case of equal times, the file will be considered newer.
পরামিতি | |
---|---|
localFile | File |
entry | IFileEntry |
Returns | |
---|---|
boolean |
notifyRebootEnded
protected void notifyRebootEnded ()
Notifies all IDeviceActionReceiver
about reboot end event.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
notifyRebootStarted
protected void notifyRebootStarted ()
Notifies all IDeviceActionReceiver
about reboot start event.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, NativeDevice.DeviceAction action, int retryAttempts)
Performs an action on this device. Attempts to recover device and optionally retry command if action fails.
পরামিতি | |
---|---|
actionDescription | String : a short description of action to be performed. Used for logging purposes only. |
action | NativeDevice.DeviceAction : the action to be performed |
retryAttempts | int : the retry attempts to make for action if it fails but recovery succeeds |
Returns | |
---|---|
boolean | true if action was performed successfully |
Throws | |
---|---|
DeviceNotAvailableException | if recovery attempt fails or max attempts done without success |
postAdbReboot
protected void postAdbReboot ()
Possible extra actions that can be taken after a reboot.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Allows each device type (AndroidNativeDevice, TestDevice) to override this method for specific post boot setup.
Throws | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
pullFileInternal
protected boolean pullFileInternal (String remoteFilePath, File localFile)
পরামিতি | |
---|---|
remoteFilePath | String |
localFile | File |
Returns | |
---|---|
boolean |
Throws | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Set the Clock instance to use.
পরামিতি | |
---|---|
clock | Clock |
setMicrodroidProcess
protected void setMicrodroidProcess (Process process)
Marks the TestDevice as microdroid and sets its CID.
পরামিতি | |
---|---|
process | Process : Process of the Microdroid VM. |
setTestDeviceOptions
protected void setTestDeviceOptions (deviceOptions)
পরামিতি | |
---|---|
deviceOptions |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout,envVarMap, String[] fullCmd)
Executes a simple fastboot command with environment variables and report the status of the command.
পরামিতি | |
---|---|
timeout | long |
envVarMap | |
fullCmd | String |
Returns | |
---|---|
CommandResult |
simpleFastbootCommand
protected CommandResult simpleFastbootCommand (long timeout, String[] fullCmd)
Executes a simple fastboot command and report the status of the command.
পরামিতি | |
---|---|
timeout | long |
fullCmd | String |
Returns | |
---|---|
CommandResult |
waitForDeviceNotAvailable
protected boolean waitForDeviceNotAvailable (String operationDesc, long time)
Wait to see the device going unavailable (stop reporting to adb).
পরামিতি | |
---|---|
operationDesc | String : The name of the operation that is waiting for unavailable. |
time | long : The time to wait for unavailable to occur. |
Returns | |
---|---|
boolean | True if device did become unavailable. |
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2023-07-19 UTC-তে শেষবার আপডেট করা হয়েছে।