Merge pull request #1685 from nextcloud/bugfix/1677/fixStartVideocall

add workaround to start videocalls when PIP is disabled
This commit is contained in:
Marcel Hibbe 2021-11-15 13:16:00 +01:00 committed by GitHub
commit 0fba973a43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {