summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt3
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java5
-rw-r--r--core/java/android/view/IWindow.aidl4
-rw-r--r--core/java/android/view/IWindowSession.aidl10
-rw-r--r--core/java/android/view/SurfaceView.java5
-rw-r--r--core/java/android/view/View.java21
-rw-r--r--core/java/android/view/ViewGroup.java1
-rw-r--r--core/java/android/view/ViewRootImpl.java22
-rw-r--r--core/java/android/view/WindowManagerPolicy.java24
-rw-r--r--core/java/android/webkit/WebViewClassic.java18
-rw-r--r--core/java/android/widget/CheckedTextView.java1
-rw-r--r--core/java/com/android/internal/view/BaseIWindow.java2
-rw-r--r--media/java/android/media/MediaRecorder.java12
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java6
-rw-r--r--packages/SystemUI/res/drawable/recents_thumbnail_fg.xml1
-rw-r--r--packages/SystemUI/res/layout/status_bar.xml1
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded.xml2
-rw-r--r--packages/SystemUI/res/layout/super_status_bar.xml39
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java257
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java64
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java26
-rw-r--r--services/java/com/android/server/wm/Session.java5
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java18
-rw-r--r--services/java/com/android/server/wm/WindowState.java68
-rw-r--r--telephony/java/com/android/internal/telephony/DataConnectionTracker.java8
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java4
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java4
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java4
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java4
32 files changed, 391 insertions, 256 deletions
diff --git a/api/current.txt b/api/current.txt
index 4a9b3bb..cb523cf 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -11283,10 +11283,11 @@ package android.media {
public final class MediaRecorder.AudioEncoder {
field public static final int AAC = 3; // 0x3
- field public static final int AAC_ELD = 6; // 0x6
+ field public static final int AAC_ELD = 5; // 0x5
field public static final int AMR_NB = 1; // 0x1
field public static final int AMR_WB = 2; // 0x2
field public static final int DEFAULT = 0; // 0x0
+ field public static final int HE_AAC = 4; // 0x4
}
public final class MediaRecorder.AudioSource {
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 6917fb2..9d36677 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -154,6 +154,7 @@ 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();
@@ -253,7 +254,7 @@ public abstract class WallpaperService extends Service {
final BaseIWindow mWindow = new BaseIWindow() {
@Override
- public void resized(int w, int h, Rect coveredInsets,
+ public void resized(int w, int h, Rect systemInsets, Rect contentInsets,
Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
reportDraw ? 1 : 0);
@@ -620,7 +621,7 @@ public abstract class WallpaperService extends Service {
final int relayoutResult = mSession.relayout(
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
- View.VISIBLE, 0, mWinFrame, mContentInsets,
+ View.VISIBLE, 0, mWinFrame, mSystemInsets, 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 d73723a..555f306 100644
--- a/core/java/android/view/IWindow.aidl
+++ b/core/java/android/view/IWindow.aidl
@@ -45,8 +45,8 @@ oneway interface IWindow {
*/
void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);
- void resized(int w, int h, in Rect coveredInsets, in Rect visibleInsets,
- boolean reportDraw, in Configuration newConfig);
+ void resized(int w, int h, in Rect systemInsets, in Rect contentInsets,
+ in Rect visibleInsets, boolean reportDraw, in Configuration newConfig);
void dispatchAppVisibility(boolean visible);
void dispatchGetNewSurface();
void dispatchScreenState(boolean on);
diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl
index 53d6e1f..f26d5e1 100644
--- a/core/java/android/view/IWindowSession.aidl
+++ b/core/java/android/view/IWindowSession.aidl
@@ -58,6 +58,10 @@ 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
@@ -79,9 +83,9 @@ 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 outContentInsets,
- out Rect outVisibleInsets, out Configuration outConfig,
- out Surface outSurface);
+ int flags, out Rect outFrame, out Rect outSystemInsets,
+ out Rect outContentInsets, out Rect outVisibleInsets,
+ out Configuration outConfig, out Surface outSurface);
/**
* If a call to relayout() asked to have the surface destroy deferred,
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index c658a80..ee322f8 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -98,6 +98,7 @@ 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();
@@ -471,7 +472,7 @@ public class SurfaceView extends View {
mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
visible ? VISIBLE : GONE,
WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY,
- mWinFrame, mContentInsets,
+ mWinFrame, mSystemInsets, mContentInsets,
mVisibleInsets, mConfiguration, mNewSurface);
if ((relayoutResult&WindowManagerImpl.RELAYOUT_RES_FIRST_TIME) != 0) {
mReportDrawNeeded = true;
@@ -605,7 +606,7 @@ public class SurfaceView extends View {
mSurfaceView = new WeakReference<SurfaceView>(surfaceView);
}
- public void resized(int w, int h, Rect coveredInsets,
+ public void resized(int w, int h, Rect systemInsets, 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 588bb06..092bcbd 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4668,6 +4668,24 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
info.addAction(AccessibilityNodeInfo.ACTION_FOCUS);
}
}
+
+ info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
+ info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
+
+ if (isClickable()) {
+ info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
+ }
+
+ if (isLongClickable()) {
+ info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
+ }
+
+ if (getContentDescription() != null) {
+ info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY);
+ info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY);
+ info.setGranularities(AccessibilityNodeInfo.GRANULARITY_CHARACTER
+ | AccessibilityNodeInfo.GRANULARITY_WORD);
+ }
}
/**
@@ -5942,7 +5960,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
* @hide
*/
public boolean requestAccessibilityFocus() {
- if (!AccessibilityManager.getInstance(mContext).isEnabled()) {
+ AccessibilityManager manager = AccessibilityManager.getInstance(mContext);
+ if (!manager.isEnabled() || !manager.isTouchExplorationEnabled()) {
return false;
}
if ((mViewFlags & VISIBILITY_MASK) != VISIBLE) {
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 467e285..bb7b3f8 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2438,7 +2438,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
handled = child.dispatchPopulateAccessibilityEvent(event);
if (handled) {
- children.recycle();
return handled;
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index c5c7746..9565547 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -261,6 +261,7 @@ 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();
@@ -635,6 +636,8 @@ public final class ViewRootImpl implements ViewParent,
if (view.getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
+
+ setAccessibilityFocusedHost(null);
}
}
}
@@ -2316,7 +2319,8 @@ public final class ViewRootImpl implements ViewParent,
* @param canvas The canvas on which to draw.
*/
private void drawAccessibilityFocusedDrawableIfNeeded(Canvas canvas) {
- if (!AccessibilityManager.getInstance(mView.mContext).isEnabled()) {
+ AccessibilityManager manager = AccessibilityManager.getInstance(mView.mContext);
+ if (!manager.isEnabled() || !manager.isTouchExplorationEnabled()) {
return;
}
if (mAccessibilityFocusedHost == null || mAccessibilityFocusedHost.mAttachInfo == null) {
@@ -2339,6 +2343,9 @@ public final class ViewRootImpl implements ViewParent,
if (mAccessibilityFocusedVirtualView == null) {
mAccessibilityFocusedVirtualView = provider.findAccessibilitiyFocus(View.NO_ID);
}
+ if (mAccessibilityFocusedVirtualView == null) {
+ return;
+ }
mAccessibilityFocusedVirtualView.getBoundsInScreen(bounds);
bounds.offset(-mAttachInfo.mWindowLeft, -mAttachInfo.mWindowTop);
}
@@ -2865,6 +2872,8 @@ public final class ViewRootImpl implements ViewParent,
mHasHadWindowFocus = true;
}
+ setAccessibilityFocusedHost(null);
+
if (mView != null && mAccessibilityManager.isEnabled()) {
if (hasWindowFocus) {
mView.sendAccessibilityEvent(
@@ -2883,9 +2892,6 @@ public final class ViewRootImpl implements ViewParent,
if (mAccessibilityFocusedHost == null) {
mView.requestAccessibilityFocus();
}
- } else {
- // Clear accessibility focus when the window loses input focus.
- setAccessibilityFocusedHost(null);
}
}
}
@@ -3841,7 +3847,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, mPendingContentInsets, mPendingVisibleInsets,
+ mWinFrame, mPendingSystemInsets, mPendingContentInsets, mPendingVisibleInsets,
mPendingConfiguration, mSurface);
//Log.d(TAG, "<<<<<< BACK FROM relayout");
if (restore) {
@@ -4684,11 +4690,11 @@ public final class ViewRootImpl implements ViewParent,
mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor);
}
- public void resized(int w, int h, Rect coveredInsets, Rect visibleInsets,
- boolean reportDraw, Configuration newConfig) {
+ public void resized(int w, int h, Rect systemInsets, Rect contentInsets,
+ Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
- viewAncestor.dispatchResized(w, h, coveredInsets, visibleInsets, reportDraw,
+ 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 27baaea..94762b9 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -140,6 +140,10 @@ 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.
@@ -151,7 +155,7 @@ public interface WindowManagerPolicy {
* are visible.
*/
public void computeFrameLw(Rect parentFrame, Rect displayFrame,
- Rect contentFrame, Rect visibleFrame);
+ Rect systemFrame, Rect contentFrame, Rect visibleFrame);
/**
* Retrieve the current frame of the window that has been assigned by
@@ -173,12 +177,20 @@ public interface WindowManagerPolicy {
* Retrieve the frame of the display that this window was last
* laid out in. Must be called with the
* window manager lock held.
- *
+ *
* @return Rect The rectangle holding the display frame.
*/
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
@@ -298,6 +310,12 @@ public interface WindowManagerPolicy {
boolean isDisplayedLw();
/**
+ * Return true if this window (or a window it is attached to, but not
+ * considering its app token) is currently animating.
+ */
+ public boolean isAnimatingLw();
+
+ /**
* Is this window considered to be gone for purposes of layout?
*/
boolean isGoneForLayoutLw();
@@ -305,8 +323,6 @@ public interface WindowManagerPolicy {
/**
* Returns true if this window has been shown on screen at some time in
* the past. Must be called with the window manager lock held.
- *
- * @return boolean
*/
public boolean hasDrawnLw();
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index ca17d31..a9b32b8 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -87,6 +87,7 @@ import android.view.View.MeasureSpec;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
+import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
@@ -5435,8 +5436,9 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
if (mWebView.isHardwareAccelerated()) {
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
- if (drawGLFunction != 0) {
- mWebView.getViewRootImpl().detachFunctor(drawGLFunction);
+ ViewRootImpl viewRoot = mWebView.getViewRootImpl();
+ if (drawGLFunction != 0 && viewRoot != null) {
+ viewRoot.detachFunctor(drawGLFunction);
}
}
}
@@ -7885,14 +7887,16 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
mSendScrollEvent = true;
int functor = 0;
- if (mWebView.isHardwareAccelerated()
- || mWebView.getLayerType() != View.LAYER_TYPE_HARDWARE) {
+ ViewRootImpl viewRoot = mWebView.getViewRootImpl();
+ if (mWebView.isHardwareAccelerated() && viewRoot != null) {
functor = nativeGetDrawGLFunction(mNativeClass);
+ if (functor != 0) {
+ viewRoot.attachFunctor(functor);
+ }
}
- if (functor != 0) {
- mWebView.getViewRootImpl().attachFunctor(functor);
- } else {
+ if (functor == 0
+ || mWebView.getLayerType() != View.LAYER_TYPE_NONE) {
// invalidate the screen so that the next repaint will show new content
// TODO: partial invalidate
mWebView.invalidate();
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 233d892..02bb4f3 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -230,6 +230,7 @@ public class CheckedTextView extends TextView implements Checkable {
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(CheckedTextView.class.getName());
+ info.setCheckable(true);
info.setChecked(mChecked);
}
}
diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java
index a649ee1..fbed485 100644
--- a/core/java/com/android/internal/view/BaseIWindow.java
+++ b/core/java/com/android/internal/view/BaseIWindow.java
@@ -33,7 +33,7 @@ public class BaseIWindow extends IWindow.Stub {
mSession = session;
}
- public void resized(int w, int h, Rect coveredInsets,
+ public void resized(int w, int h, Rect systemInsets, Rect contentInsets,
Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
if (reportDraw) {
try {
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index e0b33cd..9af201d 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -251,14 +251,12 @@ public class MediaRecorder
public static final int AMR_NB = 1;
/** AMR (Wideband) audio codec */
public static final int AMR_WB = 2;
- /** AAC audio codec */
+ /** AAC Low Complexity (AAC-LC) audio codec */
public static final int AAC = 3;
- /** @hide enhanced AAC audio codec */
- public static final int AAC_PLUS = 4;
- /** @hide enhanced AAC plus audio codec */
- public static final int EAAC_PLUS = 5;
- /** AAC-ELD audio codec */
- public static final int AAC_ELD = 6;
+ /** High Efficiency AAC (HE-AAC) audio codec */
+ public static final int HE_AAC = 4;
+ /** Enhanced Low Delay AAC (AAC-ELD) audio codec */
+ public static final int AAC_ELD = 5;
}
/**
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
index b1d049e..abe8b8c 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
@@ -88,8 +88,7 @@ public class MediaProfileReader
if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB &&
audioEncoder != MediaRecorder.AudioEncoder.AMR_WB &&
audioEncoder != MediaRecorder.AudioEncoder.AAC &&
- audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS &&
- audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
+ audioEncoder != MediaRecorder.AudioEncoder.HE_AAC) {
throw new IllegalArgumentException("Unsupported audio encodeer " + audioEncoder);
}
return audioEncoderMap.get(audioEncoder);
@@ -128,7 +127,6 @@ public class MediaProfileReader
audioEncoderMap.put(MediaRecorder.AudioEncoder.AMR_NB, "amrnb");
audioEncoderMap.put(MediaRecorder.AudioEncoder.AMR_WB, "amrwb");
audioEncoderMap.put(MediaRecorder.AudioEncoder.AAC, "aac");
- audioEncoderMap.put(MediaRecorder.AudioEncoder.AAC_PLUS, "aacplus");
- audioEncoderMap.put(MediaRecorder.AudioEncoder.EAAC_PLUS, "eaacplus");
+ audioEncoderMap.put(MediaRecorder.AudioEncoder.HE_AAC, "heaac");
}
}
diff --git a/packages/SystemUI/res/drawable/recents_thumbnail_fg.xml b/packages/SystemUI/res/drawable/recents_thumbnail_fg.xml
index 7033077..d683af9 100644
--- a/packages/SystemUI/res/drawable/recents_thumbnail_fg.xml
+++ b/packages/SystemUI/res/drawable/recents_thumbnail_fg.xml
@@ -16,6 +16,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/recents_thumbnail_bg_press" android:state_selected="true" />
<item android:drawable="@drawable/recents_thumbnail_bg_press" android:state_pressed="true" />
- <item android:drawable="@drawable/recents_thumbnail_bg_dragging" android:state_activated="true" />
<item android:drawable="@*android:color/transparent"/>
</selector>
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index f565e75..6ed5fb7 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -22,6 +22,7 @@
<com.android.systemui.statusbar.phone.PhoneStatusBarView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
+ android:id="@+id/status_bar"
android:background="@drawable/status_bar_background"
android:orientation="vertical"
android:focusable="true"
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index c64aabe..eb1e1c0 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -121,7 +121,7 @@
<com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close"
android:layout_width="match_parent"
- android:layout_height="34dp"
+ android:layout_height="@dimen/close_handle_height"
android:layout_gravity="bottom"
android:orientation="vertical"
>
diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml
new file mode 100644
index 0000000..c094988
--- /dev/null
+++ b/packages/SystemUI/res/layout/super_status_bar.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** 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.
+*/
+-->
+
+<!-- This is the combined status bar / notification panel window. -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
+ android:focusable="true"
+ android:descendantFocusability="afterDescendants"
+ android:fitsSystemWindows="true"
+ >
+
+ <include layout="@layout/status_bar_expanded"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ />
+
+ <include layout="@layout/status_bar"
+ android:layout_width="match_parent"
+ android:layout_height="@*android:dimen/status_bar_height"
+ />
+
+</FrameLayout>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 6c29c6e..f7b8cc9 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -118,4 +118,6 @@
<!-- Diameter of outer shape drawable shown in navbar search-->
<dimen name="navbar_search_outerring_diameter">300dip</dimen>
+ <!-- Height of the draggable handle at the bottom of the phone notification panel -->
+ <dimen name="close_handle_height">34dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index 97c9553..9f801b0 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -184,7 +184,6 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
mRecycledViews.add(v);
mLinearLayout.removeView(v);
mCallback.handleSwipe(v);
- v.setActivated(false);
// Restore the alpha/translation parameters to what they were before swiping
// (for when these items are recycled)
View contentView = getChildContentView(v);
@@ -196,11 +195,9 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
requestDisallowInterceptTouchEvent(true);
- v.setActivated(true);
}
public void onDragCancelled(View v) {
- v.setActivated(false);
}
public View getChildAtPosition(MotionEvent ev) {
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
index f4e516c..c1597e0 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
@@ -191,7 +191,6 @@ public class RecentsVerticalScrollView extends ScrollView
mRecycledViews.add(v);
mLinearLayout.removeView(v);
mCallback.handleSwipe(v);
- v.setActivated(false);
// Restore the alpha/translation parameters to what they were before swiping
// (for when these items are recycled)
View contentView = getChildContentView(v);
@@ -203,11 +202,9 @@ public class RecentsVerticalScrollView extends ScrollView
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
requestDisallowInterceptTouchEvent(true);
- v.setActivated(true);
}
public void onDragCancelled(View v) {
- v.setActivated(false);
}
public View getChildAtPosition(MotionEvent ev) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 8586185..0125b64 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -142,7 +142,9 @@ public class PhoneStatusBar extends BaseStatusBar {
IWindowManager mWindowManager;
+ View mStatusBarWindow;
PhoneStatusBarView mStatusBarView;
+
int mPixelFormat;
Object mQueueLock = new Object();
@@ -153,9 +155,6 @@ public class PhoneStatusBar extends BaseStatusBar {
LinearLayout mStatusIcons;
// expanded notifications
- Dialog mExpandedDialog;
- WindowManager.LayoutParams mExpandedParams;
- View mExpandedWindowView;
View mNotificationPanel; // the sliding/resizing panel within the notification window
ScrollView mScrollView;
View mExpandedContents;
@@ -165,6 +164,7 @@ public class PhoneStatusBar extends BaseStatusBar {
// drag bar
CloseDragHandle mCloseView;
+ private int mCloseViewHeight;
// all notifications
NotificationData mNotificationData = new NotificationData();
@@ -274,12 +274,13 @@ public class PhoneStatusBar extends BaseStatusBar {
mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
- final View expanded = mExpandedWindowView = View.inflate(context,
- R.layout.status_bar_expanded, null);
+ mStatusBarWindow = View.inflate(context,
+ R.layout.super_status_bar, null);
if (DEBUG) {
- expanded.setBackgroundColor(0x6000FF80);
+ mStatusBarWindow.setBackgroundColor(0x6000FF80);
}
- mNotificationPanel = expanded.findViewById(R.id.notification_panel);
+ mStatusBarView = (PhoneStatusBarView) mStatusBarWindow.findViewById(R.id.status_bar);
+ mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel);
if (ENABLE_INTRUDERS) {
mIntruderAlertView = (IntruderAlertView) View.inflate(context, R.layout.intruder_alert, null);
@@ -287,10 +288,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mIntruderAlertView.setBar(this);
}
- PhoneStatusBarView sb = (PhoneStatusBarView)View.inflate(context,
- R.layout.status_bar, null);
- sb.mService = this;
- mStatusBarView = sb;
+ mStatusBarView.mService = this;
try {
boolean showNav = mWindowManager.hasNavigationBar();
@@ -308,35 +306,35 @@ public class PhoneStatusBar extends BaseStatusBar {
// figure out which pixel-format to use for the status bar.
mPixelFormat = PixelFormat.OPAQUE;
- mStatusIcons = (LinearLayout)sb.findViewById(R.id.statusIcons);
- mNotificationIcons = (IconMerger)sb.findViewById(R.id.notificationIcons);
- mMoreIcon = sb.findViewById(R.id.moreIcon);
+ mStatusIcons = (LinearLayout)mStatusBarView.findViewById(R.id.statusIcons);
+ mNotificationIcons = (IconMerger)mStatusBarView.findViewById(R.id.notificationIcons);
+ mMoreIcon = mStatusBarView.findViewById(R.id.moreIcon);
mNotificationIcons.setOverflowIndicator(mMoreIcon);
- mIcons = (LinearLayout)sb.findViewById(R.id.icons);
- mTickerView = sb.findViewById(R.id.ticker);
+ mIcons = (LinearLayout)mStatusBarView.findViewById(R.id.icons);
+ mTickerView = mStatusBarView.findViewById(R.id.ticker);
- mExpandedDialog = new ExpandedDialog(context);
- mPile = (NotificationRowLayout)expanded.findViewById(R.id.latestItems);
+ mPile = (NotificationRowLayout)mStatusBarWindow.findViewById(R.id.latestItems);
mPile.setLongPressListener(getNotificationLongClicker());
mExpandedContents = mPile; // was: expanded.findViewById(R.id.notificationLinearLayout);
- mClearButton = expanded.findViewById(R.id.clear_all_button);
+ mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button);
mClearButton.setOnClickListener(mClearButtonListener);
mClearButton.setAlpha(0f);
mClearButton.setEnabled(false);
- mDateView = (DateView)expanded.findViewById(R.id.date);
- mSettingsButton = expanded.findViewById(R.id.settings_button);
+ mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date);
+ mSettingsButton = mStatusBarWindow.findViewById(R.id.settings_button);
mSettingsButton.setOnClickListener(mSettingsButtonListener);
- mScrollView = (ScrollView)expanded.findViewById(R.id.scroll);
+ mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll);
mScrollView.setVerticalScrollBarEnabled(false); // less drawing during pulldowns
- mTicker = new MyTicker(context, sb);
+ mTicker = new MyTicker(context, mStatusBarView);
- TickerView tickerView = (TickerView)sb.findViewById(R.id.tickerText);
+ TickerView tickerView = (TickerView)mStatusBarView.findViewById(R.id.tickerText);
tickerView.mTicker = mTicker;
- mCloseView = (CloseDragHandle)mExpandedWindowView.findViewById(R.id.close);
+ mCloseView = (CloseDragHandle)mStatusBarWindow.findViewById(R.id.close);
mCloseView.mService = this;
+ mCloseViewHeight = res.getDimensionPixelSize(R.dimen.close_handle_height);
mEdgeBorder = res.getDimensionPixelSize(R.dimen.status_bar_edge_ignore);
@@ -346,10 +344,10 @@ public class PhoneStatusBar extends BaseStatusBar {
// Other icons
mLocationController = new LocationController(mContext); // will post a notification
mBatteryController = new BatteryController(mContext);
- mBatteryController.addIconView((ImageView)sb.findViewById(R.id.battery));
+ mBatteryController.addIconView((ImageView)mStatusBarView.findViewById(R.id.battery));
mNetworkController = new NetworkController(mContext);
final SignalClusterView signalCluster =
- (SignalClusterView)sb.findViewById(R.id.signal_cluster);
+ (SignalClusterView)mStatusBarView.findViewById(R.id.signal_cluster);
mNetworkController.addSignalCluster(signalCluster);
signalCluster.setNetworkController(mNetworkController);
// final ImageView wimaxRSSI =
@@ -368,7 +366,7 @@ public class PhoneStatusBar extends BaseStatusBar {
filter.addAction(Intent.ACTION_SCREEN_OFF);
context.registerReceiver(mBroadcastReceiver, filter);
- return sb;
+ return mStatusBarView;
}
@Override
@@ -462,8 +460,16 @@ public class PhoneStatusBar extends BaseStatusBar {
}
public int getStatusBarHeight() {
- final Resources res = mContext.getResources();
- return res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
+ if (mNaturalBarHeight < 0) {
+ final Resources res = mContext.getResources();
+ mNaturalBarHeight =
+ res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
+ }
+ return mNaturalBarHeight;
+ }
+
+ private int getCloseViewHeight() {
+ return mCloseViewHeight;
}
private View.OnClickListener mRecentsClickListener = new View.OnClickListener() {
@@ -1097,19 +1103,19 @@ public class PhoneStatusBar extends BaseStatusBar {
if (mExpandedVisible) {
return;
}
- mExpandedDialog.show(); // XXX HAX
+
mExpandedVisible = true;
- visibilityChanged(true);
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
- mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
- mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
- if (DEBUG) {
- Slog.d(TAG, "makeExpandedVisible: expanded params = " + mExpandedParams);
- }
- mExpandedDialog.getWindow().setAttributes(mExpandedParams);
- mExpandedWindowView.requestFocus(View.FOCUS_FORWARD);
- mExpandedWindowView.setVisibility(View.VISIBLE);
+
+ // Expand the window to encompass the full screen in anticipation of the drag.
+ // This is only possible to do atomically because the status bar is at the top of the screen!
+ WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams();
+ lp.height = mDisplayMetrics.heightPixels;
+ final WindowManager wm = WindowManagerImpl.getDefault();
+ wm.updateViewLayout(mStatusBarWindow, lp);
+
+ visibilityChanged(true);
}
public void animateExpand() {
@@ -1190,11 +1196,13 @@ public class PhoneStatusBar extends BaseStatusBar {
}
mExpandedVisible = false;
visibilityChanged(false);
- mExpandedParams.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
- mExpandedParams.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
- mExpandedDialog.getWindow().setAttributes(mExpandedParams);
- mExpandedDialog.hide(); // XXX HAX
- mExpandedWindowView.setVisibility(View.GONE);
+ //mNotificationPanel.setVisibility(View.GONE);
+
+ // Shrink the window to the size of the status bar only
+ WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams();
+ lp.height = getStatusBarHeight();
+ final WindowManager wm = WindowManagerImpl.getDefault();
+ wm.updateViewLayout(mStatusBarWindow, lp);
if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) {
setNotificationIconVisibility(true, com.android.internal.R.anim.fade_in);
@@ -1222,7 +1230,7 @@ public class PhoneStatusBar extends BaseStatusBar {
updateExpandedViewPos(EXPANDED_FULL_OPEN);
performExpand();
}
- else if (mAnimY < mStatusBarView.getHeight()) {
+ else if (mAnimY < getStatusBarHeight()) {
if (SPEW) Slog.d(TAG, "Animation completed to collapsed state.");
mAnimating = false;
updateExpandedViewPos(0);
@@ -1255,9 +1263,9 @@ public class PhoneStatusBar extends BaseStatusBar {
//Slog.d(TAG, "y=" + y + " v=" + v + " a=" + a + " t=" + t + " mAnimY=" + mAnimY
// + " mAnimAccel=" + mAnimAccel);
}
-
+
void doRevealAnimation() {
- final int h = mCloseView.getHeight() + mStatusBarView.getHeight();
+ final int h = getCloseViewHeight() + getStatusBarHeight();
if (mAnimatingReveal && mAnimating && mAnimY < h) {
incrementAnim();
if (mAnimY >= h) {
@@ -1277,17 +1285,13 @@ public class PhoneStatusBar extends BaseStatusBar {
Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening);
}
- // there are some race conditions that cause this to be inaccurate; let's recalculate it any
- // time we're about to drag the panel
- updateExpandedSize();
-
mTracking = true;
mPile.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mVelocityTracker = VelocityTracker.obtain();
if (opening) {
mAnimAccel = mExpandAccelPx;
mAnimVel = mFlingExpandMinVelocityPx;
- mAnimY = mStatusBarView.getHeight();
+ mAnimY = getStatusBarHeight();
updateExpandedViewPos((int)mAnimY);
mAnimating = true;
mAnimatingReveal = true;
@@ -1393,7 +1397,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
final int action = event.getAction();
- final int statusBarSize = mStatusBarView.getHeight();
+ final int statusBarSize = getStatusBarHeight();
final int hitSize = statusBarSize*2;
final int y = (int)event.getRawY();
if (action == MotionEvent.ACTION_DOWN) {
@@ -1422,9 +1426,9 @@ public class PhoneStatusBar extends BaseStatusBar {
}
} else if (mTracking) {
trackMovement(event);
- final int minY = statusBarSize + mCloseView.getHeight();
+ final int minY = statusBarSize + getCloseViewHeight();
if (action == MotionEvent.ACTION_MOVE) {
- if (mAnimatingReveal && y < minY) {
+ if (mAnimatingReveal && (y + mViewDelta) < minY) {
// nothing
} else {
mAnimatingReveal = false;
@@ -1664,7 +1668,7 @@ public class PhoneStatusBar extends BaseStatusBar {
// until status bar window is attached to the window manager,
// because... well, what's the point otherwise? And trying to
// run a ticker without being attached will crash!
- if (n.notification.tickerText != null && mStatusBarView.getWindowToken() != null) {
+ if (n.notification.tickerText != null && mStatusBarWindow.getWindowToken() != null) {
if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_TICKER))) {
mTicker.addEntry(n);
@@ -1757,9 +1761,6 @@ public class PhoneStatusBar extends BaseStatusBar {
pw.println(" mAnimatingReveal=" + mAnimatingReveal
+ " mViewDelta=" + mViewDelta);
pw.println(" mDisplayMetrics=" + mDisplayMetrics);
- pw.println(" mExpandedParams: " + mExpandedParams);
- pw.println(" mExpandedView: " + viewInfo(mExpandedWindowView));
- pw.println(" mExpandedDialog: " + mExpandedDialog);
pw.println(" mPile: " + viewInfo(mPile));
pw.println(" mCloseView: " + viewInfo(mCloseView));
pw.println(" mTickerView: " + viewInfo(mTickerView));
@@ -1803,14 +1804,8 @@ public class PhoneStatusBar extends BaseStatusBar {
mStatusBarView.getLocationOnScreen(mAbsPos);
Slog.d(TAG, "mStatusBarView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
+ ") " + mStatusBarView.getWidth() + "x"
- + mStatusBarView.getHeight());
+ + getStatusBarHeight());
mStatusBarView.debug();
-
- mExpandedWindowView.getLocationOnScreen(mAbsPos);
- Slog.d(TAG, "mExpandedView: ----- (" + mAbsPos[0] + "," + mAbsPos[1]
- + ") " + mExpandedWindowView.getWidth() + "x"
- + mExpandedWindowView.getHeight());
- mExpandedWindowView.debug();
}
});
}
@@ -1822,13 +1817,15 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void createAndAddWindows() {
addStatusBarWindow();
- addExpandedWindow();
}
private void addStatusBarWindow() {
// Put up the view
final int height = getStatusBarHeight();
+ // Now that the status bar window encompasses the sliding panel and its
+ // translucent backdrop, the entire thing is made TRANSLUCENT and is
+ // hardware-accelerated.
final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
height,
@@ -1836,56 +1833,18 @@ public class PhoneStatusBar extends BaseStatusBar {
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- // We use a pixel format of RGB565 for the status bar to save memory bandwidth and
- // to ensure that the layer can be handled by HWComposer. On some devices the
- // HWComposer is unable to handle SW-rendered RGBX_8888 layers.
- PixelFormat.RGB_565);
+ PixelFormat.TRANSLUCENT);
- // We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies
- // very little screen real-estate and is updated fairly frequently. By using CPU rendering
- // for the status bar, we prevent the GPU from having to wake up just to do these small
- // updates, which should help keep power consumption down.
+ if (ActivityManager.isHighEndGfx(mDisplay)) {
+ lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
+ }
lp.gravity = getStatusBarGravity();
lp.setTitle("StatusBar");
lp.packageName = mContext.getPackageName();
- mStatusBarView = makeStatusBarView();
- WindowManagerImpl.getDefault().addView(mStatusBarView, lp);
- }
-
- void addExpandedWindow() {
- WindowManager.LayoutParams lp;
- int pixelFormat;
-
- /// ---------- Expanded View --------------
- pixelFormat = PixelFormat.TRANSLUCENT;
-
- lp = mExpandedDialog.getWindow().getAttributes();
- lp.x = 0;
- lp.y = 0;
- lp.type = WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
- lp.flags = 0
- | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
- | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
- | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
- | WindowManager.LayoutParams.FLAG_DITHER
- | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
- if (ActivityManager.isHighEndGfx(mDisplay)) {
- lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
- }
- lp.format = pixelFormat;
- lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
- lp.setTitle("StatusBarExpanded");
- mExpandedParams = lp;
- updateExpandedSize();
- mExpandedDialog.getWindow().setFormat(pixelFormat);
- mExpandedDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
- mExpandedDialog.setContentView(mExpandedWindowView,
- new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
- mExpandedDialog.getWindow().setBackgroundDrawable(null);
- //mExpandedDialog.show();
+ makeStatusBarView();
+ WindowManagerImpl.getDefault().addView(mStatusBarWindow, lp);
}
void setNotificationIconVisibility(boolean visible, int anim) {
@@ -1901,6 +1860,10 @@ public class PhoneStatusBar extends BaseStatusBar {
mTrackingPosition = -mDisplayMetrics.heightPixels;
}
+ static final float saturate(float a) {
+ return a < 0f ? 0f : (a > 1f ? 1f : a);
+ }
+
void updateExpandedViewPos(int expandedPosition) {
if (SPEW) {
Slog.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
@@ -1935,20 +1898,26 @@ public class PhoneStatusBar extends BaseStatusBar {
}
// catch orientation changes and other peculiar cases
- if (panelh > disph || (panelh < disph && !mTracking && !mAnimating))
+ if (panelh > disph || (panelh < disph && !mTracking && !mAnimating)) {
panelh = disph;
+ } else if (panelh < 0) {
+ panelh = 0;
+ }
mTrackingPosition = panelh;
- // XXX: this is all very WIP
- //mNotificationPanel.setY(panelh);
+
final View cropView = mNotificationPanel;
ViewGroup.LayoutParams lp = cropView.getLayoutParams();
lp.height = panelh;
+ if (SPEW) {
+ Slog.v(TAG, "updated cropView height=" + panelh);
+ }
cropView.setLayoutParams(lp);
// woo, special effects
- final float frac = (float)panelh / disph;
- final int color = ((int)(0xB0 * frac * frac)) << 24;
- mExpandedWindowView.setBackgroundColor(color);
+ final int barh = getCloseViewHeight() + getStatusBarHeight();
+ final float frac = saturate((float)(panelh - barh) / (disph - barh));
+ final int color = ((int)(0xB0 * Math.sin(frac * 1.57f))) << 24;
+ mStatusBarWindow.setBackgroundColor(color);
// Slog.d(TAG, String.format("updateExpanded: pos=%d frac=%.2f col=0x%08x", pos, frac, color));
@@ -2013,40 +1982,36 @@ public class PhoneStatusBar extends BaseStatusBar {
// }
}
- int getExpandedHeight(int disph) {
- if (DEBUG) {
- Slog.d(TAG, "getExpandedHeight(" + disph + "): sbView="
- + mStatusBarView.getHeight() + " closeView=" + mCloseView.getHeight());
- }
- return disph; // - mStatusBarView.getHeight();
+ int getExpandedHeight() {
+ return mDisplayMetrics.heightPixels;
}
void updateDisplaySize() {
mDisplay.getMetrics(mDisplayMetrics);
- if (DEBUG) {
- Slog.d(TAG, "updateDisplaySize: " + mDisplayMetrics);
- }
- updateExpandedSize();
+// if (DEBUG) {
+// Slog.d(TAG, "updateDisplaySize: " + mDisplayMetrics);
+// }
+// updateExpandedSize();
}
- void updateExpandedSize() {
- if (DEBUG) {
- Slog.d(TAG, "updateExpandedSize()");
- }
- if (mExpandedDialog != null && mExpandedParams != null && mDisplayMetrics != null) {
- mExpandedParams.width = mDisplayMetrics.widthPixels;
- mExpandedParams.height = getExpandedHeight(mDisplayMetrics.heightPixels);
- if (!mExpandedVisible) {
- updateExpandedInvisiblePosition();
- } else {
- mExpandedDialog.getWindow().setAttributes(mExpandedParams);
- }
- if (DEBUG) {
- Slog.d(TAG, "updateExpandedSize: height=" + mExpandedParams.height + " " +
- (mExpandedVisible ? "VISIBLE":"INVISIBLE"));
- }
- }
- }
+// void updateExpandedSize() {
+// if (DEBUG) {
+// Slog.d(TAG, "updateExpandedSize()");
+// }
+// if (mStatusBarWindow != null && mDisplayMetrics != null) {
+// mExpandedParams.width = mDisplayMetrics.widthPixels;
+// mExpandedParams.height = getExpandedHeight();
+// if (!mExpandedVisible) {
+// updateExpandedInvisiblePosition();
+// } else {
+// mExpandedDialog.getWindow().setAttributes(mExpandedParams);
+// }
+// if (DEBUG) {
+// Slog.d(TAG, "updateExpandedSize: height=" + mExpandedParams.height + " " +
+// (mExpandedVisible ? "VISIBLE":"INVISIBLE"));
+// }
+// }
+// }
void performDisableActions(int net) {
int old = mDisabled;
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index d2053ff..319eb36 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -407,6 +407,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// that area of the display from all other windows.
int mRestrictedScreenLeft, mRestrictedScreenTop;
int mRestrictedScreenWidth, mRestrictedScreenHeight;
+ // During layout, the current screen borders accounting for any currently
+ // visible system UI elements.
+ int mSystemLeft, mSystemTop, mSystemRight, mSystemBottom;
// For applications requesting stable content insets, these are them.
int mStableLeft, mStableTop, mStableRight, mStableBottom;
// During layout, the current screen borders with all outer decoration
@@ -423,6 +426,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mDockLeft, mDockTop, mDockRight, mDockBottom;
// During layout, the layer at which the doc window is placed.
int mDockLayer;
+ // During layout, this is the layer of the status bar.
+ int mStatusBarLayer;
int mLastSystemUiFlags;
// Bits that we are in the process of clearing, so we want to prevent
// them from being set by applications until everything has been updated
@@ -438,6 +443,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
static final Rect mTmpParentFrame = new Rect();
static final Rect mTmpDisplayFrame = new Rect();
+ static final Rect mTmpSystemFrame = new Rect();
static final Rect mTmpContentFrame = new Rect();
static final Rect mTmpVisibleFrame = new Rect();
static final Rect mTmpNavigationFrame = new Rect();
@@ -2168,11 +2174,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mRestrictedScreenLeft = mRestrictedScreenTop = 0;
mRestrictedScreenWidth = displayWidth;
mRestrictedScreenHeight = displayHeight;
- mDockLeft = mContentLeft = mStableLeft = mCurLeft = 0;
- mDockTop = mContentTop = mStableTop = mCurTop = 0;
- mDockRight = mContentRight = mStableRight = mCurRight = displayWidth;
- mDockBottom = mContentBottom = mStableBottom = mCurBottom = displayHeight;
+ mDockLeft = mContentLeft = mStableLeft = mSystemLeft = mCurLeft = 0;
+ mDockTop = mContentTop = mStableTop = mSystemTop = mCurTop = 0;
+ mDockRight = mContentRight = mStableRight = mSystemRight = mCurRight = displayWidth;
+ mDockBottom = mContentBottom = mStableBottom = mSystemBottom = mCurBottom = displayHeight;
mDockLayer = 0x10000000;
+ mStatusBarLayer = -1;
// start with the current dock rect, which will be (0,0,displayWidth,displayHeight)
final Rect pf = mTmpParentFrame;
@@ -2232,6 +2239,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// We currently want to hide the navigation UI.
mNavigationBar.hideLw(true);
}
+ if (navVisible && !mNavigationBar.isAnimatingLw()) {
+ // If the nav bar is currently requested to be visible,
+ // and not in the process of animating on or off, then
+ // we can tell the app that it is covered by it.
+ mSystemBottom = mTmpNavigationFrame.top;
+ }
} else {
// Landscape screen; nav bar goes to the right.
int left = displayWidth - mNavigationBarWidthForRotation[displayRotation];
@@ -2250,6 +2263,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// We currently want to hide the navigation UI.
mNavigationBar.hideLw(true);
}
+ if (navVisible && !mNavigationBar.isAnimatingLw()) {
+ // If the nav bar is currently requested to be visible,
+ // and not in the process of animating on or off, then
+ // we can tell the app that it is covered by it.
+ mSystemRight = mTmpNavigationFrame.left;
+ }
}
// Make sure the content and current rectangles are updated to
// account for the restrictions from the navigation bar.
@@ -2257,9 +2276,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mContentBottom = mCurBottom = mDockBottom;
mContentLeft = mCurLeft = mDockLeft;
mContentRight = mCurRight = mDockRight;
+ mStatusBarLayer = mNavigationBar.getSurfaceLayer();
// And compute the final frame.
mNavigationBar.computeFrameLw(mTmpNavigationFrame, mTmpNavigationFrame,
- mTmpNavigationFrame, mTmpNavigationFrame);
+ mTmpNavigationFrame, mTmpNavigationFrame, mTmpNavigationFrame);
if (DEBUG_LAYOUT) Log.i(TAG, "mNavigationBar frame: " + mTmpNavigationFrame);
}
if (DEBUG_LAYOUT) Log.i(TAG, String.format("mDock rect: (%d,%d - %d,%d)",
@@ -2277,8 +2297,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
vf.right = mStableRight;
vf.bottom = mStableBottom;
+ mStatusBarLayer = mStatusBar.getSurfaceLayer();
+
// Let the status bar determine its size.
- mStatusBar.computeFrameLw(pf, df, vf, vf);
+ mStatusBar.computeFrameLw(pf, df, df, vf, vf);
// For layout, the status bar is always at the top with our fixed height.
mStableTop = mUnrestrictedScreenTop + mStatusBarHeight;
@@ -2303,6 +2325,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mContentLeft, mContentTop, mContentRight, mContentBottom,
mCurLeft, mCurTop, mCurRight, mCurBottom));
}
+ if (mStatusBar.isVisibleLw() && !mStatusBar.isAnimatingLw()) {
+ // If the status bar is currently requested to be visible,
+ // and not in the process of animating on or off, then
+ // we can tell the app that it is covered by it.
+ mSystemTop = mUnrestrictedScreenTop + mStatusBarHeight;
+ }
}
}
@@ -2368,6 +2396,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final Rect pf = mTmpParentFrame;
final Rect df = mTmpDisplayFrame;
+ final Rect sf = mTmpSystemFrame;
final Rect cf = mTmpContentFrame;
final Rect vf = mTmpVisibleFrame;
@@ -2611,6 +2640,20 @@ public class PhoneWindowManager implements WindowManagerPolicy {
df.right = df.bottom = cf.right = cf.bottom = vf.right = vf.bottom = 10000;
}
+ // Compute the system frame. This is easy: for things behind the
+ // status bar, it is any application windows; otherwise it is not set.
+ int parentType = attached != null ? attached.getAttrs().type : attrs.type;
+ if (win.getSurfaceLayer() < mStatusBarLayer
+ && parentType < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW) {
+ sf.left = mSystemLeft;
+ sf.top = mSystemTop;
+ sf.right = mSystemRight;
+ sf.bottom = mSystemBottom;
+ } else {
+ sf.left = sf.top = -10000;
+ sf.right = sf.bottom = 10000;
+ }
+
if (DEBUG_LAYOUT) Log.v(TAG, "Compute frame " + attrs.getTitle()
+ ": sim=#" + Integer.toHexString(sim)
+ " attach=" + attached + " type=" + attrs.type
@@ -2618,7 +2661,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
+ " pf=" + pf.toShortString() + " df=" + df.toShortString()
+ " cf=" + cf.toShortString() + " vf=" + vf.toShortString());
- win.computeFrameLw(pf, df, cf, vf);
+ win.computeFrameLw(pf, df, sf, cf, vf);
// Dock windows carve out the bottom of the screen, so normal windows
// can't appear underneath them.
@@ -4193,6 +4236,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
pw.print(","); pw.print(mStableTop);
pw.print(")-("); pw.print(mStableRight);
pw.print(","); pw.print(mStableBottom); pw.println(")");
+ pw.print(prefix); pw.print("mSystem=("); pw.print(mSystemLeft);
+ pw.print(","); pw.print(mSystemTop);
+ pw.print(")-("); pw.print(mSystemRight);
+ pw.print(","); pw.print(mSystemBottom); pw.println(")");
pw.print(prefix); pw.print("mCur=("); pw.print(mCurLeft);
pw.print(","); pw.print(mCurTop);
pw.print(")-("); pw.print(mCurRight);
@@ -4205,7 +4252,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
pw.print(","); pw.print(mDockTop);
pw.print(")-("); pw.print(mDockRight);
pw.print(","); pw.print(mDockBottom); pw.println(")");
- pw.print(prefix); pw.print("mDockLayer="); pw.println(mDockLayer);
+ pw.print(prefix); pw.print("mDockLayer="); pw.print(mDockLayer);
+ pw.print(" mStatusBarLayer="); pw.println(mStatusBarLayer);
pw.print(prefix); pw.print("mTopFullscreenOpaqueWindowState=");
pw.println(mTopFullscreenOpaqueWindowState);
pw.print(prefix); pw.print("mTopIsFullscreen="); pw.print(mTopIsFullscreen);
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 01ddf1f..885389f 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -1765,8 +1765,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
Bundle arguments) {
return canRetrieveWindowContent(service)
&& isRetrievalAllowingWindow(windowId)
- && isActionPermitted(action)
- && isActionArgumentsValid(action, arguments);
+ && isActionPermitted(action);
}
public boolean canRetrieveWindowContent(Service service) {
@@ -1790,29 +1789,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
return (VALID_ACTIONS & action) != 0;
}
- private boolean isActionArgumentsValid(int action, Bundle arguments) {
- switch (action) {
- case AccessibilityNodeInfo.ACTION_NEXT_AT_GRANULARITY:
- case AccessibilityNodeInfo.ACTION_PREVIOUS_AT_GRANULARITY: {
- if (arguments.size() == 1) {
- final int granularity = arguments.getInt(
- AccessibilityNodeInfo.ACTION_ARGUMENT_GRANULARITY_INT);
- return (granularity & VALID_GRANULARITIES) != 0
- && Integer.bitCount(granularity) == 1;
- }
- } break;
- case AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT:
- case AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT: {
- if (arguments.size() == 1) {
- String element = arguments.getString(
- AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING);
- return !TextUtils.isEmpty(element);
- }
- } break;
- }
- return false;
- }
-
private void enforceCallingPermission(String permission, String function) {
if (OWN_PROCESS_ID == Binder.getCallingPid()) {
return;
diff --git a/services/java/com/android/server/wm/Session.java b/services/java/com/android/server/wm/Session.java
index 77575f2..53c0e07 100644
--- a/services/java/com/android/server/wm/Session.java
+++ b/services/java/com/android/server/wm/Session.java
@@ -151,13 +151,14 @@ final class Session extends IWindowSession.Stub
public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs,
int requestedWidth, int requestedHeight, int viewFlags,
- int flags, Rect outFrame, Rect outContentInsets,
+ int flags, Rect outFrame, Rect outSystemInsets, Rect outContentInsets,
Rect outVisibleInsets, Configuration outConfig, Surface outSurface) {
if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from "
+ Binder.getCallingPid());
int res = mService.relayoutWindow(this, window, seq, attrs,
requestedWidth, requestedHeight, viewFlags, flags,
- outFrame, outContentInsets, outVisibleInsets, outConfig, outSurface);
+ outFrame, outSystemInsets, outContentInsets, outVisibleInsets,
+ outConfig, outSurface);
if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to "
+ Binder.getCallingPid());
return res;
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 1dce5dd..16aeb35 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -2647,8 +2647,8 @@ public class WindowManagerService extends IWindowManager.Stub
public int relayoutWindow(Session session, IWindow client, int seq,
WindowManager.LayoutParams attrs, int requestedWidth,
int requestedHeight, int viewVisibility, int flags,
- Rect outFrame, Rect outContentInsets, Rect outVisibleInsets,
- Configuration outConfig, Surface outSurface) {
+ Rect outFrame, Rect outSystemInsets, Rect outContentInsets,
+ Rect outVisibleInsets, Configuration outConfig, Surface outSurface) {
boolean displayed = false;
boolean inTouchMode;
boolean configChanged;
@@ -2939,6 +2939,7 @@ public class WindowManagerService extends IWindowManager.Stub
win.mAppToken.updateReportedVisibilityLocked();
}
outFrame.set(win.mCompatFrame);
+ outSystemInsets.set(win.mSystemInsets);
outContentInsets.set(win.mContentInsets);
outVisibleInsets.set(win.mVisibleInsets);
if (localLOGV) Slog.v(
@@ -8092,10 +8093,12 @@ public class WindowManagerService extends IWindowManager.Stub
private void updateResizingWindows(final WindowState w) {
final WindowStateAnimator winAnimator = w.mWinAnimator;
if (w.mHasSurface && !w.mAppFreezing && w.mLayoutSeq == mLayoutSeq) {
+ w.mSystemInsetsChanged |=
+ !w.mLastSystemInsets.equals(w.mSystemInsets);
w.mContentInsetsChanged |=
- !w.mLastContentInsets.equals(w.mContentInsets);
+ !w.mLastContentInsets.equals(w.mContentInsets);
w.mVisibleInsetsChanged |=
- !w.mLastVisibleInsets.equals(w.mVisibleInsets);
+ !w.mLastVisibleInsets.equals(w.mVisibleInsets);
boolean configChanged =
w.mConfiguration != mCurConfiguration
&& (w.mConfiguration == null
@@ -8108,7 +8111,8 @@ public class WindowManagerService extends IWindowManager.Stub
+ ": configChanged=" + configChanged
+ " last=" + w.mLastFrame + " frame=" + w.mFrame);
w.mLastFrame.set(w.mFrame);
- if (w.mContentInsetsChanged
+ if (w.mSystemInsetsChanged
+ || w.mContentInsetsChanged
|| w.mVisibleInsetsChanged
|| winAnimator.mSurfaceResized
|| configChanged) {
@@ -8120,6 +8124,7 @@ public class WindowManagerService extends IWindowManager.Stub
+ " configChanged=" + configChanged);
}
+ w.mLastSystemInsets.set(w.mSystemInsets);
w.mLastContentInsets.set(w.mContentInsets);
w.mLastVisibleInsets.set(w.mVisibleInsets);
makeWindowFreezingScreenIfNeededLocked(w);
@@ -8505,10 +8510,11 @@ public class WindowManagerService extends IWindowManager.Stub
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i(
TAG, "Resizing " + win + " WITH DRAW PENDING");
win.mClient.resized((int)winAnimator.mSurfaceW,
- (int)winAnimator.mSurfaceH,
+ (int)winAnimator.mSurfaceH, win.mLastSystemInsets,
win.mLastContentInsets, win.mLastVisibleInsets,
winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING,
configChanged ? win.mConfiguration : null);
+ win.mSystemInsetsChanged = false;
win.mContentInsetsChanged = false;
win.mVisibleInsetsChanged = false;
winAnimator.mSurfaceResized = false;
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 4de6425..05e7d3a 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -124,7 +124,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
boolean mVisibleInsetsChanged;
/**
- * Insets that are covered by system windows. These are in the application's
+ * Insets that are covered by system windows (such as the status bar) and
+ * transient docking windows (such as the IME). These are in the application's
* coordinate space (without compatibility scale applied).
*/
final Rect mContentInsets = new Rect();
@@ -132,6 +133,14 @@ final class WindowState implements WindowManagerPolicy.WindowState {
boolean mContentInsetsChanged;
/**
+ * Insets that are covered by system windows such as the status bar. These
+ * are in the application's coordinate space (without compatibility scale applied).
+ */
+ final Rect mSystemInsets = new Rect();
+ final Rect mLastSystemInsets = new Rect();
+ boolean mSystemInsetsChanged;
+
+ /**
* Set to true if we are waiting for this window to receive its
* given internal insets before laying out other windows based on it.
*/
@@ -178,6 +187,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
final Rect mContainingFrame = new Rect();
final Rect mDisplayFrame = new Rect();
+ final Rect mSystemFrame = new Rect();
final Rect mContentFrame = new Rect();
final Rect mParentFrame = new Rect();
final Rect mVisibleFrame = new Rect();
@@ -346,7 +356,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
@Override
- public void computeFrameLw(Rect pf, Rect df, Rect cf, Rect vf) {
+ public void computeFrameLw(Rect pf, Rect df, Rect sf, Rect cf, Rect vf) {
mHaveFrame = true;
final Rect container = mContainingFrame;
@@ -403,6 +413,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mContentChanged = true;
}
+ final Rect system = mSystemFrame;
+ system.set(sf);
+
final Rect content = mContentFrame;
content.set(cf);
@@ -434,8 +447,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// Now make sure the window fits in the overall display.
Gravity.applyDisplay(mAttrs.gravity, df, frame);
- // Make sure the content and visible frames are inside of the
+ // Make sure the system, content and visible frames are inside of the
// final window frame.
+ if (system.left < frame.left) system.left = frame.left;
+ if (system.top < frame.top) system.top = frame.top;
+ if (system.right > frame.right) system.right = frame.right;
+ if (system.bottom > frame.bottom) system.bottom = frame.bottom;
if (content.left < frame.left) content.left = frame.left;
if (content.top < frame.top) content.top = frame.top;
if (content.right > frame.right) content.right = frame.right;
@@ -445,6 +462,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
if (visible.right > frame.right) visible.right = frame.right;
if (visible.bottom > frame.bottom) visible.bottom = frame.bottom;
+ final Rect systemInsets = mSystemInsets;
+ systemInsets.left = system.left-frame.left;
+ systemInsets.top = system.top-frame.top;
+ systemInsets.right = frame.right-system.right;
+ systemInsets.bottom = frame.bottom-system.bottom;
+
final Rect contentInsets = mContentInsets;
contentInsets.left = content.left-frame.left;
contentInsets.top = content.top-frame.top;
@@ -462,6 +485,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// If there is a size compatibility scale being applied to the
// window, we need to apply this to its insets so that they are
// reported to the app in its coordinate space.
+ systemInsets.scale(mInvGlobalScale);
contentInsets.scale(mInvGlobalScale);
visibleInsets.scale(mInvGlobalScale);
@@ -482,6 +506,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
+ mRequestedWidth + ", mRequestedheight="
+ mRequestedHeight + ") to" + " (pw=" + pw + ", ph=" + ph
+ "): frame=" + mFrame.toShortString()
+ + " si=" + systemInsets.toShortString()
+ " ci=" + contentInsets.toShortString()
+ " vi=" + visibleInsets.toShortString());
//}
@@ -504,6 +529,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
@Override
+ public Rect getSystemFrameLw() {
+ return mSystemFrame;
+ }
+
+ @Override
public Rect getContentFrameLw() {
return mContentFrame;
}
@@ -723,6 +753,14 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|| mWinAnimator.mAnimating);
}
+ /**
+ * Return true if this window (or a window it is attached to, but not
+ * considering its app token) is currently animating.
+ */
+ public boolean isAnimatingLw() {
+ return mWinAnimator.mAnimation != null;
+ }
+
public boolean isGoneForLayoutLw() {
final AppWindowToken atoken = mAppToken;
return mViewVisibility == View.GONE
@@ -1035,20 +1073,22 @@ final class WindowState implements WindowManagerPolicy.WindowState {
pw.println();
}
if (dumpAll) {
- pw.print(prefix); pw.print("mContainingFrame=");
+ pw.print(prefix); pw.print("Frames: containing=");
mContainingFrame.printShortString(pw);
- pw.print(" mParentFrame=");
- mParentFrame.printShortString(pw);
- pw.print(" mDisplayFrame=");
- mDisplayFrame.printShortString(pw);
+ pw.print(" parent="); mParentFrame.printShortString(pw);
+ pw.print(" display="); mDisplayFrame.printShortString(pw);
+ pw.println();
+ pw.print(prefix); pw.print(" system="); mSystemFrame.printShortString(pw);
+ pw.print(" content="); mContentFrame.printShortString(pw);
+ pw.print(" visible="); mVisibleFrame.printShortString(pw);
pw.println();
- pw.print(prefix); pw.print("mContentFrame="); mContentFrame.printShortString(pw);
- pw.print(" mVisibleFrame="); mVisibleFrame.printShortString(pw);
+ pw.print(prefix); pw.print("Cur insets: system="); mSystemInsets.printShortString(pw);
+ pw.print(" content="); mContentInsets.printShortString(pw);;
+ pw.print(" visible="); mVisibleInsets.printShortString(pw);
pw.println();
- pw.print(prefix); pw.print("mContentInsets="); mContentInsets.printShortString(pw);
- pw.print(" last="); mLastContentInsets.printShortString(pw);
- pw.print(" mVisibleInsets="); mVisibleInsets.printShortString(pw);
- pw.print(" last="); mLastVisibleInsets.printShortString(pw);
+ pw.print(prefix); pw.print("Lst insets: system="); mLastSystemInsets.printShortString(pw);
+ pw.print(" content="); mLastContentInsets.printShortString(pw);;
+ pw.print(" visible="); mLastVisibleInsets.printShortString(pw);
pw.println();
}
mWinAnimator.dump(pw, prefix, dumpAll);
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 55f2ca3..97a8755 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -1139,6 +1139,14 @@ public abstract class DataConnectionTracker extends Handler {
mUserDataEnabled = enabled;
Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
Settings.Secure.MOBILE_DATA, enabled ? 1 : 0);
+ if (getDataOnRoamingEnabled() == false &&
+ mPhone.getServiceState().getRoaming() == true) {
+ if (enabled) {
+ notifyOffApnsOfAvailability(Phone.REASON_ROAMING_ON);
+ } else {
+ notifyOffApnsOfAvailability(Phone.REASON_DATA_DISABLED);
+ }
+ }
if (prevEnabled != getAnyDataEnabled()) {
if (!prevEnabled) {
resetAllRetryCounts();
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index 7e5e707..a691eae 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -629,6 +629,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
*/
@Override
protected void onRoamingOff() {
+ if (mUserDataEnabled == false) return;
+
if (getDataOnRoamingEnabled() == false) {
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
trySetupData(Phone.REASON_ROAMING_OFF);
@@ -642,6 +644,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
*/
@Override
protected void onRoamingOn() {
+ if (mUserDataEnabled == false) return;
+
if (getDataOnRoamingEnabled()) {
trySetupData(Phone.REASON_ROAMING_ON);
notifyDataConnection(Phone.REASON_ROAMING_ON);
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 56dbfb8..bfdb706 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -1863,6 +1863,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
protected void onRoamingOff() {
if (DBG) log("onRoamingOff");
+ if (mUserDataEnabled == false) return;
+
if (getDataOnRoamingEnabled() == false) {
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
setupDataOnReadyApns(Phone.REASON_ROAMING_OFF);
@@ -1873,6 +1875,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
@Override
protected void onRoamingOn() {
+ if (mUserDataEnabled == false) return;
+
if (getDataOnRoamingEnabled()) {
if (DBG) log("onRoamingOn: setup data on roaming");
setupDataOnReadyApns(Phone.REASON_ROAMING_ON);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
index 434ae9d..c44ddc6 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindow.java
@@ -47,8 +47,8 @@ public final class BridgeWindow implements IWindow {
}
@Override
- public void resized(int arg0, int arg1, Rect arg2, Rect arg3, boolean arg4, Configuration arg5)
- throws RemoteException {
+ public void resized(int arg0, int arg1, Rect argBlah, Rect arg2, Rect arg3,
+ boolean arg4, Configuration arg5) throws RemoteException {
// pass for now.
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
index d3721ed..3996d26 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeWindowSession.java
@@ -69,8 +69,8 @@ public final class BridgeWindowSession implements IWindowSession {
}
@Override
public int relayout(IWindow arg0, int seq, LayoutParams arg1, int arg2, int arg3, int arg4,
- int arg4_5, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b, Surface arg8)
- throws RemoteException {
+ int arg4_5, Rect arg4_6, Rect arg5, Rect arg6, Rect arg7, Configuration arg7b,
+ Surface arg8) throws RemoteException {
// pass for now.
return 0;
}