File tree Expand file tree Collapse file tree 10 files changed +31
-26
lines changed
java/com/onesignal/sdktest/application
notifications/src/main/java/com/onesignal/notifications/internal/display/impl Expand file tree Collapse file tree 10 files changed +31
-26
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ plugins {
3
3
}
4
4
5
5
android {
6
+ namespace ' com.onesignal.sdktest'
6
7
compileSdkVersion 34
7
8
defaultConfig {
8
9
minSdkVersion 21
@@ -52,21 +53,28 @@ android {
52
53
53
54
// Forced downgrade to Java 1.8 for compiling the application due to Android N error when building
54
55
compileOptions {
55
- sourceCompatibility JavaVersion . VERSION_1_8
56
- targetCompatibility JavaVersion . VERSION_1_8
56
+ sourceCompatibility JavaVersion . VERSION_11
57
+ targetCompatibility JavaVersion . VERSION_11
57
58
}
58
59
59
60
packagingOptions {
60
61
exclude ' androidsupportmultidexversion.txt'
61
62
}
62
63
63
- task flavorSelection() {
64
- if (getGradle(). getStartParameter(). getTaskRequests(). toString(). contains(" Gms" )) {
65
- apply plugin : ' com.google.gms.google-services'
66
- googleServices { disableVersionCheck = true }
67
- } else {
68
- apply plugin : ' com.huawei.agconnect'
69
- }
64
+ androidComponents {
65
+ onVariants(selector(). all(), { variant ->
66
+ println (" HERE onVariants" )
67
+ println (variant. name)
68
+ switch (variant. name) {
69
+ case " gms" :
70
+ apply plugin : ' com.google.gms.google-services'
71
+ googleServices { disableVersionCheck = true }
72
+ break
73
+ case " huawei" :
74
+ apply plugin : ' com.huawei.agconnect'
75
+ break
76
+ }
77
+ })
70
78
}
71
79
}
72
80
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
3
xmlns : tools =" http://schemas.android.com/tools"
4
- xmlns : amazon =" http://schemas.amazon.com/apk/res/android"
5
- package =" com.onesignal.sdktest" >
4
+ xmlns : amazon =" http://schemas.amazon.com/apk/res/android" >
6
5
7
6
<uses-permission android : name =" com.android.vending.BILLING" />
8
7
Original file line number Diff line number Diff line change 20
20
import com .onesignal .notifications .IDisplayableNotification ;
21
21
import com .onesignal .notifications .INotificationLifecycleListener ;
22
22
import com .onesignal .notifications .INotificationWillDisplayEvent ;
23
- import com .onesignal .sdktest .BuildConfig ;
24
23
import com .onesignal .sdktest .R ;
25
24
import com .onesignal .sdktest .constant .Tag ;
26
25
import com .onesignal .sdktest .constant .Text ;
@@ -38,9 +37,8 @@ public class MainApplication extends MultiDexApplication {
38
37
private static final int SLEEP_TIME_TO_MIMIC_ASYNC_OPERATION = 2000 ;
39
38
40
39
public MainApplication () {
41
- // run strict mode default in debug mode to surface any potential issues easier
42
- if (BuildConfig .DEBUG )
43
- StrictMode .enableDefaults ();
40
+ // run strict mode to surface any potential issues easier
41
+ StrictMode .enableDefaults ();
44
42
}
45
43
46
44
@ SuppressLint ("NewApi" )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ buildscript {
12
12
maven { url ' https://developer.huawei.com/repo/' }
13
13
}
14
14
dependencies {
15
- classpath ' com.android.tools.build:gradle:7.2.2 '
15
+ classpath ' com.android.tools.build:gradle:8.7.0 '
16
16
classpath ' com.google.gms:google-services:4.3.10'
17
17
classpath ' com.huawei.agconnect:agcp:1.6.2.300'
18
18
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ buildscript {
8
8
targetSdkVersion : 34 ,
9
9
minSdkVersion : 21
10
10
]
11
- androidGradlePluginVersion = ' 7.2.0 '
11
+ androidGradlePluginVersion = ' 8.7.1 '
12
12
googleServicesGradlePluginVersion = ' 4.3.10'
13
13
huaweiAgconnectVersion = ' 1.6.2.300'
14
14
huaweiHMSPushVersion = ' 6.3.0.304'
Original file line number Diff line number Diff line change 23
23
# Remove when creating an .aar build.
24
24
# android.enableAapt2=false
25
25
26
- android.databinding.incremental = false
27
- kapt.incremental.apt = false
28
- android.testConfig.useRelativePath = false
26
+ org.gradle.jvmargs =-Xmx1536m
29
27
30
28
# Enables D8 for all modules.
31
29
android.enableD8 = true
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-7.3.3 -all.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.10.2 -all.zip
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ android {
21
21
}
22
22
// Forced downgrade to Java 8 so SDK is backwards compatible in consuming projects
23
23
compileOptions {
24
- sourceCompatibility JavaVersion . VERSION_1_8
25
- targetCompatibility JavaVersion . VERSION_1_8
24
+ sourceCompatibility JavaVersion . VERSION_11
25
+ targetCompatibility JavaVersion . VERSION_11
26
26
}
27
27
namespace ' com.onesignal'
28
28
}
Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ afterEvaluate {
66
66
67
67
publications {
68
68
release(MavenPublication ) {
69
- from components. release
69
+ // components.getByName('release')
70
+ // from components.release
71
+ // from components.java
70
72
71
73
pom {
72
74
name = projectName
Original file line number Diff line number Diff line change @@ -231,9 +231,9 @@ internal class NotificationDisplayBuilder(
231
231
if (bitmap == null ) return null
232
232
try {
233
233
val systemLargeIconHeight =
234
- contextResources!! .getDimension(R .dimen.notification_large_icon_height).toInt()
234
+ contextResources!! .getDimension(android. R .dimen.notification_large_icon_height).toInt()
235
235
val systemLargeIconWidth =
236
- contextResources!! .getDimension(R .dimen.notification_large_icon_width).toInt()
236
+ contextResources!! .getDimension(android. R .dimen.notification_large_icon_width).toInt()
237
237
val bitmapHeight = bitmap.height
238
238
val bitmapWidth = bitmap.width
239
239
if (bitmapWidth > systemLargeIconWidth || bitmapHeight > systemLargeIconHeight) {
You can’t perform that action at this time.
0 commit comments