From e6da2fcc1992511955a285b2f42ec19f243d0dc2 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 9 Nov 2021 13:36:37 +0100 Subject: [PATCH] replace hardcoded applicationId for pip permission check Signed-off-by: Marcel Hibbe --- .../java/com/nextcloud/talk/activities/CallActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 480f7d3c4..388815283 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -58,6 +58,7 @@ import android.widget.FrameLayout; import android.widget.RelativeLayout; import com.bluelinelabs.logansquare.LoganSquare; +import com.nextcloud.talk.BuildConfig; import com.nextcloud.talk.R; import com.nextcloud.talk.adapters.ParticipantDisplayItem; import com.nextcloud.talk.adapters.ParticipantsAdapter; @@ -2485,9 +2486,10 @@ public class CallActivity extends BaseActivity { boolean deviceHasPipFeature = getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE); AppOpsManager appOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE); - boolean isPipFeatureGranted = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_PICTURE_IN_PICTURE, - android.os.Process.myUid(), - "com.nextcloud.talk2") == AppOpsManager.MODE_ALLOWED; // TODO: no hardcoding (-> branding!) + boolean isPipFeatureGranted = appOpsManager.checkOpNoThrow( + AppOpsManager.OPSTR_PICTURE_IN_PICTURE, + android.os.Process.myUid(), + BuildConfig.APPLICATION_ID) == AppOpsManager.MODE_ALLOWED; return deviceHasPipFeature && isPipFeatureGranted; } return false;