Experiment to be able to change the navigation bar thickness (1/2)
Use resource overlays to change the 2 dimension navigation_bar_height
and navigation_bar_frame_height to specify how large the navigation bar
is and how large its buttons are (also for width). There are two
overlays: first to slim the navigation bar to 75% and the other to have
floating navigation buttons.
go/navbar-experiments-doc
Test: manual
Bug: 113952590
Change-Id: I936c9fa49ba029b4174a22b7e35ee070a9e07e4b
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 097ce44..ba483fb 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -47,6 +47,20 @@
<dimen name="navigation_bar_height_landscape">48dp</dimen>
<!-- Width of the navigation bar when it is placed vertically on the screen -->
<dimen name="navigation_bar_width">48dp</dimen>
+
+ <!-- EXPERIMENT BEGIN -->
+ <!-- Height of the bottom navigation bar frame; this is different than navigation_bar_height
+ where that is the height reported to all the other windows to resize themselves around the
+ navigation bar window but navigation_bar_frame_height is reported to SystemUI navigation
+ bar view's window -->
+ <dimen name="navigation_bar_frame_height">@dimen/navigation_bar_height</dimen>
+ <!-- Width of the left/right navigation bar frame; this is different than navigation_bar_width
+ where that is the width reported to all the other windows to resize themselves around the
+ navigation bar window but navigation_bar_frame_width is reported to SystemUI navigation
+ bar view's window -->
+ <dimen name="navigation_bar_frame_width">@dimen/navigation_bar_width</dimen>
+ <!-- EXPERIMENT END-->
+
<!-- Height of the bottom navigation / system bar in car mode. -->
<dimen name="navigation_bar_height_car_mode">96dp</dimen>
<!-- Height of the bottom navigation bar in portrait; often the same as
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 81a1bf8..0e787cd 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1681,6 +1681,8 @@
<java-symbol type="dimen" name="navigation_bar_height" />
<java-symbol type="dimen" name="navigation_bar_height_landscape" />
<java-symbol type="dimen" name="navigation_bar_width" />
+ <java-symbol type="dimen" name="navigation_bar_frame_height" />
+ <java-symbol type="dimen" name="navigation_bar_frame_width" />
<java-symbol type="dimen" name="navigation_bar_height_car_mode" />
<java-symbol type="dimen" name="navigation_bar_height_landscape_car_mode" />
<java-symbol type="dimen" name="navigation_bar_width_car_mode" />
diff --git a/packages/overlays/ExperimentNavigationBarFloatingOverlay/Android.mk b/packages/overlays/ExperimentNavigationBarFloatingOverlay/Android.mk
new file mode 100644
index 0000000..ee2ddc8
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarFloatingOverlay/Android.mk
@@ -0,0 +1,30 @@
+#
+# Copyright 2018, 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.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_RRO_THEME := ExperimentNavigationBarFloating
+LOCAL_CERTIFICATE := platform
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_PACKAGE_NAME := ExperimentNavigationBarFloatingOverlay
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_RRO_PACKAGE)
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarFloatingOverlay/AndroidManifest.xml b/packages/overlays/ExperimentNavigationBarFloatingOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..b4b2b16
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarFloatingOverlay/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.internal.experiment.navbar.floating"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:category="com.android.internal.experiment_navbar_floating"
+ android:priority="1"/>
+
+ <application android:label="@string/experiment_navigationbar_overlay" android:hasCode="false"/>
+</manifest>
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/config.xml b/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/config.xml
new file mode 100644
index 0000000..6a58453
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/config.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<resources>
+ <!-- Height of the bottom navigation / system bar. -->
+ <dimen name="navigation_bar_height">0dp</dimen>
+ <!-- Width of the navigation bar when it is placed vertically on the screen -->
+ <dimen name="navigation_bar_width">0dp</dimen>
+ <!-- Height of the bottom navigation / system bar frame; navigation buttons height. -->
+ <dimen name="navigation_bar_frame_height">48dp</dimen>
+ <!-- Width of the navigation bar frame when it is placed vertically on the screen -->
+ <dimen name="navigation_bar_frame_width">48dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/strings.xml b/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/strings.xml
new file mode 100644
index 0000000..884846d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarFloatingOverlay/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Name of overlay [CHAR LIMIT=64] -->
+ <string name="experiment_navigationbar_overlay">Floating Navigation Bar Experiment</string>
+</resources>
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarSlimOverlay/Android.mk b/packages/overlays/ExperimentNavigationBarSlimOverlay/Android.mk
new file mode 100644
index 0000000..e642a68
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlimOverlay/Android.mk
@@ -0,0 +1,30 @@
+#
+# Copyright 2018, 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.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_RRO_THEME := ExperimentNavigationBarSlim
+LOCAL_CERTIFICATE := platform
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_PACKAGE_NAME := ExperimentNavigationBarSlimOverlay
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_RRO_PACKAGE)
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarSlimOverlay/AndroidManifest.xml b/packages/overlays/ExperimentNavigationBarSlimOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..a1bd582
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlimOverlay/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.internal.experiment.navbar.slim"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="android"
+ android:category="com.android.internal.experiment_navbar_slim"
+ android:priority="1"/>
+
+ <application android:label="@string/experiment_navigationbar_overlay" android:hasCode="false"/>
+</manifest>
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/config.xml b/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/config.xml
new file mode 100644
index 0000000..4c3571a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/config.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<resources>
+ <!-- Height of the bottom navigation / system bar. -->
+ <dimen name="navigation_bar_height">36dp</dimen>
+ <!-- Width of the navigation bar when it is placed vertically on the screen -->
+ <dimen name="navigation_bar_width">36dp</dimen>
+ <!-- Height of the bottom navigation / system bar frame; navigation buttons height. -->
+ <dimen name="navigation_bar_frame_width">36dp</dimen>
+ <!-- Width of the navigation bar frame when it is placed vertically on the screen -->
+ <dimen name="navigation_bar_frame_height">36dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/strings.xml b/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/strings.xml
new file mode 100644
index 0000000..5ca9d15
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlimOverlay/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2018, 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.
+ */
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Name of overlay [CHAR LIMIT=64] -->
+ <string name="experiment_navigationbar_overlay">Slim Navigation Bar Experiment</string>
+</resources>
\ No newline at end of file
diff --git a/services/core/java/com/android/server/policy/NavigationBarExperiments.java b/services/core/java/com/android/server/policy/NavigationBarExperiments.java
new file mode 100644
index 0000000..06772e3
--- /dev/null
+++ b/services/core/java/com/android/server/policy/NavigationBarExperiments.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.policy;
+
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
+import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_BOTTOM;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_RIGHT;
+
+import android.content.Context;
+import android.graphics.Rect;
+
+import com.android.server.policy.WindowManagerPolicy.WindowState;
+import com.android.server.wm.WindowFrames;
+
+/**
+ * This class acts as a proxy for Navigation Bar experiments enabled with custom overlays
+ * {@see OverlayManagerService}. By default with no overlays, this class will essentially do nothing
+ * and pass the original resource data back. By default the navigation bar height/width is the same
+ * as the frame height/width and therefore any offsets calculated will cancel out and do nothing.
+ * TODO(b/113952590): Remove class once experiment in bug is completed
+ */
+public class NavigationBarExperiments {
+
+ private int mNavigationBarHeight;
+ private int mNavigationBarWidth;
+
+ /**
+ * This represents the height of the navigation bar buttons. With no experiments or overlays
+ * enabled, the frame height is the same as the normal navigation bar height.
+ */
+ private int mNavigationBarFrameHeight;
+
+ /**
+ * This represents the width of the navigation bar buttons. With no experiments or overlays
+ * enabled, the frame width is the same as the normal navigation bar width.
+ */
+ private int mNavigationBarFrameWidth;
+
+ /**
+ * Call when configuration change to refresh resource dimensions
+ * @param systemUiContext to get the resource values
+ */
+ public void onConfigurationChanged(Context systemUiContext) {
+ // Cache all the values again
+ mNavigationBarHeight = systemUiContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.navigation_bar_height);
+ mNavigationBarWidth = systemUiContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.navigation_bar_width);
+ mNavigationBarFrameHeight = systemUiContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.navigation_bar_frame_height);
+ mNavigationBarFrameWidth = systemUiContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.navigation_bar_frame_width);
+ }
+
+ public int getNavigationBarHeight() {
+ return mNavigationBarHeight;
+ }
+
+ public int getNavigationBarWidth() {
+ return mNavigationBarWidth;
+ }
+
+ public int getNavigationBarFrameHeight() {
+ return mNavigationBarFrameHeight;
+ }
+
+ public int getNavigationBarFrameWidth() {
+ return mNavigationBarFrameWidth;
+ }
+
+ /**
+ * If navigation frame width/height is different than navigation bar width/height then only
+ * offset the ime's and home activity's window rects depending on the navigation bar position to
+ * add a gap where the navigation bar would have been drawn. With no experiments or overlays
+ * enabled, the height/width is the same as the frame height/width and the offsets calculated
+ * will be 0 and this function will do nothing.
+ * @param navPosition position of navigation bar (left, right or bottom)
+ * @param w the window that is being offset by experiment
+ */
+ public void offsetWindowFramesForNavBar(int navPosition, WindowState w) {
+ if (w.getAttrs().type != TYPE_INPUT_METHOD && w.getActivityType() != ACTIVITY_TYPE_HOME) {
+ return;
+ }
+
+ final WindowFrames windowFrames = w.getWindowFrames();
+ final Rect cf = windowFrames.mContentFrame;
+ switch (navPosition) {
+ case NAV_BAR_BOTTOM:
+ int navHeight = getNavigationBarFrameHeight() - getNavigationBarHeight();
+ if (navHeight > 0) {
+ cf.bottom -= navHeight;
+ }
+ break;
+ case NAV_BAR_LEFT:
+ case NAV_BAR_RIGHT:
+ int navWidth = getNavigationBarFrameWidth() - getNavigationBarWidth();
+ if (navWidth > 0) {
+ if (navPosition == NAV_BAR_LEFT) {
+ cf.left += navWidth;
+ } else {
+ cf.right -= navWidth;
+ }
+ }
+ break;
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index c5cee32..371ac4f 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -779,6 +779,10 @@
private boolean mAodShowing;
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ private NavigationBarExperiments mExperiments = new NavigationBarExperiments();
+ // EXPERIMENT END
+
private static final int MSG_ENABLE_POINTER_LOCATION = 1;
private static final int MSG_DISABLE_POINTER_LOCATION = 2;
private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3;
@@ -2607,6 +2611,10 @@
res.getDimensionPixelSize(
com.android.internal.R.dimen.navigation_bar_width_car_mode);
}
+
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ mExperiments.onConfigurationChanged(uiContext);
+ // EXPERIMENT END
}
@VisibleForTesting
@@ -4534,7 +4542,11 @@
// It's a system nav bar or a portrait screen; nav bar goes on bottom.
final int top = cutoutSafeUnrestricted.bottom
- getNavigationBarHeight(rotation, uiMode);
- navigationFrame.set(0, top, displayWidth, displayFrames.mUnrestricted.bottom);
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ final int topNavBar = cutoutSafeUnrestricted.bottom
+ - mExperiments.getNavigationBarFrameHeight();
+ navigationFrame.set(0, topNavBar, displayWidth, displayFrames.mUnrestricted.bottom);
+ // EXPERIMENT END
displayFrames.mStable.bottom = displayFrames.mStableFullscreen.bottom = top;
if (transientNavBarShowing) {
mNavigationBarController.setBarShowingLw(true);
@@ -4557,7 +4569,11 @@
// Landscape screen; nav bar goes to the right.
final int left = cutoutSafeUnrestricted.right
- getNavigationBarWidth(rotation, uiMode);
- navigationFrame.set(left, 0, displayFrames.mUnrestricted.right, displayHeight);
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ final int leftNavBar = cutoutSafeUnrestricted.right
+ - mExperiments.getNavigationBarFrameWidth();
+ navigationFrame.set(leftNavBar, 0, displayFrames.mUnrestricted.right, displayHeight);
+ // EXPERIMENT END
displayFrames.mStable.right = displayFrames.mStableFullscreen.right = left;
if (transientNavBarShowing) {
mNavigationBarController.setBarShowingLw(true);
@@ -4580,7 +4596,11 @@
// Seascape screen; nav bar goes to the left.
final int right = cutoutSafeUnrestricted.left
+ getNavigationBarWidth(rotation, uiMode);
- navigationFrame.set(displayFrames.mUnrestricted.left, 0, right, displayHeight);
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ final int rightNavBar = cutoutSafeUnrestricted.left
+ + mExperiments.getNavigationBarFrameWidth();
+ navigationFrame.set(displayFrames.mUnrestricted.left, 0, rightNavBar, displayHeight);
+ // EXPERIMENT END
displayFrames.mStable.left = displayFrames.mStableFullscreen.left = right;
if (transientNavBarShowing) {
mNavigationBarController.setBarShowingLw(true);
@@ -4790,6 +4810,12 @@
pf.left = df.left = of.left = cf.left = vf.left = displayFrames.mStable.left;
}
}
+
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ // Offset the ime to avoid overlapping with the nav bar
+ mExperiments.offsetWindowFramesForNavBar(mNavigationBarPosition, win);
+ // EXPERIMENT END
+
// IM dock windows always go to the bottom of the screen.
attrs.gravity = Gravity.BOTTOM;
mDockLayer = win.getSurfaceLayer();
@@ -4930,6 +4956,10 @@
} else {
vf.set(cf);
}
+
+ // EXPERIMENT TODO(b/113952590): Remove once experiment in bug is completed
+ mExperiments.offsetWindowFramesForNavBar(mNavigationBarPosition, win);
+ // EXPERIMENT END
}
} else if (layoutInScreen || (sysUiFl
& (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
index db13cbc..e1c4acf 100644
--- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java
+++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
@@ -66,6 +66,7 @@
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.app.ActivityManager;
+import android.app.WindowConfiguration;
import android.content.Context;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
@@ -437,6 +438,14 @@
int getWindowingMode();
/**
+ * Returns the {@link WindowConfiguration.ActivityType} associated with the configuration
+ * of this window.
+ */
+ default int getActivityType() {
+ return WindowConfiguration.WINDOWING_MODE_UNDEFINED;
+ }
+
+ /**
* Returns true if the window is current in multi-windowing mode. i.e. it shares the
* screen with other application windows.
*/