OSFilePlaybackFragment.java 源代码


package liteos;

import activity.FishEye.FishPlaybackOnlineActivity;
import activity.LocalFile.LocalFileActivity2;
import activity.WallMounted.WallMountedOnlineActivity;
import activity.video.PlaybackOnlineActivity;
import activity.video.SearchSDCardVideoActivity;
import activity.video.adapter.VideoOnlineListAdapter;
import android.animation.ObjectAnimator;
import android.app.ActionBar;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.ColorDrawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.design.widget.FloatingActionButton;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import base.HiFragment;
import bean.MyCamera;
import butterknife.ButterKnife;
import com.hichip.callback.ICameraDownloadCallback;
import com.hichip.callback.ICameraIOSessionCallback;
import com.hichip.campro.R;
import com.hichip.content.HiChipDefines;
import com.hichip.control.HiCamera;
import com.xiaomi.mipush.sdk.Constants;
import common.ConstantCommand;
import common.HiDataValue;
import custom.CircleProgressBar;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import org.apache.http.cookie.ClientCookie;
import org.greenrobot.eventbus.EventBus;
import service.WakeUpDevService;
import timeaxis.bean.FilePlaybackModel;
import timeaxis.bean.MsyIsStop;
import utils.HiLogcatUtil;
import utils.HiTools;
import utils.MyToast;
import utils.SharePreUtils;
import utils.TimeUtil;

