Debian Codegraph @

core/java/android/content/pm/LauncherActivityInfoInternal.java

raw symbols SCIP
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.content.pm;
18
19 import android.annotation.NonNull;
20 import android.compat.annotation.UnsupportedAppUsage;
21 import android.content.ComponentName;
22 import android.os.Parcel;
23 import android.os.Parcelable;
24
25 /**
26 * @hide
27 */
28 public class LauncherActivityInfoInternal implements Parcelable {
29 @UnsupportedAppUsage
30 @NonNull private ActivityInfo mActivityInfo;
31 @NonNull private ComponentName mComponentName;
32 @NonNull private IncrementalStatesInfo mIncrementalStatesInfo;
33
34 /**
35 * @param info ActivityInfo from which to create the LauncherActivityInfo.
36 * @param incrementalStatesInfo The package's states.
37 */
38 public LauncherActivityInfoInternal(@NonNull ActivityInfo info,
39 @NonNull IncrementalStatesInfo incrementalStatesInfo) {
40 mActivityInfo = info;
41 mComponentName = new ComponentName(info.packageName, info.name);
42 mIncrementalStatesInfo = incrementalStatesInfo;
43 }
44
45 public LauncherActivityInfoInternal(Parcel source) {
46 mActivityInfo = source.readParcelable(ActivityInfo.class.getClassLoader(), android.content.pm.ActivityInfo.class);
47 mComponentName = new ComponentName(mActivityInfo.packageName, mActivityInfo.name);
48 mIncrementalStatesInfo = source.readParcelable(
49 IncrementalStatesInfo.class.getClassLoader(), android.content.pm.IncrementalStatesInfo.class);
50 }
51
52 public ComponentName getComponentName() {
53 return mComponentName;
54 }
55
56 public ActivityInfo getActivityInfo() {
57 return mActivityInfo;
58 }
59
60 public IncrementalStatesInfo getIncrementalStatesInfo() {
61 return mIncrementalStatesInfo;
62 }
63
64 @Override
65 public int describeContents() {
66 return 0;
67 }
68
69 @Override
70 public void writeToParcel(Parcel dest, int flags) {
71 dest.writeParcelable(mActivityInfo, 0);
72 dest.writeParcelable(mIncrementalStatesInfo, 0);
73 }
74
75 public static final @android.annotation.NonNull Creator<LauncherActivityInfoInternal> CREATOR =
76 new Creator<LauncherActivityInfoInternal>() {
77 public LauncherActivityInfoInternal createFromParcel(Parcel source) {
78 return new LauncherActivityInfoInternal(source);
79 }
80 public LauncherActivityInfoInternal[] newArray(int size) {
81 return new LauncherActivityInfoInternal[size];
82 }
83 };
84 }