Skip to content

Commit

Permalink
Add WAKE_LOCK permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Nguyen committed Jul 19, 2020
1 parent 559f537 commit ad51980
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ I figure this may be more of a feature than a bug, though, potentially allowing

**WARNING:** There is something *SEVERELY* wrong with the embedded Youtube videos that cause the Android device to be COMPLETELY borked. I'm trying to fix this ASAP.

**UPDATE:** Added `WAKE_LOCK` permissions by adding `<uses-permission android:name="android.permission.WAKE_LOCK"/>` to the `AndroidManifest.xml`.
Hopefully this should fix the issue above.
See https://developer.android.com/reference/android/os/PowerManager for more details.
NOTE from the Android Developers documentation:

> **Device battery life will be significantly affected by the use of this API.**
## References

- https://dbkpop.com/group/izone
Expand Down
1 change: 1 addition & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="IZ*ONE"
Expand Down
1 change: 1 addition & 0 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>
8 changes: 1 addition & 7 deletions lib/pages/YoutubeVideoListPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,7 @@ class YoutubeVideoListPageState extends State<YoutubeVideoListPage> {
widget.videos[index].youtubeUrl)) {
launch(widget.videos[index].youtubeUrl);
} else {
showDialog(
context: context,
child: Center(
child: Text(
'Unable to open video "${widget.videos[index].youtubeUrl}"'),
),
);
throw 'Unable to open video "${widget.videos[index].youtubeUrl}"';
}
},
),
Expand Down

0 comments on commit ad51980

Please sign in to comment.