summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathew Inwood <mathewi@google.com> 2018-08-03 09:00:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-08-03 09:00:25 +0000
commitd609a403426118498ea17ec4ca3bc4ab9d4d057b (patch)
treeac8ef47fd7791f547677b4a9e0643b0565d67f00
parentbb67bab55fb7fc8a94be7189fe8cbf910d4bbc5c (diff)
parent6be794927bc61115df8d3873481642efe8bb055b (diff)
Merge "Add @UnsupportedAppUsage annotations"
-rw-r--r--config/hiddenapi-light-greylist.txt19
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java11
-rw-r--r--core/java/android/inputmethodservice/Keyboard.java4
-rw-r--r--core/java/android/inputmethodservice/KeyboardView.java7
4 files changed, 22 insertions, 19 deletions
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index d2f067866d2c..de0cacbebb59 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -2262,25 +2262,6 @@ Landroid/icu/util/UResourceBundle;->getString()Ljava/lang/String;
Landroid/icu/util/UResourceBundle;->getType()I
Landroid/icu/util/UResourceBundleIterator;->hasNext()Z
Landroid/icu/util/UResourceBundleIterator;->next()Landroid/icu/util/UResourceBundle;
-Landroid/inputmethodservice/InputMethodService$SettingsObserver;->shouldShowImeWithHardKeyboard()Z
-Landroid/inputmethodservice/InputMethodService;->mExtractEditText:Landroid/inputmethodservice/ExtractEditText;
-Landroid/inputmethodservice/InputMethodService;->mExtractView:Landroid/view/View;
-Landroid/inputmethodservice/InputMethodService;->mRootView:Landroid/view/View;
-Landroid/inputmethodservice/InputMethodService;->mSettingsObserver:Landroid/inputmethodservice/InputMethodService$SettingsObserver;
-Landroid/inputmethodservice/InputMethodService;->mTheme:I
-Landroid/inputmethodservice/InputMethodService;->mTmpInsets:Landroid/inputmethodservice/InputMethodService$Insets;
-Landroid/inputmethodservice/InputMethodService;->onExtractedDeleteText(II)V
-Landroid/inputmethodservice/InputMethodService;->onExtractedReplaceText(IILjava/lang/CharSequence;)V
-Landroid/inputmethodservice/InputMethodService;->onExtractedSetSpan(Ljava/lang/Object;III)V
-Landroid/inputmethodservice/Keyboard;->mModifierKeys:Ljava/util/List;
-Landroid/inputmethodservice/Keyboard;->mTotalHeight:I
-Landroid/inputmethodservice/Keyboard;->mTotalWidth:I
-Landroid/inputmethodservice/KeyboardView;->mKeyBackground:Landroid/graphics/drawable/Drawable;
-Landroid/inputmethodservice/KeyboardView;->mLabelTextSize:I
-Landroid/inputmethodservice/KeyboardView;->mPreviewText:Landroid/widget/TextView;
-Landroid/inputmethodservice/KeyboardView;->openPopupIfRequired(Landroid/view/MotionEvent;)Z
-Landroid/inputmethodservice/KeyboardView;->repeatKey()Z
-Landroid/inputmethodservice/KeyboardView;->showKey(I)V
Landroid/location/Country;-><init>(Ljava/lang/String;I)V
Landroid/location/Country;->getCountryIso()Ljava/lang/String;
Landroid/location/Country;->getSource()I
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 1bafcaec280a..f510b3687bf2 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -25,6 +25,7 @@ import android.annotation.IntDef;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.app.ActivityManager;
import android.app.Dialog;
import android.content.Context;
@@ -266,10 +267,12 @@ public class InputMethodService extends AbstractInputMethodService {
InputMethodManager mImm;
+ @UnsupportedAppUsage
int mTheme = 0;
LayoutInflater mInflater;
TypedArray mThemeAttrs;
+ @UnsupportedAppUsage
View mRootView;
SoftInputWindow mWindow;
boolean mInitialized;
@@ -314,8 +317,10 @@ public class InputMethodService extends AbstractInputMethodService {
boolean mFullscreenApplied;
boolean mIsFullscreen;
+ @UnsupportedAppUsage
View mExtractView;
boolean mExtractViewHidden;
+ @UnsupportedAppUsage
ExtractEditText mExtractEditText;
ViewGroup mExtractAccessories;
View mExtractAction;
@@ -336,6 +341,7 @@ public class InputMethodService extends AbstractInputMethodService {
*/
boolean mShouldClearInsetOfPreviousIme;
+ @UnsupportedAppUsage
final Insets mTmpInsets = new Insets();
final int[] mTmpLocation = new int[2];
@@ -725,6 +731,7 @@ public class InputMethodService extends AbstractInputMethodService {
mService.getContentResolver().unregisterContentObserver(this);
}
+ @UnsupportedAppUsage
private boolean shouldShowImeWithHardKeyboard() {
// Lazily initialize as needed.
if (mShowImeWithHardKeyboard == ShowImeWithHardKeyboardType.UNKNOWN) {
@@ -764,6 +771,7 @@ public class InputMethodService extends AbstractInputMethodService {
return "SettingsObserver{mShowImeWithHardKeyboard=" + mShowImeWithHardKeyboard + "}";
}
}
+ @UnsupportedAppUsage
private SettingsObserver mSettingsObserver;
/**
@@ -2317,6 +2325,7 @@ public class InputMethodService extends AbstractInputMethodService {
/**
* @hide
*/
+ @UnsupportedAppUsage
public void onExtractedDeleteText(int start, int end) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
@@ -2329,6 +2338,7 @@ public class InputMethodService extends AbstractInputMethodService {
/**
* @hide
*/
+ @UnsupportedAppUsage
public void onExtractedReplaceText(int start, int end, CharSequence text) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
@@ -2340,6 +2350,7 @@ public class InputMethodService extends AbstractInputMethodService {
/**
* @hide
*/
+ @UnsupportedAppUsage
public void onExtractedSetSpan(Object span, int start, int end, int flags) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
diff --git a/core/java/android/inputmethodservice/Keyboard.java b/core/java/android/inputmethodservice/Keyboard.java
index a5490eff0899..f063496beb80 100644
--- a/core/java/android/inputmethodservice/Keyboard.java
+++ b/core/java/android/inputmethodservice/Keyboard.java
@@ -18,6 +18,7 @@ package android.inputmethodservice;
import org.xmlpull.v1.XmlPullParserException;
+import android.annotation.UnsupportedAppUsage;
import android.annotation.XmlRes;
import android.content.Context;
import android.content.res.Resources;
@@ -110,18 +111,21 @@ public class Keyboard {
private int mKeyHeight;
/** Total height of the keyboard, including the padding and keys */
+ @UnsupportedAppUsage
private int mTotalHeight;
/**
* Total width of the keyboard, including left side gaps and keys, but not any gaps on the
* right side.
*/
+ @UnsupportedAppUsage
private int mTotalWidth;
/** List of keys in this keyboard */
private List<Key> mKeys;
/** List of modifier keys such as Shift & Alt, if any */
+ @UnsupportedAppUsage
private List<Key> mModifierKeys;
/** Width of the screen available to fit the keyboard */
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java
index 13b9206b12ee..befc2bb1de28 100644
--- a/core/java/android/inputmethodservice/KeyboardView.java
+++ b/core/java/android/inputmethodservice/KeyboardView.java
@@ -16,6 +16,7 @@
package android.inputmethodservice;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
@@ -135,6 +136,7 @@ public class KeyboardView extends View implements View.OnClickListener {
private Keyboard mKeyboard;
private int mCurrentKeyIndex = NOT_A_KEY;
+ @UnsupportedAppUsage
private int mLabelTextSize;
private int mKeyTextSize;
private int mKeyTextColor;
@@ -142,6 +144,7 @@ public class KeyboardView extends View implements View.OnClickListener {
private int mShadowColor;
private float mBackgroundDimAmount;
+ @UnsupportedAppUsage
private TextView mPreviewText;
private PopupWindow mPreviewPopup;
private int mPreviewTextSizeLarge;
@@ -219,6 +222,7 @@ public class KeyboardView extends View implements View.OnClickListener {
private float mOldPointerX;
private float mOldPointerY;
+ @UnsupportedAppUsage
private Drawable mKeyBackground;
private static final int REPEAT_INTERVAL = 50; // ~20 keys per second
@@ -910,6 +914,7 @@ public class KeyboardView extends View implements View.OnClickListener {
}
}
+ @UnsupportedAppUsage
private void showKey(final int keyIndex) {
final PopupWindow previewPopup = mPreviewPopup;
final Key[] keys = mKeys;
@@ -1052,6 +1057,7 @@ public class KeyboardView extends View implements View.OnClickListener {
key.x + key.width + mPaddingLeft, key.y + key.height + mPaddingTop);
}
+ @UnsupportedAppUsage
private boolean openPopupIfRequired(MotionEvent me) {
// Check if we have a popup layout specified first.
if (mPopupLayout == 0) {
@@ -1357,6 +1363,7 @@ public class KeyboardView extends View implements View.OnClickListener {
return true;
}
+ @UnsupportedAppUsage
private boolean repeatKey() {
Key key = mKeys[mRepeatKeyIndex];
detectAndSendKey(mCurrentKey, key.x, key.y, mLastTapTime);