mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-07 23:24:33 +00:00
add workaround to start videocalls when PIP is disabled
this is a dirty workaround for issue #1677 Somehow onUserLeaveHint is executed when the user starts a videocall. If PIP is disabled, the logic inside enterPipMode would finish the activity right after it was started. This workaround suppresses the execution of enterPipMode right after the activity was started. However if a user would press the home button in the first three seconds, the call would continue in background without the ability to recover the UI. To better fix this bug it must be found out why onUserLeaveHint is executed on start (this should not happen!). Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
e599157626
commit
f2e75a7b71
@ -22,12 +22,15 @@ public abstract class CallBaseActivity extends BaseActivity {
|
||||
|
||||
public PictureInPictureParams.Builder mPictureInPictureParamsBuilder;
|
||||
public Boolean isInPipMode = false;
|
||||
long onCreateTime;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
onCreateTime = System.currentTimeMillis();
|
||||
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dismissKeyguard();
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
@ -88,7 +91,15 @@ public abstract class CallBaseActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onUserLeaveHint() {
|
||||
enterPipMode();
|
||||
long onUserLeaveHintTime = System.currentTimeMillis();
|
||||
long diff = onUserLeaveHintTime - onCreateTime;
|
||||
Log.d(TAG, "onUserLeaveHintTime - onCreateTime: " + diff);
|
||||
|
||||
if (diff < 3000) {
|
||||
Log.d(TAG, "enterPipMode skipped");
|
||||
} else {
|
||||
enterPipMode();
|
||||
}
|
||||
}
|
||||
|
||||
void enterPipMode() {
|
||||
|
Loading…
Reference in New Issue
Block a user