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

Commit 39a8e03b authored by Stefan Andonian's avatar Stefan Andonian
Browse files

Surround BaseIconCache.getUserBadgedLabel in a try catch to account for rare...

Surround BaseIconCache.getUserBadgedLabel in a try catch to account for rare SecurityException edge case

Bug: 425796604
Test: presubmit passed. No actual reproduction though.
Flag: EXEMPT bug fix
Change-Id: I91d39a64cbe46d7cf929f3a2a1df4b4a0e2e1319
parent 06c4fce5
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -188,10 +188,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)