Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 406def65 authored by Clark Scheff's avatar Clark Scheff Committed by Brint E. Kriebel
Browse files

CM11 Themes: Don't kill setup wizards

Change-Id: Ib68dbf08b5b65f66e73f2f22882932ced0851093
parent 719abe8b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ import java.util.List;
public class ThemeService extends IThemeService.Stub {
    private static final String TAG = ThemeService.class.getName();

    private static final String GOOGLE_SETUPWIZARD_PACKAGE = "com.google.android.setupwizard";
    private static final String CM_SETUPWIZARD_PACKAGE = "com.cyanogenmod.account";

    private HandlerThread mWorker;
    private ThemeWorkerHandler mHandler;
    private Context mContext;
@@ -597,7 +600,8 @@ public class ThemeService extends IThemeService.Stub {

        List<ResolveInfo> infos = pm.queryIntentActivities(homeIntent, 0);
        for(ResolveInfo info : infos) {
            if (info.activityInfo != null && info.activityInfo.applicationInfo != null) {
            if (info.activityInfo != null && info.activityInfo.applicationInfo != null &&
                    !isSetupActivity(info)) {
                String pkgToStop = info.activityInfo.applicationInfo.packageName;
                Log.d(TAG, "Force stopping " +  pkgToStop + " for theme change");
                try {
@@ -609,6 +613,11 @@ public class ThemeService extends IThemeService.Stub {
        }
    }

    private boolean isSetupActivity(ResolveInfo info) {
        return GOOGLE_SETUPWIZARD_PACKAGE.equals(info.activityInfo.packageName) ||
               CM_SETUPWIZARD_PACKAGE.equals(info.activityInfo.packageName);
    }

    private void postProgress(String pkgName) {
        int N = mClients.beginBroadcast();
        for(int i=0; i < N; i++) {