Skip to content

Commit 5459c43

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Clean up status bar, system bar, navigation bar management."
2 parents 5b4a579 + f87d196 commit 5459c43

File tree

25 files changed

+452
-410
lines changed

25 files changed

+452
-410
lines changed

core/java/android/view/IWindowManager.aidl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ interface IWindowManager
6262
void setForcedDisplaySize(int longDimen, int shortDimen);
6363
void clearForcedDisplaySize();
6464

65-
// Is device configured with a hideable status bar or a tablet system bar?
66-
boolean canStatusBarHide();
65+
// Is the device configured to have a full system bar for larger screens?
66+
boolean hasSystemNavBar();
6767

6868
// These can only be called when injecting events to your own window,
6969
// or by holding the INJECT_EVENTS permission. These methods may block
@@ -171,8 +171,10 @@ interface IWindowManager
171171
* @param alwaysSendConfiguration Flag to force a new configuration to
172172
* be evaluated. This can be used when there are other parameters in
173173
* configuration that are changing.
174+
* @param forceRelayout If true, the window manager will always do a relayout
175+
* of its windows even if the rotation hasn't changed.
174176
*/
175-
void updateRotation(boolean alwaysSendConfiguration);
177+
void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
176178

177179
/**
178180
* Retrieve the current screen orientation, constants as per

core/java/android/view/ViewConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ private ViewConfiguration(Context context) {
315315
if (!sHasPermanentMenuKeySet) {
316316
IWindowManager wm = Display.getWindowManager();
317317
try {
318-
sHasPermanentMenuKey = wm.canStatusBarHide() && !wm.hasNavigationBar();
318+
sHasPermanentMenuKey = !wm.hasSystemNavBar() && !wm.hasNavigationBar();
319319
sHasPermanentMenuKeySet = true;
320320
} catch (RemoteException ex) {
321321
sHasPermanentMenuKey = false;

core/java/android/view/WindowManagerPolicy.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ public void computeFrameLw(Rect parentFrame, Rect displayFrame,
326326
* Returns true if {@link #hideLw} was last called for the window.
327327
*/
328328
public boolean showLw(boolean doAnimation);
329+
330+
/**
331+
* Check whether the process hosting this window is currently alive.
332+
*/
333+
public boolean isAlive();
329334
}
330335

331336
/**
@@ -447,7 +452,7 @@ public void init(Context context, IWindowManager windowManager,
447452
* Called by window manager once it has the initial, default native
448453
* display dimensions.
449454
*/
450-
public void setInitialDisplaySize(int width, int height);
455+
public void setInitialDisplaySize(Display display, int width, int height);
451456

452457
/**
453458
* Check permissions when adding a window.
@@ -514,10 +519,10 @@ public void init(Context context, IWindowManager windowManager,
514519
public int getMaxWallpaperLayer();
515520

516521
/**
517-
* Return true if the policy allows the status bar to hide. Otherwise,
518-
* it is a tablet-style system bar.
522+
* Return true if the policy desires a full unified system nav bar. Otherwise,
523+
* it is a phone-style status bar with optional nav bar.
519524
*/
520-
public boolean canStatusBarHide();
525+
public boolean hasSystemNavBar();
521526

522527
/**
523528
* Return the display width available after excluding any screen
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the bottom of the screen is entering. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/decelerate_quad">
22+
<translate android:fromYDelta="75%" android:toYDelta="0"
23+
android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
25+
android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the bottom of the screen is exiting. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/accelerate_quad">
22+
<translate android:fromYDelta="0" android:toYDelta="75%"
23+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
25+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the left of the screen is entering. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/decelerate_quad">
22+
<translate android:fromXDelta="-75%" android:toXDelta="0"
23+
android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
25+
android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the right of the screen is exiting. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/accelerate_quad">
22+
<translate android:fromXDelta="0" android:toXDelta="-75%"
23+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
25+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the right of the screen is entering. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/decelerate_quad">
22+
<translate android:fromXDelta="75%" android:toXDelta="0"
23+
android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
25+
android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* Copyright 2012, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
-->
18+
19+
<!-- Animation for when a dock window at the right of the screen is exiting. -->
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:interpolator/accelerate_quad">
22+
<translate android:fromXDelta="0" android:toXDelta="75%"
23+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/>
24+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
25+
android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime" />
26+
</set>

packages/SystemUI/res/anim/status_bar_enter.xml renamed to core/res/res/anim/dock_top_enter.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
/* //device/apps/common/res/anim/options_panel_enter.xml
4-
**
5-
** Copyright 2007, The Android Open Source Project
3+
/* Copyright 2007, The Android Open Source Project
64
**
75
** Licensed under the Apache License, Version 2.0 (the "License");
86
** you may not use this file except in compliance with the License.
@@ -18,10 +16,11 @@
1816
*/
1917
-->
2018

19+
<!-- Animation for when a dock window at the top of the screen is entering. -->
2120
<set xmlns:android="http://schemas.android.com/apk/res/android"
2221
android:interpolator="@android:interpolator/decelerate_quad">
23-
<translate android:fromYDelta="-75%" android:toYDelta="0"
22+
<translate android:fromYDelta="-75%" android:toYDelta="0"
2423
android:duration="@android:integer/config_mediumAnimTime"/>
25-
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
24+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
2625
android:duration="@android:integer/config_mediumAnimTime" />
2726
</set>

0 commit comments

Comments
 (0)