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) {
|
public static void showIfNeed(FragmentManager fm) {
|
||||||
if (shown) return;
|
if (shown) return;
|
||||||
if (!ConfigManager.isBinderAlive()) return;
|
if (!ConfigManager.isBinderAlive() ||
|
||||||
if (App.getPreferences().getBoolean("never_show_welcome", false)) return;
|
App.getPreferences().getBoolean("never_show_welcome", false) ||
|
||||||
|
(App.isParasitic && ShortcutUtil.isLaunchShortcutPinned())) {
|
||||||
|
shown = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
new WelcomeDialog().show(fm, "welcome");
|
new WelcomeDialog().show(fm, "welcome");
|
||||||
shown = true;
|
shown = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,14 +168,12 @@ public class ShortcutUtil {
|
||||||
public static boolean isLaunchShortcutPinned() {
|
public static boolean isLaunchShortcutPinned() {
|
||||||
var context = App.getInstance();
|
var context = App.getInstance();
|
||||||
var sm = context.getSystemService(ShortcutManager.class);
|
var sm = context.getSystemService(ShortcutManager.class);
|
||||||
boolean pinned = false;
|
|
||||||
for (var info : sm.getPinnedShortcuts()) {
|
for (var info : sm.getPinnedShortcuts()) {
|
||||||
if (SHORTCUT_ID.equals(info.getId())) {
|
if (SHORTCUT_ID.equals(info.getId())) {
|
||||||
pinned = true;
|
return true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pinned;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldAllowPinShortcut(Context context) {
|
public static boolean shouldAllowPinShortcut(Context context) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue