@@ -141,9 +141,9 @@ public class App extends Application{
               | 
            ||
| 141 | 141 | 
                cmd0+="rm /system/lib/"+lib+"\n";  | 
            
| 142 | 142 | 
                }  | 
            
| 143 | 143 | 
                                     LogHelper.d("czy","cmd0="+cmd0);
               | 
            
| 144 | 
                +  | 
            |
| 144 | 145 | 
                String cmd = "chmod 777 " + getPackageCodePath();  | 
            
| 145 | 146 | 
                String cmd2 = "chmod -R 0777 /dev/bus/usb" ;  | 
            
| 146 | 
                -  | 
            |
| 147 | 147 | 
                String cmd3 = "mount -o rw,remount /dev/block/platform/mtk-msdc.0/by-name/system /system" ;  | 
            
| 148 | 148 | 
                String cmd5 = "cp -fr /mnt/sdcard/lensman/so/. /system/lib" ;  | 
            
| 149 | 149 | 
                 | 
            
                @@ -163,8 +163,10 @@ public class App extends Application{
               | 
            ||
| 163 | 163 | 
                                     os.writeBytes("exit\n");
               | 
            
| 164 | 164 | 
                os.flush();  | 
            
| 165 | 165 | 
                process.waitFor();  | 
            
| 166 | 
                +                    LogHelper.d("czy","camera lib so install success");
               | 
            |
| 166 | 167 | 
                Preferences.getInstance().setCameraLibExist(true);  | 
            
| 167 | 168 | 
                                 } catch (Exception e) {
               | 
            
| 169 | 
                +                    LogHelper.d("czy","camera lib so install error-->"+e);
               | 
            |
| 168 | 170 | 
                Preferences.getInstance().setCameraLibExist(false);  | 
            
| 169 | 171 | 
                                 } finally {
               | 
            
| 170 | 172 | 
                                     try {
               | 
            
                @@ -1,5 +1,7 @@  | 
            ||
| 1 | 1 | 
                package ai.pai.lensman.dslr;  | 
            
| 2 | 2 | 
                 | 
            
| 3 | 
                +import com.android.common.utils.LogHelper;  | 
            |
| 4 | 
                +  | 
            |
| 3 | 5 | 
                import java.util.Random;  | 
            
| 4 | 6 | 
                 | 
            
| 5 | 7 | 
                import ai.pai.lensman.BuildConfig;  | 
            
                @@ -11,6 +13,7 @@ public class CameraJNIInterface {
               | 
            ||
| 11 | 13 | 
                         try {
               | 
            
| 12 | 14 | 
                             System.loadLibrary("hello_jni");
               | 
            
| 13 | 15 | 
                         }catch (Throwable e){
               | 
            
| 16 | 
                +            LogHelper.d("czy","load library error-->"+e);
               | 
            |
| 14 | 17 | 
                e.printStackTrace();  | 
            
| 15 | 18 | 
                }  | 
            
| 16 | 19 | 
                }  | 
            
                @@ -82,7 +82,7 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie  | 
            ||
| 82 | 82 | 
                }  | 
            
| 83 | 83 | 
                presenter = new SessionPresenter(sessionBean,this);  | 
            
| 84 | 84 | 
                 | 
            
| 85 | 
                - titleTextView.setText(getString(R.string.scene)+sessionBean.sessionSeq);  | 
            |
| 85 | 
                + titleTextView.setText(getString(R.string.scene,sessionBean.sessionSeq));  | 
            |
| 86 | 86 | 
                adapter = new PhotoRecyclerAdapter(this);  | 
            
| 87 | 87 | 
                 | 
            
| 88 | 88 | 
                RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);  | 
            
                @@ -96,17 +96,15 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie  | 
            ||
| 96 | 96 | 
                String LOG_PATH = Environment.getExternalStorageDirectory()  | 
            
| 97 | 97 | 
                .getAbsolutePath() + "/lensman/logs/";  | 
            
