Don't show prompt when shortcut created on Android 14 (#2627)
This commit is contained in:
parent
b178215f2f
commit
aa9875eed3
|
|
@ -86,8 +86,12 @@ public class WelcomeDialog extends DialogFragment {
|
|||
|
||||
public static void showIfNeed(FragmentManager fm) {
|
||||
if (shown) return;
|
||||
if (!ConfigManager.isBinderAlive()) return;
|
||||
if (App.getPreferences().getBoolean("never_show_welcome", false)) return;
|
||||
if (!ConfigManager.isBinderAlive() ||
|
||||
App.getPreferences().getBoolean("never_show_welcome", false) ||
|
||||
(App.isParasitic && ShortcutUtil.isLaunchShortcutPinned())) {
|
||||
shown = true;
|
||||
return;
|
||||
}
|
||||
new WelcomeDialog().show(fm, "welcome");
|
||||
shown = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,14 +168,12 @@ public class ShortcutUtil {
|
|||
public static boolean isLaunchShortcutPinned() {
|
||||
var context = App.getInstance();
|
||||
var sm = context.getSystemService(ShortcutManager.class);
|
||||
boolean pinned = false;
|
||||
for (var info : sm.getPinnedShortcuts()) {
|
||||
if (SHORTCUT_ID.equals(info.getId())) {
|
||||
pinned = true;
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return pinned;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean shouldAllowPinShortcut(Context context) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue