blob: 1abfeb902f9c60ec57992b4f3b81ed1968f02265 [file] [log] [blame]
Sebastian Franco974cc942023-10-19 14:22:06 -07001/*
2 * Copyright (C) 2023 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 */
16package com.android.launcher3;
17
18public class LauncherConstants {
19
20 /**
21 * Trace events to visualize using Systrace tool.
22 */
23 public static class TraceEvents {
24
25 public static final String DISPLAY_ALL_APPS_TRACE_METHOD_NAME = "DisplayAllApps";
26 public static final int DISPLAY_WORKSPACE_TRACE_COOKIE = 0;
27 public static final int DISPLAY_ALL_APPS_TRACE_COOKIE = 1;
28 public static final int COLD_STARTUP_TRACE_COOKIE = 2;
29 public static final String ON_CREATE_EVT = "Launcher.onCreate";
30 public static final String ON_START_EVT = "Launcher.onStart";
31 public static final String ON_RESUME_EVT = "Launcher.onResume";
32 public static final String ON_NEW_INTENT_EVT = "Launcher.onNewIntent";
33 static final String DISPLAY_WORKSPACE_TRACE_METHOD_NAME = "DisplayWorkspaceFirstFrame";
34 static final String COLD_STARTUP_TRACE_METHOD_NAME = "LauncherColdStartup";
35 }
36
37 /**
38 * This are the different codes the Launcher can receive when a new Launcher Intent is created.
39 */
40 public static class ActivityCodes {
41
42 public static final int REQUEST_BIND_PENDING_APPWIDGET = 12;
43 public static final int REQUEST_RECONFIGURE_APPWIDGET = 13;
44 static final int REQUEST_CREATE_SHORTCUT = 1;
45 static final int REQUEST_CREATE_APPWIDGET = 5;
46 static final int REQUEST_PICK_APPWIDGET = 9;
47 static final int REQUEST_BIND_APPWIDGET = 11;
48 }
49
50 /**
51 * Keys used to get the saved values of the previous Activity instance.
52 */
53 public static class SavedInstanceKeys {
54
55 // Type: int
56 public static final String RUNTIME_STATE = "launcher.state";
57 // Type PendingSplitSelectInfo<Parcelable>
58 public static final String PENDING_SPLIT_SELECT_INFO = "launcher.pending_split_select_info";
59 // Type: PendingRequestArgs
60 static final String RUNTIME_STATE_PENDING_REQUEST_ARGS = "launcher.request_args";
61 // Type: int
62 static final String RUNTIME_STATE_PENDING_REQUEST_CODE = "launcher.request_code";
63 // Type: ActivityResultInfo
64 static final String RUNTIME_STATE_PENDING_ACTIVITY_RESULT = "launcher.activity_result";
65 // Type: SparseArray<Parcelable>
66 static final String RUNTIME_STATE_WIDGET_PANEL = "launcher.widget_panel";
67 // Type int[]
68 static final String RUNTIME_STATE_CURRENT_SCREEN_IDS = "launcher.current_screen_ids";
69 }
70}