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

Commit f86b4b49 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Go to sleep on fold for foldable devices."

parents fc080b57 4f7ca41f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -371,6 +371,13 @@ public abstract class DisplayManagerInternal {
     */
    public abstract Point getDisplaySurfaceDefaultSize(int displayId);

    /**
     * Receives early interactivity changes from power manager.
     *
     * @param interactive The interactive state that the device is moving into.
     */
    public abstract void onEarlyInteractivityChange(boolean interactive);

    /**
     * Describes the requested power state of the display.
     *
+10 −2
Original line number Diff line number Diff line
@@ -440,9 +440,15 @@ public final class PowerManager {
    public static final int GO_TO_SLEEP_REASON_DISPLAY_GROUPS_TURNED_OFF = 12;

    /**
     * Go to sleep reason code: A foldable device has been folded.
     * @hide
     */
    public static final int GO_TO_SLEEP_REASON_MAX = GO_TO_SLEEP_REASON_DISPLAY_GROUPS_TURNED_OFF;
    public static final int GO_TO_SLEEP_REASON_DEVICE_FOLD = 13;

    /**
     * @hide
     */
    public static final int GO_TO_SLEEP_REASON_MAX =  GO_TO_SLEEP_REASON_DEVICE_FOLD;

    /**
     * @hide
@@ -461,6 +467,7 @@ public final class PowerManager {
            case GO_TO_SLEEP_REASON_INATTENTIVE: return "inattentive";
            case GO_TO_SLEEP_REASON_DISPLAY_GROUP_REMOVED: return "display_group_removed";
            case GO_TO_SLEEP_REASON_DISPLAY_GROUPS_TURNED_OFF: return "display_groups_turned_off";
            case GO_TO_SLEEP_REASON_DEVICE_FOLD: return "device_folded";
            default: return Integer.toString(sleepReason);
        }
    }
@@ -568,7 +575,8 @@ public final class PowerManager {
            GO_TO_SLEEP_REASON_ACCESSIBILITY,
            GO_TO_SLEEP_REASON_FORCE_SUSPEND,
            GO_TO_SLEEP_REASON_INATTENTIVE,
            GO_TO_SLEEP_REASON_QUIESCENT
            GO_TO_SLEEP_REASON_QUIESCENT,
            GO_TO_SLEEP_REASON_DEVICE_FOLD
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface GoToSleepReason{}
+17 −4
Original line number Diff line number Diff line
@@ -654,10 +654,23 @@
        -->
    </integer-array>

    <!-- When entering this device state (defined in device_state_configuration.xml),
         we should wake the device. -1 to disable the feature (do not wake on any device-state
         transition). -->
    <integer name="config_deviceStateOnWhichToWakeUp">-1</integer>
    <!-- When a device enters any of these states, it should be woken up. States are defined in
         device_state_configuration.xml. -->
    <integer-array name="config_deviceStatesOnWhichToWakeUp">
        <!-- Example:
        <item>0</item>
        <item>1</item>
        -->
    </integer-array>

    <!-- When a device enters any of these states, it should go to sleep. States are defined in
         device_state_configuration.xml. -->
    <integer-array name="config_deviceStatesOnWhichToSleep">
        <!-- Example:
        <item>0</item>
        <item>1</item>
        -->
    </integer-array>

    <!-- Indicate the display area rect for foldable devices in folded state. -->
    <string name="config_foldedArea"></string>
+2 −1
Original line number Diff line number Diff line
@@ -3856,7 +3856,8 @@

  <!-- For Foldables -->
  <java-symbol type="array" name="config_foldedDeviceStates" />
  <java-symbol type="integer" name="config_deviceStateOnWhichToWakeUp" />
  <java-symbol type="array" name="config_deviceStatesOnWhichToWakeUp" />
  <java-symbol type="array" name="config_deviceStatesOnWhichToSleep" />
  <java-symbol type="string" name="config_foldedArea" />
  <java-symbol type="bool" name="config_supportsConcurrentInternalDisplays" />
  <java-symbol type="bool" name="config_unfoldTransitionEnabled" />
+6 −0
Original line number Diff line number Diff line
@@ -524,6 +524,7 @@ public final class DisplayManagerService extends SystemService {
            }
        } else if (phase == PHASE_BOOT_COMPLETED) {
            mDisplayModeDirector.onBootCompleted();
            mLogicalDisplayMapper.onBootCompleted();
        }
    }

@@ -3618,6 +3619,11 @@ public final class DisplayManagerService extends SystemService {
            }
            return device.getDisplaySurfaceDefaultSize();
        }

        @Override
        public void onEarlyInteractivityChange(boolean interactive) {
            mLogicalDisplayMapper.onEarlyInteractivityChange(interactive);
        }
    }

    class DesiredDisplayModeSpecsObserver
Loading