Skip to content

Commit

Permalink
feat: changes to compliance with android 12
Browse files Browse the repository at this point in the history
references: https://outsystemsrd.atlassian.net/browse/RMET-824

desc: added tag exported in android manifest and added flag immutable to pending intent
  • Loading branch information
CarlsCorrea committed Aug 30, 2021
1 parent 828abee commit 325e6ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
35 changes: 23 additions & 12 deletions OneSignalSDK/onesignal/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@

<application>

<receiver android:name="com.onesignal.NotificationOpenedReceiver" />
<receiver android:name="com.onesignal.NotificationOpenedReceiver"
android:exported="false"/>

<service
android:name="com.onesignal.HmsMessageServiceOneSignal"
Expand All @@ -70,41 +71,51 @@
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>

<activity android:name="com.onesignal.NotificationOpenedActivityHMS"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>

<service android:name="com.onesignal.GcmIntentService" />
<service android:name="com.onesignal.GcmIntentService"
exported="false"/>

<service android:name="com.onesignal.GcmIntentJobService"
android:permission="android.permission.BIND_JOB_SERVICE"/>
android:permission="android.permission.BIND_JOB_SERVICE"
exported="false"/>

<service android:name="com.onesignal.RestoreJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"/>

<service android:name="com.onesignal.RestoreKickoffJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"/>

<service android:name="com.onesignal.SyncService" android:stopWithTask="true" />
<service android:name="com.onesignal.SyncJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"/>

<activity android:name="com.onesignal.PermissionsActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>

<service android:name="com.onesignal.NotificationRestoreService" />
<service android:name="com.onesignal.NotificationRestoreService"
android:exported="false"/>

<receiver android:name="com.onesignal.BootUpReceiver">
<receiver android:name="com.onesignal.BootUpReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<receiver android:name="com.onesignal.UpgradeReceiver" >
<receiver android:name="com.onesignal.UpgradeReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ private static CharSequence getTitle(JSONObject gcmBundle) {

private static PendingIntent getNewActionPendingIntent(int requestCode, Intent intent) {
if (openerIsBroadcast)
return PendingIntent.getBroadcast(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
return PendingIntent.getActivity(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
return PendingIntent.getBroadcast(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
return PendingIntent.getActivity(currentContext, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}

private static Intent getNewBaseIntent(int notificationId) {
Expand Down

0 comments on commit 325e6ec

Please sign in to comment.