summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-10-15 21:46:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-10-15 21:46:04 +0000
commite30572f4bf4ab82b1bd3dc4f5d00f5dc05c44a8d (patch)
tree38d99151e82ee73048d0c65616f0d8f2ebf553e1 /core/java/android
parent4c361bbb477c57e8b8d413c8197b2417257c08eb (diff)
parente0b6a4df8308c0318e01832f7a5d7c405302a25f (diff)
Merge "Fix LauncherAppsService queryIntentLauncherActivities"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/content/pm/LauncherActivityInfoInternal.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/content/pm/LauncherActivityInfoInternal.java b/core/java/android/content/pm/LauncherActivityInfoInternal.java
index 22e9712ebe3b..839b1761aadf 100644
--- a/core/java/android/content/pm/LauncherActivityInfoInternal.java
+++ b/core/java/android/content/pm/LauncherActivityInfoInternal.java
@@ -16,6 +16,8 @@
package android.content.pm;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.os.Parcel;
@@ -28,17 +30,23 @@ public class LauncherActivityInfoInternal implements Parcelable {
@UnsupportedAppUsage
private ActivityInfo mActivityInfo;
private ComponentName mComponentName;
- private IncrementalStatesInfo mIncrementalStatesInfo;
+ @NonNull private IncrementalStatesInfo mIncrementalStatesInfo;
/**
* @param info ActivityInfo from which to create the LauncherActivityInfo.
* @param incrementalStatesInfo The package's states.
*/
public LauncherActivityInfoInternal(ActivityInfo info,
- IncrementalStatesInfo incrementalStatesInfo) {
+ @Nullable IncrementalStatesInfo incrementalStatesInfo) {
mActivityInfo = info;
mComponentName = new ComponentName(info.packageName, info.name);
- mIncrementalStatesInfo = incrementalStatesInfo;
+ if (incrementalStatesInfo == null) {
+ // default value for non-incremental apps
+ mIncrementalStatesInfo = new IncrementalStatesInfo(
+ true /* isStartable */, false /* isLoading */, 1 /* progress */);
+ } else {
+ mIncrementalStatesInfo = incrementalStatesInfo;
+ }
}
public LauncherActivityInfoInternal(Parcel source) {