| | |
| | | };
|
| | | }
|
| | |
|
| | | /**
|
| | | * 格式化SD卡
|
| | | * @param deviceId
|
| | | * @param iRecoverSDCardCallBack
|
| | | */
|
| | | public void recoverSDCard(final String deviceId, final IGetDeviceInfoCallBack.IRecoverSDCardCallBack iRecoverSDCardCallBack){
|
| | | final LCBusinessHandler handler = new LCBusinessHandler() {
|
| | | @Override
|
| | | public void handleBusiness(Message msg) {
|
| | | if (iRecoverSDCardCallBack == null) {
|
| | | return;
|
| | | }
|
| | | if (msg.what == HandleMessageCode.HMC_SUCCESS) {
|
| | | //成功
|
| | | iRecoverSDCardCallBack.onSuccess("Success");
|
| | | } else {
|
| | | //失败
|
| | | iRecoverSDCardCallBack.onError(BusinessErrorTip.throwError(msg));
|
| | | }
|
| | | }
|
| | | };
|
| | | new BusinessRunnable(handler) {
|
| | | @Override
|
| | | public void doBusiness() throws BusinessException {
|
| | | try {
|
| | | boolean b = DeviceInfoOpenApiManager.recoverSDCard(deviceId);
|
| | | handler.obtainMessage(HandleMessageCode.HMC_SUCCESS, b).sendToTarget();
|
| | | } catch (BusinessException e) {
|
| | | throw e;
|
| | | }
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | }
|