mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 00:36:49 +00:00
Showing Toast message when the target package is null for the disabled shortcut
The shortcut for a certain set of apps could have their component names set to null. In this case, if we still need the package name for the shortcut, we should use the package name from the intent, which is accomplished in getTargetPackage. Additionally, if the target package is still null, we are falling back to showing the Toast messages only. Fix: 239685630 Test: Verified that the crash no longer happens after clicking on grayed out shortcuts Change-Id: I4de68ea1a227032e16e5c00407f75159a7aba30f
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.launcher3.model.data;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
@@ -220,10 +219,10 @@ public abstract class ItemInfoWithIcon extends ItemInfo {
|
||||
/** Creates an intent to that launches the app store at this app's page. */
|
||||
@Nullable
|
||||
public Intent getMarketIntent(Context context) {
|
||||
ComponentName componentName = getTargetComponent();
|
||||
String targetPackage = getTargetPackage();
|
||||
|
||||
return componentName != null
|
||||
? new PackageManagerHelper(context).getMarketIntent(componentName.getPackageName())
|
||||
return targetPackage != null
|
||||
? new PackageManagerHelper(context).getMarketIntent(targetPackage)
|
||||
: null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user