Removing static reference of deep shortcut manager

Bug: 141376165
Change-Id: Ie60b82be63a8926825598c681d8b2a1b2ace6413
This commit is contained in:
Sunny Goyal
2019-12-11 10:00:47 -08:00
parent 98833d525c
commit fa39536570
20 changed files with 284 additions and 402 deletions

View File

@@ -332,4 +332,17 @@ public class PackageManagerHelper {
}
return false;
}
/**
* Returns true if Launcher has the permission to access shortcuts.
* @see LauncherApps#hasShortcutHostPermission()
*/
public static boolean hasShortcutsPermission(Context context) {
try {
return context.getSystemService(LauncherApps.class).hasShortcutHostPermission();
} catch (SecurityException | IllegalStateException e) {
Log.e(TAG, "Failed to make shortcut manager call", e);
}
return false;
}
}