fix issues from PR

This commit is contained in:
Godwin Asuquo 2022-01-24 16:21:52 +01:00
parent e84f122956
commit c70ced70dd
4 changed files with 9 additions and 9 deletions

View file

@ -42,11 +42,11 @@ public class MainActivity extends FlutterFragmentActivity {
switch (call.method) { switch (call.method) {
case "enableWakeScreen": case "enableWakeScreen":
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
handler.post(() -> result.success("screen wake turned ON")); handler.post(() -> result.success(true));
break; break;
case "disableWakeScreen": case "disableWakeScreen":
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
handler.post(() -> result.success("screen wake turned OFF")); handler.post(() -> result.success(true));
break; break;
case "sec_random": case "sec_random":
int count = call.argument("count"); int count = call.argument("count");

View file

@ -42,11 +42,11 @@ public class MainActivity extends FlutterFragmentActivity {
switch (call.method) { switch (call.method) {
case "enableWakeScreen": case "enableWakeScreen":
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
handler.post(() -> result.success("screen wake turned ON")); handler.post(() -> result.success(true));
break; break;
case "disableWakeScreen": case "disableWakeScreen":
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
handler.post(() -> result.success("screen wake turned ON")); handler.post(() -> result.success(true));
break; break;
case "sec_random": case "sec_random":
int count = call.argument("count"); int count = call.argument("count");

View file

@ -8,13 +8,13 @@
import Foundation import Foundation
import UIKit import UIKit
func enableWakeScreen() -> String { func enableWakeScreen() -> Bool{
UIApplication.shared.isIdleTimerDisabled = true UIApplication.shared.isIdleTimerDisabled = true
return "screen wake turned ON" return true
} }
func disableWakeScreen() -> String{ func disableWakeScreen() -> Bool{
UIApplication.shared.isIdleTimerDisabled = false UIApplication.shared.isIdleTimerDisabled = false
return "screen wake turned OFF" return true
} }

View file

@ -14,7 +14,7 @@ void startWalletSyncStatusChangeReaction(
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
TransactionInfo> TransactionInfo>
wallet) { wallet) {
final WakeLock _wakeLock = getIt.get<WakeLock>(); final _wakeLock = getIt.get<WakeLock>();
_onWalletSyncStatusChangeReaction?.reaction?.dispose(); _onWalletSyncStatusChangeReaction?.reaction?.dispose();
_onWalletSyncStatusChangeReaction = _onWalletSyncStatusChangeReaction =
reaction((_) => wallet.syncStatus, (SyncStatus status) async { reaction((_) => wallet.syncStatus, (SyncStatus status) async {