SetupWizard: Conditionally run account setup
If the package defined by cm_account_type (which can be overlayed) exists, then add CyanogenSettingsPage. Otherwise, omit. PS3: On the cyngn side, the account type and package name don't match. Added a new string to overlay. Change-Id: I15e032e21281aaf51ca32ac9cc0861e033201f19
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user