导航菜单

页面标题

页面副标题

管控平台 v5.2.3.0. - UserInfoProvider.java 源代码

正在查看: 管控平台 v5.2.3.0. 应用的 UserInfoProvider.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.iflytek.mdmservice.provider;

import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmservice.db.dao.UserInfoDao;
import com.iflytek.mdmservice.db.impl.UserInfoImpl;

public class UserInfoProvider extends ContentProvider {

    public static final Uri f346b = Uri.parse("content://com.iflytek.mdmservice.provider.UserInfoProvider/userinfo");

    private static final String f347c = UserInfoDao.Properties.UserId.e;
    private static final UriMatcher d;

    private UserInfoImpl f348a;

    static {
        UriMatcher uriMatcher = new UriMatcher(-1);
        d = uriMatcher;
        uriMatcher.addURI("com.iflytek.mdmservice.provider.UserInfoProvider", "userinfo", 0);
        d.addURI("com.iflytek.mdmservice.provider.UserInfoProvider", "userinfo/#", 1);
    }

    @Override
    public int delete(@NonNull Uri uri, @Nullable String str, @Nullable String[] strArr) {
        int delete;
        int match = d.match(uri);
        if (match == 0) {
            delete = this.f348a.delete(str, strArr);
        } else {
            if (match != 1) {
                throw new IllegalArgumentException("Unknown URI: " + uri);
            }
            delete = this.f348a.delete(f347c + "=?", new String[]{String.valueOf(ContentUris.parseId(uri))});
        }
        getContext().getContentResolver().notifyChange(uri, null);
        return delete;
    }

    @Override
    @Nullable
    public String getType(@NonNull Uri uri) {
        int match = d.match(uri);
        if (match == 0) {
            return "vnd.android.cursor.dir/userinfo";
        }
        if (match != 1) {
            return null;
        }
        return "vnd.android.cursor.item/userinfo";
    }

    @Override
    @Nullable
    public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {
        if (d.match(uri) == 0) {
            Uri withAppendedId = ContentUris.withAppendedId(uri, this.f348a.insert(contentValues));
            getContext().getContentResolver().notifyChange(uri, null);
            return withAppendedId;
        }
        throw new IllegalArgumentException("Unknown URI: " + uri);
    }

    @Override
    public boolean onCreate() {
        this.f348a = new UserInfoImpl(getContext());
        return false;
    }

    @Override
    @Nullable
    public Cursor query(@NonNull Uri uri, @Nullable String[] strArr, @Nullable String str, @Nullable String[] strArr2, @Nullable String str2) {
        Cursor query;
        int match = d.match(uri);
        if (match == 0) {
            query = this.f348a.query(str, strArr2);
        } else {
            if (match != 1) {
                throw new IllegalArgumentException("Unknown URI: " + uri);
            }
            query = this.f348a.query(f347c + "=?", new String[]{String.valueOf(ContentUris.parseId(uri))});
        }
        query.setNotificationUri(getContext().getContentResolver(), uri);
        return query;
    }

    @Override
    public int update(@NonNull Uri uri, @Nullable ContentValues contentValues, @Nullable String str, @Nullable String[] strArr) {
        int update;
        int match = d.match(uri);
        if (match == 0) {
            LogUtil.e("login update");
            update = this.f348a.update(contentValues, str, strArr);
        } else {
            if (match != 1) {
                throw new IllegalArgumentException("Unknown URI: " + uri);
            }
            LogUtil.e("login update id");
            update = this.f348a.update(contentValues, f347c + "=?", new String[]{String.valueOf(ContentUris.parseId(uri))});
        }
        getContext().getContentResolver().notifyChange(uri, null);
        return update;
    }
}