From b55ebb669c5f970839708214fa0e9c3e1d39a903 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Apr 2018 16:07:04 +0200 Subject: [PATCH] allow the app be ran over lockscreen --- app/src/main/AndroidManifest.xml | 2 ++ .../com/simplemobiletools/camera/activities/MainActivity.kt | 5 +++++ .../camera/receivers/HardwareShutterReceiver.kt | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cee64988..83b9b4e8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ + diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index 9e264798..0fdeb124 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -51,6 +51,11 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave lateinit var mOrientationEventListener: OrientationEventListener override fun onCreate(savedInstanceState: Bundle?) { + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON or + WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or + WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or + WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON) + useDynamicTheme = false super.onCreate(savedInstanceState) appLaunched() diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/receivers/HardwareShutterReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/camera/receivers/HardwareShutterReceiver.kt index 08ca4cf6..413900a9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/receivers/HardwareShutterReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/receivers/HardwareShutterReceiver.kt @@ -3,7 +3,6 @@ package com.simplemobiletools.camera.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent - import com.simplemobiletools.camera.activities.MainActivity class HardwareShutterReceiver : BroadcastReceiver() {