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

Commit 23d6bea2 authored by Frank Preel's avatar Frank Preel
Browse files

Get SetupWizard status

parent aa872933
Loading
Loading
Loading
Loading
+26 −9
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ import com.android.inputmethod.latin.utils.StatsUtils;
import com.android.inputmethod.latin.utils.StatsUtilsManager;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
import com.android.inputmethod.latin.utils.ViewLayoutUtils;
import android.provider.Settings;
import android.content.ContentResolver;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -870,6 +872,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
            mSuggestionStripView.setListener(this, view);
        }

        if (isSetupWizardFinished()) {
            ImageButton floatingButton = view.findViewById(R.id.floating_button);
            if (floatingButton != null) {
                floatingButton.setOnClickListener(new View.OnClickListener() {
@@ -881,6 +884,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
                });
            }
        }
    }

    private boolean isSetupWizardFinished() {
        Log.d(TAG, "isSetupWizardFinished");
        ContentResolver contentResolver = mDisplayContext.getContentResolver();
        Log.d(TAG, "isSetupWizardFinished 2");
        boolean isDeviceProvisioned = Settings.Global.getInt(contentResolver,
                Settings.Global.DEVICE_PROVISIONED, 0) == 1;
        boolean isUserSetupComplete = Settings.Secure.getInt(contentResolver,
                Settings.Secure.USER_SETUP_COMPLETE, 0) == 1;
        Log.d(TAG, "isSetupWizardFinished " + isDeviceProvisioned + " " + isUserSetupComplete);

        return isDeviceProvisioned && isUserSetupComplete;
    }

    @Override
    public void setCandidatesView(final View view) {