Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOBL-1809] AGP version updated to 7.4.2 and enabled Kotlin (version 1.9.0) for the android-sdk module #355

Merged
merged 1 commit into from
May 3, 2024

Conversation

rahulrvp
Copy link
Collaborator

@rahulrvp rahulrvp commented May 2, 2024

What changed?

  • Android Gradle Plugin (AGP) version updated to 7.4.2
  • Enabled Kotlin (1.9.0) for the android-sdk module

@rahulrvp rahulrvp self-assigned this May 2, 2024
@@ -127,7 +127,7 @@ private static void buildAndShowNotification(Context context, Message message) {
// Set the large icon to match the big picture.
builder.setLargeIcon(bitmap);
// Hide the large icon when the notification is expanded.
bigPictureStyle.bigLargeIcon(null);
bigPictureStyle.bigLargeIcon((Bitmap) null);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to pass the values like this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem: The bigLargeIcon method takes one argument and that can be either a Bitmap or an Icon object. Passing null creates confusion for the compiler. It won't know which method signature to use.

The solution: Cast the null to Bitmap or Icon and avoid confusion to the compiler.

Will it crash? - No. Java 17 allows you to cast null to any other object. However, it won't make a real Bitmap object. It will still be a null reference.

Copy link

@ketanshikharebsft ketanshikharebsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rahulrvp rahulrvp merged commit c382e7c into dev May 3, 2024
1 check passed
@rahulrvp rahulrvp deleted the mobl_1809_enable_kotlin branch May 3, 2024 13:02
rahulrvp added a commit that referenced this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants