导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.edu.log.bizbase.process;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.text.TextUtils;
import com.iflytek.edu.log.deviceinfo.EDULogDeviceIdentifierUtils;
import com.iflytek.edu.log.deviceinfo.EDULogNetworkIdentifierUtils;

public class EDULogDataProvider extends ContentProvider {
    private static final String TAG = "EDULogDataProvider";
    private static final UriMatcher uriMatcher = new UriMatcher(-1);
    private EDUBigDataIndexHelper mBigDataIndexHelper;
    private EDUApmIndexHelper mEDUApmIndexHelper;
    private EDULogSPHelper mEDULogSPHelper;

    @Override
    public int delete(Uri uri, String s, String[] strings) {
        return 0;
    }

    @Override
    public String getType(Uri uri) {
        return null;
    }

    @Override
    public Uri insert(Uri uri, ContentValues contentValues) {
        if (uri != null && contentValues != null && contentValues.size() != 0 && uriMatcher.match(uri) == DataSource.SP.val) {
            this.mEDULogSPHelper.setSP(getContext(), contentValues.getAsString(EDUSyncConstant.SP_KEY), contentValues.get(EDUSyncConstant.SP_VAL));
        }
        return uri;
    }

    @Override
    public boolean onCreate() {
        this.mEDULogSPHelper = new EDULogSPHelper();
        this.mBigDataIndexHelper = new EDUBigDataIndexHelper(getContext());
        this.mEDUApmIndexHelper = new EDUApmIndexHelper(getContext());
        this.mEDULogSPHelper.addUriMatcher(getContext(), uriMatcher);
        return false;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String s, String[] strings1, String s1) {
        if (uri == null || uriMatcher.match(uri) != DataSource.SP.val) {
            return null;
        }
        Object uniqueIndex = TextUtils.equals(s, EDUSyncConstant.BIGDATA_SPKEY_UNIQUE_INDEX) ? this.mBigDataIndexHelper.getUniqueIndex() : TextUtils.equals(s, EDUSyncConstant.APM_SPKEY_UNIQUE_INDEX) ? this.mEDUApmIndexHelper.getUniqueIndex() : TextUtils.equals(s, EDUSyncConstant.SAFELY_ANDROID_ID) ? EDULogDeviceIdentifierUtils.getAndroidId(getContext()) : TextUtils.equals(s, EDUSyncConstant.SAFELY_MAC) ? EDULogNetworkIdentifierUtils.getMac(getContext()) : TextUtils.equals(s, EDUSyncConstant.SAFELY_IMEI) ? EDULogDeviceIdentifierUtils.getImei(getContext()) : TextUtils.equals(s, EDUSyncConstant.SAFELY_IMSI) ? EDULogDeviceIdentifierUtils.getImsi(getContext()) : TextUtils.equals(s, EDUSyncConstant.SAFELY_SN) ? EDULogDeviceIdentifierUtils.getSnCode(getContext()) : this.mEDULogSPHelper.getSp(getContext(), s, projection[1], projection[0]);
        MatrixCursor matrixCursor = new MatrixCursor(new String[]{s});
        matrixCursor.addRow(new Object[]{uniqueIndex});
        return matrixCursor;
    }

    @Override
    public int update(Uri uri, ContentValues contentValues, String s, String[] strings) {
        return 0;
    }
}