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

Commit 6ddd42ff authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['ag/20118500'] into security-aosp-rvc-release.

Change-Id: If589afe61108d7e12f224deb4895e7f4b4506504
parents 7cc2b669 1189db7a
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import android.util.Log;


import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.GuardedBy;


import java.util.Objects;
import java.util.Set;
import java.util.Set;


/**
/**
@@ -85,6 +86,12 @@ public class Account implements Parcelable {
        if (TextUtils.isEmpty(type)) {
        if (TextUtils.isEmpty(type)) {
            throw new IllegalArgumentException("the type must not be empty: " + type);
            throw new IllegalArgumentException("the type must not be empty: " + type);
        }
        }
        if (name.length() > 200) {
            throw new IllegalArgumentException("account name is longer than 200 characters");
        }
        if (type.length() > 200) {
            throw new IllegalArgumentException("account type is longer than 200 characters");
        }
        this.name = name;
        this.name = name;
        this.type = type;
        this.type = type;
        this.accessId = accessId;
        this.accessId = accessId;
+5 −0
Original line number Original line Diff line number Diff line
@@ -1821,6 +1821,11 @@ public class AccountManagerService
                                + ", skipping since the account already exists");
                                + ", skipping since the account already exists");
                        return false;
                        return false;
                    }
                    }
                    if (accounts.accountsDb.findAllDeAccounts().size() > 100) {
                        Log.w(TAG, "insertAccountIntoDatabase: " + account.toSafeString()
                                + ", skipping since more than 50 accounts on device exist");
                        return false;
                    }
                    long accountId = accounts.accountsDb.insertCeAccount(account, password);
                    long accountId = accounts.accountsDb.insertCeAccount(account, password);
                    if (accountId < 0) {
                    if (accountId < 0) {
                        Log.w(TAG, "insertAccountIntoDatabase: " + account.toSafeString()
                        Log.w(TAG, "insertAccountIntoDatabase: " + account.toSafeString()