diff options
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java index e7411ae..4918b11 100644 --- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java +++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java @@ -199,6 +199,16 @@ public class SetupWizardUtils { return AccountManager.get(context).getAccountsByType(accountType).length > 0; } + public static boolean isPackageInstalled(Context context, String packageName) { + PackageManager pm = context.getPackageManager(); + try { + pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + public static void disableSetupWizard(Context context) { disableComponent(context, context.getPackageName(), "com.cyanogenmod.setupwizard.ui.SetupWizardActivity"); |