Merge pull request #2148 from nextcloud/fix/callactivity-receiver

Use custom permission for unfiltered broadcast receiver in CallActivity
This commit is contained in:
Álvaro Brey 2022-06-23 09:36:00 +02:00 committed by GitHub
commit c4d9105613
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -83,6 +83,10 @@ android {
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
def localBroadcastPermission = "com.nextcloud.talk.permission.PRIVATE_BROADCAST"
manifestPlaceholders.broadcastPermission = localBroadcastPermission
buildConfigField "String", "PERMISSION_LOCAL_BROADCAST", "\"${localBroadcastPermission}\""
}
buildTypes {

View file

@ -79,6 +79,11 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<permission
android:name="${broadcastPermission}"
android:protectionLevel="signature" />
<uses-permission android:name="${broadcastPermission}"/>
<application
android:name=".application.NextcloudTalkApplication"
android:allowBackup="true"

View file

@ -52,6 +52,7 @@ import android.widget.RelativeLayout;
import android.widget.Toast;
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;
@ -2555,7 +2556,10 @@ public class CallActivity extends CallBaseActivity {
}
}
};
registerReceiver(mReceiver, new IntentFilter(MICROPHONE_PIP_INTENT_NAME));
registerReceiver(mReceiver,
new IntentFilter(MICROPHONE_PIP_INTENT_NAME),
BuildConfig.PERMISSION_LOCAL_BROADCAST,
null);
updateUiForPipMode();
} else {