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

Commit 525d62e6 authored by Frank Preel's avatar Frank Preel
Browse files

switchToNextInputMethod

parent a6844b75
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -108,6 +108,11 @@ import com.android.inputmethod.latin.utils.ViewLayoutUtils;

import android.content.ContentResolver;

import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;

import android.os.IBinder;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -118,6 +123,9 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;




/**
 * Input method implementation for Qwerty'ish keyboard.
 */
@@ -880,7 +888,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
                    @Override
                    public void onClick(View v) {
                        Log.d(TAG, "Clicked");
                        //launchSettings(SettingsActivity.EXTRA_ENTRY_VALUE_LONG_PRESS_COMMA);
                        switchToNextInputMethod();
                    }
                });
            } else {
@@ -889,6 +897,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
        }
    }

    private void switchToNextInputMethod() {
        Log.d(TAG, "switchToNextInputMethod");
        final IBinder token = getWindow().getWindow().getAttributes().token;
        Log.d(TAG, "switchToNextInputMethod 2");
        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
        Log.d(TAG, "switchToNextInputMethod 3");
        if (imm != null) {
            Log.d(TAG, "switchToNextInputMethod 4");
            imm.switchToNextInputMethod(token, false /* onlyCurrentIme */);
            Log.d(TAG, "switchToNextInputMethod 5");    
        }
    }

    private boolean isSetupWizardFinished() {
        Log.d(TAG, "isSetupWizardFinished");
        ContentResolver contentResolver = mDisplayContext.getContentResolver();