public static void saveGWData(GWSaveEntry saveEntry, TagTimeEntry tagTimeEntry) { setLastSaveFolder(saveEntry.path3); String now = GTUtils.getSaveDate(); saveEntry.setNow(now); LogUtils.writeGWData(saveEntry, tagTimeEntry); LogUtils.writeGWDesc(saveEntry, tagTimeEntry); }
public LogTimeController() { if (GTUtils.isSDCardExist() && !Env.ROOT_TIME_FOLDER.exists()) { Env.ROOT_TIME_FOLDER.mkdirs(); } // started = GTPref.getGTPref().getBoolean(GTPref.PERF_MASTER_SWITCH, started); lock = new ReentrantLock(); }
public static void saveAllEnableGWData(GWSaveEntry saveEntry) { setLastSaveFolder(saveEntry.path3); String now = GTUtils.getSaveDate(); saveEntry.setNow(now); TagTimeEntry[] ttes = OpPerfBridge.getAllEnableProfilerData(); for (TagTimeEntry tte : ttes) { if (null != tte && tte.getAlias().equals("SM")) { LogUtils.writeGWDataForSM(saveEntry, tte); } else { LogUtils.writeGWData(saveEntry, tte); } } LogUtils.writeGWDesc(saveEntry, ttes); }
private void showUploadDialog(final String skey, final String pskey, final String lskey) { if (!GTUtils.isSDCardExist()) { return; } final List<File> folders = new ArrayList<File>(SavedGWDataHelper.getGWFolders()); if (folders.isEmpty()) { Toast.makeText(this, R.string.no_saved_logs, Toast.LENGTH_SHORT).show(); return; } ArrayAdapter<File> dropdownAdapter = new GWFolderAdapter(this, folders, SavedGWDataHelper.getGWDirectory(), -1, false); Builder builder = new Builder(this); builder .setTitle(R.string.pi_octopus_upload_title) .setCancelable(true) .setSingleChoiceItems( dropdownAdapter, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { File folder = folders.get(which); if (folder .getParentFile() .getParentFile() .equals(SavedGWDataHelper.getGWDirectory())) { return; // 点击上层目录行,啥也不做 } dialog.dismiss(); // 弹出新的对话框,提示用户本次上传的内容大小 comfirmUpdateSize(folder, skey, pskey, lskey); } }); builder.show(); }