I am working on call application, In One plus devices (Android 10) When I doing call using twilio from one user to other user, I am getting notification of incoming call while app is in background and then I am starting Incoming call Screen using Incoming Activity but in One plus it is not working. In other devices below Android 10 it is working.
@Override
public void onMessageReceived(final RemoteMessage remoteMessage) {
Intent intent = new Intent(this, IncomingCallActivity.class);
intent.setAction(IncomingCallActivity.ACTION_INCOMING_CALL);
intent.putExtra(IncomingCallActivity.INCOMING_CALL_NOTIFICATION_ID, notificationId);
intent.putExtra(IncomingCallActivity.INCOMING_CALL_INVITE, callInvite);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
MyFirebaseMessagingService.this.startActivity(intent);
}
I have also tried with adding flags to activity
Window window = this.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
<activity
android:name=".IncomingCallActivity"
android:excludeFromRecents="true"
android:noHistory="true"
android:screenOrientation="sensorPortrait"
android:showOnLockScreen="true"
android:showWhenLocked="true"
android:turnScreenOn="true" />