Skip to content

Commit

Permalink
Use SocialApp as the context param
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Apr 25, 2024
1 parent fde7b55 commit ec82897
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/androidx/core/app/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import androidx.annotation.RestrictTo;
import androidx.core.graphics.drawable.IconCompat;

import com.google.android.samples.socialite.SocialApp;

import java.util.Objects;

/**
Expand Down Expand Up @@ -424,7 +426,7 @@ static Person fromAndroidPerson(android.app.Person person) {
static android.app.Person toAndroidPerson(Person person) {
return new android.app.Person.Builder()
.setName(person.getName())
.setIcon((person.getIcon() != null) ? person.getIcon().toIcon() : null)
.setIcon((person.getIcon() != null) ? person.getIcon().toIcon(SocialApp.app) : null)
.setUri(person.getUri())
.setKey(person.getKey())
.setBot(person.isBot())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class SocialApp : Application()
class SocialApp : Application() {
override fun onCreate() {
super.onCreate()
app = this
}

companion object {
lateinit var app: SocialApp
}
}

0 comments on commit ec82897

Please sign in to comment.