Method
isInstalled
(Context context, String pkg)
Source from the content-addressed store, hash-verified
| 716 | } |
| 717 | |
| 718 | static boolean isInstalled(Context context, String pkg) { |
| 719 | try { |
| 720 | PackageManager pm = context.getPackageManager(); |
| 721 | pm.getPackageInfo(pkg, 0); |
| 722 | return true; |
| 723 | } catch (Throwable ex) { |
| 724 | Log.i(ex); |
| 725 | return false; |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | static boolean isComponentEnabled(Context context, Class<?> clazz) { |
| 730 | PackageManager pm = context.getPackageManager(); |
Tested by
no test coverage detected