最右.apk(点击下载) / lg5.java


package defpackage;

import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.provider.CalendarContract;
import com.tencent.sonic.sdk.SonicSession;
import java.util.TimeZone;

/* renamed from: lg5  reason: default package */
public class lg5 implements ug5 {

    /* renamed from: a  reason: collision with root package name */
    public ContentResolver f29134a;

    public lg5(Context context) {
        this.f29134a = context.getContentResolver();
    }

    @Override // defpackage.ug5
    public boolean test() throws Throwable {
        try {
            TimeZone timeZone = TimeZone.getDefault();
            ContentValues contentValues = new ContentValues();
            contentValues.put("name", "PERMISSION");
            contentValues.put("account_name", "permission@gmail.com");
            contentValues.put("account_type", "LOCAL");
            contentValues.put("calendar_displayName", "PERMISSION");
            boolean z = true;
            contentValues.put("visible", (Integer) 1);
            contentValues.put("calendar_color", (Integer) -16776961);
            contentValues.put("calendar_access_level", (Integer) 700);
            contentValues.put("sync_events", (Integer) 1);
            contentValues.put("calendar_timezone", timeZone.getID());
            contentValues.put("ownerAccount", "PERMISSION");
            contentValues.put("canOrganizerRespond", (Integer) 0);
            if (ContentUris.parseId(this.f29134a.insert(CalendarContract.Calendars.CONTENT_URI.buildUpon().appendQueryParameter("caller_is_syncadapter", SonicSession.OFFLINE_MODE_TRUE).appendQueryParameter("account_name", "PERMISSION").appendQueryParameter("account_type", "LOCAL").build(), contentValues)) <= 0) {
                z = false;
            }
            return z;
        } finally {
            this.f29134a.delete(CalendarContract.Calendars.CONTENT_URI.buildUpon().build(), "account_name=?", new String[]{"permission@gmail.com"});
        }
    }
}