31 lines
1.0 KiB
Java
31 lines
1.0 KiB
Java
package com.yanzhenjie.permission.checker;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.content.ContentUris;
|
|
import android.content.ContentValues;
|
|
import android.content.Context;
|
|
import android.provider.CallLog;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class CallLogWriteTest implements PermissionTest {
|
|
private ContentResolver a;
|
|
|
|
CallLogWriteTest(Context context) {
|
|
this.a = context.getContentResolver();
|
|
}
|
|
|
|
@Override // com.yanzhenjie.permission.checker.PermissionTest
|
|
public boolean a() throws Throwable {
|
|
try {
|
|
ContentValues contentValues = new ContentValues();
|
|
contentValues.put("type", (Integer) 1);
|
|
contentValues.put("number", "1");
|
|
contentValues.put("date", (Integer) 20080808);
|
|
contentValues.put("new", "0");
|
|
return ContentUris.parseId(this.a.insert(CallLog.Calls.CONTENT_URI, contentValues)) > 0;
|
|
} finally {
|
|
this.a.delete(CallLog.Calls.CONTENT_URI, "number=?", new String[]{"1"});
|
|
}
|
|
}
|
|
}
|