package com.tencent.mm.plugin.webview.ui.tools;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.webview.model.WebViewJSSDKFileItem;
import com.tencent.mm.plugin.webview.model.ap;
import com.tencent.mm.plugin.webview.modeltools.g;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.ArrayList;

class OpenFileChooserUI$4 implements Runnable {
    final /* synthetic */ OpenFileChooserUI usf;
    final /* synthetic */ Intent val$data;
    final /* synthetic */ int val$resultCode;

    OpenFileChooserUI$4(OpenFileChooserUI openFileChooserUI, Intent intent, int i) {
        this.usf = openFileChooserUI;
        this.val$data = intent;
        this.val$resultCode = i;
    }

    public final void run() {
        AppMethodBeat.i(7445);
        ArrayList<String> stringArrayListExtra = this.val$data.getStringArrayListExtra("CropImage_OutputPath_List");
        boolean booleanExtra = this.val$data.getBooleanExtra("isTakePhoto", false);
        boolean booleanExtra2 = this.val$data.getBooleanExtra("CropImage_Compress_Img", true);
        ArrayList arrayList = new ArrayList();
        for (String aeu : stringArrayListExtra) {
            WebViewJSSDKFileItem aeu2 = WebViewJSSDKFileItem.aeu(aeu);
            String str = aeu2.czD;
            aeu2.hes = booleanExtra2;
            g.cYF().b(aeu2);
            ab.i("MicroMsg.OpenFileChooserUI", "now filepath is : %s, local id is : %s", new Object[]{aeu, str});
            arrayList.add(str);
        }
        ab.i("MicroMsg.OpenFileChooserUI", "after parse to json data : %s", new Object[]{ap.ab(arrayList)});
        Intent intent = new Intent();
        intent.putExtra("key_pick_local_pic_callback_local_ids", aeu);
        intent.putExtra("key_pick_local_pic_source_type", booleanExtra ? "camera" : "album");
        intent.putExtra("key_pick_local_media_show_memory_warning", OpenFileChooserUI.a(this.usf));
        this.usf.setResult(this.val$resultCode, intent);
        this.usf.finish();
        AppMethodBeat.o(7445);
    }
}
