• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016, 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 com.android.managedprovisioning.provisioning;
18 
19 import android.annotation.IntDef;
20 import android.content.ComponentName;
21 import android.content.Context;
22 import android.content.Intent;
23 
24 import com.android.managedprovisioning.common.Globals;
25 
26 import java.io.File;
27 import java.lang.annotation.Retention;
28 import java.lang.annotation.RetentionPolicy;
29 import java.util.HashMap;
30 
31 /**
32  * Constants used for communication between service and activity.
33  */
34 public final class Constants {
35     // Intents sent by the activity to the service
36     /**
37      * Intent action sent to the {@link ProvisioningService} to indicate that provisioning should be
38      * started.
39      */
40     public static final String ACTION_START_PROVISIONING =
41             "com.android.managedprovisioning.START_PROVISIONING";
42 
43     public static final int COLOR_TYPE_ACCENT = 1;
44     public static final int COLOR_TYPE_PRIMARY_TEXT = 2;
45     public static final int COLOR_TYPE_SECONDARY_TEXT = 3;
46     public static final int COLOR_TYPE_BACKGROUND_SURFACE = 4;
47     public static final int COLOR_TYPE_NOTIFICATION_BACKGROUND = 5;
48     public static final int COLOR_TYPE_NAVIGATION_BAR_COLOR = 6;
49     public static final int COLOR_TYPE_NAVIGATION_BAR_DIVIDER_COLOR = 7;
50     public static final int COLOR_TYPE_IS_NIGHT_MODE_ACTIVE = 8;
51 
52     @IntDef(prefix = {"COLOR_PALETTE_"}, value = {
53         COLOR_TYPE_ACCENT,
54         COLOR_TYPE_PRIMARY_TEXT,
55         COLOR_TYPE_SECONDARY_TEXT,
56         COLOR_TYPE_BACKGROUND_SURFACE,
57         COLOR_TYPE_NOTIFICATION_BACKGROUND,
58         COLOR_TYPE_NAVIGATION_BAR_COLOR,
59         COLOR_TYPE_NAVIGATION_BAR_DIVIDER_COLOR,
60         COLOR_TYPE_IS_NIGHT_MODE_ACTIVE
61     })
62     @Retention(RetentionPolicy.SOURCE)
63     public @interface ColorType {}
64 
65     /**
66      * A {@link HashMap} extra that maps colors from {@link ColorType} to an {@link Integer} color
67      */
68     public static final String EXTRA_PROVISIONING_COLOR_PALETTE =
69             "android.app.extra.PROVISIONING_COLOR_PALETTE";
70 
getDeferredMetricsFile(Context context)71     public static File getDeferredMetricsFile(Context context) {
72         return new File(context.getFilesDir(), "deferred_metrics");
73     }
74 
75     public static boolean FLAG_ENABLE_LIGHT_DARK_MODE = true;
76 
77     /**
78      * A boolean flag to indicate whether to lock the orientation to portrait mode.
79      * <p>This is a temporary feature flag until the setup wizard library support is implemented.
80      */
81     public static final boolean LOCK_TO_PORTRAIT_MODE = false;
82 
83     /**
84      * A boolean flag to indicate whether to enable custom activity start gestures.
85      */
86     public static boolean ENABLE_CUSTOM_TRANSITIONS = false;
87 
88     public static final Intent PROVISIONING_SERVICE_INTENT = new Intent().setComponent(
89             new ComponentName(
90                     Globals.MANAGED_PROVISIONING_PACKAGE_NAME,
91                     ProvisioningService.class.getName()));
92 
Constants()93     private Constants() {
94         // Do not instantiate
95     }
96 }
97