package com.tencent.mm.plugin.music.model.a.a;

import android.content.ContentValues;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ipcinvoker.i;
import com.tencent.mm.ipcinvoker.type.IPCVoid;
import com.tencent.mm.plugin.music.cache.ipc.IPCAudioParamRequest;
import com.tencent.mm.plugin.music.model.e;
import com.tencent.mm.plugin.music.model.e.c;
import com.tencent.mm.plugin.music.model.e.d;
import com.tencent.mm.sdk.platformtools.ab;

public final class a$m implements i<IPCAudioParamRequest, IPCVoid> {
    private a$m() {
    }

    public final /* synthetic */ Object am(Object obj) {
        AppMethodBeat.i(104960);
        IPCVoid a = a((IPCAudioParamRequest) obj);
        AppMethodBeat.o(104960);
        return a;
    }

    private static IPCVoid a(IPCAudioParamRequest iPCAudioParamRequest) {
        AppMethodBeat.i(104959);
        try {
            ab.i("MicroMsg.Audio.MusicDataSourceCrossProcessImp", "ipc updateMusicFileCacheComplete Task, musicId:%s, complete:%d", new Object[]{iPCAudioParamRequest.cFI, Integer.valueOf(iPCAudioParamRequest.oLm)});
            String str = iPCAudioParamRequest.cFI;
            int i = iPCAudioParamRequest.oLm;
            d bUm = e.bUm();
            ContentValues contentValues = new ContentValues();
            contentValues.put("fileCacheComplete", Integer.valueOf(i));
            if (i == 1) {
                contentValues.put("removeDirtyBit", Integer.valueOf(1));
            }
            int update = bUm.bSd.update("PieceMusicInfo", contentValues, "musicId=?", new String[]{str});
            ab.i("MicroMsg.Music.PieceMusicInfoStorage", "updateMusicFileCacheComplete raw=%d musicId=%s fileCacheComplete=%d", new Object[]{Integer.valueOf(update), str, Integer.valueOf(i)});
            c cVar = (c) bUm.oNq.get(str);
            if (cVar != null) {
                cVar.field_fileCacheComplete = i;
                if (i == 1) {
                    cVar.field_removeDirtyBit = 1;
                }
            }
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.Audio.MusicDataSourceCrossProcessImp", e, "ipc updateMusicFileCacheComplete task", new Object[0]);
        }
        IPCVoid iPCVoid = new IPCVoid();
        AppMethodBeat.o(104959);
        return iPCVoid;
    }
}
