Skip to content

Commit

Permalink
Fixed wakelock issue (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 authored Aug 4, 2023
1 parent defe573 commit 9b91267
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class _HLSViewerPageState extends State<HLSViewerPage> {
child:
Padding(
padding: const EdgeInsets
.only(
.only(
right:
10.0,
bottom:
Expand Down Expand Up @@ -396,7 +396,7 @@ class _HLSViewerPageState extends State<HLSViewerPage> {
Padding(
padding:
const EdgeInsets
.only(
.only(
bottom: 20.0),
child: Row(
mainAxisAlignment:
Expand Down
9 changes: 4 additions & 5 deletions packages/hms_room_kit/lib/src/meeting/meeting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class _MeetingPageState extends State<MeetingPage> {
void initState() {
super.initState();
checkAudioState();
_enableAlwaysScreenOn();
_enableForegroundService();
}

void checkAudioState() async {
Expand All @@ -59,8 +59,7 @@ class _MeetingPageState extends State<MeetingPage> {
}
}

void _enableAlwaysScreenOn() {
context.read<MeetingStore>().toggleAlwaysScreenOn();
void _enableForegroundService() {
context.read<MeetingStore>().initForegroundTask();
}

Expand Down Expand Up @@ -429,7 +428,7 @@ class _MeetingPageState extends State<MeetingPage> {
.asset(
"packages/hms_room_kit/lib/src/assets/icons/exit_room.svg",
colorFilter: const ColorFilter
.mode(
.mode(
Colors
.white,
BlendMode
Expand Down Expand Up @@ -489,7 +488,7 @@ class _MeetingPageState extends State<MeetingPage> {
children: [
Padding(
padding: const EdgeInsets
.only(
.only(
right:
5.0),
child: SvgPicture
Expand Down
3 changes: 2 additions & 1 deletion packages/hms_room_kit/lib/src/preview/preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class _PreviewPageState extends State<PreviewPage> {
await _meetingStore.startHLSStreaming(false, false),
if (isStreamSuccessful != null)
{
previewStore.hmsSDKInteractor.toggleAlwaysScreenOn(),
setState(() {
isHLSStarting = false;
}),
Expand Down Expand Up @@ -231,7 +232,7 @@ class _PreviewPageState extends State<PreviewPage> {
transparentBackgroundColor),
child: Padding(
padding: const EdgeInsets
.symmetric(
.symmetric(
horizontal: 8,
vertical: 4),
child: Row(
Expand Down
1 change: 1 addition & 0 deletions packages/hms_room_kit/lib/src/preview/preview_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class PreviewStore extends ChangeNotifier

void leave() {
hmsSDKInteractor.leave();
hmsSDKInteractor.toggleAlwaysScreenOn();
destroy();
}

Expand Down
1 change: 1 addition & 0 deletions packages/hms_room_kit/lib/src/screen_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class _ScreenControllerState extends State<ScreenController> {
Navigator.popUntil(context, (route) => route.isFirst);
});
} else {
_hmsSDKInteractor.toggleAlwaysScreenOn();
setState(() {
isLoading = false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class AudioTile extends StatelessWidget {
decoration: BoxDecoration(
color: const Color.fromRGBO(0, 0, 0, 0.9),
borderRadius: BorderRadius.circular(8)),
child: const Center(
child: Center(
child: Padding(
padding: EdgeInsets.all(4),
padding: const EdgeInsets.all(4),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
children: const [
NetworkIconWidget(),
PeerName(),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ class _PeerTileState extends State<PeerTile> {
decoration: BoxDecoration(
color: transparentBackgroundColor,
borderRadius: BorderRadius.circular(8)),
child: const Center(
child: Center(
child: Padding(
padding: EdgeInsets.only(
padding: const EdgeInsets.only(
left: 8.0, right: 4, top: 4, bottom: 4),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
children: const [
NetworkIconWidget(),
PeerName(),
DegradeText()
Expand Down

0 comments on commit 9b91267

Please sign in to comment.