Commit 331fcf0b authored by Amit Kumar's avatar Amit Kumar

Fix #25, #31 and Close #23

parents 870f9888 535e20bf
Pipeline #1461 passed with stage
in 3 minutes and 8 seconds
......@@ -7,6 +7,7 @@ import java.util.Set;
import com.jakewharton.rxrelay2.BehaviorRelay;
import android.app.Notification;
import android.service.notification.StatusBarNotification;
import android.util.Log;
......@@ -37,6 +38,13 @@ public class NotificationRepository {
Log.d(TAG, "updateNotification() called with: list = [" + list.size() + "]");
Set<String> notificationSet = new HashSet<>();
for (StatusBarNotification statusBarNotification : list) {
Notification notification = statusBarNotification.getNotification();
if ((notification.flags & Notification.FLAG_ONGOING_EVENT)
== Notification.FLAG_ONGOING_EVENT
|| (notification.flags & Notification.FLAG_FOREGROUND_SERVICE)
== Notification.FLAG_FOREGROUND_SERVICE) {
continue;
}
notificationSet.add(statusBarNotification.getPackageName());
}
this.notificationRelay.accept(notificationSet);
......
......@@ -38,14 +38,15 @@ public class PackageAddedRemovedHandler extends BroadcastReceiver {
if ("android.intent.action.PACKAGE_CHANGED".equalsIgnoreCase(action)) {
Log.i(TAG, "handleEvent: changed " + packageName);
Intent launchIntent = ctx.getPackageManager().getLaunchIntentForPackage(packageName);
if (launchIntent == null) {
return;
if (launchIntent != null) {
BlissLauncher.getApplication(ctx).getIconsHandler().resetIconDrawableForPackage(
launchIntent.getComponent(), user);
}
BlissLauncher.getApplication(ctx).getIconsHandler().resetIconDrawableForPackage(
launchIntent.getComponent(), user);
AppChangeEvent appChangeEvent = new AppChangeEvent();
appChangeEvent.packageName = packageName;
EventBus.getDefault().post(appChangeEvent);
}
if ("android.intent.action.PACKAGE_REMOVED".equals(action) && !replacing) {
Log.i(TAG, "handleEvent: removed " + packageName);
......
......@@ -160,6 +160,9 @@ public class AppUtils {
try {
PackageManager packageManager = context.getPackageManager();
ApplicationInfo appInfo = packageManager.getApplicationInfo(packageName, 0);
if (!appInfo.enabled) {
return null;
}
Intent intent = packageManager.getLaunchIntentForPackage(packageName);
if (appInfo.packageName.equalsIgnoreCase(AppProvider.MICROG_PACKAGE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment