Skip to content

Commit ff486f0

Browse files
vincent0425copybara-github
authored andcommitted
Add AflagsDecorator for flipping read/write aflags on Android devices.
PiperOrigin-RevId: 932947112
1 parent 1aa2508 commit ff486f0

11 files changed

Lines changed: 826 additions & 0 deletions

File tree

src/java/com/google/devtools/deviceinfra/ext/devicemanagement/device/platform/android/AndroidDeviceDelegate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ private void additionalAndroidDeviceConfiguration(boolean fullStackFeaturesEnabl
564564
* devices only.
565565
*/
566566
private void rootedAndroidDeviceConfiguration(String deviceId) throws InterruptedException {
567+
device.addSupportedDecorator("AflagsDecorator");
567568

568569
// *********************************************************************************************
569570
// The following features are only enabled in full stack labs or Local Mode.

src/java/com/google/devtools/mobileharness/api/model/error/AndroidErrorId.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,14 @@ public enum AndroidErrorId implements ErrorId {
983983
ANDROID_REPORT_INTEGRITY_DECORATOR_CSR_CHALLENGE_MISMATCH(176_276, ErrorType.INFRA_ISSUE),
984984
ANDROID_REPORT_INTEGRITY_DECORATOR_CSR_UNSUPPORTED_VERSION(176_277, ErrorType.INFRA_ISSUE),
985985

986+
// AflagsDecorator: 176_281 ~ 176_300
987+
ANDROID_AFLAGS_DECORATOR_FLAG_FORMAT_CHECK_FAILURE(176_281, ErrorType.CUSTOMER_ISSUE),
988+
ANDROID_AFLAGS_DECORATOR_FLAG_NOT_READ_WRITE(176_282, ErrorType.CUSTOMER_ISSUE),
989+
ANDROID_AFLAGS_DECORATOR_LIST_FLAGS_ERROR(176_283, ErrorType.INFRA_ISSUE),
990+
ANDROID_AFLAGS_DECORATOR_UPDATE_FLAG_ERROR(176_284, ErrorType.INFRA_ISSUE),
991+
ANDROID_AFLAGS_DECORATOR_REBOOT_ERROR(176_285, ErrorType.INFRA_ISSUE),
992+
ANDROID_AFLAGS_DECORATOR_SDK_VERSION_TOO_LOW(176_286, ErrorType.CUSTOMER_ISSUE),
993+
986994
ANDROID_ERROR_ID_PLACE_HOLDER_TO_BE_RENAMED(200_000, ErrorType.UNDETERMINED);
987995

988996
public static final int MIN_CODE = ExtErrorId.MAX_CODE + 1;

src/java/com/google/wireless/qa/mobileharness/shared/api/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ java_library(
4646
":xts_test_lab_plugin",
4747
"//src/java/com/google/devtools/mobileharness/api/devicemanager/detector:android_jit_emulator_detector",
4848
"//src/java/com/google/devtools/mobileharness/api/devicemanager/dispatcher:android_jit_emulator_dispatcher",
49+
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:aflags_decorator",
4950
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_adb_shell_decorator",
5051
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_ats_dynamic_config_pusher_decorator",
5152
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_business_logic_skip_module_decorator",
@@ -74,6 +75,7 @@ java_library(
7475
"//src/java/com/google/wireless/qa/mobileharness/shared/api/driver:slate_driver",
7576
"//src/java/com/google/wireless/qa/mobileharness/shared/api/driver:tradefed_test",
7677
"//src/java/com/google/wireless/qa/mobileharness/shared/api/module:tradefed_test_module",
78+
"//src/java/com/google/wireless/qa/mobileharness/shared/api/validator/env:aflags_decorator_env_validator",
7779
"//src/java/com/google/wireless/qa/mobileharness/shared/api/validator/env:android_device_settings_decorator_env_validator",
7880
"//src/java/com/google/wireless/qa/mobileharness/shared/api/validator/env:android_switch_user_decorator_env_validator",
7981
],
@@ -194,6 +196,7 @@ java_library(
194196
name = "all_drivers_and_decorators_for_unit_tests",
195197
testonly = 1,
196198
runtime_deps = [
199+
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:aflags_decorator",
197200
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_adb_shell_decorator",
198201
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_ats_dynamic_config_pusher_decorator",
199202
"//src/java/com/google/wireless/qa/mobileharness/shared/api/decorator:android_bugreport_decorator",

0 commit comments

Comments
 (0)