34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
package com.yanzhenjie.permission.checker;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.content.Context;
|
|
import android.database.Cursor;
|
|
import android.provider.ContactsContract;
|
|
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
|
import com.yanzhenjie.permission.checker.PermissionTest;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class ContactsReadTest implements PermissionTest {
|
|
private ContentResolver a;
|
|
|
|
ContactsReadTest(Context context) {
|
|
this.a = context.getContentResolver();
|
|
}
|
|
|
|
@Override // com.yanzhenjie.permission.checker.PermissionTest
|
|
public boolean a() throws Throwable {
|
|
Cursor query = this.a.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, new String[]{FileDownloadModel.ID, "data1"}, null, null, null);
|
|
if (query == null) {
|
|
return false;
|
|
}
|
|
try {
|
|
PermissionTest.CursorTest.a(query);
|
|
query.close();
|
|
return true;
|
|
} catch (Throwable th) {
|
|
query.close();
|
|
throw th;
|
|
}
|
|
}
|
|
}
|