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

Commit 46a00726 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Fix some compiler warnings"

parents 0b8bb0c2 5f00fe09
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -346,7 +346,8 @@ final class KeyCodeDescriptionMapper {
    }

    // TODO: Remove this method once TTS supports emoticon verbalization.
    private String getSpokenEmoticonDescription(final Context context, final String outputText) {
    private static String getSpokenEmoticonDescription(final Context context,
            final String outputText) {
        final StringBuilder sb = new StringBuilder(SPOKEN_EMOTICON_RESOURCE_NAME_PREFIX);
        final int textLength = outputText.length();
        for (int index = 0; index < textLength; index = outputText.offsetByCodePoints(index, 1)) {
+1 −2
Original line number Diff line number Diff line
@@ -329,9 +329,8 @@ final class KeyboardAccessibilityNodeProvider<KV extends KeyboardView>
        if (currentSettings.isWordSeparator(key.getCode())) {
            return mAccessibilityUtils.getAutoCorrectionDescription(
                    keyCodeDescription, shouldObscure);
        } else {
            return keyCodeDescription;
        }
        return keyCodeDescription;
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public final class CompatUtils {

        public <T> ToObjectMethodWrapper<T> getMethod(final String name,
                final T defaultValue, final Class<?>... parameterTypes) {
            return new ToObjectMethodWrapper<T>(CompatUtils.getMethod(mClass, name, parameterTypes),
            return new ToObjectMethodWrapper<>(CompatUtils.getMethod(mClass, name, parameterTypes),
                    defaultValue);
        }

+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public class CursorAnchorInfoCompatWrapper {
     */
    public static final int FLAG_IS_RTL = 0x04;

    private CursorAnchorInfoCompatWrapper() {
    CursorAnchorInfoCompatWrapper() {
        // This class is not publicly instantiable.
    }

+10 −16
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.inputmethod.compat;

import android.text.Spannable;
import android.text.Spanned;
import android.text.style.LocaleSpan;
import android.util.Log;

@@ -127,13 +128,13 @@ public final class LocaleSpanCompatUtils {
            final int spanFlag = spannable.getSpanFlags(existingLocaleSpan);
            if (spanStart < newStart) {
                newStart = spanStart;
                isStartExclusive = ((spanFlag & Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) ==
                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                isStartExclusive = ((spanFlag & Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) ==
                        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
            if (newEnd < spanEnd) {
                newEnd = spanEnd;
                isEndExclusive = ((spanFlag & Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) ==
                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                isEndExclusive = ((spanFlag & Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) ==
                        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
            existingLocaleSpansToBeMerged.add(existingLocaleSpan);
        }
@@ -201,24 +202,17 @@ public final class LocaleSpanCompatUtils {

    private static int getSpanFlag(final int originalFlag,
            final boolean isStartExclusive, final boolean isEndExclusive) {
        return (originalFlag & ~Spannable.SPAN_POINT_MARK_MASK) |
        return (originalFlag & ~Spanned.SPAN_POINT_MARK_MASK) |
                getSpanPointMarkFlag(isStartExclusive, isEndExclusive);
    }

    private static int getSpanPointMarkFlag(final boolean isStartExclusive,
            final boolean isEndExclusive) {
        if (isStartExclusive) {
            if (isEndExclusive) {
                return Spannable.SPAN_EXCLUSIVE_EXCLUSIVE;
            } else {
                return Spannable.SPAN_EXCLUSIVE_INCLUSIVE;
            }
        } else {
            if (isEndExclusive) {
                return Spannable.SPAN_INCLUSIVE_EXCLUSIVE;
            } else {
                return Spannable.SPAN_INCLUSIVE_INCLUSIVE;
            }
            return isEndExclusive ? Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
                    : Spanned.SPAN_EXCLUSIVE_INCLUSIVE;
        }
        return isEndExclusive ? Spanned.SPAN_INCLUSIVE_EXCLUSIVE
                : Spanned.SPAN_INCLUSIVE_INCLUSIVE;
    }
}
Loading