summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/LauncherConstants.java
blob: 1abfeb902f9c60ec57992b4f3b81ed1968f02265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.launcher3;

public class LauncherConstants {

    /**
     * Trace events to visualize using Systrace tool.
     */
    public static class TraceEvents {

        public static final String DISPLAY_ALL_APPS_TRACE_METHOD_NAME = "DisplayAllApps";
        public static final int DISPLAY_WORKSPACE_TRACE_COOKIE = 0;
        public static final int DISPLAY_ALL_APPS_TRACE_COOKIE = 1;
        public static final int COLD_STARTUP_TRACE_COOKIE = 2;
        public static final String ON_CREATE_EVT = "Launcher.onCreate";
        public static final String ON_START_EVT = "Launcher.onStart";
        public static final String ON_RESUME_EVT = "Launcher.onResume";
        public static final String ON_NEW_INTENT_EVT = "Launcher.onNewIntent";
        static final String DISPLAY_WORKSPACE_TRACE_METHOD_NAME = "DisplayWorkspaceFirstFrame";
        static final String COLD_STARTUP_TRACE_METHOD_NAME = "LauncherColdStartup";
    }

    /**
     * This are the different codes the Launcher can receive when a new Launcher Intent is created.
     */
    public static class ActivityCodes {

        public static final int REQUEST_BIND_PENDING_APPWIDGET = 12;
        public static final int REQUEST_RECONFIGURE_APPWIDGET = 13;
        static final int REQUEST_CREATE_SHORTCUT = 1;
        static final int REQUEST_CREATE_APPWIDGET = 5;
        static final int REQUEST_PICK_APPWIDGET = 9;
        static final int REQUEST_BIND_APPWIDGET = 11;
    }

    /**
     * Keys used to get the saved values of the previous Activity instance.
     */
    public static class SavedInstanceKeys {

        // Type: int
        public static final String RUNTIME_STATE = "launcher.state";
        // Type PendingSplitSelectInfo<Parcelable>
        public static final String PENDING_SPLIT_SELECT_INFO = "launcher.pending_split_select_info";
        // Type: PendingRequestArgs
        static final String RUNTIME_STATE_PENDING_REQUEST_ARGS = "launcher.request_args";
        // Type: int
        static final String RUNTIME_STATE_PENDING_REQUEST_CODE = "launcher.request_code";
        // Type: ActivityResultInfo
        static final String RUNTIME_STATE_PENDING_ACTIVITY_RESULT = "launcher.activity_result";
        // Type: SparseArray<Parcelable>
        static final String RUNTIME_STATE_WIDGET_PANEL = "launcher.widget_panel";
        // Type int[]
        static final String RUNTIME_STATE_CURRENT_SCREEN_IDS = "launcher.current_screen_ids";
    }
}