Skip to content

Commit

Permalink
* Fix for prevent screen sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
thanksmister committed Jan 10, 2019
1 parent a0715f6 commit 274fe8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WallPanelApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repositories {
def versionMajor = 0
def versionMinor = 8
def versionPatch = 5
def versionBuild = 4 // bump for dog food builds, public betas, etc.
def versionBuild = 5 // bump for dog food builds, public betas, etc.

android {
kapt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ abstract class BrowserActivity : DaggerAppCompatActivity() {
if(configuration.cameraEnabled || configuration.hasCameraDetections() && Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) {
window.setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
}

Timber.d("Prevent Sleep ${configuration.appPreventSleep}")
if (configuration.appPreventSleep) {
window.addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON )
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON )
decorView?.keepScreenOn = true
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
decorView?.keepScreenOn = false
}

lifecycle.addObserver(dialogUtils)
Expand Down

0 comments on commit 274fe8e

Please sign in to comment.