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

Commit 3b6aba8f authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Android (Google) Code Review
Browse files

Merge "Log ACCOUNT_MANAGER_EVENT__EVENT_TYPE__AUTHENTICATOR_ADDED" into main

parents c5793bb2 543e846f
Loading
Loading
Loading
Loading
+22 −1
Original line number Original line Diff line number Diff line
@@ -112,6 +112,7 @@ import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Preconditions;
import com.android.internal.util.Preconditions;
import com.android.modules.expresslog.Histogram;
import com.android.modules.expresslog.Histogram;
@@ -1226,7 +1227,17 @@ public class AccountManagerService
                // been re-enabled (after being updated for example), then we just overwrite the old
                // been re-enabled (after being updated for example), then we just overwrite the old
                // values.
                // values.
                for (Entry<String, Integer> entry : knownAuth.entrySet()) {
                for (Entry<String, Integer> entry : knownAuth.entrySet()) {
                    accountsDb.insertOrReplaceMetaAuthTypeAndUid(entry.getKey(), entry.getValue());
                    String type = entry.getKey();
                    Integer newUid = entry.getValue();
                    if (!Objects.equals(metaAuthUid.get(type), newUid)) {
                        FrameworkStatsLog.write(
                                FrameworkStatsLog.ACCOUNT_MANAGER_EVENT,
                                type,
                                newUid,
                                FrameworkStatsLog
                                        .ACCOUNT_MANAGER_EVENT__EVENT_TYPE__AUTHENTICATOR_ADDED);
                    }
                    accountsDb.insertOrReplaceMetaAuthTypeAndUid(type, newUid);
                }
                }


                final Map<Long, Account> accountsMap = accountsDb.findAllDeAccounts();
                final Map<Long, Account> accountsMap = accountsDb.findAllDeAccounts();
@@ -1945,6 +1956,11 @@ public class AccountManagerService
                    }
                    }
                    accounts.accountsDb.setTransactionSuccessful();
                    accounts.accountsDb.setTransactionSuccessful();


                    FrameworkStatsLog.write(
                            FrameworkStatsLog.ACCOUNT_MANAGER_EVENT,
                            account.type,
                            callingUid,
                            FrameworkStatsLog.ACCOUNT_MANAGER_EVENT__EVENT_TYPE__ACCOUNT_ADDED);
                    logRecord(AccountsDb.DEBUG_ACTION_ACCOUNT_ADD, AccountsDb.TABLE_ACCOUNTS,
                    logRecord(AccountsDb.DEBUG_ACTION_ACCOUNT_ADD, AccountsDb.TABLE_ACCOUNTS,
                            accountId,
                            accountId,
                            accounts, callingUid);
                            accounts, callingUid);
@@ -2544,6 +2560,11 @@ public class AccountManagerService
                    }
                    }
                    String action = userUnlocked ? AccountsDb.DEBUG_ACTION_ACCOUNT_REMOVE
                    String action = userUnlocked ? AccountsDb.DEBUG_ACTION_ACCOUNT_REMOVE
                            : AccountsDb.DEBUG_ACTION_ACCOUNT_REMOVE_DE;
                            : AccountsDb.DEBUG_ACTION_ACCOUNT_REMOVE_DE;
                    FrameworkStatsLog.write(
                            FrameworkStatsLog.ACCOUNT_MANAGER_EVENT,
                            account.type,
                            callingUid,
                            FrameworkStatsLog.ACCOUNT_MANAGER_EVENT__EVENT_TYPE__ACCOUNT_REMOVED);
                    logRecord(action, AccountsDb.TABLE_ACCOUNTS, accountId, accounts);
                    logRecord(action, AccountsDb.TABLE_ACCOUNTS, accountId, accounts);
                }
                }
            }
            }