Skip to content

Android keep screen on #67

Merged
Frenzie merged 2 commits intokoreader:masterfrom
mwoz123:android-keep-screen-on
Oct 13, 2017
Merged

Android keep screen on #67
Frenzie merged 2 commits intokoreader:masterfrom
mwoz123:android-keep-screen-on

Conversation

@mwoz123
Copy link
Copy Markdown
Contributor

@mwoz123 mwoz123 commented Oct 13, 2017

Allows to keeps screen on koreader/koreader#2748

Please use this as an option/ checkbox in menu, so it won't stop suspending.

@Frenzie Frenzie changed the title Android keep scren on Android keep screen on Oct 13, 2017
return (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
}


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray newline.



public void setKeepScreenOn(final boolean keepOn) {
final CountDownLatch cd = new CountDownLatch(1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do exactly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question.
This is something for mulithreading waiting.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html

As you wrote it had to be done on the ui thread like brightness I didn't dig into that, and did just add it was for setBrightness

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now, thanks.

@Frenzie Frenzie merged commit dbc47c5 into koreader:master Oct 13, 2017
@mwoz123 mwoz123 deleted the android-keep-screen-on branch November 4, 2017 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants