Skip to content

armgit / haven

Public Imported from GitHub
0

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors

Allow PIP mode for API level 26 (Android O) or above

Arka Prava Basu52e6f70b9680
diff --git a/src/main/java/org/havenapp/main/MonitorActivity.java b/src/main/java/org/havenapp/main/MonitorActivity.java
index 39a359b..6f44aa7 100644
--- a/src/main/java/org/havenapp/main/MonitorActivity.java
+++ b/src/main/java/org/havenapp/main/MonitorActivity.java
@@ -17,6 +17,7 @@
package org.havenapp.main;
import android.Manifest;
+import android.app.PictureInPictureParams;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
@@ -312,8 +313,8 @@ public class MonitorActivity extends AppCompatActivity implements TimePickerDial
@Override
public void onUserLeaveHint () {
if (mIsMonitoring) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- enterPictureInPictureMode();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ enterPictureInPictureMode(new PictureInPictureParams.Builder().build());
}
}
}
@@ -324,8 +325,8 @@ public class MonitorActivity extends AppCompatActivity implements TimePickerDial
public void onBackPressed() {
if (mIsMonitoring) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- enterPictureInPictureMode();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ enterPictureInPictureMode(new PictureInPictureParams.Builder().build());
}
else
{