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

Commit c04e25d3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't attempt to use RawContacts.getLocalAccount APIs below R"

parents a7406b1e 2875a0db
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.ContentProviderOperation;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.BaseColumns;
@@ -87,11 +88,12 @@ public class AccountWithDataSet implements Parcelable {
    }

    public static AccountWithDataSet getLocalAccount(Context context) {
        return new AccountWithDataSet(
        return android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.R
                ? getNullAccount()
                : new AccountWithDataSet(
                      RawContacts.getLocalAccountName(context),
                      RawContacts.getLocalAccountType(context),
                null
        );
                      null);
    }

    public Account getAccountOrNull() {
@@ -261,4 +263,3 @@ public class AccountWithDataSet implements Parcelable {
        return ret;
    }
}