diff options
author | Joe Onorato <joeo@google.com> | 2011-01-26 11:46:58 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-26 11:46:58 -0800 |
commit | 1aadb2108d7614d9d1ff61b41c6c31cb8d211ab9 (patch) | |
tree | b80382d478fb152c20d4f0d5995de377e085b297 | |
parent | a9f27fa631ab21d52c75842ccaacc1cbcd75fca0 (diff) | |
parent | 14782f705e94d4e563a48efc85fd25129fd38a7d (diff) | |
download | frameworks_base-1aadb2108d7614d9d1ff61b41c6c31cb8d211ab9.zip frameworks_base-1aadb2108d7614d9d1ff61b41c6c31cb8d211ab9.tar.gz frameworks_base-1aadb2108d7614d9d1ff61b41c6c31cb8d211ab9.tar.bz2 |
Merge changes I48392c75,Id09437a4,I4a0aa878 into honeycomb
* changes:
Expose the window flags for lights out mode.
Make TabletStatusBar call into StatusBarManagerService when it goes out of lights out mode on its own.
Make FLAG_FULLSCREEN not go into lights out mode anymore.
-rw-r--r-- | api/current.xml | 10 | ||||
-rw-r--r-- | core/java/android/view/View.java | 1 | ||||
-rw-r--r-- | core/java/android/view/ViewRoot.java | 14 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 21 | ||||
-rw-r--r-- | core/java/com/android/internal/statusbar/IStatusBarService.aidl | 1 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 7 | ||||
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 12 | ||||
-rw-r--r-- | services/java/com/android/server/StatusBarManagerService.java | 27 |
8 files changed, 50 insertions, 43 deletions
diff --git a/api/current.xml b/api/current.xml index d79baf0..a1113ec 100644 --- a/api/current.xml +++ b/api/current.xml @@ -225876,6 +225876,16 @@ visibility="public" > </field> +<field name="systemUiVisibility" + type="int" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="token" type="android.os.IBinder" transient="false" diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index aa91120..3ed7549 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10807,6 +10807,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** */ public void dispatchSystemUiVisibilityChanged(int visibility) { + mSystemUiVisibility = visibility; if (mOnSystemUiVisibilityChangeListener != null) { mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility); } diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index b0553c6..042095a 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -903,8 +903,9 @@ public final class ViewRoot extends Handler implements ViewParent, attachInfo.mSystemUiVisibility = 0; attachInfo.mHasSystemUiListeners = false; host.dispatchCollectViewAttributes(0); - if (attachInfo.mKeepScreenOn != oldScreenOn || - attachInfo.mSystemUiVisibility != oldVis) { + if (attachInfo.mKeepScreenOn != oldScreenOn + || attachInfo.mSystemUiVisibility != oldVis + || attachInfo.mHasSystemUiListeners) { params = lp; } } @@ -987,8 +988,10 @@ public final class ViewRoot extends Handler implements ViewParent, if (attachInfo.mKeepScreenOn) { params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; } - params.systemUiVisibility = attachInfo.mSystemUiVisibility; - params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners; + params.subtreeSystemUiVisibility = attachInfo.mSystemUiVisibility; + params.hasSystemUiListeners = attachInfo.mHasSystemUiListeners + || params.subtreeSystemUiVisibility != 0 + || params.systemUiVisibility != 0; } if (DEBUG_LAYOUT) { Log.i(TAG, "host=w:" + host.getMeasuredWidth() + ", h:" + @@ -2854,6 +2857,9 @@ public final class ViewRoot extends Handler implements ViewParent, public void handleDispatchSystemUiVisibilityChanged(int visibility) { if (mView == null) return; + if (mAttachInfo != null) { + mAttachInfo.mSystemUiVisibility = visibility; + } mView.dispatchSystemUiVisibilityChanged(visibility); } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 491a79f..c26fa93 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -953,11 +953,20 @@ public interface WindowManager extends ViewManager { /** * Control the visibility of the status bar. - * @hide + * + * @see View#STATUS_BAR_VISIBLE + * @see View#STATUS_BAR_HIDDEN */ public int systemUiVisibility; /** + * @hide + * The ui visibility as requested by the views in this hierarchy. + * the combined value should be systemUiVisibility | subtreeSystemUiVisibility. + */ + public int subtreeSystemUiVisibility; + + /** * Get callbacks about the system ui visibility changing. * * TODO: Maybe there should be a bitfield of optional callbacks that we need. @@ -1046,6 +1055,7 @@ public interface WindowManager extends ViewManager { TextUtils.writeToParcel(mTitle, out, parcelableFlags); out.writeInt(screenOrientation); out.writeInt(systemUiVisibility); + out.writeInt(subtreeSystemUiVisibility); out.writeInt(hasSystemUiListeners ? 1 : 0); } @@ -1083,6 +1093,7 @@ public interface WindowManager extends ViewManager { mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); screenOrientation = in.readInt(); systemUiVisibility = in.readInt(); + subtreeSystemUiVisibility = in.readInt(); hasSystemUiListeners = in.readInt() != 0; } @@ -1212,8 +1223,10 @@ public interface WindowManager extends ViewManager { changes |= SCREEN_ORIENTATION_CHANGED; } - if (systemUiVisibility != o.systemUiVisibility) { + if (systemUiVisibility != o.systemUiVisibility + || subtreeSystemUiVisibility != o.subtreeSystemUiVisibility) { systemUiVisibility = o.systemUiVisibility; + subtreeSystemUiVisibility = o.subtreeSystemUiVisibility; changes |= SYSTEM_UI_VISIBILITY_CHANGED; } @@ -1298,6 +1311,10 @@ public interface WindowManager extends ViewManager { sb.append(" sysui=0x"); sb.append(Integer.toHexString(systemUiVisibility)); } + if (subtreeSystemUiVisibility != 0) { + sb.append(" vsysui=0x"); + sb.append(Integer.toHexString(subtreeSystemUiVisibility)); + } if (hasSystemUiListeners) { sb.append(" sysuil="); sb.append(hasSystemUiListeners); diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index d83a534..d1ea52e 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -30,7 +30,6 @@ interface IStatusBarService void setIcon(String slot, String iconPackage, int iconId, int iconLevel); void setIconVisibility(String slot, boolean visible); void removeIcon(String slot); - void setActiveWindowIsFullscreen(boolean fullscreen); void setMenuKeyVisible(boolean visible); void setIMEButtonVisible(in IBinder token, boolean visible); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index d46de15..14a2f90 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -391,8 +391,11 @@ public class TabletStatusBar extends StatusBar implements new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { - mShadow.setVisibility(View.GONE); - mBarContents.setVisibility(View.VISIBLE); + try { + mBarService.setSystemUiVisibility(View.STATUS_BAR_VISIBLE); + } catch (RemoteException ex) { + // system process dead + } } return false; } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 9b5c42e..fd84a2a 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1892,14 +1892,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { + (topNeedsMenu ? "needs" : "does not need") + " the MENU key"); - final boolean changedFullscreen = (mTopIsFullscreen != topIsFullscreen); + mTopIsFullscreen = topIsFullscreen; final boolean changedMenu = (topNeedsMenu != mShowMenuKey); - if (changedFullscreen || changedMenu) { - final boolean topIsFullscreenF = topIsFullscreen; + if (changedMenu) { final boolean topNeedsMenuF = topNeedsMenu; - mTopIsFullscreen = topIsFullscreen; mShowMenuKey = topNeedsMenu; mHandler.post(new Runnable() { @@ -1918,9 +1916,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (changedMenu) { sbs.setMenuKeyVisible(topNeedsMenuF); } - if (changedFullscreen) { - sbs.setActiveWindowIsFullscreen(topIsFullscreenF); - } } catch (RemoteException e) { // This should be impossible because we're in the same process. mStatusBarService = null; @@ -2860,7 +2855,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If there is no window focused, there will be nobody to handle the events // anyway, so just hang on in whatever state we're in until things settle down. if (mFocusedWindow != null) { - final int visibility = mFocusedWindow.getAttrs().systemUiVisibility; + final WindowManager.LayoutParams params = mFocusedWindow.getAttrs(); + final int visibility = params.systemUiVisibility | params.subtreeSystemUiVisibility; mHandler.post(new Runnable() { public void run() { if (mStatusBarService == null) { diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index 50ea3fa..bdaa3b0 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -283,33 +283,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - /** - * This is used for the automatic version of lights-out mode. Only call this from - * the window manager. - * - * @see setLightsOn(boolean) - */ - public void setActiveWindowIsFullscreen(boolean fullscreen) { - // We could get away with a separate permission here, but STATUS_BAR is - // signatureOrSystem which is probably good enough. There is no public API - // for this, so the question is a security issue, not an API compatibility issue. - enforceStatusBar(); - - synchronized (mLock) { - updateLightsOnLocked(!fullscreen); - } - } - - /** - * This is used for the user-controlled version of lights-out mode. Only call this from - * the status bar itself. - * - * We have two different functions here, because I think we're going to want to - * tweak the behavior when the user keeps turning lights-out mode off and the - * app keeps trying to turn it on. For now they can just fight it out. Having - * these two separte inputs will allow us to keep that change local to here. --joeo - */ public void setSystemUiVisibility(int vis) { + // also allows calls from window manager which is in this process. enforceStatusBarService(); synchronized (mLock) { |