| | |
| | | import android.location.LocationManager; |
| | | import android.os.IBinder; |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.core.app.ActivityCompat; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | |
| | | import com.hdl.photovoltaic.uni.HDLUniMPSDKManager; |
| | | import com.hdl.photovoltaic.utils.NetworkUtils; |
| | | import com.hdl.photovoltaic.utils.WifiUtils; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.sdk.link.common.exception.HDLLinkCode; |
| | | import com.hdl.sdk.link.common.exception.HDLLinkException; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | |
| | | break; |
| | | |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL.equals(topic)) { |
| | | //其它模块 |
| | | switch (type) { |
| | | //获取温度单位 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNIT: { |
| | | uniCallbackData(mode_type, UserConfigManage.getInstance().getTemperature_unit(), callback); |
| | | } |
| | | break; |
| | | //获取当前app语言 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_APP_LANGUAGE: { |
| | | uniCallbackData(mode_type, UserConfigManage.getInstance().getCurrentAppLanguage(), callback); |
| | | } |
| | | break; |
| | | //获取位置信息 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOCATION_INFO: { |
| | | this.uniGetLocationInfo(mode_type, data, callback); |
| | | } |
| | | break; |
| | | //应用冲突 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT: { |
| | | if (callback != null) { |
| | | uniCallbackData(type, HDLUdpConnect.getInstance().isBindSuccess(), callback); |
| | | } |
| | | } |
| | | break; |
| | | //专门收集uni日志 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNI_LOG: { |
| | | String customizeContentFormat = getKeyValue("customizeContentFormat", getKeyValue("data", data)); |
| | | HdlLogLogic.print("uni--->log--->" + customizeContentFormat, true); |
| | | |
| | | } |
| | | break; |
| | | //uni主页点击返回通知 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK: { |
| | | //EventBus事件分发 |
| | | BaseEventBus baseEventBus = new BaseEventBus(); |
| | | baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL); |
| | | baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK); |
| | | EventBus.getDefault().post(baseEventBus); |
| | | |
| | | } |
| | | break; |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_MINE_MODEL.equals(topic)) { |
| | | //我的模块 |
| | | switch (type) { |
| | |
| | | |
| | | |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL.equals(topic)) { |
| | | //其它模块 |
| | | switch (type) { |
| | | //获取温度单位 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNIT: { |
| | | uniCallbackData(mode_type, UserConfigManage.getInstance().getTemperature_unit(), callback); |
| | | } |
| | | break; |
| | | //获取当前app语言 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_APP_LANGUAGE: { |
| | | uniCallbackData(mode_type, UserConfigManage.getInstance().getCurrentAppLanguage(), callback); |
| | | } |
| | | break; |
| | | //获取位置信息 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOCATION_INFO: { |
| | | this.uniGetLocationInfo(mode_type, data, callback); |
| | | } |
| | | break; |
| | | //应用冲突 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT: { |
| | | if (callback != null) { |
| | | uniCallbackData(type, HDLUdpConnect.getInstance().isBindSuccess(), callback); |
| | | } |
| | | } |
| | | break; |
| | | //专门收集uni日志 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNI_LOG: { |
| | | String customizeContentFormat = getKeyValue("customizeContentFormat", getKeyValue("data", data)); |
| | | HdlLogLogic.print("uni--->log--->" + customizeContentFormat, true); |
| | | |
| | | } |
| | | break; |
| | | //uni主页点击返回通知 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK: { |
| | | //EventBus事件分发 |
| | | BaseEventBus baseEventBus = new BaseEventBus(); |
| | | baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL); |
| | | baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK); |
| | | EventBus.getDefault().post(baseEventBus); |
| | | |
| | | } |
| | | break; |
| | | //uni通知原生退出登录 |
| | | case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOGOUT: { |
| | | HDLLinkPMUser.getInstance().logout(0); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |