diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/accessibilityservice/AccessibilityService.java | 18 | ||||
| -rw-r--r-- | core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl | 3 | ||||
| -rw-r--r-- | core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.aidl | 30 | ||||
| -rw-r--r-- | core/java/android/os/Power.java | 109 | ||||
| -rw-r--r-- | core/java/android/os/PowerManager.java | 26 | ||||
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 5 | ||||
| -rw-r--r-- | core/java/android/view/IWindow.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/view/IWindowSession.aidl | 6 | ||||
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 5 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 49 | ||||
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 29 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 34 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewClassic.java | 10 | ||||
| -rw-r--r-- | core/java/android/widget/NumberPicker.java | 12 |
14 files changed, 105 insertions, 233 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index 850fe48..044c0c2 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -371,7 +371,7 @@ public abstract class AccessibilityService extends Service { * * <strong>Note:</strong> To receive gestures an accessibility service must * request that the device is in touch exploration mode by setting the - * {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_INCLUDE_NOT_IMPORTANT_VIEWS} + * {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE} * flag. * * @param gestureId The unique id of the performed gesture. @@ -565,10 +565,8 @@ public abstract class AccessibilityService extends Service { mCaller.sendMessage(message); } - public void onGesture(int gestureId, IAccessibilityServiceClientCallback callback, - int interactionId) { - Message message = mCaller.obtainMessageIIO(DO_ON_GESTURE, gestureId, interactionId, - callback); + public void onGesture(int gestureId) { + Message message = mCaller.obtainMessageI(DO_ON_GESTURE, gestureId); mCaller.sendMessage(message); } @@ -601,15 +599,7 @@ public abstract class AccessibilityService extends Service { return; case DO_ON_GESTURE : final int gestureId = message.arg1; - final int interactionId = message.arg2; - IAccessibilityServiceClientCallback callback = - (IAccessibilityServiceClientCallback) message.obj; - final boolean handled = mCallback.onGesture(gestureId); - try { - callback.setGestureResult(gestureId, handled, interactionId); - } catch (RemoteException re) { - Log.e(LOG_TAG, "Error calling back with the gesture resut.", re); - } + mCallback.onGesture(gestureId); return; default : Log.w(LOG_TAG, "Unknown message type " + message.what); diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl index 0257aa4..d459fd5 100644 --- a/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl +++ b/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl @@ -16,7 +16,6 @@ package android.accessibilityservice; -import android.accessibilityservice.IAccessibilityServiceClientCallback; import android.accessibilityservice.IAccessibilityServiceConnection; import android.view.accessibility.AccessibilityEvent; @@ -33,5 +32,5 @@ import android.view.accessibility.AccessibilityEvent; void onInterrupt(); - void onGesture(int gesture, in IAccessibilityServiceClientCallback callback, int interactionId); + void onGesture(int gesture); } diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.aidl deleted file mode 100644 index 9061398..0000000 --- a/core/java/android/accessibilityservice/IAccessibilityServiceClientCallback.aidl +++ /dev/null @@ -1,30 +0,0 @@ -/* -** Copyright 2012, 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 License for the specific language governing permissions and -** limitations under the License. -*/ - -package android.accessibilityservice; - -import android.accessibilityservice.IAccessibilityServiceConnection; -import android.view.accessibility.AccessibilityEvent; - -/** - * Callback for IAccessibilityServiceClient. - * - * @hide - */ - oneway interface IAccessibilityServiceClientCallback { - - void setGestureResult(int gestureId, boolean handled, int interactionId); -} diff --git a/core/java/android/os/Power.java b/core/java/android/os/Power.java deleted file mode 100644 index 58df940..0000000 --- a/core/java/android/os/Power.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2007 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 License for the specific language governing permissions and - * limitations under the License. - */ - -package android.os; - -import java.io.IOException; -import android.os.ServiceManager; - -/** - * Class that provides access to some of the power management functions. - * - * {@hide} - */ -public class Power -{ - // can't instantiate this class - private Power() - { - } - - /** - * Wake lock that ensures that the CPU is running. The screen might - * not be on. - */ - public static final int PARTIAL_WAKE_LOCK = 1; - - /** - * Wake lock that ensures that the screen is on. - */ - public static final int FULL_WAKE_LOCK = 2; - - public static native void acquireWakeLock(int lock, String id); - public static native void releaseWakeLock(String id); - - /** - * Brightness value for fully off - */ - public static final int BRIGHTNESS_OFF = 0; - - /** - * Brightness value for dim backlight - */ - public static final int BRIGHTNESS_DIM = 20; - - /** - * Brightness value for fully on - */ - public static final int BRIGHTNESS_ON = 255; - - /** - * Brightness value to use when battery is low - */ - public static final int BRIGHTNESS_LOW_BATTERY = 10; - - /** - * Threshold for BRIGHTNESS_LOW_BATTERY (percentage) - * Screen will stay dim if battery level is <= LOW_BATTERY_THRESHOLD - */ - public static final int LOW_BATTERY_THRESHOLD = 10; - - /** - * Turn the screen on or off - * - * @param on Whether you want the screen on or off - */ - public static native int setScreenState(boolean on); - - public static native int setLastUserActivityTimeout(long ms); - - /** - * Low-level function turn the device off immediately, without trying - * to be clean. Most people should use - * {@link android.internal.app.ShutdownThread} for a clean shutdown. - * - * @deprecated - * @hide - */ - @Deprecated - public static native void shutdown(); - - /** - * Reboot the device. - * @param reason code to pass to the kernel (e.g. "recovery"), or null. - * - * @throws IOException if reboot fails for some reason (eg, lack of - * permission) - */ - public static void reboot(String reason) throws IOException - { - rebootNative(reason); - } - - private static native void rebootNative(String reason) throws IOException ; - - public static native int powerInitNative(); -} diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 21373ec..903c8b3 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -197,7 +197,31 @@ public class PowerManager * Does not work with PARTIAL_WAKE_LOCKs. */ public static final int ON_AFTER_RELEASE = 0x20000000; - + + /** + * Brightness value to use when battery is low. + * @hide + */ + public static final int BRIGHTNESS_LOW_BATTERY = 10; + + /** + * Brightness value for fully on. + * @hide + */ + public static final int BRIGHTNESS_ON = 255; + + /** + * Brightness value for dim backlight. + * @hide + */ + public static final int BRIGHTNESS_DIM = 20; + + /** + * Brightness value for fully off. + * @hide + */ + public static final int BRIGHTNESS_OFF = 0; + /** * Class lets you say that you need to have the device on. * <p> diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 9d36677..3e0942c 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -154,7 +154,6 @@ public abstract class WallpaperService extends Service { int mCurWindowPrivateFlags = mWindowPrivateFlags; final Rect mVisibleInsets = new Rect(); final Rect mWinFrame = new Rect(); - final Rect mSystemInsets = new Rect(); final Rect mContentInsets = new Rect(); final Configuration mConfiguration = new Configuration(); @@ -254,7 +253,7 @@ public abstract class WallpaperService extends Service { final BaseIWindow mWindow = new BaseIWindow() { @Override - public void resized(int w, int h, Rect systemInsets, Rect contentInsets, + public void resized(int w, int h, Rect contentInsets, Rect visibleInsets, boolean reportDraw, Configuration newConfig) { Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0); @@ -621,7 +620,7 @@ public abstract class WallpaperService extends Service { final int relayoutResult = mSession.relayout( mWindow, mWindow.mSeq, mLayout, mWidth, mHeight, - View.VISIBLE, 0, mWinFrame, mSystemInsets, mContentInsets, + View.VISIBLE, 0, mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mSurfaceHolder.mSurface); if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl index 555f306..b4caad3 100644 --- a/core/java/android/view/IWindow.aidl +++ b/core/java/android/view/IWindow.aidl @@ -45,7 +45,7 @@ oneway interface IWindow { */ void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor); - void resized(int w, int h, in Rect systemInsets, in Rect contentInsets, + void resized(int w, int h, in Rect contentInsets, in Rect visibleInsets, boolean reportDraw, in Configuration newConfig); void dispatchAppVisibility(boolean visible); void dispatchGetNewSurface(); diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl index f26d5e1..d4a03ce 100644 --- a/core/java/android/view/IWindowSession.aidl +++ b/core/java/android/view/IWindowSession.aidl @@ -58,10 +58,6 @@ interface IWindowSession { * {@link WindowManagerImpl#RELAYOUT_DEFER_SURFACE_DESTROY}. * @param outFrame Rect in which is placed the new position/size on * screen. - * @param outSystemInsets Rect in which is placed the offsets from - * <var>outFrame</var> over which any core system UI elements are - * currently covering the window. This is not generally used for - * layout, but just to know where the window is obscured. * @param outContentInsets Rect in which is placed the offsets from * <var>outFrame</var> in which the content of the window should be * placed. This can be used to modify the window layout to ensure its @@ -83,7 +79,7 @@ interface IWindowSession { */ int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, - int flags, out Rect outFrame, out Rect outSystemInsets, + int flags, out Rect outFrame, out Rect outContentInsets, out Rect outVisibleInsets, out Configuration outConfig, out Surface outSurface); diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 5e7a12b..fd302dc 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -98,7 +98,6 @@ public class SurfaceView extends View { MyWindow mWindow; final Rect mVisibleInsets = new Rect(); final Rect mWinFrame = new Rect(); - final Rect mSystemInsets = new Rect(); final Rect mContentInsets = new Rect(); final Configuration mConfiguration = new Configuration(); @@ -482,7 +481,7 @@ public class SurfaceView extends View { mWindow, mWindow.mSeq, mLayout, mWidth, mHeight, visible ? VISIBLE : GONE, WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY, - mWinFrame, mSystemInsets, mContentInsets, + mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mNewSurface); if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) { mReportDrawNeeded = true; @@ -616,7 +615,7 @@ public class SurfaceView extends View { mSurfaceView = new WeakReference<SurfaceView>(surfaceView); } - public void resized(int w, int h, Rect systemInsets, Rect contentInsets, + public void resized(int w, int h, Rect contentInsets, Rect visibleInsets, boolean reportDraw, Configuration newConfig) { SurfaceView surfaceView = mSurfaceView.get(); if (surfaceView != null) { diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 4d13e8a..501cf29 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -666,7 +666,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal protected static final String VIEW_LOG_TAG = "View"; /** - * When set to true, apps will draw debugging information about their layouts. + * When set to true, apps will draw debugging information about their layouts. * * @hide */ @@ -4801,17 +4801,46 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * entirely by its predecessors, and has an alpha greater than zero. * * @return Whether the view is visible on the screen. + * + * @hide + */ + protected boolean isVisibleToUser() { + return isVisibleToUser(null); + } + + /** + * Computes whether the given portion of this view is visible to the user. Such a view is + * attached, visible, all its predecessors are visible, has an alpha greater than zero, and + * the specified portion is not clipped entirely by its predecessors. + * + * @param boundInView the portion of the view to test; coordinates should be relative; may be + * <code>null</code>, and the entire view will be tested in this case. + * When <code>true</code> is returned by the function, the actual visible + * region will be stored in this parameter; that is, if boundInView is fully + * contained within the view, no modification will be made, otherwise regions + * outside of the visible area of the view will be clipped. + * + * @return Whether the specified portion of the view is visible on the screen. + * + * @hide */ - private boolean isVisibleToUser() { + protected boolean isVisibleToUser(Rect boundInView) { + Rect visibleRect = mAttachInfo.mTmpInvalRect; + Point offset = mAttachInfo.mPoint; // The first two checks are made also made by isShown() which // however traverses the tree up to the parent to catch that. // Therefore, we do some fail fast check to minimize the up // tree traversal. - return (mAttachInfo != null - && mAttachInfo.mWindowVisibility == View.VISIBLE - && getAlpha() > 0 - && isShown() - && getGlobalVisibleRect(mAttachInfo.mTmpInvalRect)); + boolean isVisible = mAttachInfo != null + && mAttachInfo.mWindowVisibility == View.VISIBLE + && getAlpha() > 0 + && isShown() + && getGlobalVisibleRect(visibleRect, offset); + if (isVisible && boundInView != null) { + visibleRect.offset(-offset.x, -offset.y); + isVisible &= boundInView.intersect(visibleRect); + } + return isVisible; } /** @@ -17161,12 +17190,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal boolean mUse32BitDrawingCache; /** - * Describes the parts of the window that are currently completely - * obscured by system UI elements. - */ - final Rect mSystemInsets = new Rect(); - - /** * For windows that are full-screen but using insets to layout inside * of the screen decorations, these are the current insets for the * content of the window. diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 1310719..90e6034 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -262,7 +262,6 @@ public final class ViewRootImpl implements ViewParent, final Rect mPendingVisibleInsets = new Rect(); final Rect mPendingContentInsets = new Rect(); - final Rect mPendingSystemInsets = new Rect(); final ViewTreeObserver.InternalInsetsInfo mLastGivenInsets = new ViewTreeObserver.InternalInsetsInfo(); @@ -272,7 +271,6 @@ public final class ViewRootImpl implements ViewParent, final Configuration mPendingConfiguration = new Configuration(); class ResizedInfo { - Rect systemInsets; Rect contentInsets; Rect visibleInsets; Configuration newConfig; @@ -568,7 +566,6 @@ public final class ViewRootImpl implements ViewParent, if (mTranslator != null) { mTranslator.translateRectInScreenToAppWindow(mAttachInfo.mContentInsets); } - mPendingSystemInsets.set(0, 0, 0, 0); mPendingContentInsets.set(mAttachInfo.mContentInsets); mPendingVisibleInsets.set(0, 0, 0, 0); if (DEBUG_LAYOUT) Log.v(TAG, "Added window " + mWindow); @@ -1235,7 +1232,6 @@ public final class ViewRootImpl implements ViewParent, getRunQueue().executeActions(attachInfo.mHandler); boolean insetsChanged = false; - boolean activeRectChanged = false; boolean layoutRequested = mLayoutRequested && !mStopped; if (layoutRequested) { @@ -1247,12 +1243,7 @@ public final class ViewRootImpl implements ViewParent, // to opposite of the added touch mode. mAttachInfo.mInTouchMode = !mAddedTouchMode; ensureTouchModeLocally(mAddedTouchMode); - activeRectChanged = true; } else { - if (!mPendingSystemInsets.equals(mAttachInfo.mSystemInsets)) { - mAttachInfo.mSystemInsets.set(mPendingSystemInsets); - activeRectChanged = true; - } if (!mPendingContentInsets.equals(mAttachInfo.mContentInsets)) { insetsChanged = true; } @@ -1406,10 +1397,6 @@ public final class ViewRootImpl implements ViewParent, mPendingConfiguration.seq = 0; } - if (!mPendingSystemInsets.equals(mAttachInfo.mSystemInsets)) { - activeRectChanged = true; - mAttachInfo.mSystemInsets.set(mPendingSystemInsets); - } contentInsetsChanged = !mPendingContentInsets.equals( mAttachInfo.mContentInsets); visibleInsetsChanged = !mPendingVisibleInsets.equals( @@ -1512,7 +1499,6 @@ public final class ViewRootImpl implements ViewParent, // before actually drawing them, so it can display then // all at once. newSurface = true; - activeRectChanged = true; mFullRedrawNeeded = true; mPreviousTransparentRegion.setEmpty(); @@ -1578,7 +1564,6 @@ public final class ViewRootImpl implements ViewParent, // window size we asked for. We should avoid this by getting a maximum size from // the window session beforehand. if (mWidth != frame.width() || mHeight != frame.height()) { - activeRectChanged = true; mWidth = frame.width(); mHeight = frame.height(); } @@ -2814,7 +2799,6 @@ public final class ViewRootImpl implements ViewParent, ResizedInfo ri = (ResizedInfo)msg.obj; if (mWinFrame.width() == msg.arg1 && mWinFrame.height() == msg.arg2 - && mPendingSystemInsets.equals(ri.systemInsets) && mPendingContentInsets.equals(ri.contentInsets) && mPendingVisibleInsets.equals(ri.visibleInsets) && ((ResizedInfo)msg.obj).newConfig == null) { @@ -2831,7 +2815,6 @@ public final class ViewRootImpl implements ViewParent, mWinFrame.right = msg.arg1; mWinFrame.top = 0; mWinFrame.bottom = msg.arg2; - mPendingSystemInsets.set(((ResizedInfo)msg.obj).systemInsets); mPendingContentInsets.set(((ResizedInfo)msg.obj).contentInsets); mPendingVisibleInsets.set(((ResizedInfo)msg.obj).visibleInsets); if (msg.what == MSG_RESIZED_REPORT) { @@ -3866,7 +3849,7 @@ public final class ViewRootImpl implements ViewParent, (int) (mView.getMeasuredWidth() * appScale + 0.5f), (int) (mView.getMeasuredHeight() * appScale + 0.5f), viewVisibility, insetsPending ? WindowManagerImpl.RELAYOUT_INSETS_PENDING : 0, - mWinFrame, mPendingSystemInsets, mPendingContentInsets, mPendingVisibleInsets, + mWinFrame, mPendingContentInsets, mPendingVisibleInsets, mPendingConfiguration, mSurface); //Log.d(TAG, "<<<<<< BACK FROM relayout"); if (restore) { @@ -4062,11 +4045,10 @@ public final class ViewRootImpl implements ViewParent, mHandler.sendMessage(msg); } - public void dispatchResized(int w, int h, Rect systemInsets, Rect contentInsets, + public void dispatchResized(int w, int h, Rect contentInsets, Rect visibleInsets, boolean reportDraw, Configuration newConfig) { if (DEBUG_LAYOUT) Log.v(TAG, "Resizing " + this + ": w=" + w - + " h=" + h + " systemInsets=" + systemInsets.toShortString() - + " contentInsets=" + contentInsets.toShortString() + + " h=" + h + " contentInsets=" + contentInsets.toShortString() + " visibleInsets=" + visibleInsets.toShortString() + " reportDraw=" + reportDraw); Message msg = mHandler.obtainMessage(reportDraw ? MSG_RESIZED_REPORT :MSG_RESIZED); @@ -4079,7 +4061,6 @@ public final class ViewRootImpl implements ViewParent, msg.arg1 = w; msg.arg2 = h; ResizedInfo ri = new ResizedInfo(); - ri.systemInsets = new Rect(systemInsets); ri.contentInsets = new Rect(contentInsets); ri.visibleInsets = new Rect(visibleInsets); ri.newConfig = newConfig; @@ -4735,11 +4716,11 @@ public final class ViewRootImpl implements ViewParent, mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor); } - public void resized(int w, int h, Rect systemInsets, Rect contentInsets, + public void resized(int w, int h, Rect contentInsets, Rect visibleInsets, boolean reportDraw, Configuration newConfig) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { - viewAncestor.dispatchResized(w, h, systemInsets, contentInsets, + viewAncestor.dispatchResized(w, h, contentInsets, visibleInsets, reportDraw, newConfig); } } diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 388cfb3..0c5d6ea 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -145,10 +145,6 @@ public interface WindowManagerPolicy { * @param displayFrame The frame of the overall display in which this * window can appear, used for constraining the overall dimensions * of the window. - * @param systemFrame The frame within the display that any system - * elements are currently covering. These indicate which parts of - * the window should be considered completely obscured by the screen - * decorations. * @param contentFrame The frame within the display in which we would * like active content to appear. This will cause windows behind to * be resized to match the given content frame. @@ -160,7 +156,7 @@ public interface WindowManagerPolicy { * are visible. */ public void computeFrameLw(Rect parentFrame, Rect displayFrame, - Rect systemFrame, Rect contentFrame, Rect visibleFrame); + Rect contentFrame, Rect visibleFrame); /** * Retrieve the current frame of the window that has been assigned by @@ -188,14 +184,6 @@ public interface WindowManagerPolicy { public Rect getDisplayFrameLw(); /** - * Retrieve the frame of the system elements that last covered the window. - * Must be called with the window manager lock held. - * - * @return Rect The rectangle holding the system frame. - */ - public Rect getSystemFrameLw(); - - /** * Retrieve the frame of the content area that this window was last * laid out in. This is the area in which the content of the window * should be placed. It will be smaller than the display frame to @@ -397,6 +385,9 @@ public interface WindowManagerPolicy { * Creates an input channel that will receive all input from the input dispatcher. */ public InputChannel monitorInput(String name); + + public void shutdown(); + public void rebootSafeMode(); } /** @@ -770,6 +761,21 @@ public interface WindowManagerPolicy { public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotation); /** + * Return the rectangle of the screen currently covered by system decorations. + * This will be called immediately after {@link #layoutWindowLw}. It can + * fill in the rectangle to indicate any part of the screen that it knows + * for sure is covered by system decor such as the status bar. The rectangle + * is initially set to the actual size of the screen, indicating nothing is + * covered. + * + * @param systemRect The rectangle of the screen that is not covered by + * system decoration. + * @return Returns the layer above which the system rectangle should + * not be applied. + */ + public int getSystemDecorRectLw(Rect systemRect); + + /** * Called for each window attached to the window manager as layout is * proceeding. The implementation of this function must take care of * setting the window's frame, either here or in finishLayout(). @@ -794,7 +800,7 @@ public interface WindowManagerPolicy { * */ public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset); - + /** * Called when layout of the windows is finished. After this function has * returned, all windows given to layoutWindow() <em>must</em> have had a diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index 057c3d1..eb6b7e3 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -7452,18 +7452,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc case SHOW_RECT_MSG_ID: { WebViewCore.ShowRectData data = (WebViewCore.ShowRectData) msg.obj; - int x = getScrollX(); int left = contentToViewX(data.mLeft); int width = contentToViewDimension(data.mWidth); int maxWidth = contentToViewDimension(data.mContentWidth); int viewWidth = getViewWidth(); - if (width < viewWidth) { - // center align - x += left + width / 2 - getScrollX() - viewWidth / 2; - } else { - x += (int) (left + data.mXPercentInDoc * width - - getScrollX() - data.mXPercentInView * viewWidth); - } + int x = (int) (left + data.mXPercentInDoc * width - + data.mXPercentInView * viewWidth); if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "showRectMsg=(left=" + left + ",width=" + width + ",maxWidth=" + maxWidth + diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index 6ff924b..7c809b3 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -2239,20 +2239,17 @@ public class NumberPicker extends LinearLayout { info.setPackageName(mContext.getPackageName()); info.setSource(NumberPicker.this, virtualViewId); info.setParent(NumberPicker.this); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT); info.setText(text); info.setClickable(true); info.setLongClickable(true); info.setEnabled(NumberPicker.this.isEnabled()); Rect boundsInParent = mTempRect; boundsInParent.set(left, top, right, bottom); + info.setVisibleToUser(isVisibleToUser(boundsInParent)); info.setBoundsInParent(boundsInParent); Rect boundsInScreen = boundsInParent; int[] locationOnScreen = mTempArray; getLocationOnScreen(locationOnScreen); - boundsInScreen.offsetTo(0, 0); boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]); info.setBoundsInScreen(boundsInScreen); return info; @@ -2261,19 +2258,22 @@ public class NumberPicker extends LinearLayout { private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top, int right, int bottom) { AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(); - info.setClassName(Button.class.getName()); + info.setClassName(NumberPicker.class.getName()); info.setPackageName(mContext.getPackageName()); info.setSource(NumberPicker.this); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT); info.setParent((View) getParent()); info.setEnabled(NumberPicker.this.isEnabled()); info.setScrollable(true); Rect boundsInParent = mTempRect; boundsInParent.set(left, top, right, bottom); info.setBoundsInParent(boundsInParent); + info.setVisibleToUser(isVisibleToUser()); Rect boundsInScreen = boundsInParent; int[] locationOnScreen = mTempArray; getLocationOnScreen(locationOnScreen); - boundsInScreen.offsetTo(0, 0); boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]); info.setBoundsInScreen(boundsInScreen); return info; |
