Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fde4cf8 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Don't export context-registered broadcast receivers



Change-Id: I6168e69781cf81c40a44c46647f2500d38146341
Signed-off-by: default avatarAayush Gupta <aayushgupta219@gmail.com>
parent 36e8ee5a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ android {
}

dependencies {
    implementation("androidx.appcompat:appcompat:1.5.1")
    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.6.1")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
}
+6 −2
Original line number Diff line number Diff line
@@ -197,8 +197,12 @@ public class RecorderActivity extends AppCompatActivity {
    @Override
    protected void onStart() {
        super.onStart();
        registerReceiver(mTelephonyReceiver,
                new IntentFilter(TelephonyManager.ACTION_PHONE_STATE_CHANGED));
        ContextCompat.registerReceiver(
                this,
                mTelephonyReceiver,
                new IntentFilter(TelephonyManager.ACTION_PHONE_STATE_CHANGED),
                ContextCompat.RECEIVER_NOT_EXPORTED
        );
    }

    @Override
+6 −1
Original line number Diff line number Diff line
@@ -139,7 +139,12 @@ public class SoundRecorderService extends Service {
    public void onCreate() {
        super.onCreate();

        registerReceiver(mShutdownReceiver, new IntentFilter(Intent.ACTION_SHUTDOWN));
        ContextCompat.registerReceiver(
                this,
                mShutdownReceiver,
                new IntentFilter(Intent.ACTION_SHUTDOWN),
                ContextCompat.RECEIVER_NOT_EXPORTED
        );

        mNotificationManager = getSystemService(NotificationManager.class);
        if (mNotificationManager != null &&