File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
android/src/main/java/io/wazo/callkeep Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ public static Boolean isConnectionServiceAvailable() {
544
544
@ SuppressLint ("WrongConstant" )
545
545
public void backToForeground (@ NonNull MethodChannel .Result result ) {
546
546
Context context = getAppContext ();
547
- String packageName = context .getApplicationContext (). getPackageName ();
547
+ String packageName = context .getPackageName ();
548
548
Intent focusIntent = context .getPackageManager ().getLaunchIntentForPackage (packageName ).cloneFilter ();
549
549
Activity activity = this ._currentActivity ;
550
550
boolean isOpened = activity != null ;
@@ -557,10 +557,13 @@ public void backToForeground(@NonNull MethodChannel.Result result) {
557
557
WindowManager .LayoutParams .FLAG_SHOW_WHEN_LOCKED +
558
558
WindowManager .LayoutParams .FLAG_DISMISS_KEYGUARD +
559
559
WindowManager .LayoutParams .FLAG_TURN_SCREEN_ON );
560
-
561
- this ._currentActivity .startActivity (focusIntent );
560
+ if (activity != null ) {
561
+ activity .startActivity (focusIntent );
562
+ } else {
563
+ context .startActivity (focusIntent );
564
+ }
562
565
}
563
- result .success (null );
566
+ result .success (isOpened );
564
567
}
565
568
566
569
private void initializeTelecomManager () {
Original file line number Diff line number Diff line change @@ -253,10 +253,11 @@ class FlutterCallkeep extends EventManager {
253
253
254
254
Future <void > backToForeground () async {
255
255
if (isIOS) {
256
- return ;
256
+ return false ;
257
257
}
258
258
259
- await _channel.invokeMethod <void >('backToForeground' , < String , dynamic > {});
259
+ return await _channel
260
+ .invokeMethod <bool >('backToForeground' , < String , dynamic > {});
260
261
}
261
262
262
263
Future <void > _setupIOS (Map <String , dynamic > options) async {
You can’t perform that action at this time.
0 commit comments