summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-07-18 13:22:50 -0700
committerDianne Hackborn <hackbod@google.com>2011-07-18 16:16:23 -0700
commit6dd005b48138708762bfade0081d031a2a4a3822 (patch)
treed3843867826a4a5a439897674a9dfef4a15d77b5 /core/java/android
parentf40aa3834d92bfb516e0f865375103d81e3de71d (diff)
downloadframeworks_base-6dd005b48138708762bfade0081d031a2a4a3822.zip
frameworks_base-6dd005b48138708762bfade0081d031a2a4a3822.tar.gz
frameworks_base-6dd005b48138708762bfade0081d031a2a4a3822.tar.bz2
I. Can. Not. Stand. ViewAncestor.
It was done so we would have the name "ViewRoot" available for a public API. However, the name "ViewAncestor" just makes no sense. So instead, change it to ViewRootImpl. Change-Id: If9599ca67896f339f6fefa7d1dde121201171d97
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityThread.java6
-rw-r--r--core/java/android/app/WallpaperManager.java8
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java4
-rw-r--r--core/java/android/view/SurfaceView.java2
-rw-r--r--core/java/android/view/View.java22
-rw-r--r--core/java/android/view/ViewDebug.java8
-rw-r--r--core/java/android/view/ViewGroup.java18
-rw-r--r--core/java/android/view/ViewRootImpl.java (renamed from core/java/android/view/ViewAncestor.java)50
-rw-r--r--core/java/android/view/WindowManagerImpl.java28
-rw-r--r--core/java/android/view/inputmethod/BaseInputConnection.java4
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java8
-rw-r--r--core/java/android/webkit/BrowserFrame.java4
-rw-r--r--core/java/android/widget/TextView.java6
-rw-r--r--core/java/android/widget/ZoomButtonsController.java10
14 files changed, 89 insertions, 89 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 86161da..f6cd866 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -70,7 +70,7 @@ import android.view.HardwareRenderer;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewManager;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
@@ -4072,7 +4072,7 @@ public final class ActivityThread {
sThreadLocal.set(this);
mSystemThread = system;
if (!system) {
- ViewAncestor.addFirstDrawHandler(new Runnable() {
+ ViewRootImpl.addFirstDrawHandler(new Runnable() {
public void run() {
ensureJitEnabled();
}
@@ -4102,7 +4102,7 @@ public final class ActivityThread {
}
}
- ViewAncestor.addConfigCallback(new ComponentCallbacks() {
+ ViewRootImpl.addConfigCallback(new ComponentCallbacks() {
public void onConfigurationChanged(Configuration newConfig) {
synchronized (mPackages) {
// We need to apply this change to the resources
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 7fd5a7d..8472b31 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -40,7 +40,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.DisplayMetrics;
import android.util.Log;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -592,7 +592,7 @@ public class WallpaperManager {
public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
try {
//Log.v(TAG, "Sending new wallpaper offsets from app...");
- ViewAncestor.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
+ ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
//Log.v(TAG, "...app returning after sending offsets!");
} catch (RemoteException e) {
@@ -630,7 +630,7 @@ public class WallpaperManager {
int x, int y, int z, Bundle extras) {
try {
//Log.v(TAG, "Sending new wallpaper offsets from app...");
- ViewAncestor.getWindowSession(mContext.getMainLooper()).sendWallpaperCommand(
+ ViewRootImpl.getWindowSession(mContext.getMainLooper()).sendWallpaperCommand(
windowToken, action, x, y, z, extras, false);
//Log.v(TAG, "...app returning after sending offsets!");
} catch (RemoteException e) {
@@ -650,7 +650,7 @@ public class WallpaperManager {
*/
public void clearWallpaperOffsets(IBinder windowToken) {
try {
- ViewAncestor.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
+ ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
windowToken, -1, -1, -1, -1);
} catch (RemoteException e) {
// Ignore.
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 8fc8b9d..c51ba2a 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -51,7 +51,7 @@ import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.ViewGroup;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.view.WindowManagerPolicy;
@@ -650,7 +650,7 @@ public abstract class WallpaperService extends Service {
mWindowToken = wrapper.mWindowToken;
mSurfaceHolder.setSizeFromLayout();
mInitializing = true;
- mSession = ViewAncestor.getWindowSession(getMainLooper());
+ mSession = ViewRootImpl.getWindowSession(getMainLooper());
mWindow.setSession(mSession);
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 764899f..cbdb38e 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -426,7 +426,7 @@ public class SurfaceView extends View {
if (!mHaveFrame) {
return;
}
- ViewAncestor viewRoot = (ViewAncestor) getRootView().getParent();
+ ViewRootImpl viewRoot = (ViewRootImpl) getRootView().getParent();
if (viewRoot != null) {
mTranslator = viewRoot.mTranslator;
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 4385c2f..4e9c0b7 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5043,9 +5043,9 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
}
/** Gets the ViewAncestor, or null if not attached. */
- /*package*/ ViewAncestor getViewAncestor() {
+ /*package*/ ViewRootImpl getViewRootImpl() {
View root = getRootView();
- return root != null ? (ViewAncestor)root.getParent() : null;
+ return root != null ? (ViewRootImpl)root.getParent() : null;
}
/**
@@ -5061,7 +5061,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
public final boolean requestFocusFromTouch() {
// Leave touch mode if we need to
if (isInTouchMode()) {
- ViewAncestor viewRoot = getViewAncestor();
+ ViewRootImpl viewRoot = getViewRootImpl();
if (viewRoot != null) {
viewRoot.ensureTouchMode(false);
}
@@ -5653,7 +5653,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
if (mAttachInfo != null) {
return mAttachInfo.mInTouchMode;
} else {
- return ViewAncestor.isInTouchMode();
+ return ViewRootImpl.isInTouchMode();
}
}
@@ -8254,7 +8254,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
handler = attachInfo.mHandler;
} else {
// Assume that post will succeed later
- ViewAncestor.getRunQueue().post(action);
+ ViewRootImpl.getRunQueue().post(action);
return true;
}
@@ -8284,7 +8284,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
handler = attachInfo.mHandler;
} else {
// Assume that post will succeed later
- ViewAncestor.getRunQueue().postDelayed(action, delayMillis);
+ ViewRootImpl.getRunQueue().postDelayed(action, delayMillis);
return true;
}
@@ -8308,7 +8308,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
handler = attachInfo.mHandler;
} else {
// Assume that post will succeed later
- ViewAncestor.getRunQueue().removeCallbacks(action);
+ ViewRootImpl.getRunQueue().removeCallbacks(action);
return true;
}
@@ -11580,9 +11580,9 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
viewParent = view.mParent;
}
- if (viewParent instanceof ViewAncestor) {
+ if (viewParent instanceof ViewRootImpl) {
// *cough*
- final ViewAncestor vr = (ViewAncestor)viewParent;
+ final ViewRootImpl vr = (ViewRootImpl)viewParent;
location[1] -= vr.mCurScrollY;
}
}
@@ -12709,7 +12709,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
surface.unlockCanvasAndPost(canvas);
}
- final ViewAncestor root = getViewAncestor();
+ final ViewRootImpl root = getViewRootImpl();
// Cache the local state object for delivery with DragEvents
root.setLocalDragState(myLocalState);
@@ -13916,7 +13916,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
Canvas mCanvas;
/**
- * A Handler supplied by a view's {@link android.view.ViewAncestor}. This
+ * A Handler supplied by a view's {@link android.view.ViewRootImpl}. This
* handler can be used to pump events in the UI events queue.
*/
final Handler mHandler;
diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java
index f7f5a21..b85159b 100644
--- a/core/java/android/view/ViewDebug.java
+++ b/core/java/android/view/ViewDebug.java
@@ -366,7 +366,7 @@ public class ViewDebug {
}
private static BufferedWriter sHierarchyTraces;
- private static ViewAncestor sHierarhcyRoot;
+ private static ViewRootImpl sHierarhcyRoot;
private static String sHierarchyTracePrefix;
/**
@@ -415,7 +415,7 @@ public class ViewDebug {
* @hide
*/
public static long getViewAncestorInstanceCount() {
- return Debug.countInstancesOfClass(ViewAncestor.class);
+ return Debug.countInstancesOfClass(ViewRootImpl.class);
}
/**
@@ -748,7 +748,7 @@ public class ViewDebug {
return;
}
- sHierarhcyRoot = (ViewAncestor) view.getRootView().getParent();
+ sHierarhcyRoot = (ViewRootImpl) view.getRootView().getParent();
}
/**
@@ -1100,7 +1100,7 @@ public class ViewDebug {
private static void outputDisplayList(View root, String parameter) throws IOException {
final View view = findView(root, parameter);
- view.getViewAncestor().outputDisplayList(view);
+ view.getViewRootImpl().outputDisplayList(view);
}
private static void capture(View root, final OutputStream clientStream, String parameter)
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index cb3e9c6..5f7673a 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -954,7 +954,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
final float tx = event.mX;
final float ty = event.mY;
- ViewAncestor root = getViewAncestor();
+ ViewRootImpl root = getViewRootImpl();
// Dispatch down the view hierarchy
switch (event.mAction) {
@@ -3839,13 +3839,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (drawAnimation) {
if (view != null) {
view.mPrivateFlags |= DRAW_ANIMATION;
- } else if (parent instanceof ViewAncestor) {
- ((ViewAncestor) parent).mIsAnimating = true;
+ } else if (parent instanceof ViewRootImpl) {
+ ((ViewRootImpl) parent).mIsAnimating = true;
}
}
- if (parent instanceof ViewAncestor) {
- ((ViewAncestor) parent).invalidate();
+ if (parent instanceof ViewRootImpl) {
+ ((ViewRootImpl) parent).invalidate();
parent = null;
} else if (view != null) {
if ((view.mPrivateFlags & DRAWN) == DRAWN ||
@@ -3902,8 +3902,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (drawAnimation) {
if (view != null) {
view.mPrivateFlags |= DRAW_ANIMATION;
- } else if (parent instanceof ViewAncestor) {
- ((ViewAncestor) parent).mIsAnimating = true;
+ } else if (parent instanceof ViewRootImpl) {
+ ((ViewRootImpl) parent).mIsAnimating = true;
}
}
@@ -4426,7 +4426,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
// If this group is dirty, check that the parent is dirty as well
if ((mPrivateFlags & DIRTY_MASK) != 0) {
final ViewParent parent = getParent();
- if (parent != null && !(parent instanceof ViewAncestor)) {
+ if (parent != null && !(parent instanceof ViewRootImpl)) {
if ((((View) parent).mPrivateFlags & DIRTY_MASK) == 0) {
result = false;
android.util.Log.d(ViewDebug.CONSISTENCY_LOG_TAG,
@@ -4995,7 +4995,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
public void requestTransitionStart(LayoutTransition transition) {
- ViewAncestor viewAncestor = getViewAncestor();
+ ViewRootImpl viewAncestor = getViewRootImpl();
viewAncestor.requestTransitionStart(transition);
}
diff --git a/core/java/android/view/ViewAncestor.java b/core/java/android/view/ViewRootImpl.java
index ac73611..470493d 100644
--- a/core/java/android/view/ViewAncestor.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -92,7 +92,7 @@ import java.util.List;
* {@hide}
*/
@SuppressWarnings({"EmptyCatchBlock", "PointlessBooleanExpression"})
-public final class ViewAncestor extends Handler implements ViewParent,
+public final class ViewRootImpl extends Handler implements ViewParent,
View.AttachInfo.Callbacks, HardwareRenderer.HardwareDrawCallbacks {
private static final String TAG = "ViewAncestor";
private static final boolean DBG = false;
@@ -303,7 +303,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
}
- public ViewAncestor(Context context) {
+ public ViewRootImpl(Context context) {
super();
if (MEASURE_LATENCY) {
@@ -3807,14 +3807,14 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
static class InputMethodCallback extends IInputMethodCallback.Stub {
- private WeakReference<ViewAncestor> mViewAncestor;
+ private WeakReference<ViewRootImpl> mViewAncestor;
- public InputMethodCallback(ViewAncestor viewAncestor) {
- mViewAncestor = new WeakReference<ViewAncestor>(viewAncestor);
+ public InputMethodCallback(ViewRootImpl viewAncestor) {
+ mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor);
}
public void finishedEvent(int seq, boolean handled) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchFinishedEvent(seq, handled);
}
@@ -3826,15 +3826,15 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
static class W extends IWindow.Stub {
- private final WeakReference<ViewAncestor> mViewAncestor;
+ private final WeakReference<ViewRootImpl> mViewAncestor;
- W(ViewAncestor viewAncestor) {
- mViewAncestor = new WeakReference<ViewAncestor>(viewAncestor);
+ W(ViewRootImpl viewAncestor) {
+ mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor);
}
public void resized(int w, int h, Rect coveredInsets, Rect visibleInsets,
boolean reportDraw, Configuration newConfig) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchResized(w, h, coveredInsets, visibleInsets, reportDraw,
newConfig);
@@ -3842,21 +3842,21 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
public void dispatchAppVisibility(boolean visible) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchAppVisibility(visible);
}
}
public void dispatchGetNewSurface() {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchGetNewSurface();
}
}
public void windowFocusChanged(boolean hasFocus, boolean inTouchMode) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.windowFocusChanged(hasFocus, inTouchMode);
}
@@ -3872,7 +3872,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
public void executeCommand(String command, String parameters, ParcelFileDescriptor out) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
final View view = viewAncestor.mView;
if (view != null) {
@@ -3903,7 +3903,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
public void closeSystemDialogs(String reason) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchCloseSystemDialogs(reason);
}
@@ -3931,14 +3931,14 @@ public final class ViewAncestor extends Handler implements ViewParent,
/* Drag/drop */
public void dispatchDragEvent(DragEvent event) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchDragEvent(event);
}
}
public void dispatchSystemUiVisibilityChanged(int visibility) {
- final ViewAncestor viewAncestor = mViewAncestor.get();
+ final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchSystemUiVisibilityChanged(visibility);
}
@@ -4269,7 +4269,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
if (!registered) {
mAttachInfo.mAccessibilityWindowId =
mAccessibilityManager.addAccessibilityInteractionConnection(mWindow,
- new AccessibilityInteractionConnection(ViewAncestor.this));
+ new AccessibilityInteractionConnection(ViewRootImpl.this));
}
}
@@ -4289,10 +4289,10 @@ public final class ViewAncestor extends Handler implements ViewParent,
*/
final class AccessibilityInteractionConnection
extends IAccessibilityInteractionConnection.Stub {
- private final WeakReference<ViewAncestor> mViewAncestor;
+ private final WeakReference<ViewRootImpl> mViewAncestor;
- AccessibilityInteractionConnection(ViewAncestor viewAncestor) {
- mViewAncestor = new WeakReference<ViewAncestor>(viewAncestor);
+ AccessibilityInteractionConnection(ViewRootImpl viewAncestor) {
+ mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor);
}
public void findAccessibilityNodeInfoByAccessibilityId(int accessibilityId,
@@ -4421,7 +4421,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
try {
FindByAccessibilitytIdPredicate predicate = mFindByAccessibilityIdPredicate;
predicate.init(accessibilityId);
- View root = ViewAncestor.this.mView;
+ View root = ViewRootImpl.this.mView;
View target = root.findViewByPredicate(predicate);
if (target != null && target.isShown()) {
info = target.createAccessibilityNodeInfo();
@@ -4453,7 +4453,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
AccessibilityNodeInfo info = null;
try {
- View root = ViewAncestor.this.mView;
+ View root = ViewRootImpl.this.mView;
View target = root.findViewById(viewId);
if (target != null && target.isShown()) {
info = target.createAccessibilityNodeInfo();
@@ -4499,7 +4499,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
if (accessibilityViewId != View.NO_ID) {
root = findViewByAccessibilityId(accessibilityViewId);
} else {
- root = ViewAncestor.this.mView;
+ root = ViewRootImpl.this.mView;
}
if (root == null || !root.isShown()) {
@@ -4624,7 +4624,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
}
private View findViewByAccessibilityId(int accessibilityId) {
- View root = ViewAncestor.this.mView;
+ View root = ViewRootImpl.this.mView;
if (root == null) {
return null;
}
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index 4e9531b..a451bb5 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -78,7 +78,7 @@ public class WindowManagerImpl implements WindowManager {
public static final int ADD_PERMISSION_DENIED = -8;
private View[] mViews;
- private ViewAncestor[] mRoots;
+ private ViewRootImpl[] mRoots;
private WindowManager.LayoutParams[] mParams;
private final static Object sLock = new Object();
@@ -202,7 +202,7 @@ public class WindowManagerImpl implements WindowManager {
final WindowManager.LayoutParams wparams
= (WindowManager.LayoutParams)params;
- ViewAncestor root;
+ ViewRootImpl root;
View panelParentView = null;
synchronized (this) {
@@ -239,7 +239,7 @@ public class WindowManagerImpl implements WindowManager {
}
}
- root = new ViewAncestor(view.getContext());
+ root = new ViewRootImpl(view.getContext());
root.mAddNesting = 1;
if (cih == null) {
root.mCompatibilityInfo = new CompatibilityInfoHolder();
@@ -252,7 +252,7 @@ public class WindowManagerImpl implements WindowManager {
if (mViews == null) {
index = 1;
mViews = new View[1];
- mRoots = new ViewAncestor[1];
+ mRoots = new ViewRootImpl[1];
mParams = new WindowManager.LayoutParams[1];
} else {
index = mViews.length + 1;
@@ -260,7 +260,7 @@ public class WindowManagerImpl implements WindowManager {
mViews = new View[index];
System.arraycopy(old, 0, mViews, 0, index-1);
old = mRoots;
- mRoots = new ViewAncestor[index];
+ mRoots = new ViewRootImpl[index];
System.arraycopy(old, 0, mRoots, 0, index-1);
old = mParams;
mParams = new WindowManager.LayoutParams[index];
@@ -288,7 +288,7 @@ public class WindowManagerImpl implements WindowManager {
synchronized (this) {
int index = findViewLocked(view, true);
- ViewAncestor root = mRoots[index];
+ ViewRootImpl root = mRoots[index];
mParams[index] = wparams;
root.setLayoutParams(wparams, false);
}
@@ -310,7 +310,7 @@ public class WindowManagerImpl implements WindowManager {
public void removeViewImmediate(View view) {
synchronized (this) {
int index = findViewLocked(view, true);
- ViewAncestor root = mRoots[index];
+ ViewRootImpl root = mRoots[index];
View curView = root.getView();
root.mAddNesting = 0;
@@ -326,7 +326,7 @@ public class WindowManagerImpl implements WindowManager {
}
View removeViewLocked(int index) {
- ViewAncestor root = mRoots[index];
+ ViewRootImpl root = mRoots[index];
View view = root.getView();
// Don't really remove until we have matched all calls to add().
@@ -354,7 +354,7 @@ public class WindowManagerImpl implements WindowManager {
removeItem(tmpViews, mViews, index);
mViews = tmpViews;
- ViewAncestor[] tmpRoots = new ViewAncestor[count-1];
+ ViewRootImpl[] tmpRoots = new ViewRootImpl[count-1];
removeItem(tmpRoots, mRoots, index);
mRoots = tmpRoots;
@@ -381,7 +381,7 @@ public class WindowManagerImpl implements WindowManager {
//Log.i("foo", "@ " + i + " token " + mParams[i].token
// + " view " + mRoots[i].getView());
if (token == null || mParams[i].token == token) {
- ViewAncestor root = mRoots[i];
+ ViewRootImpl root = mRoots[i];
root.mAddNesting = 1;
//Log.i("foo", "Force closing " + root);
@@ -417,7 +417,7 @@ public class WindowManagerImpl implements WindowManager {
int count = mViews.length;
for (int i=0; i<count; i++) {
if (token == null || mParams[i].token == token) {
- ViewAncestor root = mRoots[i];
+ ViewRootImpl root = mRoots[i];
root.setStopped(stopped);
}
}
@@ -429,7 +429,7 @@ public class WindowManagerImpl implements WindowManager {
int count = mViews.length;
config = new Configuration(config);
for (int i=0; i<count; i++) {
- ViewAncestor root = mRoots[i];
+ ViewRootImpl root = mRoots[i];
root.requestUpdateConfiguration(config);
}
}
@@ -437,13 +437,13 @@ public class WindowManagerImpl implements WindowManager {
public WindowManager.LayoutParams getRootViewLayoutParameter(View view) {
ViewParent vp = view.getParent();
- while (vp != null && !(vp instanceof ViewAncestor)) {
+ while (vp != null && !(vp instanceof ViewRootImpl)) {
vp = vp.getParent();
}
if (vp == null) return null;
- ViewAncestor vr = (ViewAncestor)vp;
+ ViewRootImpl vr = (ViewRootImpl)vp;
int N = mRoots.length;
for (int i = 0; i < N; ++i) {
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java
index abe3c2c..5ec1ec3 100644
--- a/core/java/android/view/inputmethod/BaseInputConnection.java
+++ b/core/java/android/view/inputmethod/BaseInputConnection.java
@@ -34,7 +34,7 @@ import android.util.LogPrinter;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
class ComposingText implements NoCopySpan {
}
@@ -502,7 +502,7 @@ public class BaseInputConnection implements InputConnection {
}
}
if (h != null) {
- h.sendMessage(h.obtainMessage(ViewAncestor.DISPATCH_KEY_FROM_IME,
+ h.sendMessage(h.obtainMessage(ViewRootImpl.DISPATCH_KEY_FROM_IME,
event));
}
}
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index a1a7281..e5f3fc9 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -42,7 +42,7 @@ import android.util.Printer;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -655,7 +655,7 @@ public final class InputMethodManager {
if (vh != null) {
// This will result in a call to reportFinishInputConnection()
// below.
- vh.sendMessage(vh.obtainMessage(ViewAncestor.FINISH_INPUT_CONNECTION,
+ vh.sendMessage(vh.obtainMessage(ViewRootImpl.FINISH_INPUT_CONNECTION,
mServedInputConnection));
}
}
@@ -1112,9 +1112,9 @@ public final class InputMethodManager {
void scheduleCheckFocusLocked(View view) {
Handler vh = view.getHandler();
- if (vh != null && !vh.hasMessages(ViewAncestor.CHECK_FOCUS)) {
+ if (vh != null && !vh.hasMessages(ViewRootImpl.CHECK_FOCUS)) {
// This will result in a call to checkFocus() below.
- vh.sendMessage(vh.obtainMessage(ViewAncestor.CHECK_FOCUS));
+ vh.sendMessage(vh.obtainMessage(ViewRootImpl.CHECK_FOCUS));
}
}
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 5aa60f4..738bcb9 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -35,7 +35,7 @@ import android.os.Message;
import android.util.Log;
import android.util.TypedValue;
import android.view.Surface;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import android.view.WindowManager;
import junit.framework.Assert;
@@ -228,7 +228,7 @@ class BrowserFrame extends Handler {
sConfigCallback = new ConfigCallback(
(WindowManager) appContext.getSystemService(
Context.WINDOW_SERVICE));
- ViewAncestor.addConfigCallback(sConfigCallback);
+ ViewRootImpl.addConfigCallback(sConfigCallback);
}
sConfigCallback.addHandler(this);
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 769f5e3..66a07d3 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -117,7 +117,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import android.view.ViewConfiguration;
import android.view.ViewDebug;
import android.view.ViewGroup;
@@ -3731,13 +3731,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
Handler h = getHandler();
if (h != null) {
long eventTime = SystemClock.uptimeMillis();
- h.sendMessage(h.obtainMessage(ViewAncestor.DISPATCH_KEY_FROM_IME,
+ h.sendMessage(h.obtainMessage(ViewRootImpl.DISPATCH_KEY_FROM_IME,
new KeyEvent(eventTime, eventTime,
KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER, 0, 0,
KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE
| KeyEvent.FLAG_EDITOR_ACTION)));
- h.sendMessage(h.obtainMessage(ViewAncestor.DISPATCH_KEY_FROM_IME,
+ h.sendMessage(h.obtainMessage(ViewRootImpl.DISPATCH_KEY_FROM_IME,
new KeyEvent(SystemClock.uptimeMillis(), eventTime,
KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER, 0, 0,
KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
diff --git a/core/java/android/widget/ZoomButtonsController.java b/core/java/android/widget/ZoomButtonsController.java
index 9e37c7b..f3d891d 100644
--- a/core/java/android/widget/ZoomButtonsController.java
+++ b/core/java/android/widget/ZoomButtonsController.java
@@ -33,7 +33,7 @@ import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
-import android.view.ViewAncestor;
+import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.WindowManager.LayoutParams;
@@ -501,7 +501,7 @@ public class ZoomButtonsController implements View.OnTouchListener {
} else {
- ViewAncestor viewRoot = getOwnerViewAncestor();
+ ViewRootImpl viewRoot = getOwnerViewRootImpl();
if (viewRoot != null) {
viewRoot.dispatchKey(event);
}
@@ -526,15 +526,15 @@ public class ZoomButtonsController implements View.OnTouchListener {
}
}
- private ViewAncestor getOwnerViewAncestor() {
+ private ViewRootImpl getOwnerViewRootImpl() {
View rootViewOfOwner = mOwnerView.getRootView();
if (rootViewOfOwner == null) {
return null;
}
ViewParent parentOfRootView = rootViewOfOwner.getParent();
- if (parentOfRootView instanceof ViewAncestor) {
- return (ViewAncestor) parentOfRootView;
+ if (parentOfRootView instanceof ViewRootImpl) {
+ return (ViewRootImpl) parentOfRootView;
} else {
return null;
}