Fix case where device lied about pip mode support.
This commit is contained in:
parent
aff5c2aa16
commit
ea6d1a9381
1 changed files with 8 additions and 1 deletions
|
@ -35,6 +35,7 @@ import android.view.WindowManager;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.util.Consumer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
@ -279,7 +280,13 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
|
|||
private boolean enterPipModeIfPossible() {
|
||||
if (isSystemPipEnabledAndAvailable()) {
|
||||
if (viewModel.canEnterPipMode()) {
|
||||
enterPictureInPictureMode(pipBuilderParams.build());
|
||||
try {
|
||||
enterPictureInPictureMode(pipBuilderParams.build());
|
||||
} catch (IllegalStateException e) {
|
||||
Log.w(TAG, "Device lied to us about supporting PiP.", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
CallParticipantsListDialog.dismiss(getSupportFragmentManager());
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue