more fixes for Android 31

FLAG_IMMUTABLE and android:exported="true"
This commit is contained in:
Eric House 2022-08-20 12:33:48 -07:00
parent 5654602662
commit 9429fd34e6
8 changed files with 19 additions and 9 deletions

View file

@ -172,7 +172,8 @@ public class DupeModeTimer extends BroadcastReceiver {
if ( whenSeconds < sCurTimer ) {
sCurTimer = whenSeconds;
Intent intent = new Intent( context, DupeModeTimer.class );
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, 0 );
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent,
PendingIntent.FLAG_IMMUTABLE );
long now = Utils.getCurSeconds();
long fire_millis = SystemClock.elapsedRealtime()

View file

@ -379,7 +379,8 @@ public class NBSProto {
private PendingIntent makeStatusIntent( Context context, String msg )
{
Intent intent = new Intent( msg );
return PendingIntent.getBroadcast( context, 0, intent, 0 );
return PendingIntent.getBroadcast( context, 0, intent,
PendingIntent.FLAG_IMMUTABLE );
}
private void cacheForRetry( QueueElem elem )

View file

@ -389,8 +389,9 @@ public class TimerReceiver extends BroadcastReceiver {
(AlarmManager)context.getSystemService( Context.ALARM_SERVICE );
Intent intent = new Intent( context, TimerReceiver.class );
intent.putExtra( KEY_TIMER_ID, timerID );
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT );
PendingIntent pi = PendingIntent
.getBroadcast( context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT
| PendingIntent.FLAG_IMMUTABLE );
am.set( AlarmManager.RTC_WAKEUP, firstFireTime, pi );
setJobTimerIf( context, delayMS, timerID );

View file

@ -96,7 +96,8 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
(AlarmManager)context.getSystemService( Context.ALARM_SERVICE );
Intent intent = new Intent( context, UpdateCheckReceiver.class );
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, 0 );
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent,
PendingIntent.FLAG_IMMUTABLE );
am.cancel( pi );
long interval_millis;

View file

@ -379,7 +379,7 @@ public class Utils {
{
PendingIntent pi = PendingIntent
.getActivity( context, Utils.nextRandomInt(), intent,
PendingIntent.FLAG_ONE_SHOT );
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE );
return pi;
}

View file

@ -22,7 +22,9 @@
<service android:name="WiDirService"/>
<receiver android:name="SMSReceiver" >
<receiver android:name="SMSReceiver"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />

View file

@ -25,7 +25,9 @@
<service android:name="WiDirService"/>
<receiver android:name="SMSReceiver" >
<receiver android:name="SMSReceiver"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />

View file

@ -9,7 +9,9 @@
<uses-permission android:name="android.permission.SEND_SMS" />
<application>
<receiver android:name="SMSReceiver" >
<receiver android:name="SMSReceiver"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.DATA_SMS_RECEIVED" />
<data android:scheme="sms" />