Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57b2300f authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Avoid mentioning complex deprecated API in API docs

In getBounds() API doc, the code snippet to get the window size
excluding system decorations refers it as the legacy value of getSize()
API. As the getSize() behavior becomes more complex, to explicitly
describe the behavior instead of referring to it can make things clear.

Bug: 151861875
Test: N/A
Change-Id: If59ef701b833727885ea3baa16b0f6804c05cba8
parent b0f4faad
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1677,7 +1677,12 @@ public final class Display {
     *         {@code getWindowManager()} or {@code getSystemService(Context.WINDOW_SERVICE)}), the
     *         returned metrics provide the size of the current app window. As a result, in
     *         multi-window mode, the returned size can be smaller than the size of the device
     *         screen.
     *         screen. System decoration handling may vary depending on API level:
     *         <ul>
     *             <li>API level 35 and above, the window size will be returned.
     *             <li>API level 34 and below, the window size minus system decoration areas and
     *                 display cutout is returned.
     *         </ul>
     *     <li>If metrics are requested from a non-activity context (for example, the application
     *         context, where the WindowManager is accessed by
     *         {@code getApplicationContext().getSystemService(Context.WINDOW_SERVICE)}), the
+2 −2
Original line number Diff line number Diff line
@@ -107,8 +107,8 @@ public final class WindowMetrics {
     * and display cutout areas depending on the calling context and target SDK level. Please refer
     * to {@link Display#getSize(Point)} for details.
     * <p>
     * The value reported by {@link Display#getSize(Point)} excluding system decoration areas can be
     * obtained by using:
     * The following code snippet shows how to get the bounds excluding navigation bars and display
     * cutout:
     * <pre class="prettyprint">
     * final WindowMetrics metrics = windowManager.getCurrentWindowMetrics();
     * // Gets all excluding insets