1 /*
2  * Copyright (C) 2020 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 
17 package android.incrementalinstall.common;
18 
19 public class Consts {
20 
21     // Tag for the package to launch and verify, sent from Host to app validator.
22     public static final String PACKAGE_TO_LAUNCH_TAG = "PACKAGE_TO_LAUNCH";
23 
24     // Tag for the components that should be loaded, sent from Host to app validator.
25     public static final String LOADED_COMPONENTS_TAG = "LOADED_COMPONENTS";
26 
27     // Tag for the components that should not be loaded, sent from Host to app validator.
28     public static final String NOT_LOADED_COMPONENTS_TAG = "NOT_LOADED_COMPONENTS";
29 
30     // Tag for installation type (incremental or not), sent from Host to app validator.
31     public static final String IS_INCFS_INSTALLATION_TAG = "IS_INCFS";
32 
33     // Tag for the version of the installed app, sent from Host to app validator.
34     public static final String INSTALLED_VERSION_CODE_TAG = "VERSION_CODE";
35 
36     // Action broadcast from test app after attempting to load a component.
37     public static final String INCREMENTAL_TEST_APP_STATUS_RECEIVER_ACTION =
38             "android.incrementalinstall.incrementaltestapp.INCREMENTAL_TEST_APP_RECEIVER_ACTION";
39 
40     // Name of component attempted to load in the test app.
41     public static final String TARGET_COMPONENT_KEY = "IncrementalTestAppTargetComponent";
42 
43     // Status of the attempt to load the component.
44     public static final String COMPONENT_STATUS_KEY = "ComponentStatus";
45 
46     public static class SupportedComponents {
47 
48         public static final String ON_CREATE_COMPONENT = "onCreate";
49         public static final String ON_CREATE_COMPONENT_2 = "onCreate2";
50         public static final String DYNAMIC_ASSET_COMPONENT = "dynamicAsset";
51         public static final String DYNAMIC_CODE_COMPONENT = "dynamicCode";
52         public static final String COMPRESSED_NATIVE_COMPONENT = "compressedNative";
53         public static final String UNCOMPRESSED_NATIVE_COMPONENT = "unCompressedNative";
54 
getAllComponents()55         public static String[] getAllComponents() {
56             return new String[]{ON_CREATE_COMPONENT, ON_CREATE_COMPONENT_2, DYNAMIC_ASSET_COMPONENT,
57                     DYNAMIC_CODE_COMPONENT, COMPRESSED_NATIVE_COMPONENT,
58                     UNCOMPRESSED_NATIVE_COMPONENT};
59         }
60     }
61 
62 }
63