| 98 | 98 | 
                         if(!new File(LOG_PATH).exists()&&!new File(LOG_PATH).mkdirs()){
               | 
            
| 99 | 
                +            LogHelper.d("czy","sdcard write file error");
               | 
            |
| 99 | 100 | 
                Toast.makeText(this,R.string.sdcard_fail,Toast.LENGTH_SHORT).show();  | 
            
| 100 | 101 | 
                }  | 
            
| 101 | 
                - LogHelper.d(TAG,"onCreate");  | 
            |
| 102 | 
                - LogHelper.d(TAG,"session info = "+sessionBean);  | 
            |
| 103 | 102 | 
                }  | 
            
| 104 | 103 | 
                 | 
            
| 105 | 104 | 
                @Override  | 
            
| 106 | 105 | 
                     protected void onDestroy() {
               | 
            
| 107 | 106 | 
                super.onDestroy();  | 
            
| 108 | 107 | 
                presenter.stop();  | 
            
| 109 | 
                - LogHelper.d(TAG,"onDestroy");  | 
            |
| 110 | 108 | 
                }  | 
            
| 111 | 109 | 
                 | 
            
| 112 | 110 | 
                @OnClick(R.id.iv_scan)  | 
            
                @@ -176,8 +174,16 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie  | 
            ||
| 176 | 174 | 
                }  | 
            
| 177 | 175 | 
                 | 
            
| 178 | 176 | 
                @Override  | 
            
| 179 | 
                -    public void showToast(String toast) {
               | 
            |
| 180 | 
                - Toast.makeText(this,toast,Toast.LENGTH_SHORT).show();  | 
            |
| 177 | 
                +    public void showToast(final String toast) {
               | 
            |
| 178 | 
                +        if(photosRecyclerView!=null){
               | 
            |
| 179 | 
                +            photosRecyclerView.post(new Runnable() {
               | 
            |
| 180 | 
                + @Override  | 
            |
| 181 | 
                +                public void run() {
               | 
            |
| 182 | 
                + Toast.makeText(SessionActivity.this,toast,Toast.LENGTH_SHORT).show();  | 
            |
| 183 | 
                + }  | 
            |
| 184 | 
                + });  | 
            |
| 185 | 
                + }  | 
            |
| 186 | 
                +  | 
            |
| 181 | 187 | 
                }  | 
            
| 182 | 188 | 
                 | 
            
| 183 | 189 | 
                 | 
            
                @@ -66,10 +66,12 @@ public class SessionInteractor implements Callback{
               | 
            ||
| 66 | 66 | 
                 | 
            
| 67 | 67 | 
                int result = CameraJNIInterface.getInstance().java_mygpcamerainit();  | 
            
| 68 | 68 | 
                         if(result>=0){
               | 
            
| 69 | 
                +            LogHelper.d("czy","mygpcamerainit init success="+result);
               | 
            |
| 69 | 70 | 
                listener.onSessionStartSuccess(sessionBean.sessionId);  | 
            
| 70 | 71 | 
                isWorking = true;  | 
            
| 71 | 72 | 
                startCapture();  | 
            
| 72 | 73 | 
                         }else{
               | 
            
| 74 | 
                +            LogHelper.d("czy","mygpcamerainit init fail ="+result+" and schedule retry");
               | 
            |
| 73 | 75 | 
                             if(cameraInitHandler!=null){
               | 
            
| 74 | 76 | 
                cameraInitHandler.removeCallbacksAndMessages(null);  | 
            
| 75 | 77 | 
                cameraInitHandler = null;  | 
            
                @@ -79,7 +81,6 @@ public class SessionInteractor implements Callback{
               | 
            ||
| 79 | 81 | 
                listener.onSessionStartError(sessionBean.sessionId);  | 
            
| 80 | 82 | 
                }  | 
            
| 81 | 83 | 
                 | 
            
| 82 | 
                - LogHelper.d(TAG,"startSession sessionStartTask execute");  | 
            |
| 83 | 84 | 
                }  | 
            
| 84 | 85 | 
                 | 
            
| 85 | 86 | 
                     public void startCapture() {
               | 
            
                @@ -93,7 +94,8 @@ public class SessionInteractor implements Callback{
               | 
            ||
| 93 | 94 | 
                             public void run() {
               | 
            
| 94 | 95 | 
                fetchPhotoTask();  | 
            
| 95 | 96 | 
                }  | 
            
| 96 | 
                - },1000,200);  | 
            |
| 97 | 
                + },1000,10);  | 
            |
| 98 | 
                +        LogHelper.d("czy","startCapture ,schedule fetchPhotoTask ");
               | 
            |
| 97 | 99 | 
                }  | 
            
