1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.testtype.suite.params; 17 18 /** Special values associated with the suite "parameter" keys in the metadata of each module. */ 19 public enum ModuleParameters { 20 /** describes a parameterization based on app that should be installed in instant mode. */ 21 INSTANT_APP("instant_app", ModuleParameters.INSTANT_APP_FAMILY), 22 NOT_INSTANT_APP("not_instant_app", ModuleParameters.INSTANT_APP_FAMILY), 23 24 MULTI_ABI("multi_abi", ModuleParameters.MULTI_ABI_FAMILY), 25 NOT_MULTI_ABI("not_multi_abi", ModuleParameters.MULTI_ABI_FAMILY), 26 27 SECONDARY_USER("secondary_user", ModuleParameters.SECONDARY_USER_FAMILY), 28 NOT_SECONDARY_USER("not_secondary_user", ModuleParameters.SECONDARY_USER_FAMILY), 29 30 // Secondary user started on background, visible in a secondary display 31 SECONDARY_USER_ON_SECONDARY_DISPLAY( 32 "secondary_user_on_secondary_display", 33 ModuleParameters.SECONDARY_USER_ON_SECONDARY_DISPLAY_FAMILY), 34 NOT_SECONDARY_USER_ON_SECONDARY_DISPLAY( 35 "not_secondary_user_on_secondary_display", 36 ModuleParameters.SECONDARY_USER_ON_SECONDARY_DISPLAY_FAMILY), 37 38 // Secondary user started on background, visible in the default display 39 SECONDARY_USER_ON_DEFAULT_DISPLAY( 40 "secondary_user_on_defauilt_display", 41 ModuleParameters.SECONDARY_USER_ON_DEFAULT_DISPLAY_FAMILY), 42 NOT_SECONDARY_USER_ON_DEFAULT_DISPLAY( 43 "not_secondary_user_on_default_display", 44 ModuleParameters.SECONDARY_USER_ON_DEFAULT_DISPLAY_FAMILY), 45 46 // Multi-user 47 MULTIUSER("multiuser", ModuleParameters.MULTIUSER_FAMILY), 48 RUN_ON_WORK_PROFILE("run_on_work_profile", ModuleParameters.RUN_ON_WORK_PROFILE_FAMILY), 49 RUN_ON_SECONDARY_USER("run_on_secondary_user", ModuleParameters.RUN_ON_SECONDARY_USER_FAMILY), 50 RUN_ON_CLONE_PROFILE("run_on_clone_profile", ModuleParameters.RUN_ON_CLONE_PROFILE_FAMILY), 51 RUN_ON_PRIVATE_PROFILE("run_on_private_profile", ModuleParameters.RUN_ON_PRIVATE_PROFILE_FAMILY), 52 53 // Foldable mode 54 ALL_FOLDABLE_STATES("all_foldable_states", ModuleParameters.FOLDABLE_STATES_FAMILY), 55 NO_FOLDABLE_STATES("no_foldable_states", ModuleParameters.FOLDABLE_STATES_FAMILY), 56 57 // SDK sandbox mode 58 RUN_ON_SDK_SANDBOX("run_on_sdk_sandbox", ModuleParameters.RUN_ON_SDK_SANDBOX_FAMILY), 59 NOT_RUN_ON_SDK_SANDBOX("not_run_on_sdk_sandbox", ModuleParameters.RUN_ON_SDK_SANDBOX_FAMILY); 60 61 public static final String INSTANT_APP_FAMILY = "instant_app_family"; 62 public static final String MULTI_ABI_FAMILY = "multi_abi_family"; 63 public static final String SECONDARY_USER_FAMILY = "secondary_user_family"; 64 public static final String SECONDARY_USER_ON_SECONDARY_DISPLAY_FAMILY = 65 "secondary_user_on_secondary_display_family"; 66 public static final String SECONDARY_USER_ON_DEFAULT_DISPLAY_FAMILY = 67 "secondary_user_on_default_display_family"; 68 public static final String MULTIUSER_FAMILY = "multiuser_family"; 69 public static final String FOLDABLE_STATES_FAMILY = "foldable_family"; 70 public static final String RUN_ON_SDK_SANDBOX_FAMILY = "run_on_sdk_sandbox_family"; 71 public static final String RUN_ON_WORK_PROFILE_FAMILY = "run_on_work_profile_family"; 72 public static final String RUN_ON_SECONDARY_USER_FAMILY = "run_on_secondary_user_family"; 73 public static final String RUN_ON_CLONE_PROFILE_FAMILY = "run_on_clone_profile_family"; 74 public static final String RUN_ON_PRIVATE_PROFILE_FAMILY = "run_on_private_profile_family"; 75 76 private final String mName; 77 /** Defines whether several module parameters are associated and mutually exclusive. */ 78 private final String mFamily; 79 ModuleParameters(String name, String family)80 private ModuleParameters(String name, String family) { 81 mName = name; 82 mFamily = family; 83 } 84 85 @Override toString()86 public String toString() { 87 return mName; 88 } 89 90 /** Returns the family of the Module Parameter. */ getFamily()91 public String getFamily() { 92 return mFamily; 93 } 94 } 95