use of com.google.android.gms.people.model.AccountMetadata in project android_packages_apps_GmsCore by microg.
the class PeopleServiceImpl method loadOwners.
@SuppressWarnings("MissingPermission")
@Override
public void loadOwners(final IPeopleCallbacks callbacks, boolean var2, boolean var3, final String accountName, String var5, int sortOrder) {
Log.d(TAG, "loadOwners: " + var2 + ", " + var3 + ", " + accountName + ", " + var5 + ", " + sortOrder);
PackageUtils.assertExtendedAccess(context);
AccountManager accountManager = AccountManager.get(context);
Bundle accountMetadata = new Bundle();
String accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
for (Account account : accountManager.getAccountsByType(accountType)) {
if (accountName == null || account.name.equals(accountName)) {
accountMetadata.putParcelable(account.name, new AccountMetadata());
}
}
Bundle extras = new Bundle();
extras.putBundle("account_metadata", accountMetadata);
try {
DatabaseHelper databaseHelper = new DatabaseHelper(context);
DataHolder dataHolder = new DataHolder(databaseHelper.getOwners(), 0, extras);
Log.d(TAG, "loadOwners[result]: " + dataHolder);
callbacks.onDataHolder(0, extras, dataHolder);
databaseHelper.close();
} catch (Exception e) {
Log.w(TAG, e);
}
}
Aggregations