summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/server/search/SearchManagerService.java2
-rw-r--r--core/java/android/view/View.java15
-rw-r--r--core/java/android/widget/TextView.java15
3 files changed, 15 insertions, 17 deletions
diff --git a/core/java/android/server/search/SearchManagerService.java b/core/java/android/server/search/SearchManagerService.java
index de4dd88..affeb90 100644
--- a/core/java/android/server/search/SearchManagerService.java
+++ b/core/java/android/server/search/SearchManagerService.java
@@ -283,6 +283,8 @@ public class SearchManagerService extends ISearchManager.Stub {
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
+
IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ");
synchronized (mSearchables) {
for (int i = 0; i < mSearchables.size(); i++) {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 946965b..158e0c0 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -10515,9 +10515,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* <p>Causes the Runnable to be added to the message queue.
* The runnable will be run on the user interface thread.</p>
*
- * <p>This method can be invoked from outside of the UI thread
- * only when this View is attached to a window.</p>
- *
* @param action The Runnable that will be executed.
*
* @return Returns true if the Runnable was successfully placed in to the
@@ -10542,9 +10539,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* after the specified amount of time elapses.
* The runnable will be run on the user interface thread.</p>
*
- * <p>This method can be invoked from outside of the UI thread
- * only when this View is attached to a window.</p>
- *
* @param action The Runnable that will be executed.
* @param delayMillis The delay (in milliseconds) until the Runnable
* will be executed.
@@ -10573,9 +10567,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* <p>Causes the Runnable to execute on the next animation time step.
* The runnable will be run on the user interface thread.</p>
*
- * <p>This method can be invoked from outside of the UI thread
- * only when this View is attached to a window.</p>
- *
* @param action The Runnable that will be executed.
*
* @see #postOnAnimationDelayed
@@ -10597,9 +10588,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* after the specified amount of time elapses.
* The runnable will be run on the user interface thread.</p>
*
- * <p>This method can be invoked from outside of the UI thread
- * only when this View is attached to a window.</p>
- *
* @param action The Runnable that will be executed.
* @param delayMillis The delay (in milliseconds) until the Runnable
* will be executed.
@@ -10621,9 +10609,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* <p>Removes the specified Runnable from the message queue.</p>
*
- * <p>This method can be invoked from outside of the UI thread
- * only when this View is attached to a window.</p>
- *
* @param action The Runnable to remove from the message handling queue
*
* @return true if this view could ask the Handler to remove the Runnable,
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b3c679c..751ed7c 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -367,6 +367,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
private boolean mSingleLine;
private int mDesiredHeightAtMeasure = -1;
private boolean mIncludePad = true;
+ private int mDeferScroll = -1;
// tmp primitives, so we don't alloc them on each draw
private Rect mTempRect;
@@ -6317,6 +6318,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
+ if (mDeferScroll >= 0) {
+ int curs = mDeferScroll;
+ mDeferScroll = -1;
+ bringPointIntoView(curs);
+ }
if (changed && mEditor != null) mEditor.invalidateTextDisplayList();
}
@@ -6399,6 +6405,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* This has to be called after layout. Returns true if anything changed.
*/
public boolean bringPointIntoView(int offset) {
+ if (isLayoutRequested()) {
+ mDeferScroll = offset;
+ return false;
+ }
boolean changed = false;
Layout layout = isShowingHint() ? mHintLayout: mLayout;
@@ -7108,13 +7118,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
registerForPreDraw();
}
+ checkForResize();
+
if (curs >= 0) {
mHighlightPathBogus = true;
if (mEditor != null) mEditor.makeBlink();
bringPointIntoView(curs);
}
-
- checkForResize();
}
/**
@@ -7161,6 +7171,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
if (oldStart >= 0 || newStart >= 0) {
invalidateCursor(Selection.getSelectionStart(buf), oldStart, newStart);
+ checkForResize();
registerForPreDraw();
if (mEditor != null) mEditor.makeBlink();
}