| 98 | 100 | 
                 | 
            
| 99 | 101 | 
                     private void fetchPhotoTask(){
               | 
            
                @@ -102,11 +104,13 @@ public class SessionInteractor implements Callback{
               | 
            ||
| 102 | 104 | 
                }  | 
            
| 103 | 105 | 
                 | 
            
| 104 | 106 | 
                         if(!isLastQueryReturned){
               | 
            
| 107 | 
                +            LogHelper.d("czy","fetchPhotoTask last query not finished,return ");
               | 
            |
| 105 | 108 | 
                return;  | 
            
| 106 | 109 | 
                }  | 
            
| 107 | 110 | 
                 | 
            
| 108 | 111 | 
                isLastQueryReturned = false;  | 
            
| 109 | 112 | 
                String photoName = CameraJNIInterface.getInstance().java_mygpcamerawaitforevent(sessionWorkingDirPath);  | 
            
| 113 | 
                +        LogHelper.d("czy","mygpcamerawaitforevent return result = "+photoName);
               | 
            |
| 110 | 114 | 
                         if(photoName!=null && photoName.length()>0){
               | 
            
| 111 | 115 | 
                String sub = photoName.substring(0,1);  | 
            
| 112 | 116 | 
                             if(TextUtils.isDigitsOnly(sub)){
               | 
            
                @@ -144,6 +148,7 @@ public class SessionInteractor implements Callback{
               | 
            ||
| 144 | 148 | 
                cameraInitHandler.removeCallbacksAndMessages(null);  | 
            
| 145 | 149 | 
                cameraInitHandler = null;  | 
            
| 146 | 150 | 
                }  | 
            
| 151 | 
                +        LogHelper.d("czy","endSession ");
               | 
            |
| 147 | 152 | 
                }  | 
            
| 148 | 153 | 
                 | 
            
| 149 | 154 | 
                     public void deletePhoto(PhotoBean photoBean){
               | 
            
                @@ -14,7 +14,6 @@ import ai.pai.lensman.R;  | 
            ||
| 14 | 14 | 
                import ai.pai.lensman.bean.PhotoBean;  | 
            
| 15 | 15 | 
                import ai.pai.lensman.bean.SessionBean;  | 
            
| 16 | 16 | 
                import ai.pai.lensman.db.DBService;  | 
            
| 17 | 
                -import ai.pai.lensman.db.Preferences;  | 
            |
| 18 | 17 | 
                import ai.pai.lensman.service.UploadService;  | 
            
| 19 | 18 | 
                 | 
            
| 20 | 19 | 
                 | 
            
                @@ -10,7 +10,7 @@  | 
            ||
| 10 | 10 | 
                <string name="bt_disconnected">已断开</string>  | 
            
| 11 | 11 | 
                <string name="briefs">简报</string>  | 
            
| 12 | 12 | 
                <string name="settings">设置</string>  | 
            
| 13 | 
                - <string name="scene">场景</string>  | 
            |
| 13 | 
                + <string name="scene">场景%d</string>  | 
            |
| 14 | 14 | 
                 | 
            
| 15 | 15 | 
                <string name="wx_login">微信登录</string>  | 
            
| 16 | 16 | 
                <string name="agree_protocol">已阅读并同意<u>拍爱用户协议</u></string>  |