Skip to content

Commit 50ca45b

Browse files
author
Pedro Martins
authored
Merge pull request #23 from getyoti/YM-25652
[YM-25652] Update pending intent flags
2 parents c15ac40 + 68dd54e commit 50ca45b

File tree

8 files changed

+43
-13
lines changed

8 files changed

+43
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.3.1] - 2022-02-22
5+
### Changed
6+
- Update pending intent flags to support Android 12.
7+
48
## [1.3.0] - 2021-07-20
59
### Added
610
- Added attribute buttonTheme to the YotiSDKButton for applying the theme.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
mavenCentral()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.5.0'
11+
classpath 'com.android.tools.build:gradle:3.5.4'
1212
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.20.0"
1313
}
1414
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
minSdkVersionVersion=21
25-
targetSdkVersion=28
25+
targetSdkVersion=31
2626
compileSdkVersion=28
2727

2828
uiWidgetsVersion=1.9.0
@@ -56,9 +56,9 @@ easyIDScheme=easyid://
5656
pomId=yoti-button-sdk
5757
pomGroup=com.yoti.mobile.android.sdk
5858
pomPackaging=aar
59-
pomVersion=1.3.0
59+
pomVersion=1.3.1
6060
pomDescription=Button SDK that allows 3rd party to trigger Yoti as support app
61-
currentVersionCode=000010
61+
currentVersionCode=000011
6262

6363
pomLicenseName=MIT
6464
pomLicenseUrl=https://github.com/getyoti/android-sdk-button/blob/master/LICENSE.md

sample-app-2/src/main/AndroidManifest.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<activity
1717
android:name="com.yoti.mobile.android.sampleapp2.MainActivity"
18+
android:exported="true"
1819
android:launchMode="singleInstance"
1920
android:theme="@style/SampleAppFullScreenTheme">
2021
<intent-filter>
@@ -24,13 +25,17 @@
2425
</intent-filter>
2526
</activity>
2627

27-
<receiver android:name="com.yoti.mobile.android.sampleapp2.recievers.ShareAttributesResultBroadcastReceiver" android:exported="false">
28+
<receiver
29+
android:name="com.yoti.mobile.android.sampleapp2.recievers.ShareAttributesResultBroadcastReceiver"
30+
android:exported="false">
2831
<intent-filter>
2932
<action android:name="com.yoti.services.CALLBACK" />
3033
</intent-filter>
3134
</receiver>
3235

33-
<activity android:name="com.yoti.mobile.android.sampleapp2.ProfileActivity" />
36+
<activity
37+
android:name="com.yoti.mobile.android.sampleapp2.ProfileActivity"
38+
android:exported="false" />
3439

3540
<service
3641
android:name="com.yoti.mobile.android.sampleapp2.services.CallbackIntentService"

sample-app-3/src/main/AndroidManifest.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
android:roundIcon="@mipmap/ic_launcher_round"
1212
android:supportsRtl="true"
1313
android:theme="@style/AppTheme">
14-
<activity android:name="com.yoti.mobile.android.sdk.sampleapp.MainActivity"
15-
android:theme="@style/SampleAppTheme"
16-
android:launchMode="singleInstance">
14+
<activity
15+
android:name="com.yoti.mobile.android.sdk.sampleapp.MainActivity"
16+
android:exported="true"
17+
android:launchMode="singleInstance"
18+
android:theme="@style/SampleAppTheme">
1719
<intent-filter>
1820
<action android:name="android.intent.action.MAIN" />
1921

2022
<category android:name="android.intent.category.LAUNCHER" />
2123
</intent-filter>
2224
</activity>
2325

24-
<receiver android:name="com.yoti.mobile.android.sdk.sampleapp.ShareAttributesResultBroadcastReceiver" android:exported="false">
26+
<receiver
27+
android:name="com.yoti.mobile.android.sdk.sampleapp.ShareAttributesResultBroadcastReceiver"
28+
android:exported="false">
2529
<intent-filter>
2630
<action android:name="com.test.app.YOTI_CALLBACK" />
2731
<action android:name="com.test.app.BACKEND_CALLBACK" />

sample-app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
android:roundIcon="@mipmap/ic_launcher_round"
1313
android:supportsRtl="true"
1414
android:theme="@style/AppTheme">
15-
<activity android:name=".MainActivity"
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true"
1618
android:launchMode="singleInstance"
1719
android:theme="@style/SampleAppTheme">
1820
<intent-filter>
@@ -22,7 +24,9 @@
2224
</intent-filter>
2325
</activity>
2426

25-
<receiver android:name=".ShareAttributesResultBroadcastReceiver" android:exported="false">
27+
<receiver
28+
android:name=".ShareAttributesResultBroadcastReceiver"
29+
android:exported="false">
2630
<intent-filter>
2731
<action android:name="com.test.app.YOTI_CALLBACK" />
2832
<action android:name="com.test.app.BACKEND_CALLBACK" />

yoti-sdk/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.yoti.mobile.android.sdk">
44

5+
<queries>
6+
<package android:name="com.yoti.mobile.android.live" />
7+
<package android:name="com.postofficeid.mobile.android.live" />
8+
</queries>
9+
510
<application
611
android:label="@string/app_name">
712
<activity android:name=".ReceiverActivity"

yoti-sdk/src/main/java/com/yoti/mobile/android/sdk/kernelSDK/KernelSDKIntentService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.content.Intent;
77
import android.content.pm.ApplicationInfo;
88
import android.net.Uri;
9+
import android.os.Build;
910
import android.os.ResultReceiver;
1011
import android.text.TextUtils;
1112

@@ -150,8 +151,15 @@ private void handleActionStartScenario(String useCaseId, ResultReceiver resultRe
150151
intent.setData(uri);
151152
}
152153

154+
int flags;
155+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
156+
flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE;
157+
} else {
158+
flags = PendingIntent.FLAG_UPDATE_CURRENT;
159+
}
153160
Intent wakeupIntent = new Intent(this, ReceiverActivity.class);
154-
PendingIntent pendingIntent = PendingIntent.getActivity(this, 1, wakeupIntent, PendingIntent.FLAG_UPDATE_CURRENT);
161+
PendingIntent pendingIntent = PendingIntent.getActivity(this, 1, wakeupIntent, flags);
162+
155163

156164
intent.putExtra(YOTI_PENDING_INTENT_EXTRA, pendingIntent);
157165

0 commit comments

Comments
 (0)