35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
package com.yanzhenjie.permission.checker;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.content.Context;
|
|
import android.database.Cursor;
|
|
import android.provider.CalendarContract;
|
|
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
|
import com.unity3d.ads.metadata.MediationMetaData;
|
|
import com.yanzhenjie.permission.checker.PermissionTest;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class CalendarReadTest implements PermissionTest {
|
|
private ContentResolver a;
|
|
|
|
CalendarReadTest(Context context) {
|
|
this.a = context.getContentResolver();
|
|
}
|
|
|
|
@Override // com.yanzhenjie.permission.checker.PermissionTest
|
|
public boolean a() throws Throwable {
|
|
Cursor query = this.a.query(CalendarContract.Calendars.CONTENT_URI, new String[]{FileDownloadModel.ID, MediationMetaData.KEY_NAME}, null, null, null);
|
|
if (query == null) {
|
|
return false;
|
|
}
|
|
try {
|
|
PermissionTest.CursorTest.a(query);
|
|
query.close();
|
|
return true;
|
|
} catch (Throwable th) {
|
|
query.close();
|
|
throw th;
|
|
}
|
|
}
|
|
}
|