def reset_window_flags(self): LayoutParams = autoclass('android.view.WindowManager$LayoutParams') activity.getWindow().clearFlags( LayoutParams.FLAG_KEEP_SCREEN_ON | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKED | LayoutParams.FLAG_TURN_SCREEN_ON)
def set_window_flags(self): # Cuando salta la alarma es necesario que se encienda el móvil # El servicio llama a la actividad, que como tiene estos parámetros # enciende el móvil. El servicio por su parte coge un wake lock # porque si no cuando el usuario ha apagado el móvil con Planilla # en foreground Android no vuelve a encender al llamar a la app LayoutParams = autoclass('android.view.WindowManager$LayoutParams') activity.getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKED | LayoutParams.FLAG_TURN_SCREEN_ON)
def set_window_flags(self): # Cuando salta la alarma es necesario que se encienda el móvil # El servicio llama a la actividad, que como tiene estos parámetros # enciende el móvil. El servicio por su parte coge un wake lock # porque si no cuando el usuario ha apagado el móvil con Planilla # en foreground Android no vuelve a encender al llamar a la app LayoutParams = autoclass('android.view.WindowManager$LayoutParams') activity.getWindow().addFlags( LayoutParams.FLAG_KEEP_SCREEN_ON | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKED | LayoutParams.FLAG_TURN_SCREEN_ON)
def __init__(self): if platform != 'android': return self.params = autoclass('android.view.WindowManager$LayoutParams') self.window = activity.getWindow()