Class ShadowDisplayManager

    • Constructor Detail

      • ShadowDisplayManager

        public ShadowDisplayManager()
    • Method Detail

      • addDisplay

        public static int addDisplay​(String qualifiersStr)
        Adds a simulated display and drain the main looper queue to ensure all the callbacks are processed.
        Parameters:
        qualifiersStr - the Qualifiers string representing characteristics of the new display.
        Returns:
        the new display's ID
      • configureDefaultDisplay

        public static void configureDefaultDisplay​(Configuration configuration,
                                                   DisplayMetrics displayMetrics)
        internal only
      • changeDisplay

        public static void changeDisplay​(int displayId,
                                         String qualifiersStr)
        Changes properties of a simulated display. If {@param qualifiersStr} starts with a plus ('+') sign, the display's previous configuration is modified with the given qualifiers; otherwise defaults are applied as described here.

        Idles the main looper to ensure all listeners are notified.

        Parameters:
        displayId - the display id to change
        qualifiersStr - the Qualifiers string representing characteristics of the new display
      • removeDisplay

        public static void removeDisplay​(int displayId)
        Removes a simulated display and idles the main looper to ensure all listeners are notified.
        Parameters:
        displayId - the display id to remove
      • setDefaultBrightnessConfiguration

        public static void setDefaultBrightnessConfiguration​(Object config)
        Set the default brightness configuration for this device.
      • setBrightnessEvents

        public static void setBrightnessEvents​(List<BrightnessChangeEvent> events)
        Set the slider events the system has seen.