diff options
author | 2016-10-12 21:31:53 +0000 | |
---|---|---|
committer | 2016-10-12 21:31:56 +0000 | |
commit | 3bc72e55497a5a4e28c816b89c6dfffec0d2764d (patch) | |
tree | 9a66a565bdb3b041e519f4a3022928f3c40d5be8 | |
parent | 85fe52dacdc5054e0eb0db82a98992298947c95f (diff) | |
parent | 67e2ae86396c6d0f989285275cbf908dee5e71f7 (diff) |
Merge "Fix import statement in view|transition|animation packages."
62 files changed, 351 insertions, 373 deletions
diff --git a/core/java/android/animation/KeyframeSet.java b/core/java/android/animation/KeyframeSet.java index fd0bf0bc4727..116d0631bd7d 100644 --- a/core/java/android/animation/KeyframeSet.java +++ b/core/java/android/animation/KeyframeSet.java @@ -16,15 +16,15 @@ package android.animation; -import java.util.Arrays; -import java.util.List; - -import android.animation.Keyframe.IntKeyframe; import android.animation.Keyframe.FloatKeyframe; +import android.animation.Keyframe.IntKeyframe; import android.animation.Keyframe.ObjectKeyframe; import android.graphics.Path; import android.util.Log; +import java.util.Arrays; +import java.util.List; + /** * This class holds a collection of Keyframe objects and is called by ValueAnimator to calculate * values between those keyframes for a given animation. The class internal to the animation diff --git a/core/java/android/transition/ChangeBounds.java b/core/java/android/transition/ChangeBounds.java index a95da976d115..b6d8aa449533 100644 --- a/core/java/android/transition/ChangeBounds.java +++ b/core/java/android/transition/ChangeBounds.java @@ -16,19 +16,18 @@ package android.transition; -import android.animation.AnimatorSet; -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.PointF; - import android.animation.Animator; import android.animation.AnimatorListenerAdapter; +import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.animation.RectEvaluator; +import android.content.Context; +import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Path; +import android.graphics.PointF; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; diff --git a/core/java/android/transition/ChangeScroll.java b/core/java/android/transition/ChangeScroll.java index e09268553a18..8a3fd1c34daa 100644 --- a/core/java/android/transition/ChangeScroll.java +++ b/core/java/android/transition/ChangeScroll.java @@ -19,8 +19,6 @@ package android.transition; import android.animation.Animator; import android.animation.ObjectAnimator; import android.content.Context; -import android.transition.Transition; -import android.transition.TransitionValues; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/core/java/android/transition/ChangeTransform.java b/core/java/android/transition/ChangeTransform.java index 974912167205..4b0b065ad6b1 100644 --- a/core/java/android/transition/ChangeTransform.java +++ b/core/java/android/transition/ChangeTransform.java @@ -30,6 +30,7 @@ import android.util.Property; import android.view.GhostView; import android.view.View; import android.view.ViewGroup; + import com.android.internal.R; /** diff --git a/core/java/android/transition/Explode.java b/core/java/android/transition/Explode.java index 3445ef2fbbaa..5f078ca53fec 100644 --- a/core/java/android/transition/Explode.java +++ b/core/java/android/transition/Explode.java @@ -15,8 +15,6 @@ */ package android.transition; -import com.android.internal.R; - import android.animation.Animator; import android.animation.TimeInterpolator; import android.content.Context; @@ -26,6 +24,8 @@ import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; + +import com.android.internal.R; /** * This transition tracks changes to the visibility of target views in the * start and end scenes and moves views in or out from the edges of the diff --git a/core/java/android/transition/PatternPathMotion.java b/core/java/android/transition/PatternPathMotion.java index f23863f8851f..7a2c191be0dd 100644 --- a/core/java/android/transition/PatternPathMotion.java +++ b/core/java/android/transition/PatternPathMotion.java @@ -15,8 +15,6 @@ */ package android.transition; -import com.android.internal.R; - import android.content.Context; import android.content.res.TypedArray; import android.graphics.Matrix; @@ -25,6 +23,8 @@ import android.graphics.PathMeasure; import android.util.AttributeSet; import android.util.PathParser; +import com.android.internal.R; + /** * A PathMotion that takes a Path pattern and applies it to the separation between two points. * The starting point of the Path will be moved to the origin and the end point will be scaled diff --git a/core/java/android/transition/Slide.java b/core/java/android/transition/Slide.java index 2645f861a5ad..9cf321014ff8 100644 --- a/core/java/android/transition/Slide.java +++ b/core/java/android/transition/Slide.java @@ -26,6 +26,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; + import com.android.internal.R; import java.lang.annotation.Retention; diff --git a/core/java/android/transition/TransitionInflater.java b/core/java/android/transition/TransitionInflater.java index cbf76bc3dc4b..4c5a71764728 100644 --- a/core/java/android/transition/TransitionInflater.java +++ b/core/java/android/transition/TransitionInflater.java @@ -17,11 +17,6 @@ package android.transition; import android.annotation.TransitionRes; -import com.android.internal.R; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; @@ -32,6 +27,11 @@ import android.util.Xml; import android.view.InflateException; import android.view.ViewGroup; +import com.android.internal.R; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; diff --git a/core/java/android/transition/TranslationAnimationCreator.java b/core/java/android/transition/TranslationAnimationCreator.java index b07f3f87b1e6..ae76e6254f6b 100644 --- a/core/java/android/transition/TranslationAnimationCreator.java +++ b/core/java/android/transition/TranslationAnimationCreator.java @@ -15,8 +15,6 @@ */ package android.transition; -import com.android.internal.R; - import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; @@ -25,6 +23,8 @@ import android.graphics.Path; import android.transition.Transition.TransitionListener; import android.view.View; +import com.android.internal.R; + /** * This class is used by Slide and Explode to create an animator that goes from the start * position to the end position. It takes into account the canceled position so that it diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 85a4bf9d9e8f..3beb00fc8d9e 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -16,11 +16,11 @@ package android.view; +import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE; + import android.annotation.IntDef; import android.annotation.RequiresPermission; -import android.content.Context; import android.content.res.CompatibilityInfo; -import android.content.res.Resources; import android.graphics.PixelFormat; import android.graphics.Point; import android.graphics.Rect; @@ -36,8 +36,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Arrays; -import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE; - /** * Provides information about the size and density of a logical display. * <p> diff --git a/core/java/android/view/DisplayEventReceiver.java b/core/java/android/view/DisplayEventReceiver.java index 4393992b3245..67cdfc53fb39 100644 --- a/core/java/android/view/DisplayEventReceiver.java +++ b/core/java/android/view/DisplayEventReceiver.java @@ -16,13 +16,13 @@ package android.view; -import dalvik.annotation.optimization.FastNative; -import dalvik.system.CloseGuard; - import android.os.Looper; import android.os.MessageQueue; import android.util.Log; +import dalvik.annotation.optimization.FastNative; +import dalvik.system.CloseGuard; + import java.lang.ref.WeakReference; /** diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index bc40849a47bc..1aef6ec0f302 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -23,10 +23,10 @@ import android.os.Parcelable; import android.util.ArraySet; import android.util.DisplayMetrics; -import java.util.Arrays; - import libcore.util.Objects; +import java.util.Arrays; + /** * Describes the characteristics of a particular logical display. * @hide diff --git a/core/java/android/view/FallbackEventHandler.java b/core/java/android/view/FallbackEventHandler.java index dd68d8966eb8..8e00d6da7ea7 100644 --- a/core/java/android/view/FallbackEventHandler.java +++ b/core/java/android/view/FallbackEventHandler.java @@ -24,4 +24,3 @@ public interface FallbackEventHandler { public void preDispatchKeyEvent(KeyEvent event); public boolean dispatchKeyEvent(KeyEvent event); } - diff --git a/core/java/android/view/FrameMetrics.java b/core/java/android/view/FrameMetrics.java index 2b938d0df7eb..800a63f7da07 100644 --- a/core/java/android/view/FrameMetrics.java +++ b/core/java/android/view/FrameMetrics.java @@ -17,7 +17,6 @@ package android.view; import android.annotation.IntDef; -import android.view.Window; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/core/java/android/view/FrameMetricsObserver.java b/core/java/android/view/FrameMetricsObserver.java index 63313578cffe..9e81de0e09bb 100644 --- a/core/java/android/view/FrameMetricsObserver.java +++ b/core/java/android/view/FrameMetricsObserver.java @@ -17,15 +17,12 @@ package android.view; import android.annotation.NonNull; -import android.util.Log; import android.os.Looper; import android.os.MessageQueue; import com.android.internal.util.VirtualRefBasePtr; -import java.lang.NullPointerException; import java.lang.ref.WeakReference; -import java.lang.SuppressWarnings; /** * Provides streaming access to frame stats information from the rendering diff --git a/core/java/android/view/HandlerActionQueue.java b/core/java/android/view/HandlerActionQueue.java index 4758a3408dc2..d016a7444082 100644 --- a/core/java/android/view/HandlerActionQueue.java +++ b/core/java/android/view/HandlerActionQueue.java @@ -16,11 +16,9 @@ package android.view; -import com.android.internal.util.GrowingArrayUtils; - import android.os.Handler; -import java.util.ArrayList; +import com.android.internal.util.GrowingArrayUtils; /** * Class used to enqueue pending work from Views when no Handler is attached. diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index f8796c31fe93..55f64d9f6664 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -19,10 +19,10 @@ package android.view; import android.content.Context; import android.hardware.input.InputDeviceIdentifier; import android.hardware.input.InputManager; +import android.os.NullVibrator; import android.os.Parcel; import android.os.Parcelable; import android.os.Vibrator; -import android.os.NullVibrator; import java.util.ArrayList; import java.util.List; diff --git a/core/java/android/view/InputEventReceiver.java b/core/java/android/view/InputEventReceiver.java index 91ef50d76180..20ab539f52d2 100644 --- a/core/java/android/view/InputEventReceiver.java +++ b/core/java/android/view/InputEventReceiver.java @@ -16,13 +16,13 @@ package android.view; -import dalvik.system.CloseGuard; - import android.os.Looper; import android.os.MessageQueue; import android.util.Log; import android.util.SparseIntArray; +import dalvik.system.CloseGuard; + import java.lang.ref.WeakReference; /** diff --git a/core/java/android/view/InputEventSender.java b/core/java/android/view/InputEventSender.java index 304ea3f8bd2b..b25fb65b654c 100644 --- a/core/java/android/view/InputEventSender.java +++ b/core/java/android/view/InputEventSender.java @@ -16,12 +16,12 @@ package android.view; -import dalvik.system.CloseGuard; - import android.os.Looper; import android.os.MessageQueue; import android.util.Log; +import dalvik.system.CloseGuard; + import java.lang.ref.WeakReference; /** diff --git a/core/java/android/view/InputFilter.java b/core/java/android/view/InputFilter.java index 4aba30ca483e..d0dab4000fff 100644 --- a/core/java/android/view/InputFilter.java +++ b/core/java/android/view/InputFilter.java @@ -20,12 +20,6 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; -import android.view.IInputFilter; -import android.view.InputEvent; -import android.view.InputEventConsistencyVerifier; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.WindowManagerPolicy; /** * Filters input events before they are dispatched to the system. diff --git a/core/java/android/view/InputQueue.java b/core/java/android/view/InputQueue.java index aebc60152bf0..582ae79a743f 100644 --- a/core/java/android/view/InputQueue.java +++ b/core/java/android/view/InputQueue.java @@ -16,13 +16,13 @@ package android.view; -import dalvik.system.CloseGuard; - import android.os.Looper; import android.os.MessageQueue; +import android.util.LongSparseArray; import android.util.Pools.Pool; import android.util.Pools.SimplePool; -import android.util.LongSparseArray; + +import dalvik.system.CloseGuard; import java.lang.ref.WeakReference; diff --git a/core/java/android/view/KeyCharacterMap.java b/core/java/android/view/KeyCharacterMap.java index c8b89e7ac607..88f2d3460346 100644 --- a/core/java/android/view/KeyCharacterMap.java +++ b/core/java/android/view/KeyCharacterMap.java @@ -16,14 +16,13 @@ package android.view; +import android.hardware.input.InputManager; import android.os.Parcel; import android.os.Parcelable; import android.text.method.MetaKeyKeyListener; import android.util.AndroidRuntimeException; import android.util.SparseIntArray; -import android.hardware.input.InputManager; -import java.lang.Character; import java.text.Normalizer; /** diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index b73acdaf6d8b..5d8f336ef193 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -21,7 +21,6 @@ import android.os.Parcelable; import android.text.method.MetaKeyKeyListener; import android.util.Log; import android.util.SparseIntArray; -import android.view.KeyCharacterMap; import android.view.KeyCharacterMap.KeyData; /** diff --git a/core/java/android/view/KeyboardShortcutGroup.java b/core/java/android/view/KeyboardShortcutGroup.java index 57d07c0d0eac..78f0b30e7e20 100644 --- a/core/java/android/view/KeyboardShortcutGroup.java +++ b/core/java/android/view/KeyboardShortcutGroup.java @@ -15,6 +15,8 @@ */ package android.view; +import static com.android.internal.util.Preconditions.checkNotNull; + import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; @@ -24,8 +26,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static com.android.internal.util.Preconditions.checkNotNull; - /** * A group of {@link KeyboardShortcutInfo}. */ diff --git a/core/java/android/view/KeyboardShortcutInfo.java b/core/java/android/view/KeyboardShortcutInfo.java index a9f2699a6bb1..c934a4e31f98 100644 --- a/core/java/android/view/KeyboardShortcutInfo.java +++ b/core/java/android/view/KeyboardShortcutInfo.java @@ -15,14 +15,15 @@ */ package android.view; +import static com.android.internal.util.Preconditions.checkArgument; + +import static java.lang.Character.MIN_VALUE; + import android.annotation.Nullable; import android.graphics.drawable.Icon; import android.os.Parcel; import android.os.Parcelable; -import static com.android.internal.util.Preconditions.checkArgument; -import static java.lang.Character.MIN_VALUE; - /** * Information about a Keyboard Shortcut. */ diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index 914bd5684b4a..e3ac40c5da4e 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -16,11 +16,6 @@ package android.view; -import com.android.internal.R; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.annotation.LayoutRes; import android.annotation.Nullable; import android.content.Context; @@ -37,6 +32,11 @@ import android.util.TypedValue; import android.util.Xml; import android.widget.FrameLayout; +import com.android.internal.R; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + import java.io.IOException; import java.lang.reflect.Constructor; import java.util.HashMap; @@ -51,20 +51,20 @@ import java.util.HashMap; * * <pre>LayoutInflater inflater = (LayoutInflater)context.getSystemService * (Context.LAYOUT_INFLATER_SERVICE);</pre> - * + * * <p> * To create a new LayoutInflater with an additional {@link Factory} for your * own views, you can use {@link #cloneInContext} to clone an existing * ViewFactory, and then call {@link #setFactory} on it to include your * Factory. - * + * * <p> * For performance reasons, view inflation relies heavily on pre-processing of * XML files that is done at build time. Therefore, it is not currently possible * to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; * it only works with an XmlPullParser returned from a compiled resource * (R.<em>something</em> file.) - * + * * @see Context#getSystemService */ public abstract class LayoutInflater { @@ -95,7 +95,7 @@ public abstract class LayoutInflater { private static final HashMap<String, Constructor<? extends View>> sConstructorMap = new HashMap<String, Constructor<? extends View>>(); - + private HashMap<String, Boolean> mFilterMap; private TypedValue mTempValue; @@ -114,36 +114,36 @@ public abstract class LayoutInflater { /** * Hook to allow clients of the LayoutInflater to restrict the set of Views that are allowed * to be inflated. - * + * */ public interface Filter { /** - * Hook to allow clients of the LayoutInflater to restrict the set of Views + * Hook to allow clients of the LayoutInflater to restrict the set of Views * that are allowed to be inflated. - * + * * @param clazz The class object for the View that is about to be inflated - * + * * @return True if this class is allowed to be inflated, or false otherwise */ @SuppressWarnings("unchecked") boolean onLoadClass(Class clazz); } - + public interface Factory { /** * Hook you can supply that is called when inflating from a LayoutInflater. * You can use this to customize the tag names available in your XML * layout files. - * + * * <p> * Note that it is good practice to prefix these custom names with your * package (i.e., com.coolcompany.apps) to avoid conflicts with system * names. - * + * * @param name Tag name to be inflated. * @param context The context the view is being created in. * @param attrs Inflation attributes as specified in XML file. - * + * * @return View Newly created view. Return null for the default * behavior. */ @@ -171,14 +171,14 @@ public abstract class LayoutInflater { private static class FactoryMerger implements Factory2 { private final Factory mF1, mF2; private final Factory2 mF12, mF22; - + FactoryMerger(Factory f1, Factory2 f12, Factory f2, Factory2 f22) { mF1 = f1; mF2 = f2; mF12 = f12; mF22 = f22; } - + public View onCreateView(String name, Context context, AttributeSet attrs) { View v = mF1.onCreateView(name, context, attrs); if (v != null) return v; @@ -193,13 +193,13 @@ public abstract class LayoutInflater { : mF2.onCreateView(name, context, attrs); } } - + /** * Create a new LayoutInflater instance associated with a particular Context. * Applications will almost always want to use * {@link Context#getSystemService Context.getSystemService()} to retrieve * the standard {@link Context#LAYOUT_INFLATER_SERVICE Context.INFLATER_SERVICE}. - * + * * @param context The Context in which this LayoutInflater will create its * Views; most importantly, this supplies the theme from which the default * values for their attributes are retrieved. @@ -212,7 +212,7 @@ public abstract class LayoutInflater { * Create a new LayoutInflater instance that is a copy of an existing * LayoutInflater, optionally with its Context changed. For use in * implementing {@link #cloneInContext}. - * + * * @param original The original LayoutInflater to copy. * @param newContext The new Context to use. */ @@ -223,7 +223,7 @@ public abstract class LayoutInflater { mPrivateFactory = original.mPrivateFactory; setFilter(original.mFilter); } - + /** * Obtains the LayoutInflater from the given context. */ @@ -241,15 +241,15 @@ public abstract class LayoutInflater { * pointing to a different Context than the original. This is used by * {@link ContextThemeWrapper} to create a new LayoutInflater to go along * with the new Context theme. - * + * * @param newContext The new Context to associate with the new LayoutInflater. * May be the same as the original Context if desired. - * + * * @return Returns a brand spanking new LayoutInflater object associated with * the given Context. */ public abstract LayoutInflater cloneInContext(Context newContext); - + /** * Return the context we are running in, for access to resources, class * loader, etc. @@ -285,7 +285,7 @@ public abstract class LayoutInflater { * called on each element name as the xml is parsed. If the factory returns * a View, that is added to the hierarchy. If it returns null, the next * factory default {@link #onCreateView} method is called. - * + * * <p>If you have an existing * LayoutInflater and want to add your own factory to it, use * {@link #cloneInContext} to clone the existing instance and then you @@ -345,13 +345,13 @@ public abstract class LayoutInflater { public Filter getFilter() { return mFilter; } - + /** * Sets the {@link Filter} to by this LayoutInflater. If a view is attempted to be inflated * which is not allowed by the {@link Filter}, the {@link #inflate(int, ViewGroup)} call will * throw an {@link InflateException}. This filter will replace any previous filter set on this * LayoutInflater. - * + * * @param filter The Filter which restricts the set of Views that are allowed to be inflated. * This filter will replace any previous filter set on this LayoutInflater. */ @@ -365,7 +365,7 @@ public abstract class LayoutInflater { /** * Inflate a new view hierarchy from the specified xml resource. Throws * {@link InflateException} if there is an error. - * + * * @param resource ID for an XML layout resource to load (e.g., * <code>R.layout.main_page</code>) * @param root Optional view to be the parent of the generated hierarchy. @@ -385,7 +385,7 @@ public abstract class LayoutInflater { * reasons, view inflation relies heavily on pre-processing of XML files * that is done at build time. Therefore, it is not currently possible to * use LayoutInflater with an XmlPullParser over a plain XML file at runtime. - * + * * @param parser XML dom node containing the description of the view * hierarchy. * @param root Optional view to be the parent of the generated hierarchy. @@ -400,7 +400,7 @@ public abstract class LayoutInflater { /** * Inflate a new view hierarchy from the specified xml resource. Throws * {@link InflateException} if there is an error. - * + * * @param resource ID for an XML layout resource to load (e.g., * <code>R.layout.main_page</code>) * @param root Optional view to be the parent of the generated hierarchy (if @@ -437,7 +437,7 @@ public abstract class LayoutInflater { * reasons, view inflation relies heavily on pre-processing of XML files * that is done at build time. Therefore, it is not currently possible to * use LayoutInflater with an XmlPullParser over a plain XML file at runtime. - * + * * @param parser XML dom node containing the description of the view * hierarchy. * @param root Optional view to be the parent of the generated hierarchy (if @@ -475,7 +475,7 @@ public abstract class LayoutInflater { } final String name = parser.getName(); - + if (DEBUG) { System.out.println("**************************"); System.out.println("Creating root view: " @@ -579,17 +579,17 @@ public abstract class LayoutInflater { * Low-level function for instantiating a view by name. This attempts to * instantiate a view class of the given <var>name</var> found in this * LayoutInflater's ClassLoader. - * + * * <p> * There are two things that can happen in an error case: either the * exception describing the error will be thrown, or a null will be * returned. You must deal with both possibilities -- the former will happen * the first time createView() is called for a class of a particular name, * the latter every time there-after for that class name. - * + * * @param name The full name of the class to be instantiated. * @param attrs The XML attributes supplied for this instance. - * + * * @return View The newly instantiated view, or null. */ public final View createView(String name, String prefix, AttributeSet attrs) @@ -608,7 +608,7 @@ public abstract class LayoutInflater { // Class not found in the cache, see if it's real, and try to add it clazz = mContext.getClassLoader().loadClass( prefix != null ? (prefix + name) : name).asSubclass(View.class); - + if (mFilter != null && clazz != null) { boolean allowed = mFilter.onLoadClass(clazz); if (!allowed) { @@ -627,7 +627,7 @@ public abstract class LayoutInflater { // New class -- remember whether it is allowed clazz = mContext.getClassLoader().loadClass( prefix != null ? (prefix + name) : name).asSubclass(View.class); - + boolean allowed = clazz != null && mFilter.onLoadClass(clazz); mFilterMap.put(name, allowed); if (!allowed) { @@ -689,10 +689,10 @@ public abstract class LayoutInflater { * given the xml element name. Override it to handle custom view objects. If * you override this in your subclass be sure to call through to * super.onCreateView(name) for names you do not recognize. - * + * * @param name The fully qualified class name of the View to be create. * @param attrs An AttributeSet of attributes to apply to the View. - * + * * @return View The View created. */ protected View onCreateView(String name, AttributeSet attrs) @@ -842,7 +842,7 @@ public abstract class LayoutInflater { } final String name = parser.getName(); - + if (TAG_REQUEST_FOCUS.equals(name)) { parseRequestFocus(parser, parent); } else if (TAG_TAG.equals(name)) { diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java index 1c67ba74184e..73ea9ee31bce 100644 --- a/core/java/android/view/MenuInflater.java +++ b/core/java/android/view/MenuInflater.java @@ -16,11 +16,6 @@ package android.view; -import com.android.internal.view.menu.MenuItemImpl; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.annotation.MenuRes; import android.app.Activity; import android.content.Context; @@ -31,6 +26,11 @@ import android.util.AttributeSet; import android.util.Log; import android.util.Xml; +import com.android.internal.view.menu.MenuItemImpl; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -49,15 +49,15 @@ public class MenuInflater { /** Menu tag name in XML. */ private static final String XML_MENU = "menu"; - + /** Group tag name in XML. */ private static final String XML_GROUP = "group"; - + /** Item tag name in XML. */ private static final String XML_ITEM = "item"; private static final int NO_ID = 0; - + private static final Class<?>[] ACTION_VIEW_CONSTRUCTOR_SIGNATURE = new Class[] {Context.class}; private static final Class<?>[] ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE = ACTION_VIEW_CONSTRUCTOR_SIGNATURE; @@ -71,7 +71,7 @@ public class MenuInflater { /** * Constructs a menu inflater. - * + * * @see Activity#getMenuInflater() */ public MenuInflater(Context context) { @@ -96,7 +96,7 @@ public class MenuInflater { /** * Inflate a menu hierarchy from the specified XML resource. Throws * {@link InflateException} if there is an error. - * + * * @param menuRes Resource ID for an XML layout resource to load (e.g., * <code>R.menu.main_activity</code>) * @param menu The Menu to inflate into. The items and submenus will be @@ -107,7 +107,7 @@ public class MenuInflater { try { parser = mContext.getResources().getLayout(menuRes); AttributeSet attrs = Xml.asAttributeSet(parser); - + parseMenu(parser, attrs, menu); } catch (XmlPullParserException e) { throw new InflateException("Error inflating menu XML", e); @@ -140,12 +140,12 @@ public class MenuInflater { eventType = parser.next(); break; } - + throw new RuntimeException("Expecting menu, got " + tagName); } eventType = parser.next(); } while (eventType != XmlPullParser.END_DOCUMENT); - + boolean reachedEndOfMenu = false; while (!reachedEndOfMenu) { switch (eventType) { @@ -153,7 +153,7 @@ public class MenuInflater { if (lookingForEndOfUnknownTag) { break; } - + tagName = parser.getName(); if (tagName.equals(XML_GROUP)) { menuState.readGroup(attrs); @@ -171,7 +171,7 @@ public class MenuInflater { unknownTagName = tagName; } break; - + case XmlPullParser.END_TAG: tagName = parser.getName(); if (lookingForEndOfUnknownTag && tagName.equals(unknownTagName)) { @@ -194,11 +194,11 @@ public class MenuInflater { reachedEndOfMenu = true; } break; - + case XmlPullParser.END_DOCUMENT: throw new RuntimeException("Unexpected end of document"); } - + eventType = parser.next(); } } @@ -229,10 +229,10 @@ public class MenuInflater { private static class InflatedOnMenuItemClickListener implements MenuItem.OnMenuItemClickListener { private static final Class<?>[] PARAM_TYPES = new Class[] { MenuItem.class }; - + private Object mRealOwner; private Method mMethod; - + public InflatedOnMenuItemClickListener(Object realOwner, String methodName) { mRealOwner = realOwner; Class<?> c = realOwner.getClass(); @@ -246,7 +246,7 @@ public class MenuInflater { throw ex; } } - + public boolean onMenuItemClick(MenuItem item) { try { if (mMethod.getReturnType() == Boolean.TYPE) { @@ -277,7 +277,7 @@ public class MenuInflater { } return owner; } - + /** * State for the current menu. * <p> @@ -316,7 +316,7 @@ public class MenuInflater { private boolean itemChecked; private boolean itemVisible; private boolean itemEnabled; - + /** * Sync to attrs.xml enum, values in MenuItem: * - 0: never @@ -331,7 +331,7 @@ public class MenuInflater { private String itemActionProviderClassName; private String itemListenerMethodName; - + private ActionProvider itemActionProvider; private static final int defaultGroupId = NO_ID; @@ -342,13 +342,13 @@ public class MenuInflater { private static final boolean defaultItemChecked = false; private static final boolean defaultItemVisible = true; private static final boolean defaultItemEnabled = true; - + public MenuState(final Menu menu) { this.menu = menu; - + resetGroup(); } - + public void resetGroup() { groupId = defaultGroupId; groupCategory = defaultItemCategory; @@ -364,7 +364,7 @@ public class MenuInflater { public void readGroup(AttributeSet attrs) { TypedArray a = mContext.obtainStyledAttributes(attrs, com.android.internal.R.styleable.MenuGroup); - + groupId = a.getResourceId(com.android.internal.R.styleable.MenuGroup_id, defaultGroupId); groupCategory = a.getInt(com.android.internal.R.styleable.MenuGroup_menuCategory, defaultItemCategory); groupOrder = a.getInt(com.android.internal.R.styleable.MenuGroup_orderInCategory, defaultItemOrder); @@ -374,7 +374,7 @@ public class MenuInflater { a.recycle(); } - + /** * Called when the parser is pointing to an item tag. */ @@ -436,7 +436,7 @@ public class MenuInflater { return shortcutString.charAt(0); } } - + private void setItem(MenuItem item) { item.setChecked(itemChecked) .setVisible(itemVisible) @@ -446,11 +446,11 @@ public class MenuInflater { .setIcon(itemIconResId) .setAlphabeticShortcut(itemAlphabeticShortcut) .setNumericShortcut(itemNumericShortcut); - + if (itemShowAsAction >= 0) { item.setShowAsAction(itemShowAsAction); } - + if (itemListenerMethodName != null) { if (mContext.isRestricted()) { throw new IllegalStateException("The android:onClick attribute cannot " @@ -494,14 +494,14 @@ public class MenuInflater { setItem(item); return item; } - + public SubMenu addSubMenuItem() { itemAdded = true; SubMenu subMenu = menu.addSubMenu(groupId, itemId, itemCategoryOrder, itemTitle); setItem(subMenu.getItem()); return subMenu; } - + public boolean hasAddedItem() { return itemAdded; } diff --git a/core/java/android/view/PointerIcon.java b/core/java/android/view/PointerIcon.java index fc79f53b744b..998fd0195a98 100644 --- a/core/java/android/view/PointerIcon.java +++ b/core/java/android/view/PointerIcon.java @@ -17,9 +17,6 @@ package android.view; import android.annotation.NonNull; -import android.util.SparseArray; -import com.android.internal.util.XmlUtils; - import android.annotation.XmlRes; import android.content.Context; import android.content.res.Resources; @@ -32,6 +29,9 @@ import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; +import android.util.SparseArray; + +import com.android.internal.util.XmlUtils; /** * Represents an icon that can be used as a mouse pointer. diff --git a/core/java/android/view/RemotableViewMethod.java b/core/java/android/view/RemotableViewMethod.java index e5cae84942f9..03aed9a53925 100644 --- a/core/java/android/view/RemotableViewMethod.java +++ b/core/java/android/view/RemotableViewMethod.java @@ -36,6 +36,3 @@ public @interface RemotableViewMethod { */ String asyncImpl() default ""; } - - - diff --git a/core/java/android/view/RenderNodeAnimatorSetHelper.java b/core/java/android/view/RenderNodeAnimatorSetHelper.java index ba592d29fa3d..e1ef05941394 100644 --- a/core/java/android/view/RenderNodeAnimatorSetHelper.java +++ b/core/java/android/view/RenderNodeAnimatorSetHelper.java @@ -16,6 +16,7 @@ package android.view; import android.animation.TimeInterpolator; + import com.android.internal.view.animation.FallbackLUTInterpolator; import com.android.internal.view.animation.NativeInterpolatorFactory; import com.android.internal.view.animation.NativeInterpolatorFactoryHelper; diff --git a/core/java/android/view/RoundScrollbarRenderer.java b/core/java/android/view/RoundScrollbarRenderer.java index b77be8c00e69..4c555aed40cc 100644 --- a/core/java/android/view/RoundScrollbarRenderer.java +++ b/core/java/android/view/RoundScrollbarRenderer.java @@ -19,8 +19,8 @@ package android.view; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.graphics.RectF; import android.graphics.Rect; +import android.graphics.RectF; /** * Helper class for drawing round scroll bars on round Wear devices. diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java index 7cd161c17cd9..9787494c5018 100644 --- a/core/java/android/view/ScaleGestureDetector.java +++ b/core/java/android/view/ScaleGestureDetector.java @@ -20,7 +20,6 @@ import android.content.Context; import android.content.res.Resources; import android.os.Build; import android.os.Handler; -import android.os.SystemClock; /** * Detects scaling transformation gestures using the supplied {@link MotionEvent}s. diff --git a/core/java/android/view/SearchEvent.java b/core/java/android/view/SearchEvent.java index 643cc3ee28ec..72b5e4ba7398 100644 --- a/core/java/android/view/SearchEvent.java +++ b/core/java/android/view/SearchEvent.java @@ -16,8 +16,6 @@ package android.view; -import android.view.InputDevice; - /** * Class that contains information about an event that triggers a search. */ diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index 22e68a3b909c..ecd5e3b22188 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -26,11 +26,11 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.Log; +import dalvik.system.CloseGuard; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import dalvik.system.CloseGuard; - /** * Handle onto a raw buffer that is being managed by the screen compositor. * diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 64568260c022..b87250e5f131 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -16,7 +16,6 @@ package android.view; -import dalvik.system.CloseGuard; import android.graphics.Bitmap; import android.graphics.Rect; import android.graphics.Region; @@ -24,6 +23,8 @@ import android.os.IBinder; import android.util.Log; import android.view.Surface.OutOfResourcesException; +import dalvik.system.CloseGuard; + /** * SurfaceControl * @hide diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 816bcf09a89d..80f447ec51f8 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -16,11 +16,9 @@ package android.view; -import com.android.internal.view.BaseIWindow; - import android.content.Context; -import android.content.res.Configuration; import android.content.res.CompatibilityInfo.Translator; +import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.PixelFormat; import android.graphics.PorterDuff; @@ -28,12 +26,14 @@ import android.graphics.Rect; import android.graphics.Region; import android.os.Handler; import android.os.Message; +import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.SystemClock; -import android.os.ParcelFileDescriptor; import android.util.AttributeSet; import android.util.Log; +import com.android.internal.view.BaseIWindow; + import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.concurrent.locks.ReentrantLock; diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index f71459e426dc..0bb84cca174a 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -16,9 +16,9 @@ package android.view; -import android.app.ActivityManagerNative; import android.annotation.IntDef; import android.annotation.NonNull; +import android.app.ActivityManagerNative; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; diff --git a/core/java/android/view/TouchDelegate.java b/core/java/android/view/TouchDelegate.java index 27b49dbb377c..cf36f4360c3b 100644 --- a/core/java/android/view/TouchDelegate.java +++ b/core/java/android/view/TouchDelegate.java @@ -17,9 +17,6 @@ package android.view; import android.graphics.Rect; -import android.view.MotionEvent; -import android.view.View; -import android.view.ViewConfiguration; /** * Helper class to handle situations where you want a view to have a larger touch area than its @@ -33,24 +30,24 @@ import android.view.ViewConfiguration; * </p> */ public class TouchDelegate { - + /** - * View that should receive forwarded touch events + * View that should receive forwarded touch events */ private View mDelegateView; - + /** * Bounds in local coordinates of the containing view that should be mapped to the delegate * view. This rect is used for initial hit testing. */ private Rect mBounds; - + /** * mBounds inflated to include some slop. This rect is to track whether the motion events * should be considered to be be within the delegate view. */ private Rect mSlopBounds; - + /** * True if the delegate had been targeted on a down event (intersected mBounds). */ @@ -82,7 +79,7 @@ public class TouchDelegate { /** * Constructor - * + * * @param bounds Bounds in local coordinates of the containing view that should be mapped to * the delegate view * @param delegateView The view that should receive motion events @@ -99,7 +96,7 @@ public class TouchDelegate { /** * Will forward touch events to the delegate view if the event is within the bounds * specified in the constructor. - * + * * @param event The touch event to forward * @return True if the event was forwarded to the delegate, false otherwise. */ @@ -136,7 +133,7 @@ public class TouchDelegate { } if (sendToDelegate) { final View delegateView = mDelegateView; - + if (hit) { // Offset event coordinates to be inside the target view event.setLocation(delegateView.getWidth() / 2, delegateView.getHeight() / 2); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index bdf93e40de47..49d664ea60d9 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -16,6 +16,14 @@ package android.view; +import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; +import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; +import static android.os.Build.VERSION_CODES.KITKAT; +import static android.os.Build.VERSION_CODES.M; +import static android.os.Build.VERSION_CODES.N; + +import static java.lang.Math.max; + import android.animation.AnimatorInflater; import android.animation.StateListAnimator; import android.annotation.CallSuper; @@ -79,11 +87,11 @@ import android.util.SparseArray; import android.util.StateSet; import android.util.SuperNotCalledException; import android.util.TypedValue; -import android.view.ContextMenu.ContextMenuInfo; import android.view.AccessibilityIterators.CharacterTextSegmentIterator; import android.view.AccessibilityIterators.ParagraphTextSegmentIterator; import android.view.AccessibilityIterators.TextSegmentIterator; import android.view.AccessibilityIterators.WordTextSegmentIterator; +import android.view.ContextMenu.ContextMenuInfo; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityEventSource; import android.view.accessibility.AccessibilityManager; @@ -99,17 +107,15 @@ import android.view.inputmethod.InputMethodManager; import android.widget.Checkable; import android.widget.FrameLayout; import android.widget.ScrollBarDrawable; -import static android.os.Build.VERSION_CODES.*; -import static java.lang.Math.max; import com.android.internal.R; import com.android.internal.util.Predicate; import com.android.internal.view.menu.MenuBuilder; import com.android.internal.widget.ScrollBarUtils; + import com.google.android.collect.Lists; import com.google.android.collect.Maps; -import java.lang.NullPointerException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java index e1ff0d6735ab..047a515bb99e 100644 --- a/core/java/android/view/ViewDebug.java +++ b/core/java/android/view/ViewDebug.java @@ -51,8 +51,8 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; -import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; /** diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 2e428a734331..87a85f16043a 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -16,6 +16,8 @@ package android.view; +import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; + import android.animation.LayoutTransition; import android.annotation.IdRes; import android.annotation.NonNull; @@ -62,8 +64,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; - /** * <p> * A <code>ViewGroup</code> is a special view that can contain other views diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index c604234fa577..6c84b63bb241 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -17,8 +17,9 @@ package android.view; import android.animation.Animator; -import android.animation.ValueAnimator; import android.animation.TimeInterpolator; +import android.animation.ValueAnimator; + import java.util.ArrayList; import java.util.HashMap; import java.util.Set; @@ -42,7 +43,7 @@ import java.util.Set; * <p>This class is not constructed by the caller, but rather by the View whose properties * it will animate. Calls to {@link android.view.View#animate()} will return a reference * to the appropriate ViewPropertyAnimator object for that View.</p> - * + * */ public class ViewPropertyAnimator { @@ -332,7 +333,7 @@ public class ViewPropertyAnimator { * Sets the interpolator for the underlying animator that animates the requested properties. * By default, the animator uses the default interpolator for ValueAnimator. Calling this method * will cause the declared object to be used instead. - * + * * @param interpolator The TimeInterpolator to be used for ensuing property animations. A value * of <code>null</code> will result in linear interpolation. * @return This object, allowing calls to methods in this class to be chained. diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index b046e2d5c768..2c1383174eb6 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -16,6 +16,8 @@ package android.view; +import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; + import android.annotation.ColorInt; import android.annotation.DrawableRes; import android.annotation.IdRes; @@ -24,7 +26,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; import android.annotation.SystemApi; -import android.app.ActivityManagerNative; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -44,8 +45,6 @@ import android.transition.Transition; import android.transition.TransitionManager; import android.view.accessibility.AccessibilityEvent; -import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; - import java.util.List; /** diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java index dd4e09685362..c1b8f04a6865 100644 --- a/core/java/android/view/WindowManagerImpl.java +++ b/core/java/android/view/WindowManagerImpl.java @@ -23,7 +23,6 @@ import android.os.IBinder; import android.os.RemoteException; import com.android.internal.os.IResultReceiver; -import com.android.internal.R; import java.util.List; @@ -38,11 +37,11 @@ import java.util.List; * Additional window manager specific layout parameters are defined for * control over how windows are displayed. It also implements the {@link WindowManager} * interface, allowing you to control the displays attached to the device. - * + * * <p>Applications will not normally use WindowManager directly, instead relying * on the higher-level facilities in {@link android.app.Activity} and * {@link android.app.Dialog}. - * + * * <p>Even for low-level window manager access, it is almost never correct to use * this class. For example, {@link android.app.Activity#getWindowManager} * provides a window manager for adding windows that are associated with that diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index da361c1c04d2..b30104327f31 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -25,12 +25,12 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.RectF; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.view.animation.Animation; + import com.android.internal.policy.IShortcutService; import java.io.PrintWriter; diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java index c125b32f237a..8084195468c5 100644 --- a/core/java/android/view/accessibility/AccessibilityManager.java +++ b/core/java/android/view/accessibility/AccessibilityManager.java @@ -21,7 +21,6 @@ import android.accessibilityservice.AccessibilityServiceInfo; import android.annotation.NonNull; import android.content.Context; import android.content.pm.PackageManager; -import android.content.pm.ParceledListSlice; import android.content.pm.ServiceInfo; import android.os.Binder; import android.os.Handler; diff --git a/core/java/android/view/animation/Animation.java b/core/java/android/view/animation/Animation.java index d89c172be8a7..474db128fcc3 100644 --- a/core/java/android/view/animation/Animation.java +++ b/core/java/android/view/animation/Animation.java @@ -26,6 +26,7 @@ import android.os.Handler; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.TypedValue; + import dalvik.system.CloseGuard; /** @@ -80,13 +81,13 @@ public abstract class Animation implements Cloneable { * order. */ public static final int ZORDER_NORMAL = 0; - + /** * Requests that the content being animated be forced on top of all other * content for the duration of the animation. */ public static final int ZORDER_TOP = 1; - + /** * Requests that the content being animated be forced under all other * content for the duration of the animation. @@ -138,7 +139,7 @@ public abstract class Animation implements Cloneable { /** * Indicates whether fillBefore should be taken into account. */ - boolean mFillEnabled = false; + boolean mFillEnabled = false; /** * The time in milliseconds at which the animation must start; @@ -240,7 +241,7 @@ public abstract class Animation implements Cloneable { setDuration((long) a.getInt(com.android.internal.R.styleable.Animation_duration, 0)); setStartOffset((long) a.getInt(com.android.internal.R.styleable.Animation_startOffset, 0)); - + setFillEnabled(a.getBoolean(com.android.internal.R.styleable.Animation_fillEnabled, mFillEnabled)); setFillBefore(a.getBoolean(com.android.internal.R.styleable.Animation_fillBefore, mFillBefore)); setFillAfter(a.getBoolean(com.android.internal.R.styleable.Animation_fillAfter, mFillAfter)); @@ -249,7 +250,7 @@ public abstract class Animation implements Cloneable { setRepeatMode(a.getInt(com.android.internal.R.styleable.Animation_repeatMode, RESTART)); setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL)); - + setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0)); setDetachWallpaper(a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false)); @@ -294,13 +295,13 @@ public abstract class Animation implements Cloneable { /** * Cancel the animation. Cancelling an animation invokes the animation * listener, if set, to notify the end of the animation. - * + * * If you cancel an animation manually, you must call {@link #reset()} * before starting the animation again. - * - * @see #reset() - * @see #start() - * @see #startNow() + * + * @see #reset() + * @see #start() + * @see #startNow() */ public void cancel() { if (mStarted && !mEnded) { @@ -356,7 +357,7 @@ public abstract class Animation implements Cloneable { /** * Sets the handler used to invoke listeners. - * + * * @hide */ public void setListenerHandler(Handler handler) { @@ -424,7 +425,7 @@ public abstract class Animation implements Cloneable { /** * How long this animation should last. The duration cannot be negative. - * + * * @param durationMillis Duration in milliseconds * * @throws java.lang.IllegalArgumentException if the duration is < 0 @@ -443,7 +444,7 @@ public abstract class Animation implements Cloneable { * than <var>durationMillis</var>. In addition to adjusting the duration * itself, this ensures that the repeat count also will not make it run * longer than the given time. - * + * * @param durationMillis The maximum duration the animation is allowed * to run. */ @@ -455,7 +456,7 @@ public abstract class Animation implements Cloneable { mRepeatCount = 0; return; } - + long dur = mDuration + mStartOffset; if (dur > durationMillis) { mDuration = durationMillis-mStartOffset; @@ -480,7 +481,7 @@ public abstract class Animation implements Cloneable { } } } - + /** * How much to scale the duration by. * @@ -528,7 +529,7 @@ public abstract class Animation implements Cloneable { /** * Defines what this animation should do when it reaches the end. This * setting is applied only when the repeat count is either greater than - * 0 or {@link #INFINITE}. Defaults to {@link #RESTART}. + * 0 or {@link #INFINITE}. Defaults to {@link #RESTART}. * * @param repeatMode {@link #RESTART} or {@link #REVERSE} * @attr ref android.R.styleable#Animation_repeatMode @@ -606,7 +607,7 @@ public abstract class Animation implements Cloneable { * @param fillAfter true if the animation should apply its transformation after it ends * @attr ref android.R.styleable#Animation_fillAfter * - * @see #setFillEnabled(boolean) + * @see #setFillEnabled(boolean) */ public void setFillAfter(boolean fillAfter) { mFillAfter = fillAfter; @@ -614,7 +615,7 @@ public abstract class Animation implements Cloneable { /** * Set the Z ordering mode to use while running the animation. - * + * * @param zAdjustment The desired mode, one of {@link #ZORDER_NORMAL}, * {@link #ZORDER_TOP}, or {@link #ZORDER_BOTTOM}. * @attr ref android.R.styleable#Animation_zAdjustment @@ -622,7 +623,7 @@ public abstract class Animation implements Cloneable { public void setZAdjustment(int zAdjustment) { mZAdjustment = zAdjustment; } - + /** * Set background behind animation. * @@ -634,11 +635,11 @@ public abstract class Animation implements Cloneable { } /** - * The scale factor is set by the call to <code>getTransformation</code>. Overrides of + * The scale factor is set by the call to <code>getTransformation</code>. Overrides of * {@link #getTransformation(long, Transformation, float)} will get this value * directly. Overrides of {@link #applyTransformation(float, Transformation)} can * call this method to get the value. - * + * * @return float The scale factor that should be applied to pre-scaled values in * an Animation such as the pivot points in {@link ScaleAnimation} and {@link RotateAnimation}. */ @@ -748,7 +749,7 @@ public abstract class Animation implements Cloneable { /** * Returns the Z ordering mode to use while running the animation as * previously set by {@link #setZAdjustment}. - * + * * @return Returns one of {@link #ZORDER_NORMAL}, * {@link #ZORDER_TOP}, or {@link #ZORDER_BOTTOM}. * @attr ref android.R.styleable#Animation_zAdjustment @@ -827,7 +828,7 @@ public abstract class Animation implements Cloneable { public long computeDurationHint() { return (getStartOffset() + getDuration()) * (getRepeatCount() + 1); } - + /** * Gets the transformation to apply at a specified point in time. Implementations of this * method should always replace the specified Transformation or document they are doing @@ -975,7 +976,7 @@ public abstract class Animation implements Cloneable { * their transforms given an interpolation value. Implementations of this * method should always replace the specified Transformation or document * they are doing otherwise. - * + * * @param interpolatedTime The value of the normalized time (0.0 to 1.0) * after it has been run through the interpolation function. * @param t The Transformation object to fill in with the current @@ -1015,7 +1016,7 @@ public abstract class Animation implements Cloneable { * @param bottom * @param invalidate * @param transformation - * + * * @hide */ public void getInvalidateRegion(int left, int top, int right, int bottom, @@ -1072,7 +1073,7 @@ public abstract class Animation implements Cloneable { /** * Return true if this animation changes the view's alpha property. - * + * * @hide */ public boolean hasAlpha() { diff --git a/core/java/android/view/animation/AnimationSet.java b/core/java/android/view/animation/AnimationSet.java index 71c74506b917..09d4dfc93b19 100644 --- a/core/java/android/view/animation/AnimationSet.java +++ b/core/java/android/view/animation/AnimationSet.java @@ -18,17 +18,17 @@ package android.view.animation; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.RectF; import android.os.Build; import android.util.AttributeSet; -import android.graphics.RectF; import java.util.ArrayList; import java.util.List; /** * Represents a group of Animations that should be played together. - * The transformation of each individual animation are composed - * together into a single transform. + * The transformation of each individual animation are composed + * together into a single transform. * If AnimationSet sets any properties that its children also set * (for example, duration or fillBefore), the values of AnimationSet * override the child values. @@ -72,17 +72,17 @@ public class AnimationSet extends Animation { private long[] mStoredOffsets; /** - * Constructor used when an AnimationSet is loaded from a resource. - * + * Constructor used when an AnimationSet is loaded from a resource. + * * @param context Application context to use * @param attrs Attribute set from which to read values */ public AnimationSet(Context context, AttributeSet attrs) { super(context, attrs); - + TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.AnimationSet); - + setFlag(PROPERTY_SHARE_INTERPOLATOR_MASK, a.getBoolean(com.android.internal.R.styleable.AnimationSet_shareInterpolator, true)); init(); @@ -108,11 +108,11 @@ public class AnimationSet extends Animation { a.recycle(); } - - + + /** * Constructor to use when building an AnimationSet from code - * + * * @param shareInterpolator Pass true if all of the animations in this set * should use the interpolator associated with this AnimationSet. * Pass false if each animation should use its own interpolator. @@ -244,10 +244,10 @@ public class AnimationSet extends Animation { mDirty = true; } - + /** * Sets the start time of this animation and all child animations - * + * * @see android.view.animation.Animation#setStartTime(long) */ @Override @@ -289,11 +289,11 @@ public class AnimationSet extends Animation { animations.get(i).restrictDuration(durationMillis); } } - + /** - * The duration of an AnimationSet is defined to be the + * The duration of an AnimationSet is defined to be the * duration of the longest child animation. - * + * * @see android.view.animation.Animation#getDuration() */ @Override @@ -317,7 +317,7 @@ public class AnimationSet extends Animation { /** * The duration hint of an animation set is the maximum of the duration * hints of all of its component animations. - * + * * @see android.view.animation.Animation#computeDurationHint */ public long computeDurationHint() { @@ -362,7 +362,7 @@ public class AnimationSet extends Animation { /** * The transformation of an animation set is the concatenation of all of its * component animations. - * + * * @see android.view.animation.Animation#getTransformation */ @Override @@ -404,7 +404,7 @@ public class AnimationSet extends Animation { return more; } - + /** * @see android.view.animation.Animation#scaleCurrentDuration(float) */ diff --git a/core/java/android/view/animation/AnimationUtils.java b/core/java/android/view/animation/AnimationUtils.java index 351b6dbd6616..f5c36139df0f 100644 --- a/core/java/android/view/animation/AnimationUtils.java +++ b/core/java/android/view/animation/AnimationUtils.java @@ -16,19 +16,19 @@ package android.view.animation; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.annotation.AnimRes; import android.annotation.InterpolatorRes; import android.content.Context; import android.content.res.Resources; +import android.content.res.Resources.NotFoundException; import android.content.res.Resources.Theme; import android.content.res.XmlResourceParser; -import android.content.res.Resources.NotFoundException; +import android.os.SystemClock; import android.util.AttributeSet; import android.util.Xml; -import android.os.SystemClock; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; diff --git a/core/java/android/view/animation/AnticipateInterpolator.java b/core/java/android/view/animation/AnticipateInterpolator.java index fb66c312181c..7a837c37810c 100644 --- a/core/java/android/view/animation/AnticipateInterpolator.java +++ b/core/java/android/view/animation/AnticipateInterpolator.java @@ -18,8 +18,8 @@ package android.view.animation; import android.content.Context; import android.content.res.Resources; -import android.content.res.TypedArray; import android.content.res.Resources.Theme; +import android.content.res.TypedArray; import android.util.AttributeSet; import com.android.internal.R; diff --git a/core/java/android/view/animation/AnticipateOvershootInterpolator.java b/core/java/android/view/animation/AnticipateOvershootInterpolator.java index 1af72da7a3a4..9a75134a0c21 100644 --- a/core/java/android/view/animation/AnticipateOvershootInterpolator.java +++ b/core/java/android/view/animation/AnticipateOvershootInterpolator.java @@ -16,6 +16,10 @@ package android.view.animation; +import static com.android.internal.R.styleable.AnticipateOvershootInterpolator; +import static com.android.internal.R.styleable.AnticipateOvershootInterpolator_extraTension; +import static com.android.internal.R.styleable.AnticipateOvershootInterpolator_tension; + import android.content.Context; import android.content.res.Resources; import android.content.res.Resources.Theme; @@ -26,10 +30,6 @@ import com.android.internal.view.animation.HasNativeInterpolator; import com.android.internal.view.animation.NativeInterpolatorFactory; import com.android.internal.view.animation.NativeInterpolatorFactoryHelper; -import static com.android.internal.R.styleable.AnticipateOvershootInterpolator_extraTension; -import static com.android.internal.R.styleable.AnticipateOvershootInterpolator_tension; -import static com.android.internal.R.styleable.AnticipateOvershootInterpolator; - /** * An interpolator where the change starts backward then flings forward and overshoots * the target value and finally goes back to the final value. diff --git a/core/java/android/view/animation/CycleInterpolator.java b/core/java/android/view/animation/CycleInterpolator.java index 663c1091ca29..72d64a16393a 100644 --- a/core/java/android/view/animation/CycleInterpolator.java +++ b/core/java/android/view/animation/CycleInterpolator.java @@ -18,8 +18,8 @@ package android.view.animation; import android.content.Context; import android.content.res.Resources; -import android.content.res.TypedArray; import android.content.res.Resources.Theme; +import android.content.res.TypedArray; import android.util.AttributeSet; import com.android.internal.R; diff --git a/core/java/android/view/animation/DecelerateInterpolator.java b/core/java/android/view/animation/DecelerateInterpolator.java index f426f60dc581..f89743c149b1 100644 --- a/core/java/android/view/animation/DecelerateInterpolator.java +++ b/core/java/android/view/animation/DecelerateInterpolator.java @@ -18,8 +18,8 @@ package android.view.animation; import android.content.Context; import android.content.res.Resources; -import android.content.res.TypedArray; import android.content.res.Resources.Theme; +import android.content.res.TypedArray; import android.util.AttributeSet; import com.android.internal.R; diff --git a/core/java/android/view/animation/GridLayoutAnimationController.java b/core/java/android/view/animation/GridLayoutAnimationController.java index 9161d8beba7a..0f189ae98030 100644 --- a/core/java/android/view/animation/GridLayoutAnimationController.java +++ b/core/java/android/view/animation/GridLayoutAnimationController.java @@ -16,11 +16,11 @@ package android.view.animation; -import android.view.View; -import android.view.ViewGroup; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; import java.util.Random; @@ -43,7 +43,7 @@ import java.util.Random; * * @see LayoutAnimationController * @see android.widget.GridView - * + * * @attr ref android.R.styleable#GridLayoutAnimation_columnDelay * @attr ref android.R.styleable#GridLayoutAnimation_rowDelay * @attr ref android.R.styleable#GridLayoutAnimation_direction @@ -206,7 +206,7 @@ public class GridLayoutAnimationController extends LayoutAnimationController { * * @see #getRowDelay() * @see #getColumnDelay() - * @see #setColumnDelay(float) + * @see #setColumnDelay(float) */ public void setRowDelay(float rowDelay) { mRowDelay = rowDelay; diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java index 38962a36dd70..5f7a0f789fa4 100644 --- a/core/java/android/view/inputmethod/BaseInputConnection.java +++ b/core/java/android/view/inputmethod/BaseInputConnection.java @@ -1,12 +1,12 @@ /* * Copyright (C) 2008 The Android Open Source Project - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -35,7 +35,6 @@ import android.util.LogPrinter; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.View; -import android.view.ViewRootImpl; class ComposingText implements NoCopySpan { } @@ -56,25 +55,25 @@ public class BaseInputConnection implements InputConnection { protected final InputMethodManager mIMM; final View mTargetView; final boolean mDummyMode; - + private Object[] mDefaultComposingSpans; - + Editable mEditable; KeyCharacterMap mKeyCharacterMap; - + BaseInputConnection(InputMethodManager mgr, boolean fullEditor) { mIMM = mgr; mTargetView = null; mDummyMode = !fullEditor; } - + public BaseInputConnection(View targetView, boolean fullEditor) { mIMM = (InputMethodManager)targetView.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); mTargetView = targetView; mDummyMode = !fullEditor; } - + public static final void removeComposingSpans(Spannable text) { text.removeSpan(COMPOSING); Object[] sps = text.getSpans(0, text.length(), Object.class); @@ -104,8 +103,8 @@ public class BaseInputConnection implements InputConnection { } final int fl = text.getSpanFlags(o); - if ((fl&(Spanned.SPAN_COMPOSING|Spanned.SPAN_POINT_MARK_MASK)) - != (Spanned.SPAN_COMPOSING|Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)) { + if ((fl & (Spanned.SPAN_COMPOSING | Spanned.SPAN_POINT_MARK_MASK)) + != (Spanned.SPAN_COMPOSING | Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)) { text.setSpan(o, text.getSpanStart(o), text.getSpanEnd(o), (fl & ~Spanned.SPAN_POINT_MARK_MASK) | Spanned.SPAN_COMPOSING @@ -117,15 +116,15 @@ public class BaseInputConnection implements InputConnection { text.setSpan(COMPOSING, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING); } - + public static int getComposingSpanStart(Spannable text) { return text.getSpanStart(COMPOSING); } - + public static int getComposingSpanEnd(Spannable text) { return text.getSpanEnd(COMPOSING); } - + /** * Return the target of edit operations. The default implementation * returns its own fake editable that is just used for composing text; @@ -139,7 +138,7 @@ public class BaseInputConnection implements InputConnection { } return mEditable; } - + /** * Default implementation does nothing. */ @@ -452,10 +451,10 @@ public class BaseInputConnection implements InputConnection { */ public int getCursorCapsMode(int reqModes) { if (mDummyMode) return 0; - + final Editable content = getEditable(); if (content == null) return 0; - + int a = Selection.getSelectionStart(content); int b = Selection.getSelectionEnd(content); @@ -495,7 +494,7 @@ public class BaseInputConnection implements InputConnection { if (a <= 0) { return ""; } - + if (length > a) { length = a; } @@ -702,7 +701,7 @@ public class BaseInputConnection implements InputConnection { if (!mDummyMode) { return; } - + Editable content = getEditable(); if (content != null) { final int N = content.length(); @@ -727,7 +726,7 @@ public class BaseInputConnection implements InputConnection { return; } } - + // Otherwise, revert to the special key event containing // the actual characters. KeyEvent event = new KeyEvent(SystemClock.uptimeMillis(), @@ -768,7 +767,7 @@ public class BaseInputConnection implements InputConnection { if (content == null) { return; } - + beginBatchEdit(); // delete composing text set previously. @@ -776,7 +775,7 @@ public class BaseInputConnection implements InputConnection { int b = getComposingSpanEnd(content); if (DEBUG) Log.v(TAG, "Composing span: " + a + " to " + b); - + if (b < a) { int tmp = a; a = b; @@ -814,11 +813,11 @@ public class BaseInputConnection implements InputConnection { } setComposingSpans(sp); } - + if (DEBUG) Log.v(TAG, "Replacing from " + a + " to " + b + " with \"" + text + "\", composing=" + composing + ", type=" + text.getClass().getCanonicalName()); - + if (DEBUG) { LogPrinter lp = new LogPrinter(Log.VERBOSE, TAG); lp.println("Current text:"); @@ -842,13 +841,13 @@ public class BaseInputConnection implements InputConnection { Selection.setSelection(content, newCursorPosition); content.replace(a, b, text); - + if (DEBUG) { LogPrinter lp = new LogPrinter(Log.VERBOSE, TAG); lp.println("Final text:"); TextUtils.dumpSpans(content, lp, " "); } - + endBatchEdit(); } diff --git a/core/java/android/view/inputmethod/InputConnectionInspector.java b/core/java/android/view/inputmethod/InputConnectionInspector.java index 2b292bbca849..5f25bf58ce57 100644 --- a/core/java/android/view/inputmethod/InputConnectionInspector.java +++ b/core/java/android/view/inputmethod/InputConnectionInspector.java @@ -16,6 +16,8 @@ package android.view.inputmethod; +import static java.lang.annotation.RetentionPolicy.SOURCE; + import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -28,8 +30,6 @@ import java.util.Collections; import java.util.Map; import java.util.WeakHashMap; -import static java.lang.annotation.RetentionPolicy.SOURCE; - /** * @hide */ diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java index 661b52fd4366..5c8e6dc39960 100644 --- a/core/java/android/view/inputmethod/InputMethodInfo.java +++ b/core/java/android/view/inputmethod/InputMethodInfo.java @@ -16,9 +16,6 @@ package android.view.inputmethod; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; @@ -39,6 +36,9 @@ import android.util.Slog; import android.util.Xml; import android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index ca370dc749ef..2e99092006f0 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1,12 +1,12 @@ /* * Copyright (C) 2007-2008 The Android Open Source Project - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,15 +16,7 @@ package android.view.inputmethod; -import com.android.internal.inputmethod.IInputContentUriToken; -import com.android.internal.os.SomeArgs; -import com.android.internal.view.IInputConnectionWrapper; -import com.android.internal.view.IInputContext; -import com.android.internal.view.IInputMethodClient; -import com.android.internal.view.IInputMethodManager; -import com.android.internal.view.IInputMethodSession; -import com.android.internal.view.InputBindResult; -import com.android.internal.view.InputMethodClient; +import static android.Manifest.permission.WRITE_SECURE_SETTINGS; import android.annotation.NonNull; import android.annotation.Nullable; @@ -40,8 +32,8 @@ import android.os.Message; import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ServiceManager; -import android.os.Trace; import android.os.ServiceManager.ServiceNotFoundException; +import android.os.Trace; import android.text.TextUtils; import android.text.style.SuggestionSpan; import android.util.Log; @@ -56,11 +48,19 @@ import android.view.InputEventSender; import android.view.KeyEvent; import android.view.View; import android.view.ViewRootImpl; -import android.view.textservice.TextServicesManager; + +import com.android.internal.inputmethod.IInputContentUriToken; +import com.android.internal.os.SomeArgs; +import com.android.internal.view.IInputConnectionWrapper; +import com.android.internal.view.IInputContext; +import com.android.internal.view.IInputMethodClient; +import com.android.internal.view.IInputMethodManager; +import com.android.internal.view.IInputMethodSession; +import com.android.internal.view.InputBindResult; +import com.android.internal.view.InputMethodClient; import java.io.FileDescriptor; import java.io.PrintWriter; -import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -70,14 +70,12 @@ import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static android.Manifest.permission.WRITE_SECURE_SETTINGS; - /** * Central system API to the overall input method framework (IMF) architecture, * which arbitrates interaction between applications and the current input method. * You can retrieve an instance of this interface with * {@link Context#getSystemService(String) Context.getSystemService()}. - * + * * <p>Topics covered here: * <ol> * <li><a href="#ArchitectureOverview">Architecture Overview</a> @@ -85,13 +83,13 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * <li><a href="#InputMethods">Input Methods</a> * <li><a href="#Security">Security</a> * </ol> - * + * * <a name="ArchitectureOverview"></a> * <h3>Architecture Overview</h3> - * + * * <p>There are three primary parties involved in the input method * framework (IMF) architecture:</p> - * + * * <ul> * <li> The <strong>input method manager</strong> as expressed by this class * is the central point of the system that manages interaction between all @@ -106,16 +104,16 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * method manager for input focus and control over the state of the IME. Only * one such client is ever active (working with the IME) at a time. * </ul> - * - * + * + * * <a name="Applications"></a> * <h3>Applications</h3> - * + * * <p>In most cases, applications that are using the standard * {@link android.widget.TextView} or its subclasses will have little they need * to do to work well with soft input methods. The main things you need to * be aware of are:</p> - * + * * <ul> * <li> Properly set the {@link android.R.attr#inputType} in your editable * text views, so that the input method will have enough context to help the @@ -131,43 +129,43 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * for your window using the same {@link android.R.attr#windowSoftInputMode} * attribute. * </ul> - * + * * <p>More finer-grained control is available through the APIs here to directly * interact with the IMF and its IME -- either showing or hiding the input * area, letting the user pick an input method, etc.</p> - * + * * <p>For the rare people amongst us writing their own text editors, you * will need to implement {@link android.view.View#onCreateInputConnection} * to return a new instance of your own {@link InputConnection} interface * allowing the IME to interact with your editor.</p> - * - * + * + * * <a name="InputMethods"></a> * <h3>Input Methods</h3> - * + * * <p>An input method (IME) is implemented * as a {@link android.app.Service}, typically deriving from * {@link android.inputmethodservice.InputMethodService}. It must provide * the core {@link InputMethod} interface, though this is normally handled by * {@link android.inputmethodservice.InputMethodService} and implementors will * only need to deal with the higher-level API there.</p> - * + * * See the {@link android.inputmethodservice.InputMethodService} class for * more information on implementing IMEs. - * - * + * + * * <a name="Security"></a> * <h3>Security</h3> - * + * * <p>There are a lot of security issues associated with input methods, * since they essentially have freedom to completely drive the UI and monitor * everything the user enters. The Android input method framework also allows * arbitrary third party IMEs, so care must be taken to restrict their * selection and interactions.</p> - * + * * <p>Here are some key points about the security architecture behind the * IMF:</p> - * + * * <ul> * <li> <p>Only the system is allowed to directly access an IME's * {@link InputMethod} interface, via the @@ -175,11 +173,11 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * enforced in the system by not binding to an input method service that does * not require this permission, so the system can guarantee no other untrusted * clients are accessing the current input method outside of its control.</p> - * + * * <li> <p>There may be many client processes of the IMF, but only one may * be active at a time. The inactive clients can not interact with key * parts of the IMF through the mechanisms described below.</p> - * + * * <li> <p>Clients of an input method are only given access to its * {@link InputMethodSession} interface. One instance of this interface is * created for each client, and only calls from the session associated with @@ -187,19 +185,19 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * by {@link android.inputmethodservice.AbstractInputMethodService} for normal * IMEs, but must be explicitly handled by an IME that is customizing the * raw {@link InputMethodSession} implementation.</p> - * + * * <li> <p>Only the active client's {@link InputConnection} will accept * operations. The IMF tells each client process whether it is active, and * the framework enforces that in inactive processes calls on to the current * InputConnection will be ignored. This ensures that the current IME can * only deliver events and text edits to the UI that the user sees as * being in focus.</p> - * + * * <li> <p>An IME can never interact with an {@link InputConnection} while * the screen is off. This is enforced by making all clients inactive while * the screen is off, and prevents bad IMEs from driving the UI when the user * can not be aware of its behavior.</p> - * + * * <li> <p>A client application can ask that the system let the user pick a * new IME, but can not programmatically switch to one itself. This avoids * malicious applications from switching the user to their own IME, which @@ -207,7 +205,7 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS; * IME, on the other hand, <em>is</em> allowed to programmatically switch * the system to another IME, since it already has full control of user * input.</p> - * + * * <li> <p>The user must explicitly enable a new IME in settings before * they can switch to it, to confirm with the system that they know about it * and want to make it available for use.</p> @@ -268,11 +266,11 @@ public final class InputMethodManager { final IInputMethodManager mService; final Looper mMainLooper; - + // For scheduling work on the main thread. This also serves as our // global lock. final H mH; - + // Our generic input connection if the current target does not have its own. final IInputContext mIInputContext; @@ -280,20 +278,20 @@ public final class InputMethodManager { * True if this input method client is active, initially false. */ boolean mActive = false; - + /** * Set whenever this client becomes inactive, to know we need to reset * state with the IME the next time we receive focus. */ boolean mHasBeenInactive = true; - + /** * As reported by IME through InputConnection. */ boolean mFullscreenMode; - + // ----------------------------------------------------------- - + /** * This is the root view of the overall window that currently has input * method focus. @@ -328,7 +326,7 @@ public final class InputMethodManager { * The completions that were last provided by the served view. */ CompletionInfo[] mCompletions; - + // Cursor position on the screen. Rect mTmpCursorRect = new Rect(); Rect mCursorRect = new Rect(); @@ -389,7 +387,7 @@ public final class InputMethodManager { final SparseArray<PendingEvent> mPendingEvents = new SparseArray<>(20); // ----------------------------------------------------------- - + static final int MSG_DUMP = 1; static final int MSG_BIND = 2; static final int MSG_UNBIND = 3; @@ -403,7 +401,7 @@ public final class InputMethodManager { H(Looper looper) { super(looper, null, true); } - + @Override public void handleMessage(Message msg) { switch (msg.what) { @@ -654,7 +652,7 @@ public final class InputMethodManager { return sInstance; } } - + /** * Private optimization: retrieve the global InputMethodManager instance, * if it exists. @@ -663,17 +661,17 @@ public final class InputMethodManager { public static InputMethodManager peekInstance() { return sInstance; } - + /** @hide */ public IInputMethodClient getClient() { return mClient; } - + /** @hide */ public IInputContext getInputContext() { return mIInputContext; } - + public List<InputMethodInfo> getInputMethodList() { try { return mService.getInputMethodList(); @@ -784,7 +782,7 @@ public final class InputMethodManager { && mCurrentTextBoxAttribute != null; } } - + /** * Return true if any view is currently active in the input method. */ @@ -794,7 +792,7 @@ public final class InputMethodManager { return mServedView != null && mCurrentTextBoxAttribute != null; } } - + /** * Return true if the currently served view is accepting full text edits. * If false, it has no input connection, so can only handle raw key events. @@ -871,7 +869,7 @@ public final class InputMethodManager { || !mServedView.checkInputConnectionProxy(view))) { return; } - + mCompletions = completions; if (mCurMethod != null) { try { @@ -881,7 +879,7 @@ public final class InputMethodManager { } } } - + public void updateExtractedText(View view, int token, ExtractedText text) { checkFocus(); synchronized (mH) { @@ -889,7 +887,7 @@ public final class InputMethodManager { || !mServedView.checkInputConnectionProxy(view))) { return; } - + if (mCurMethod != null) { try { mCurMethod.updateExtractedText(token, text); @@ -898,26 +896,26 @@ public final class InputMethodManager { } } } - + /** * Flag for {@link #showSoftInput} to indicate that this is an implicit * request to show the input window, not as the result of a direct request * by the user. The window may not be shown in this case. */ public static final int SHOW_IMPLICIT = 0x0001; - + /** * Flag for {@link #showSoftInput} to indicate that the user has forced * the input method open (such as by long-pressing menu) so it should * not be closed until they explicitly do so. */ public static final int SHOW_FORCED = 0x0002; - + /** * Synonym for {@link #showSoftInput(View, int, ResultReceiver)} without * a result receiver: explicitly request that the current input method's * soft input area be shown to the user, if needed. - * + * * @param view The currently focused view, which would like to receive * soft keyboard input. * @param flags Provides additional operating flags. Currently may be @@ -926,7 +924,7 @@ public final class InputMethodManager { public boolean showSoftInput(View view, int flags) { return showSoftInput(view, flags, null); } - + /** * Flag for the {@link ResultReceiver} result code from * {@link #showSoftInput(View, int, ResultReceiver)} and @@ -934,7 +932,7 @@ public final class InputMethodManager { * state of the soft input window was unchanged and remains shown. */ public static final int RESULT_UNCHANGED_SHOWN = 0; - + /** * Flag for the {@link ResultReceiver} result code from * {@link #showSoftInput(View, int, ResultReceiver)} and @@ -942,7 +940,7 @@ public final class InputMethodManager { * state of the soft input window was unchanged and remains hidden. */ public static final int RESULT_UNCHANGED_HIDDEN = 1; - + /** * Flag for the {@link ResultReceiver} result code from * {@link #showSoftInput(View, int, ResultReceiver)} and @@ -950,7 +948,7 @@ public final class InputMethodManager { * state of the soft input window changed from hidden to shown. */ public static final int RESULT_SHOWN = 2; - + /** * Flag for the {@link ResultReceiver} result code from * {@link #showSoftInput(View, int, ResultReceiver)} and @@ -958,7 +956,7 @@ public final class InputMethodManager { * state of the soft input window changed from shown to hidden. */ public static final int RESULT_HIDDEN = 3; - + /** * Explicitly request that the current input method's soft input area be * shown to the user, if needed. Call this if the user interacts with @@ -1000,7 +998,7 @@ public final class InputMethodManager { } } } - + /** @hide */ public void showSoftInputUnchecked(int flags, ResultReceiver resultReceiver) { try { @@ -1009,14 +1007,14 @@ public final class InputMethodManager { throw e.rethrowFromSystemServer(); } } - + /** * Flag for {@link #hideSoftInputFromWindow} to indicate that the soft * input window should only be hidden if it was not explicitly shown * by the user. */ public static final int HIDE_IMPLICIT_ONLY = 0x0001; - + /** * Flag for {@link #hideSoftInputFromWindow} to indicate that the soft * input window should normally be hidden, unless it was originally @@ -1028,7 +1026,7 @@ public final class InputMethodManager { * Synonym for {@link #hideSoftInputFromWindow(IBinder, int, ResultReceiver)} * without a result: request to hide the soft input window from the * context of the window that is currently accepting input. - * + * * @param windowToken The token of the window that is making the request, * as returned by {@link View#getWindowToken() View.getWindowToken()}. * @param flags Provides additional operating flags. Currently may be @@ -1037,7 +1035,7 @@ public final class InputMethodManager { public boolean hideSoftInputFromWindow(IBinder windowToken, int flags) { return hideSoftInputFromWindow(windowToken, flags, null); } - + /** * Request to hide the soft input window from the context of the window * that is currently accepting input. This should be called as a result @@ -1079,11 +1077,11 @@ public final class InputMethodManager { } } } - + /** * This method toggles the input method window display. - * If the input window is already displayed, it gets hidden. + * If the input window is already displayed, it gets hidden. * If not the input window will be displayed. * @param windowToken The token of the window that is making the request, * as returned by {@link View#getWindowToken() View.getWindowToken()}. @@ -1110,7 +1108,7 @@ public final class InputMethodManager { /* * This method toggles the input method window display. - * If the input window is already displayed, it gets hidden. + * If the input window is already displayed, it gets hidden. * If not the input window will be displayed. * @param showFlags Provides additional operating flags. May be * 0 or have the {@link #SHOW_IMPLICIT}, @@ -1134,7 +1132,7 @@ public final class InputMethodManager { * restart it with its new contents. You should call this when the text * within your view changes outside of the normal input method or key * input flow, such as when an application calls TextView.setText(). - * + * * @param view The view whose text has changed. */ public void restartInput(View view) { @@ -1144,7 +1142,7 @@ public final class InputMethodManager { || !mServedView.checkInputConnectionProxy(view))) { return; } - + mServedConnecting = true; } @@ -1196,7 +1194,7 @@ public final class InputMethodManager { }); return false; } - + // Okay we are now ready to call into the served view and have it // do its stuff. // Life is good: let's hook everything up! @@ -1465,7 +1463,7 @@ public final class InputMethodManager { return true; } - + void closeCurrentInput() { try { mService.hideSoftInput(mClient, HIDE_NOT_ALWAYS, null); @@ -1504,7 +1502,7 @@ public final class InputMethodManager { if (first) { controlFlags |= CONTROL_WINDOW_FIRST; } - + if (checkFocusNoStartInput(forceNewFocus)) { // We need to restart input on the current focus view. This // should be done in conjunction with telling the system service @@ -1792,7 +1790,7 @@ public final class InputMethodManager { * Close/hide the input method's soft input area, so the user no longer * sees it or can interact with it. This can only be called * from the currently active input method, as validated by the given token. - * + * * @param token Supplies the identifying token given to an input method * when it was started, which allows it to perform this operation on * itself. @@ -1807,13 +1805,13 @@ public final class InputMethodManager { throw e.rethrowFromSystemServer(); } } - + /** - * Show the input method's soft input area, so the user + * Show the input method's soft input area, so the user * sees the input method window and can interact with it. * This can only be called from the currently active input method, * as validated by the given token. - * + * * @param token Supplies the identifying token given to an input method * when it was started, which allows it to perform this operation on * itself. @@ -2335,7 +2333,7 @@ public final class InputMethodManager { void doDump(FileDescriptor fd, PrintWriter fout, String[] args) { final Printer p = new PrintWriterPrinter(fout); p.println("Input method client state for " + this + ":"); - + p.println(" mService=" + mService); p.println(" mMainLooper=" + mMainLooper); p.println(" mIInputContext=" + mIInputContext); diff --git a/core/java/android/view/textservice/SpellCheckerInfo.java b/core/java/android/view/textservice/SpellCheckerInfo.java index fc17f7aed301..7aa2c23ae5e0 100644 --- a/core/java/android/view/textservice/SpellCheckerInfo.java +++ b/core/java/android/view/textservice/SpellCheckerInfo.java @@ -16,9 +16,6 @@ package android.view.textservice; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; @@ -35,6 +32,9 @@ import android.util.PrintWriterPrinter; import android.util.Slog; import android.util.Xml; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; diff --git a/core/java/android/view/textservice/SpellCheckerSession.java b/core/java/android/view/textservice/SpellCheckerSession.java index e77dc0dd97d8..729eb8d131a7 100644 --- a/core/java/android/view/textservice/SpellCheckerSession.java +++ b/core/java/android/view/textservice/SpellCheckerSession.java @@ -16,11 +16,6 @@ package android.view.textservice; -import com.android.internal.textservice.ISpellCheckerSession; -import com.android.internal.textservice.ISpellCheckerSessionListener; -import com.android.internal.textservice.ITextServicesManager; -import com.android.internal.textservice.ITextServicesSessionListener; - import android.os.Binder; import android.os.Handler; import android.os.HandlerThread; @@ -29,6 +24,11 @@ import android.os.Process; import android.os.RemoteException; import android.util.Log; +import com.android.internal.textservice.ISpellCheckerSession; +import com.android.internal.textservice.ISpellCheckerSessionListener; +import com.android.internal.textservice.ITextServicesManager; +import com.android.internal.textservice.ITextServicesSessionListener; + import java.util.LinkedList; import java.util.Queue; diff --git a/core/java/android/view/textservice/SpellCheckerSubtype.java b/core/java/android/view/textservice/SpellCheckerSubtype.java index 8dff0c67eeee..026610ecb6f9 100644 --- a/core/java/android/view/textservice/SpellCheckerSubtype.java +++ b/core/java/android/view/textservice/SpellCheckerSubtype.java @@ -16,8 +16,6 @@ package android.view.textservice; -import com.android.internal.inputmethod.InputMethodUtils; - import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; @@ -27,6 +25,8 @@ import android.os.Parcelable; import android.text.TextUtils; import android.util.Slog; +import com.android.internal.inputmethod.InputMethodUtils; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; diff --git a/core/java/android/view/textservice/SuggestionsInfo.java b/core/java/android/view/textservice/SuggestionsInfo.java index 78bc1a9678f1..dc2051cccbf6 100644 --- a/core/java/android/view/textservice/SuggestionsInfo.java +++ b/core/java/android/view/textservice/SuggestionsInfo.java @@ -16,11 +16,11 @@ package android.view.textservice; -import com.android.internal.util.ArrayUtils; - import android.os.Parcel; import android.os.Parcelable; +import com.android.internal.util.ArrayUtils; + /** * This class contains a metadata of suggestions from the text service */ |