public class OSFilePlaybackFragment extends HiFragment implements View.OnClickListener, AdapterView.OnItemClickListener, ICameraIOSessionCallback, ICameraDownloadCallback {
    public static final int HANDLE_MESSAGE_NETWORK_CHANGED = 1048577;
    public static final int MY_PERMISSION_REQUEST_CODE = 10027;
    public static final String SEARCH_ACTIVITY_END_TIME = "END TIME";
    public static final int SEARCH_ACTIVITY_RESULT = 1;
    public static final String SEARCH_ACTIVITY_START_TIME = "START TIME";
    public static final String VIDEO_PLAYBACK_END_TIME = "VIDEO END TIME";
    public static final String VIDEO_PLAYBACK_START_TIME = "VIDEO START TIME";
    private static final String newAddress = "http://iot.juzi1688.cn/dist/#/info?iccid=";
    private static final String oldAddress = "http://m2m.zweitx.com/dist/#/info?iccid=";
    private static final String oldAddressID = "&userId=1476846140417773568";
    private static final SimpleDateFormat sdf = new SimpleDateFormat("00:mm:ss");
    private VideoOnlineListAdapter adapter;
    FloatingActionButton btn_floatingaction;
    private CircleProgressBar circleprogressbar;
    private long currentMills;
    private PopupWindow downloadPopupWindow;
    private String download_path;
    private ConstantCommand.HI_P2P_FILE_INFO evt;
    private String fileName;
    boolean hideSize;
    private boolean isClickCancel;
    private ImageView iv_arrow;
    ListView list_video_online;
    private OSTimeAxisActivity mAct;
    private boolean mIsVisibleToUser;
    private MyCamera mMyCamera;
    private ConnectionChangeReceiver myReceiver;
    private boolean not_hint;
    private String path;
    private TextView popu_tips_down;
    private HiChipDefines.HI_P2P_S_SD_INFO sd_info;
    private TextView tv_cancel_downloading_video;
    private TextView tv_goto_downloading_video;
    TextView tv_not_online;
    TextView tv_nothing;
    private TextView tv_one;
    private TextView tv_sort;
    private TextView tv_two;
    private View searchTimeView = null;
    private View loadingView = null;
    private List<ConstantCommand.HI_P2P_FILE_INFO> file_list = Collections.synchronizedList(new ArrayList());
    private boolean isDownloading = false;
    private int mType = 0;
    public boolean mIsDataReceveEnd = false;
    private boolean mIsDown = true;
    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message message) {
            String str;
            switch (message.what) {
                case HiDataValue.HANDLE_MESSAGE_SESSION_STATE:
                    if (message.arg1 == 0 && OSFilePlaybackFragment.this.mIsVisibleToUser) {
                        if (OSFilePlaybackFragment.this.isDownloading && !TextUtils.isEmpty(OSFilePlaybackFragment.this.path)) {
                            File file = new File(OSFilePlaybackFragment.this.path);
                            if (file.isFile() && file.exists()) {
                                file.delete();
                            }
                        }
                        OSFilePlaybackFragment.this.dismissJuHuaDialog();
                        if (OSFilePlaybackFragment.this.mMyCamera.misshowgoRecharge || OSFilePlaybackFragment.this.mMyCamera.mPreICCIDRecharge != 2) {
                            MyToast.showToast(OSFilePlaybackFragment.this.mAct, OSFilePlaybackFragment.this.getString(R.string.disconnect));
                            if (OSFilePlaybackFragment.this.mAct != null) {
                                OSFilePlaybackFragment.this.mAct.finish();
                                return;
                            }
                            return;
                        }
                        OSFilePlaybackFragment oSFilePlaybackFragment = OSFilePlaybackFragment.this;
                        oSFilePlaybackFragment.showgoRechargeHint(oSFilePlaybackFragment.mMyCamera);
                        return;
                    }
                    return;
                case HiDataValue.HANDLE_MESSAGE_RECEIVE_IOCTRL:
                    if (message.arg2 == -1) {
                        MyToast.showToast(OSFilePlaybackFragment.this.mAct, OSFilePlaybackFragment.this.getString(R.string.tips_update_system_failed));
                        OSFilePlaybackFragment.this.dismissLoadDialog();
                        return;
                    }
                    if (message.arg2 == 0) {
                        byte[] byteArray = message.getData().getByteArray("data");
                        int i = message.arg1;
                        if ((i == 8193 || i == 16685 || i == 16701 || i == 16729) && byteArray.length >= 12) {
                            byte b = byteArray[8];
                            byte b2 = byteArray[9];
                            if (b2 > 0) {
                                for (int i2 = 0; i2 < b2; i2++) {
                                    byte[] bArr = new byte[24];
                                    int sizeof = (HiChipDefines.HI_P2P_FILE_INFO.sizeof() * i2) + 12;
                                    if (byteArray.length >= sizeof + 24) {
                                        System.arraycopy(byteArray, sizeof, bArr, 0, 24);
                                        ConstantCommand.HI_P2P_FILE_INFO hi_p2p_file_info = new ConstantCommand.HI_P2P_FILE_INFO(bArr);
                                        long timeInMillis2 = hi_p2p_file_info.sEndTime.getTimeInMillis2() - hi_p2p_file_info.sStartTime.getTimeInMillis2();
                                        if (timeInMillis2 <= 1500000 && timeInMillis2 > 0) {
                                            hi_p2p_file_info.fileLength = OSFilePlaybackFragment.sdf.format(new Date(timeInMillis2 + 1));
                                            OSFilePlaybackFragment.this.file_list.add(hi_p2p_file_info);
                                        }
                                    }
                                }
                            }
                            if (b == 1) {
                                OSFilePlaybackFragment.this.mIsDataReceveEnd = true;
                                OSFilePlaybackFragment.this.list_video_online.removeFooterView(OSFilePlaybackFragment.this.loadingView);
                                if (OSFilePlaybackFragment.this.file_list != null && OSFilePlaybackFragment.this.file_list.size() <= 0) {
                                    OSFilePlaybackFragment.this.list_video_online.removeHeaderView(OSFilePlaybackFragment.this.searchTimeView);
                                    OSFilePlaybackFragment.this.list_video_online.setVisibility(8);
                                    OSFilePlaybackFragment.this.tv_nothing.setVisibility(0);
                                    int i3 = OSFilePlaybackFragment.this.mType;
                                    if (i3 == 0) {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.six_hours) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    } else if (i3 == 1) {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.one_hours) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    } else if (i3 == 2) {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.half_day) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    } else if (i3 == 3) {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.one_day) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    } else if (i3 == 4) {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.one_week) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    } else if (i3 != 5) {
                                        str = " ";
                                    } else {
                                        str = "<font color='#45A7E6'>" + OSFilePlaybackFragment.this.getString(R.string.constom_time) + "</font><font color='#666666'/>" + OSFilePlaybackFragment.this.getString(R.string.click_right_corner) + "</font>";
                                    }
                                    OSFilePlaybackFragment.this.tv_nothing.setText(Html.fromHtml(str));
                                }
                                OSFilePlaybackFragment.this.dismissJuHuaDialog();
                                Collections.reverse(OSFilePlaybackFragment.this.file_list);
                                if (OSFilePlaybackFragment.this.adapter != null) {
                                    OSFilePlaybackFragment.this.adapter.notifyDataSetChanged();
                                    return;
                                }
                                return;
                            }
                            return;
                        }
                        return;
                    }
                    return;
                case HiDataValue.HANDLE_MESSAGE_DOWNLOAD_STATE:
                    OSFilePlaybackFragment.this.handDownLoad(message);
                    return;
                case 1048577:
                    OSFilePlaybackFragment.this.handNETWORK_CHANGED();
                    return;
                default:
                    return;
            }
        }
    };

    @Override
    public void callbackDownloadSnapData(HiCamera hiCamera, int i, byte[] bArr, int i2, int i3) {
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(R.layout.fragment_os_file_playback, (ViewGroup) null);
        ButterKnife.bind(this, inflate);
        getIntentData();
        OSTimeAxisActivity oSTimeAxisActivity = this.mAct;
        if (oSTimeAxisActivity != null && HiTools.cameraWhetherNull(this.mMyCamera, oSTimeAxisActivity)) {
            return null;
        }
        initView();
        setOnListeners();
        return inflate;
    }

    private void setOnListeners() {
        this.btn_floatingaction.setOnClickListener(this);
    }

    private void initView() {
        this.searchTimeView = getLayoutInflater().inflate(R.layout.search_event_result, (ViewGroup) null);
        this.loadingView = getLayoutInflater().inflate(R.layout.loading_events, (ViewGroup) null);
        ((LinearLayout) this.searchTimeView.findViewById(R.id.ll_sort)).setOnClickListener(this);
        this.tv_sort = (TextView) this.searchTimeView.findViewById(R.id.tv_sort);
        this.iv_arrow = (ImageView) this.searchTimeView.findViewById(R.id.iv_arrow);
        this.list_video_online.setOverScrollMode(2);
    }

    private void getIntentData() {
        String string = getArguments().getString(HiDataValue.EXTRAS_KEY_UID);
        if (TextUtils.isEmpty(string)) {
            return;
        }
        for (MyCamera myCamera : HiDataValue.CameraList) {
            if (string.equals(myCamera.getUid())) {
                this.mMyCamera = myCamera;
                return;
            }
        }
    }

    private void searchVideo() {
        long beforeHourTime = getBeforeHourTime(6);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(TimeUtil.FORMAT_DATE_TIME_FULL, Locale.getDefault());
        ListView listView = this.list_video_online;
        if (listView == null) {
            return;
        }
        listView.addFooterView(this.loadingView);
        if (this.list_video_online.getHeaderViewsCount() == 0) {
            this.list_video_online.addHeaderView(this.searchTimeView);
        }
        if (this.mAct == null) {
            return;
        }
        if (this.mMyCamera.getIsLiteOs()) {
            this.hideSize = this.mMyCamera.appGetCommandFunction(65594);
        } else {
            this.hideSize = this.mMyCamera.appGetCommandFunction(ConstantCommand.HI_P2P_SUPPORT_SDPERCENT);
        }
        VideoOnlineListAdapter videoOnlineListAdapter = new VideoOnlineListAdapter(this.mAct, this.file_list, this.hideSize);
        this.adapter = videoOnlineListAdapter;
        this.list_video_online.setAdapter((ListAdapter) videoOnlineListAdapter);
        this.list_video_online.setOnItemClickListener(this);
        ((TextView) this.searchTimeView.findViewById(R.id.txtSearchTimeDuration)).setText(simpleDateFormat.format(new Date(beforeHourTime)) + " - " + HiTools.sdfTimeSec(System.currentTimeMillis()));
        MyCamera myCamera = this.mMyCamera;
        if (myCamera != null) {
            if (myCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_NODST)) {
                this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_NODST, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, beforeHourTime, System.currentTimeMillis(), (byte) 0, 0));
                return;
            }
            if (this.mMyCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_NEW)) {
                this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_NEW, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, beforeHourTime, System.currentTimeMillis(), (byte) 0, 1));
            } else if (this.mMyCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_EXT)) {
                this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_EXT, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, beforeHourTime, System.currentTimeMillis(), (byte) 0, 1));
            } else {
                this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, beforeHourTime, System.currentTimeMillis(), (byte) 0, 1));
            }
        }
    }

    public long getBeforeHourTime(int i) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(11, calendar.get(11) - i);
        return calendar.getTimeInMillis();
    }

    public class ConnectionChangeReceiver extends BroadcastReceiver {
        public ConnectionChangeReceiver() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            NetworkInfo networkInfo = connectivityManager.getNetworkInfo(0);
            NetworkInfo networkInfo2 = connectivityManager.getNetworkInfo(1);
            if (networkInfo == null || networkInfo.isConnected() || networkInfo2 == null || networkInfo2.isConnected() || !OSFilePlaybackFragment.this.isDownloading) {
                return;
            }
            OSFilePlaybackFragment.this.handler.sendEmptyMessage(1048577);
        }
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id != R.id.btn_floatingaction) {
            if (id != R.id.ll_sort) {
                return;
            }
            if (this.mIsDataReceveEnd) {
                TextView textView = this.tv_sort;
                if (textView == null || this.iv_arrow == null) {
                    return;
                }
                textView.setText(getString(this.mIsDown ? R.string.asce : R.string.desc));
                this.iv_arrow.animate().rotation(this.mIsDown ? 180.0f : 0.0f).setDuration(400L).start();
                Collections.reverse(this.file_list);
                this.adapter.setClickItemPosition(-10);
                this.adapter.notifyDataSetChanged();
                this.mIsDown = !this.mIsDown;
                return;
            }
            OSTimeAxisActivity oSTimeAxisActivity = this.mAct;
            if (oSTimeAxisActivity != null) {
                MyToast.showToast(oSTimeAxisActivity, getString(R.string.data_get_wait));
                return;
            }
            return;
        }
        if (System.currentTimeMillis() - this.currentMills < 500) {
            return;
        }
        this.currentMills = System.currentTimeMillis();
        OSTimeAxisActivity oSTimeAxisActivity2 = this.mAct;
        if (oSTimeAxisActivity2 != null) {
            if (!this.mIsDataReceveEnd) {
                MyToast.showToast(oSTimeAxisActivity2, getString(R.string.data_get_wait));
                return;
            }
            if (!this.mMyCamera.getdevDual()) {
                this.mMyCamera.stopPlaybackNew();
            } else if (this.mMyCamera.mPBFastsdk != null) {
                if (this.mAct.isDownloading || this.mAct.isCallDownload) {
                    this.mMyCamera.stopPlaybackFast(true);
                }
                this.mMyCamera.isFirstPlayOsDual = true;
                this.mMyCamera.mPBFastsdk.StopDownFast();
                this.mMyCamera.mPBFastsdk.StopPlayLocal();
                this.mAct.isDownloading = false;
                this.mAct.isCallDownload = false;
            }
            EventBus.getDefault().post(new MsyIsStop(true));
            Intent intent = new Intent(this.mAct, (Class<?>) SearchSDCardVideoActivity.class);
            intent.putExtra(HiDataValue.EXTRAS_KEY_UID, this.mMyCamera.getUid());
            startActivityForResult(intent, 1);
            this.mAct.overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
        }
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i2 == -1) {
            this.tv_sort.setText(getString(R.string.desc));
            this.mIsDown = true;
            this.iv_arrow.animate().rotation(0.0f).setDuration(0L).start();
            Bundle bundleExtra = intent.getBundleExtra("data");
            long j = bundleExtra.getLong("START TIME");
            long j2 = bundleExtra.getLong("END TIME");
            this.mType = intent.getIntExtra("type", 5);
            this.file_list.clear();
            this.adapter.setClickItemPosition(-10);
            this.adapter.notifyDataSetChanged();
            MyCamera myCamera = this.mMyCamera;
            if (myCamera != null) {
                this.mIsDataReceveEnd = false;
                if (myCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_NODST)) {
                    this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_NODST, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, j, j2, (byte) 0, 0));
                } else if (this.mMyCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_NEW)) {
                    this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_NEW, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, j, j2, (byte) 0, 1));
                } else if (this.mMyCamera.appGetCommandFunction(HiChipDefines.HI_P2P_PB_QUERY_START_EXT)) {
                    this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START_EXT, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, j, j2, (byte) 0, 1));
                } else {
                    this.mMyCamera.sendIOCtrl(HiChipDefines.HI_P2P_PB_QUERY_START, HiChipDefines.HI_P2P_S_PB_LIST_REQ.parseContent(0, j, j2, (byte) 0, 1));
                }
            }
            this.list_video_online.setVisibility(0);
            this.tv_nothing.setVisibility(8);
            if (this.list_video_online.getHeaderViewsCount() == 0) {
                this.list_video_online.addHeaderView(this.searchTimeView);
            }
            if (this.list_video_online.getFooterViewsCount() == 0) {
                this.list_video_online.addFooterView(this.loadingView);
            }
            ((TextView) this.searchTimeView.findViewById(R.id.txtSearchTimeDuration)).setText(HiTools.sdfTimeSec(j) + " - " + HiTools.sdfTimeSec(j2));
            this.mMyCamera.registerIOSessionListener(this);
        }
    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, final int i, long j) {
        if (System.currentTimeMillis() - this.currentMills < 500) {
            return;
        }
        this.currentMills = System.currentTimeMillis();
        int i2 = i - 1;
        if (i2 >= 0) {
            this.adapter.setClickItemPosition(i2);
            this.adapter.notifyDataSetChanged();
        }
        if (HiTools.isCustomFastClick(1000)) {
            return;
        }
        this.list_video_online.postDelayed(new Runnable() {
            @Override
            public final void run() {
                OSFilePlaybackFragment.this.lambda$onItemClick$0$OSFilePlaybackFragment(i);
            }
        }, 150L);
    }

    public void lambda$onItemClick$0$OSFilePlaybackFragment(int i) {
        OSTimeAxisActivity oSTimeAxisActivity;
        final int headerViewsCount = i - this.list_video_online.getHeaderViewsCount();
        if (headerViewsCount >= 0 && (oSTimeAxisActivity = this.mAct) != null) {
            View inflate = View.inflate(oSTimeAxisActivity, R.layout.popview_video_online, null);
            final PopupWindow popupWindow = new PopupWindow(inflate);
            popupWindow.setBackgroundDrawable(new ColorDrawable(0));
            popupWindow.setWidth(-1);
            popupWindow.setHeight(-1);
            popupWindow.setFocusable(true);
            popupWindow.showAtLocation(inflate, 17, 0, 0);
            this.evt = this.file_list.get(headerViewsCount);
            TextView textView = (TextView) inflate.findViewById(R.id.pup_vo_item_tv_state);
            String[] stringArray = getResources().getStringArray(R.array.online_recording_type);
            if (this.evt.EventType <= 3 && this.evt.EventType >= 0) {
                textView.setText(stringArray[this.evt.EventType]);
            }
            TextView textView2 = (TextView) inflate.findViewById(R.id.pup_vo_item_tv_time);
            String[] split = this.evt.sStartTime.toString().split(" ");
            textView2.setText(split[0] + "   " + split[1] + " - " + this.evt.sEndTime.toString().split(" ")[1]);
            ((TextView) inflate.findViewById(R.id.tv_play_video_online)).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    OSFilePlaybackFragment.this.lambda$popupMethod$2$OSFilePlaybackFragment(popupWindow, headerViewsCount, view);
                }
            });
            ((TextView) inflate.findViewById(R.id.tv_downlinad_video_online)).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    OSFilePlaybackFragment.this.lambda$popupMethod$3$OSFilePlaybackFragment(popupWindow, headerViewsCount, view);
                }
            });
            ((TextView) inflate.findViewById(R.id.tv_downlinad_video_cancel)).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    popupWindow.dismiss();
                }
            });
        }
    }

    public void lambda$popupMethod$2$OSFilePlaybackFragment(PopupWindow popupWindow, final int i, View view) {
        popupWindow.dismiss();
        MyCamera myCamera = this.mMyCamera;
        if (myCamera == null) {
            return;
        }
        if (!myCamera.getdevDual()) {
            this.mMyCamera.stopPlaybackNew();
        } else if (this.mMyCamera.mPBFastsdk != null) {
            if (this.mAct.isDownloading || this.mAct.isCallDownload) {
                this.mMyCamera.stopPlaybackFast(true);
            }
            this.mMyCamera.isFirstPlayOsDual = true;
            this.mMyCamera.mPBFastsdk.StopDownFast();
            this.mMyCamera.mPBFastsdk.StopPlayLocal();
            this.mAct.isDownloading = false;
            this.mAct.isCallDownload = false;
        }
        EventBus.getDefault().post(new MsyIsStop(true));
        this.list_video_online.postDelayed(new Runnable() {
            @Override
            public final void run() {
                OSFilePlaybackFragment.this.lambda$popupMethod$1$OSFilePlaybackFragment(i);
            }
        }, 100L);
    }

    public void lambda$popupMethod$3$OSFilePlaybackFragment(PopupWindow popupWindow, int i, View view) {
        popupWindow.dismiss();
        if (this.mAct == null || HiTools.HiPermission(getActivity(), getActivity(), 1, MY_PERMISSION_REQUEST_CODE)) {
            return;
        }
        downloadRecording(i, this.evt);
    }

    public void lambda$popupMethod$1$OSFilePlaybackFragment(int i) {
        if (this.mMyCamera == null) {
            return;
        }
        ConstantCommand.HI_P2P_FILE_INFO hi_p2p_file_info = this.file_list.get(i);
        Bundle bundle = new Bundle();
        bundle.putString(HiDataValue.EXTRAS_KEY_UID, this.mMyCamera.getUid());
        bundle.putByteArray("st", hi_p2p_file_info.sStartTime.parseContent());
        bundle.putByteArray("end", hi_p2p_file_info.sEndTime.parseContent());
        long timeInMillis2 = hi_p2p_file_info.sStartTime.getTimeInMillis2();
        long timeInMillis22 = hi_p2p_file_info.sEndTime.getTimeInMillis2();
        bundle.putLong("VIDEO START TIME", timeInMillis2);
        bundle.putLong("VIDEO END TIME", timeInMillis22);
        String[] split = hi_p2p_file_info.sEndTime.toString().split(" ");
        String[] split2 = hi_p2p_file_info.sStartTime.toString().split(" ");
        bundle.putString("title", split2[0] + "   " + split2[1] + Constants.ACCEPT_TIME_SEPARATOR_SERVER + split[1]);
        Intent intent = new Intent();
        intent.putExtras(bundle);
        if (this.mMyCamera.isWallMounted) {
            intent.setClass(this.mAct, WallMountedOnlineActivity.class);
            startActivity(intent);
            return;
        }
        if (this.mMyCamera.isFishEye()) {
            intent.setClass(this.mAct, FishPlaybackOnlineActivity.class);
        } else if (!this.mMyCamera.getdevDual()) {
            intent.setClass(this.mAct, PlaybackOnlineActivity.class);
        } else {
            intent.setClass(this.mAct, OSPlaybackFastOnlineDualActivity.class);
        }
        startActivity(intent);
        EventBus.getDefault().post(new FilePlaybackModel(true));
    }

    private void downloadRecording(int i, final ConstantCommand.HI_P2P_FILE_INFO hi_p2p_file_info) {
        if (HiTools.isSDCardValid()) {
            File file = new File(HiDataValue.getPathCameraVideoOnLineDownLoad(this.mMyCamera.getUid(), this.mAct));
            if (!file.exists()) {
                file.mkdirs();
            }
            this.download_path = file.getAbsoluteFile() + "/";
            this.fileName = splitFileName(hi_p2p_file_info.sStartTime.toString());
            File file2 = new File(this.download_path + this.fileName + ".avi");
            File file3 = new File(this.download_path + this.fileName + ".mp4");
            File file4 = new File(this.download_path + this.fileName + ".h264");
            File file5 = new File(this.download_path + this.fileName + ".h265");
            if (file2.exists() || file3.exists() || file4.exists() || file5.exists()) {
                View inflate = View.inflate(this.mAct, R.layout.popuwindow_aleary_down, null);
                final PopupWindow popupWindow = new PopupWindow(inflate);
                popupWindow.setBackgroundDrawable(new ColorDrawable(0));
                popupWindow.setFocusable(true);
                popupWindow.setWidth(-1);
                popupWindow.setHeight(-1);
                popupWindow.showAtLocation(inflate, 17, 0, 0);
                ((TextView) inflate.findViewById(R.id.item_tv_know)).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        popupWindow.dismiss();
                    }
                });
                return;
            }
            showLoadDialog(getString(R.string.tips_loading) + "...", false, false);
            if (!this.mMyCamera.getdevDual()) {
                this.mMyCamera.stopPlaybackNew();
            } else if (this.mMyCamera.mPBFastsdk != null) {
                if (this.mAct.isDownloading || this.mAct.isCallDownload) {
                    this.mMyCamera.stopPlaybackFast(true);
                }
                this.mMyCamera.isFirstPlayOsDual = true;
                this.mMyCamera.mPBFastsdk.StopDownFast();
                this.mMyCamera.mPBFastsdk.StopPlayLocal();
                this.mAct.isDownloading = false;
                this.mAct.isCallDownload = false;
            }
            new Thread() {
                @Override
                public void run() {
                    OSFilePlaybackFragment.this.mMyCamera.startDownloadRecording2(hi_p2p_file_info.sStartTime, OSFilePlaybackFragment.this.download_path, OSFilePlaybackFragment.this.fileName, 2);
                }
            }.start();
            EventBus.getDefault().post(new MsyIsStop(true));
            return;
        }
        Toast.makeText(this.mAct, getText(R.string.tips_no_sdcard).toString(), 0).show();
    }

    private String splitFileName(String str) {
        long j;
        try {
            j = new SimpleDateFormat(TimeUtil.FORMAT_DATE_TIME_FULL).parse(str).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
            j = 0;
        }
        return new SimpleDateFormat(TimeUtil.FORMAT_DATE_TIME_NEW2).format(Long.valueOf(j));
    }

    @Override
    public void receiveSessionState(HiCamera hiCamera, int i) {
        Message obtainMessage = this.handler.obtainMessage();
        obtainMessage.what = HiDataValue.HANDLE_MESSAGE_SESSION_STATE;
        obtainMessage.arg1 = i;
        obtainMessage.obj = hiCamera;
        this.handler.sendMessage(obtainMessage);
    }

    @Override
    public void receiveIOCtrlData(HiCamera hiCamera, int i, byte[] bArr, int i2) {
        Bundle bundle = new Bundle();
        bundle.putByteArray("data", bArr);
        Message obtainMessage = this.handler.obtainMessage();
        obtainMessage.what = HiDataValue.HANDLE_MESSAGE_RECEIVE_IOCTRL;
        obtainMessage.obj = hiCamera;
        obtainMessage.arg1 = i;
        obtainMessage.arg2 = i2;
        obtainMessage.setData(bundle);
        this.handler.sendMessage(obtainMessage);
    }

    @Override
    public void callbackDownloadState(HiCamera hiCamera, int i, int i2, int i3, String str) {
        if (hiCamera != this.mMyCamera) {
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putLong("total", i);
        bundle.putLong("curSize", i2);
        bundle.putString(ClientCookie.PATH_ATTR, str);
        Message obtainMessage = this.handler.obtainMessage();
        obtainMessage.what = HiDataValue.HANDLE_MESSAGE_DOWNLOAD_STATE;
        obtainMessage.arg1 = i3;
        obtainMessage.setData(bundle);
        this.handler.sendMessage(obtainMessage);
    }

    public void handNETWORK_CHANGED() {
        if (this.isDownloading) {
            this.isDownloading = false;
            MyCamera myCamera = this.mMyCamera;
            if (myCamera != null) {
                myCamera.stopDownloadRecording();
                if (!TextUtils.isEmpty(this.path)) {
                    File file = new File(this.path);
                    if (file.isFile() && file.exists()) {
                        file.delete();
                    }
                }
            }
            MyToast.showToast(this.mAct, getString(R.string.tips_network_disconnect));
        }
    }

    @Override
    public void setUserVisibleHint(boolean z) {
        super.setUserVisibleHint(z);
        this.mIsVisibleToUser = z;
        if (z) {
            MyCamera myCamera = this.mMyCamera;
            if (myCamera != null) {
                myCamera.registerDownloadListener(this);
                return;
            }
            return;
        }
        MyCamera myCamera2 = this.mMyCamera;
        if (myCamera2 != null) {
            myCamera2.unregisterDownloadListener(this);
        }
    }

    public void handDownLoad(Message message) {
        float f;
        Bundle data = message.getData();
        int i = message.arg1;
        if (i == -3) {
            HiLogcatUtil.e("######  os filePlaybackFragment  DOWNLOAD_ONLINE_STATE_ERROR  #########");
            MyCamera myCamera = this.mMyCamera;
            if (myCamera != null) {
                myCamera.stopDownloadRecording();
                this.mMyCamera.setReconnectTimes(10);
            }
            if (getActivity() != null) {
                Toast.makeText(getActivity(), getString(R.string.play_4k_sd_error), 1).show();
            }
            dismissLoadDialog();
            OSTimeAxisActivity oSTimeAxisActivity = this.mAct;
            if (oSTimeAxisActivity != null) {
                oSTimeAxisActivity.finish();
                return;
            }
            return;
        }
        if (i == 0) {
            if (isAdded()) {
                dismissLoadDialog();
            }
            showPopPupProgress();
            this.isDownloading = true;
            this.path = data.getString(ClientCookie.PATH_ATTR);
            return;
        }
        if (i == 1) {
            if (this.isDownloading) {
                long j = data.getLong("total");
                if (j == 0) {
                    f = (float) ((data.getLong("curSize") * 100) / 1048576);
                } else {
                    f = (float) ((data.getLong("curSize") * 100) / j);
                }
                if (f >= 100.0f) {
                    f = 99.0f;
                }
                int i2 = (int) f;
                CircleProgressBar circleProgressBar = this.circleprogressbar;
                if (circleProgressBar != null) {
                    circleProgressBar.setProgress(i2);
                    return;
                }
                return;
            }
            return;
        }
        if (i != 2) {
            if (i == 3) {
                MyToast.showToast(this.mAct, getString(R.string.tips_wifi_connect_failed));
                dismissLoadDialog();
                return;
            }
            if (i != 4) {
                return;
            }
            MyCamera myCamera2 = this.mMyCamera;
            if (myCamera2 != null && this.isDownloading) {
                myCamera2.stopDownloadRecording();
                this.isDownloading = false;
                this.mMyCamera.disconnect(1);
                wakeUpAndConnect(this.mMyCamera);
                if (!TextUtils.isEmpty(this.path)) {
                    File file = new File(this.path);
                    if (file.isFile() && file.exists()) {
                        file.delete();
                    }
                }
            }
            dismissLoadDialog();
            return;
        }
        ConstantCommand.HI_P2P_FILE_INFO hi_p2p_file_info = this.evt;
        if (hi_p2p_file_info != null) {
            SharePreUtils.putInt(HiDataValue.CACHE, this.mAct, this.fileName, hi_p2p_file_info.EventType);
        }
        CircleProgressBar circleProgressBar2 = this.circleprogressbar;
        if (circleProgressBar2 != null) {
            circleProgressBar2.setProgress(100);
        }
        this.isDownloading = false;
        TextView textView = this.tv_cancel_downloading_video;
        if (textView != null) {
            textView.setText(R.string.continue_down);
        }
        TextView textView2 = this.tv_goto_downloading_video;
        if (textView2 != null) {
            textView2.setVisibility(0);
        }
        if (this.popu_tips_down != null && isAdded()) {
            this.popu_tips_down.setText(getString(R.string.download_done));
        }
        CircleProgressBar circleProgressBar3 = this.circleprogressbar;
        if (circleProgressBar3 != null) {
            circleProgressBar3.setVisibility(8);
        }
        TextView textView3 = this.tv_one;
        if (textView3 != null) {
            textView3.setVisibility(0);
        }
        TextView textView4 = this.tv_two;
        if (textView4 != null) {
            textView4.setVisibility(0);
        }
        ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.tv_one, "Alpha", 0.0f, 1.0f);
        ofFloat.setDuration(300L);
        ofFloat.start();
        ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(this.tv_two, "Alpha", 0.0f, 1.0f);
        ofFloat2.setDuration(300L);
        ofFloat2.start();
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.mAct = (OSTimeAxisActivity) context;
    }

    private void showPopPupProgress() {
        if (this.mAct != null && this.mIsVisibleToUser) {
            HiLogcatUtil.dTag(HiLogcatUtil.TAG_Google, "1111111");
            View inflate = LayoutInflater.from(this.mAct).inflate(R.layout.pup_loading_video, (ViewGroup) null, false);
            this.downloadPopupWindow = new PopupWindow(inflate);
            this.downloadPopupWindow.setBackgroundDrawable(new ColorDrawable(0));
            this.downloadPopupWindow.setFocusable(true);
            this.downloadPopupWindow.setWidth(-1);
            this.downloadPopupWindow.setHeight(-1);
            this.circleprogressbar = (CircleProgressBar) inflate.findViewById(R.id.circleprogressbar);
            this.popu_tips_down = (TextView) inflate.findViewById(R.id.popu_tips_down);
            this.tv_one = (TextView) inflate.findViewById(R.id.tv_one);
            this.tv_two = (TextView) inflate.findViewById(R.id.tv_two);
            if (this.mAct.isFinishing()) {
                return;
            }
            this.downloadPopupWindow.showAtLocation(inflate, 17, 0, 0);
            String[] stringArray = getResources().getStringArray(R.array.online_recording_type);
            ConstantCommand.HI_P2P_FILE_INFO hi_p2p_file_info = this.evt;
            if (hi_p2p_file_info == null) {
                return;
            }
            if (hi_p2p_file_info.EventType <= 3 && this.evt.EventType >= 0) {
                this.popu_tips_down.setText(stringArray[this.evt.EventType]);
            }
            this.downloadPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
                @Override
                public void onDismiss() {
                    OSFilePlaybackFragment.this.isDownloading = false;
                    if (OSFilePlaybackFragment.this.mMyCamera != null) {
                        OSFilePlaybackFragment.this.mMyCamera.stopDownloadRecording();
                    }
                    if (!OSFilePlaybackFragment.this.isClickCancel && !OSFilePlaybackFragment.this.getString(R.string.continue_down).equals(OSFilePlaybackFragment.this.tv_cancel_downloading_video.getText().toString().trim())) {
                        OSFilePlaybackFragment.this.deleteLoadingFile();
                    }
                    OSFilePlaybackFragment.this.isClickCancel = false;
                }
            });
            TextView textView = (TextView) inflate.findViewById(R.id.tv_cancel_downloading_video);
            this.tv_cancel_downloading_video = textView;
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (OSFilePlaybackFragment.this.getString(R.string.continue_down).equals(OSFilePlaybackFragment.this.tv_cancel_downloading_video.getText().toString().trim())) {
                        OSFilePlaybackFragment.this.isClickCancel = true;
                        OSFilePlaybackFragment.this.downloadPopupWindow.dismiss();
                    } else {
                        OSFilePlaybackFragment.this.downloadPopupWindow.dismiss();
                        OSFilePlaybackFragment.this.isClickCancel = true;
                        OSFilePlaybackFragment.this.deleteLoadingFile();
                    }
                }
            });
            TextView textView2 = (TextView) inflate.findViewById(R.id.tv_goto_downloading_video);
            this.tv_goto_downloading_video = textView2;
            textView2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    OSFilePlaybackFragment.this.isClickCancel = true;
                    OSFilePlaybackFragment.this.downloadPopupWindow.dismiss();
                    if (!OSFilePlaybackFragment.this.mMyCamera.getdevDual()) {
                        OSFilePlaybackFragment.this.mMyCamera.stopPlaybackNew();
                    } else if (OSFilePlaybackFragment.this.mMyCamera.mPBFastsdk != null) {
                        if (OSFilePlaybackFragment.this.mAct.isDownloading || OSFilePlaybackFragment.this.mAct.isCallDownload) {
                            OSFilePlaybackFragment.this.mMyCamera.stopPlaybackFast(true);
                        }
                        OSFilePlaybackFragment.this.mMyCamera.isFirstPlayOsDual = true;
                        OSFilePlaybackFragment.this.mMyCamera.mPBFastsdk.StopDownFast();
                        OSFilePlaybackFragment.this.mMyCamera.mPBFastsdk.StopPlayLocal();
                        OSFilePlaybackFragment.this.mAct.isDownloading = false;
                        OSFilePlaybackFragment.this.mAct.isCallDownload = false;
                    }
                    EventBus.getDefault().post(new MsyIsStop(true));
                    Intent intent = new Intent(OSFilePlaybackFragment.this.mAct, (Class<?>) LocalFileActivity2.class);
                    intent.putExtra(HiDataValue.EXTRAS_KEY_UID, OSFilePlaybackFragment.this.mMyCamera.getUid());
                    OSFilePlaybackFragment.this.startActivity(intent);
                }
            });
        }
    }

    public void deleteLoadingFile() {
        new File(this.path).delete();
    }

    private void registerCompent() {
        MyCamera myCamera = this.mMyCamera;
        if (myCamera != null) {
            myCamera.registerIOSessionListener(this);
            this.mMyCamera.registerDownloadListener(this);
        }
        IntentFilter intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
        ConnectionChangeReceiver connectionChangeReceiver = new ConnectionChangeReceiver();
        this.myReceiver = connectionChangeReceiver;
        this.mAct.registerReceiver(connectionChangeReceiver, intentFilter);
    }

    private void unregisterCompent() {
        MyCamera myCamera = this.mMyCamera;
        if (myCamera != null) {
            myCamera.unregisterIOSessionListener(this);
            this.mMyCamera.unregisterDownloadListener(this);
        }
        ConnectionChangeReceiver connectionChangeReceiver = this.myReceiver;
        if (connectionChangeReceiver != null) {
            try {
                this.mAct.unregisterReceiver(connectionChangeReceiver);
            } catch (Exception unused) {
            }
        }
    }

    @Override
    public void onResume() {
        OSTimeAxisActivity oSTimeAxisActivity;
        super.onResume();
        registerCompent();
        if (this.mMyCamera != null || (oSTimeAxisActivity = this.mAct) == null) {
            return;
        }
        oSTimeAxisActivity.finish();
    }

    @Override
    public void onPause() {
        PopupWindow popupWindow;
        super.onPause();
        unregisterCompent();
        if (this.isDownloading && (popupWindow = this.downloadPopupWindow) != null && popupWindow.isShowing()) {
            this.downloadPopupWindow.dismiss();
            deleteLoadingFile();
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.isDownloading = false;
        Handler handler = this.handler;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
        List<ConstantCommand.HI_P2P_FILE_INFO> list = this.file_list;
        if (list != null && list.size() > 0) {
            this.file_list.clear();
        }
        dismissLoadDialog();
    }

    public void getStart() {
        if (this.mMyCamera.getConnectState() != 4) {
            this.list_video_online.setVisibility(8);
            this.tv_not_online.setVisibility(0);
        } else {
            searchVideo();
        }
    }

    public void wakeUpAndConnect(MyCamera myCamera) {
        if (getContext() == null) {
            return;
        }
        Intent intent = new Intent(getContext(), (Class<?>) WakeUpDevService.class);
        intent.putExtra(HiDataValue.EXTRAS_KEY_UID, myCamera.getUid());
        getContext().startService(intent);
    }

    public void showgoRechargeHint(final MyCamera myCamera) {
        if (myCamera.misshowgoRecharge) {
            return;
        }
        this.not_hint = false;
        final Dialog dialog = new Dialog(this.mAct, R.style.CustomDialog);
        dialog.setCancelable(false);
        View inflate = View.inflate(this.mAct, R.layout.dialog_recharge_hint, null);
        TextView textView = (TextView) inflate.findViewById(R.id.rechage_tit);
        final ImageView imageView = (ImageView) inflate.findViewById(R.id.iv);
        TextView textView2 = (TextView) inflate.findViewById(R.id.rechage_name);
        TextView textView3 = (TextView) inflate.findViewById(R.id.rechage_uid);
        if (myCamera.mPreICCIDRecharge == 2) {
            textView.setText(getString(R.string.recharge_hint_meg1));
        }
        textView2.setText(myCamera.getNikeName());
        textView3.setText(myCamera.getUid());
        inflate.findViewById(R.id.ll_not_hint_again).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                OSFilePlaybackFragment.this.lambda$showgoRechargeHint$5$OSFilePlaybackFragment(imageView, myCamera, view);
            }
        });
        inflate.findViewById(R.id.tv_know).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                OSFilePlaybackFragment.this.lambda$showgoRechargeHint$6$OSFilePlaybackFragment(myCamera, dialog, view);
            }
        });
        inflate.findViewById(R.id.tv_gorecharge).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                OSFilePlaybackFragment.this.lambda$showgoRechargeHint$7$OSFilePlaybackFragment(myCamera, dialog, view);
            }
        });
        dialog.addContentView(inflate, new ActionBar.LayoutParams(-1, -2));
        Window window = dialog.getWindow();
        Objects.requireNonNull(window);
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.width = (int) (getResources().getDisplayMetrics().widthPixels * 0.85d);
        dialog.getWindow().setAttributes(attributes);
        dialog.show();
    }

    public void lambda$showgoRechargeHint$5$OSFilePlaybackFragment(ImageView imageView, MyCamera myCamera, View view) {
        if (this.not_hint) {
            this.not_hint = false;
            imageView.setImageResource(R.mipmap.checkboc_unselect);
            myCamera.setPreICCIDRecharge(1);
        } else {
            this.not_hint = true;
            imageView.setImageResource(R.mipmap.checkbox_select);
            myCamera.setPreICCIDRecharge(0);
        }
    }

    public void lambda$showgoRechargeHint$6$OSFilePlaybackFragment(MyCamera myCamera, Dialog dialog, View view) {
        myCamera.misshowgoRecharge = true;
        dialog.dismiss();
        this.mAct.finish();
    }

    public void lambda$showgoRechargeHint$7$OSFilePlaybackFragment(MyCamera myCamera, Dialog dialog, View view) {
        Uri parse;
        myCamera.misshowgoRecharge = true;
        dialog.dismiss();
        if (!TextUtils.isEmpty(myCamera.getICCID())) {
            if (myCamera.getPreICCIDType() == 1) {
                parse = Uri.parse(newAddress + myCamera.getICCID());
            } else if (myCamera.getPreICCIDType() == 2 || myCamera.getPreICCIDType() == 3) {
                parse = Uri.parse("https://www.wxkjwlw.com/wechat/cardDetail/" + myCamera.getICCID() + "?platformId=" + myCamera.getPreICCIDOperator() + "&gzhConfigId=77");
            } else {
                parse = Uri.parse(oldAddress + myCamera.getICCID() + oldAddressID);
            }
            startActivity(new Intent("android.intent.action.VIEW", parse));
        }
        this.mAct.finish();
    }

    @Override
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        boolean z = true;
        HiLogcatUtil.e("" + i);
        int length = strArr.length;
        for (int i2 = 0; i2 < length; i2++) {
            HiLogcatUtil.e(strArr.length + Constants.COLON_SEPARATOR + strArr[i2]);
        }
        for (int i3 : iArr) {
            HiLogcatUtil.e(iArr.length + Constants.COLON_SEPARATOR + i3);
        }
        if (i == 10027) {
            int length2 = iArr.length;
            int i4 = 0;
            while (true) {
                if (i4 >= length2) {
                    break;
                }
                if (iArr[i4] != 0) {
                    z = false;
                    break;
                }
                i4++;
            }
            if (z) {
                return;
            }
            HiTools.Hi_GoToSetting(strArr, getActivity(), getActivity());
        }
    }
}