package X6FRs_4.WwEq_13;

import X6FRs_4.WwEq_13.IFxWkV_5;
import android.content.Context;
import android.media.browse.MediaBrowser;
import android.os.Bundle;
import android.os.Parcel;
import android.service.media.MediaBrowserService;
import android.support.v4.media.session.MediaSessionCompat;
import android.util.Log;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/* compiled from: MediaBrowserServiceCompatApi26.java */
/* loaded from: classes.dex */
public class IMuAHx_6 {
    public static Field KQgRr5e_0;

    /* compiled from: MediaBrowserServiceCompatApi26.java */
    /* loaded from: classes.dex */
    public static class KQgRr5e_0 extends IFxWkV_5.KQgRr5e_0 {
        public KQgRr5e_0(Context context, PGPF6hQ_2 pGPF6hQ_2) {
            super(context, pGPF6hQ_2);
        }

        @Override // android.service.media.MediaBrowserService
        public void onLoadChildren(String str, MediaBrowserService.Result<List<MediaBrowser.MediaItem>> result, Bundle bundle) {
            MediaSessionCompat.KQgRr5e_0(bundle);
            ((PGPF6hQ_2) this.KQgRr5e_0).KQgRr5e_0(str, new QxJ9d_1(result), bundle);
        }
    }

    /* compiled from: MediaBrowserServiceCompatApi26.java */
    /* loaded from: classes.dex */
    public interface PGPF6hQ_2 extends IFxWkV_5.QxJ9d_1 {
        void KQgRr5e_0(String str, QxJ9d_1 qxJ9d_1, Bundle bundle);
    }

    static {
        try {
            Field declaredField = MediaBrowserService.Result.class.getDeclaredField("mFlags");
            KQgRr5e_0 = declaredField;
            declaredField.setAccessible(true);
        } catch (NoSuchFieldException e) {
            Log.w("MBSCompatApi26", e);
        }
    }

    public static Object KQgRr5e_0(Context context, PGPF6hQ_2 pGPF6hQ_2) {
        return new KQgRr5e_0(context, pGPF6hQ_2);
    }

    /* compiled from: MediaBrowserServiceCompatApi26.java */
    /* loaded from: classes.dex */
    public static class QxJ9d_1 {
        public MediaBrowserService.Result KQgRr5e_0;

        public QxJ9d_1(MediaBrowserService.Result result) {
            this.KQgRr5e_0 = result;
        }

        public void KQgRr5e_0(List<Parcel> list, int i) {
            try {
                IMuAHx_6.KQgRr5e_0.setInt(this.KQgRr5e_0, i);
            } catch (IllegalAccessException e) {
                Log.w("MBSCompatApi26", e);
            }
            this.KQgRr5e_0.sendResult(KQgRr5e_0(list));
        }

        public List<MediaBrowser.MediaItem> KQgRr5e_0(List<Parcel> list) {
            if (list == null) {
                return null;
            }
            ArrayList arrayList = new ArrayList();
            for (Parcel parcel : list) {
                parcel.setDataPosition(0);
                arrayList.add(MediaBrowser.MediaItem.CREATOR.createFromParcel(parcel));
                parcel.recycle();
            }
            return arrayList;
        }
    }
}
