Skip to content

Commit

Permalink
Merge pull request leolin310148#65 from auchri/patch-2
Browse files Browse the repository at this point in the history
Fix for xiaomi devices with custom launcher
  • Loading branch information
leolin310148 committed Mar 20, 2016
2 parents 82a6c75 + 7025e73 commit 51e4aa1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ private static void initBadger(Context context) {
ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
String currentHomePackage = resolveInfo.activityInfo.packageName;

if (Build.MANUFACTURER.equalsIgnoreCase("Xiaomi")) {
sShortcutBadger = new XiaomiHomeBadger();
return;
}

for (Class<? extends Badger> badger : BADGERS) {
Badger shortcutBadger = badger.newInstance();
if (shortcutBadger.getSupportLaunchers().contains(currentHomePackage)) {
sShortcutBadger = shortcutBadger;
break;
}
}

if (sShortcutBadger == null && Build.MANUFACTURER.equalsIgnoreCase("Xiaomi")) {
sShortcutBadger = new XiaomiHomeBadger();
return;
}
} catch (Exception e) {
Log.e(LOG_TAG, e.getMessage(), e);
}
Expand Down

0 comments on commit 51e4aa1

Please sign in to comment.