disable bugly, add onDestroy on WaitingForCardViewModel, always show handle print in PaymentActivity
This commit is contained in:
parent
491fcb8d94
commit
09a032aa97
|
@ -54,28 +54,31 @@ public class TerminalApplication extends BaseApplication {
|
||||||
|
|
||||||
private void initBugly() {
|
private void initBugly() {
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
|
|
||||||
|
CrashReport.enableBugly(false);
|
||||||
|
return;
|
||||||
// Get the current package name
|
// Get the current package name
|
||||||
String packageName = context.getPackageName();
|
// String packageName = context.getPackageName();
|
||||||
// Get the current process name
|
// // Get the current process name
|
||||||
String processName = DevUtils.getProcessName(android.os.Process.myPid());
|
// String processName = DevUtils.getProcessName(android.os.Process.myPid());
|
||||||
// Set whether it is a reporting process
|
// // Set whether it is a reporting process
|
||||||
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
|
// CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
|
||||||
strategy.setUploadProcess(processName == null || processName.equals(packageName));
|
// strategy.setUploadProcess(processName == null || processName.equals(packageName));
|
||||||
strategy.setAppVersion(DevUtils.getPackageVersionName(this, packageName));
|
// strategy.setAppVersion(DevUtils.getPackageVersionName(this, packageName));
|
||||||
strategy.setAppPackageName(packageName);
|
// strategy.setAppPackageName(packageName);
|
||||||
|
//
|
||||||
// Initialize Bugly
|
// // Initialize Bugly
|
||||||
CrashReport.initCrashReport(context, "b2d80aa171", BuildConfig.DEBUG, strategy);
|
// CrashReport.initCrashReport(context, "b2d80aa171", BuildConfig.DEBUG, strategy);
|
||||||
BuglyLog.setCache(1024 * 10); // 设置本地缓存大小(10KB)
|
// BuglyLog.setCache(1024 * 10); // 设置本地缓存大小(10KB)
|
||||||
|
//
|
||||||
// Set user data
|
// // Set user data
|
||||||
CrashReport.setUserId(DevUtils.getDeviceId(this));
|
// CrashReport.setUserId(DevUtils.getDeviceId(this));
|
||||||
CrashReport.setDeviceModel(this,Build.MODEL);
|
// CrashReport.setDeviceModel(this,Build.MODEL);
|
||||||
|
//
|
||||||
// Add custom logs
|
// // Add custom logs
|
||||||
CrashReport.setUserSceneTag(context, 9527); // Set label
|
// CrashReport.setUserSceneTag(context, 9527); // Set label
|
||||||
CrashReport.putUserData(context, "deviceModel", Build.MODEL);
|
// CrashReport.putUserData(context, "deviceModel", Build.MODEL);
|
||||||
CrashReport.putUserData(context, "deviceManufacturer", Build.MANUFACTURER);
|
// CrashReport.putUserData(context, "deviceManufacturer", Build.MANUFACTURER);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initShiply(){
|
private void initShiply(){
|
||||||
|
|
|
@ -245,8 +245,9 @@ public class PaymentActivity extends BaseActivity<ActivityPaymentBinding, Paymen
|
||||||
POS.getInstance().sendOnlineProcessResult("8A023030");
|
POS.getInstance().sendOnlineProcessResult("8A023030");
|
||||||
} else {
|
} else {
|
||||||
if (DeviceUtils.isPrinterDevices()) {
|
if (DeviceUtils.isPrinterDevices()) {
|
||||||
handleSendReceipt();
|
// handleSendReceipt();
|
||||||
}
|
}
|
||||||
|
handleSendReceipt();
|
||||||
viewModel.setTransactionSuccess();
|
viewModel.setTransactionSuccess();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,6 +8,9 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.ObservableBoolean;
|
import androidx.databinding.ObservableBoolean;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import com.dspread.pos.common.manager.QPOSCallbackManager;
|
||||||
|
import com.dspread.pos.printerAPI.PrinterHelper;
|
||||||
|
import com.dspread.pos.utils.LogFileConfig;
|
||||||
import com.dspread.pos.utils.QRCodeGenerator;
|
import com.dspread.pos.utils.QRCodeGenerator;
|
||||||
|
|
||||||
import me.goldze.mvvmhabit.base.BaseViewModel;
|
import me.goldze.mvvmhabit.base.BaseViewModel;
|
||||||
|
@ -61,4 +64,14 @@ public class WaitingForCardViewModel extends BaseViewModel {
|
||||||
// Handle cancel action
|
// Handle cancel action
|
||||||
Log.d("WaitingForCardViewModel", "onCancel: ");
|
Log.d("WaitingForCardViewModel", "onCancel: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
Log.d("WaitingCardVM", "onDestroy: ");
|
||||||
|
// super.onDestroy();
|
||||||
|
// LogFileConfig.getInstance(this).readLog();
|
||||||
|
// QPOSCallbackManager.getInstance().unregisterPaymentCallback();
|
||||||
|
// PrinterHelper.getInstance().close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue