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

Commit 69811a98 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Add a utility method to InputMethodInfo for FBE.

This is another preparation for Bug 26279466.  Whether an input method
is marked to be encryption-aware or not would become the thing here and
there in the Framework code.  Having a utility method and debug info
in dumpsys should make our lives easier.

Bug: 26279466
Change-Id: Icf921fe3661eccf4a589b08b616d05decc561356
parent 28576501
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -428,12 +428,31 @@ public final class InputMethodInfo implements Parcelable {
        }
    }

    /**
     * @return {@code true} if the IME is marked to be Encryption-Aware.
     * @hide
     */
    public boolean isEncryptionAware() {
        if (mService == null || mService.serviceInfo == null ||
                mService.serviceInfo.applicationInfo == null) {
            return false;
        }
        return mService.serviceInfo.applicationInfo.isEncryptionAware();
    }

    public void dump(Printer pw, String prefix) {
        pw.println(prefix + "mId=" + mId
                + " mSettingsActivityName=" + mSettingsActivityName
                + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod);
        pw.println(prefix + "mIsDefaultResId=0x"
                + Integer.toHexString(mIsDefaultResId));
        if (mService != null && mService.serviceInfo != null &&
                mService.serviceInfo.applicationInfo != null) {
            pw.println(" encryptionAware=" +
                    mService.serviceInfo.applicationInfo.isEncryptionAware());
        } else {
            pw.println(" encryptionAware=unknown");
        }
        pw.println(prefix + "Service:");
        mService.dump(pw, prefix + "  ");
    }