mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
Fixing wrong check being used for application status
Earlier we were relying on activity list to check is an app is installed or not. It fails if the app only exposes widgets and no visible activity. Hence dragging an icon to AppInfo sometimes causes the icon to get disappear. Bug: 33241335 Change-Id: Ieb71e298a0930dd0a831cf09bd1e998514a427fd
This commit is contained in:
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
@@ -139,9 +140,10 @@ public class UninstallDropTarget extends ButtonDropTarget {
|
||||
final Runnable checkIfUninstallWasSuccess = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String packageName = cn.getPackageName();
|
||||
boolean uninstallSuccessful = !AllAppsList.packageHasActivities(
|
||||
launcher, packageName, user);
|
||||
// We use MATCH_UNINSTALLED_PACKAGES as the app can be on SD card as well.
|
||||
boolean uninstallSuccessful = LauncherAppsCompat.getInstance(launcher)
|
||||
.getApplicationInfo(cn.getPackageName(),
|
||||
PackageManager.MATCH_UNINSTALLED_PACKAGES, user) == null;
|
||||
callback.onDragObjectRemoved(uninstallSuccessful);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user