Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3d833cf authored by Stefan Andonian's avatar Stefan Andonian Committed by Android (Google) Code Review
Browse files

Merge "Surround BaseIconCache.getUserBadgedLabel in a try catch to account for...

Merge "Surround BaseIconCache.getUserBadgedLabel in a try catch to account for rare SecurityException edge case" into main
parents 17641910 39a8e03b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -189,10 +189,17 @@ constructor(
        val index = userFormatString.indexOfKey(key)
        var format: String?
        if (index < 0) {
            try {
                format = packageManager.getUserBadgedLabel(IDENTITY_FORMAT_STRING, user).toString()
                if (TextUtils.equals(IDENTITY_FORMAT_STRING, format)) {
                    format = null
                }
            } catch (e: Exception) {
                // Its possible that the caller may have an outdated cached user specific-entry.
                // For eg, if a user was removed but that event has not propagated to the client yet
                Log.e(TAG, "failed to access private profile data", e)
                format = null
            }
            userFormatString.put(key, format)
        } else {
            format = userFormatString.valueAt(index)