คลาสที่ซ้อนกัน class
ModuleOemTargetPreparer.ModuleInfo
คลาส struct อย่างง่ายเพื่อเก็บข้อมูลเกี่ยวกับโมดูล
วิธีการสาธารณะ void
checkModuleAfterPush (ITestDevice device, pushedModules)
checkModuleAfterPush (ITestDevice device, pushedModules)
ตรวจสอบชื่อโมดูลและรหัสเวอร์ชันหลังจากกด
void
setUp (TestInformation testInfo)
ดำเนินการตั้งค่าเป้าหมายสำหรับการทดสอบ ดันโมดูลเพื่อแทนที่โมดูลพรีโหลด
วิธีการป้องกัน void
checkPreloadModules (TestInformation testInfo, DeviceDescriptor deviceDescriptor)
ตรวจสอบข้อมูลโมดูลพรีโหลด
String[]
getApkDirectory (ITestDevice device, String packageName)
รับเส้นทางไฟล์ apk ภายใต้ไดเรกทอรีระบบ
String
getPackageVersioncode (ITestDevice device, String packageName, boolean isAPK)
ตรวจสอบเวอร์ชันของแพ็คเกจหลังจากผลักโมดูลที่ระบุชื่อแพ็คเกจ
ModuleOemTargetPreparer.ModuleInfo
pushFile (File moduleFile, TestInformation testInfo)
พุชไฟล์ไปที่ /system/apex/ สำหรับ apex หรือ /system/** สำหรับ apk
String
renameFile (ITestDevice device, File moduleFile, String packageName)
เปลี่ยนชื่อไฟล์ที่จะอัปเดตเป็นชื่อเดียวกันภายใต้ /system.
void
setupDevice (TestInformation testInfo)
adb root และ remount อุปกรณ์ก่อนกดไฟล์ภายใต้ /system
ผู้สร้างสาธารณะ ModuleOemTargetPreparer
public ModuleOemTargetPreparer ()
วิธีการสาธารณะ ตรวจสอบโมดูล AfterPush
public void checkModuleAfterPush (ITestDevice device,
pushedModules) ตรวจสอบชื่อโมดูลและรหัสเวอร์ชันหลังจากกด
พารามิเตอร์ device
ITestDevice
pushedModules
: รายการโมดูลที่ผลัก
ขว้าง TargetSetupError
โยนข้อยกเว้นหากไม่มีโมดูลที่ผลัก DeviceNotAvailableException
โยนข้อยกเว้นหากไม่มีอุปกรณ์
public void setUp (TestInformation testInfo) ดำเนินการตั้งค่าเป้าหมายสำหรับการทดสอบ ดันโมดูลเพื่อแทนที่โมดูลพรีโหลด
ขว้าง TargetSetupError
หากเกิดข้อผิดพลาดร้ายแรงในการตั้งค่าสภาพแวดล้อม BuildError
หากเกิดข้อผิดพลาดเนื่องจากกำลังเตรียมบิลด์ DeviceNotAvailableException
ถ้าเครื่องไม่ตอบสนอง
วิธีการป้องกัน
protected void checkPreloadModules (TestInformation testInfo,
DeviceDescriptor deviceDescriptor) ตรวจสอบข้อมูลโมดูลพรีโหลด
พารามิเตอร์ testInfo
TestInformation
: ข้อมูลการทดสอบ deviceDescriptor
DeviceDescriptor
ขว้าง DeviceNotAvailableException
ส่งข้อยกเว้นหากไม่มีอุปกรณ์ TargetSetupError
ส่งข้อยกเว้นหากไม่มีโมดูลที่โหลดไว้ล่วงหน้า
getApkDirectory
protected String[] getApkDirectory (ITestDevice device,
String packageName) รับเส้นทางไฟล์ apk ภายใต้ไดเรกทอรีระบบ
พารามิเตอร์ device
ITestDevice
packageName
String
: ชื่อแพคเกจโมดูล
คืนสินค้า String[]
อาร์เรย์สตริงที่มีชื่อ apk และเส้นทาง
ขว้าง DeviceNotAvailableException
หากอุปกรณ์ไม่พร้อมใช้งาน TargetSetupError
หากไม่พบเส้นทางของแพ็คเกจ
getPackageVersioncode
protected String getPackageVersioncode (ITestDevice device,
String packageName,
boolean isAPK) ตรวจสอบเวอร์ชันของแพ็คเกจหลังจากผลักโมดูลที่ระบุชื่อแพ็คเกจ
พารามิเตอร์ packageName
String
: ผลักชื่อแพคเกจ isAPK
boolean
ขว้าง DeviceNotAvailableException
ส่งข้อยกเว้นหากไม่พบอุปกรณ์
protected ModuleOemTargetPreparer.ModuleInfo pushFile (File moduleFile,
TestInformation testInfo) พุชไฟล์ไปที่ /system/apex/ สำหรับ apex หรือ /system/** สำหรับ apk
พารามิเตอร์ moduleFile
File
: ไฟล์โมดูล testInfo
TestInformation
ที่: TestInformation
สำหรับการภาวนา
ขว้าง TargetSetupError
ถ้าไม่สามารถดันไฟล์ผ่าน adb DeviceNotAvailableException
หากไม่มีอุปกรณ์
เปลี่ยนชื่อไฟล์
protected String renameFile (ITestDevice device,
File moduleFile,
String packageName) เปลี่ยนชื่อไฟล์ที่จะอัปเดตเป็นชื่อเดียวกันภายใต้ /system.
พารามิเตอร์ device
ITestDevice
: อุปกรณ์ทดสอบ moduleFile
File
: ไฟล์โมดูลที่จะติดตั้ง packageName
String
: ชื่อภายใต้ระบบ / / *
คืนสินค้า String
ชื่อไฟล์ใหม่หลังจากเปลี่ยนชื่อ
ขว้าง TargetSetupError
หากไม่สามารถเปลี่ยนชื่อไฟล์ได้ DeviceNotAvailableException
protected void setupDevice (TestInformation testInfo) adb root และ remount อุปกรณ์ก่อนกดไฟล์ภายใต้ /system
ขว้าง TargetSetupError
หากไม่สามารถต่อเชื่อมอุปกรณ์ได้ DeviceNotAvailableException
ส่งความคิดเห็น
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"ไม่มีข้อมูลที่ฉันต้องการ"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"ล้าสมัย"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"ปัญหาเกี่ยวกับการแปล"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"อื่นๆ"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"เข้าใจง่าย"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"แก้ปัญหาของฉันได้"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"อื่นๆ"
}]
หากต้องการบอกให้เราทราบเพิ่มเติม