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

Commit d69b23c8 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Ignore SQLite exceptions in AccountManager onPackageAdded

Callback is used to dismiss rarely used notification if account becomes
visible after app update -  b/79918517

Bug: 289131456
Test: N/A
Change-Id: I775c53b3c7663bda218125748dc76f1f1c242f7f
parent 9941e10e
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -357,15 +357,25 @@ public class AccountManagerService
            @Override
            public void onPackageAdded(String packageName, int uid) {
                // Called on a handler, and running as the system
                try {
                    UserAccounts accounts = getUserAccounts(UserHandle.getUserId(uid));
                    cancelAccountAccessRequestNotificationIfNeeded(uid, true, accounts);
                } catch (SQLiteCantOpenDatabaseException e) {
                    Log.w(TAG, "Can't read accounts database", e);
                    return;
                }
            }

            @Override
            public void onPackageUpdateFinished(String packageName, int uid) {
                // Called on a handler, and running as the system
                try {
                    UserAccounts accounts = getUserAccounts(UserHandle.getUserId(uid));
                    cancelAccountAccessRequestNotificationIfNeeded(uid, true, accounts);
                } catch (SQLiteCantOpenDatabaseException e) {
                    Log.w(TAG, "Can't read accounts database", e);
                    return;
                }
            }
        }.register(mContext, mHandler.getLooper(), UserHandle.ALL, true);

@@ -391,6 +401,9 @@ public class AccountManagerService
                    }
                } catch (NameNotFoundException e) {
                    /* ignore */
                } catch (SQLiteCantOpenDatabaseException e) {
                    Log.w(TAG, "Can't read accounts database", e);
                    return;
                }
            }
        });