-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'split-tunneling-icon-rendering-crash-droid-607'
- Loading branch information
Showing
6 changed files
with
20 additions
and
160 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
.../src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
android/app/src/main/kotlin/net/mullvad/mullvadvpn/applist/ApplicationsIconManager.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PackageManagerExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package net.mullvad.mullvadvpn.util | ||
|
||
import android.content.pm.PackageManager | ||
import android.graphics.Bitmap | ||
import androidx.core.graphics.drawable.toBitmapOrNull | ||
|
||
fun PackageManager.getApplicationIconBitmapOrNull(packageName: String): Bitmap? = | ||
try { | ||
getApplicationIcon(packageName).toBitmapOrNull() | ||
} catch (e: Exception) { | ||
// Name not found is thrown if the application is not installed | ||
// IllegalArgumentException is thrown if the application has an invalid icon | ||
when (e) { | ||
is PackageManager.NameNotFoundException, | ||
is IllegalArgumentException -> null | ||
else -> throw e | ||
} | ||
} |
110 changes: 0 additions & 110 deletions
110
android/app/src/test/kotlin/net/mullvad/mullvadvpn/applist/ApplicationsIconManagerTest.kt
This file was deleted.
Oops, something went wrong.