本文整理汇总了Java中com.tencent.tinker.lib.util.TinkerLog.d方法的典型用法代码示例。如果您正苦于以下问题:Java TinkerLog.d方法的具体用法?Java TinkerLog.d怎么用?Java TinkerLog.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.tinker.lib.util.TinkerLog
的用法示例。
在下文中一共展示了TinkerLog.d方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tinkerFastCrashProtect
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
private boolean tinkerFastCrashProtect() {
ApplicationLike applicationLike = TinkerManager.getTinkerApplicationLike();
if (applicationLike == null || applicationLike.getApplication() == null ||
!TinkerApplicationHelper.isTinkerLoadSuccess(applicationLike)) {
return false;
}
long elapsedTime = SystemClock.elapsedRealtime() - applicationLike
.getApplicationStartElapsedTime();
TinkerLog.d(TAG, "exlapsedTime :" + elapsedTime, new Object[0]);
if (elapsedTime >= QUICK_CRASH_ELAPSE) {
return false;
}
String currentVersion = TinkerApplicationHelper.getCurrentVersion(applicationLike);
if (ShareTinkerInternals.isNullOrNil(currentVersion)) {
return false;
}
SharedPreferences sp = applicationLike.getApplication().getSharedPreferences
(ShareConstants.TINKER_SHARE_PREFERENCE_CONFIG, 4);
int fastCrashCount = sp.getInt(currentVersion, 0);
if (fastCrashCount >= 3) {
MobclickAgent.onEvent(applicationLike.getApplication(), Event.tinker_crash_protect);
SampleTinkerReport.onFastCrashProtect();
TinkerApplicationHelper.cleanPatch(applicationLike);
TinkerLog.e(TAG, "tinker has fast crash more than %d, we just clean patch!", Integer
.valueOf(fastCrashCount));
return true;
}
sp.edit().putInt(currentVersion, fastCrashCount + 1).commit();
TinkerLog.e(TAG, "tinker has fast crash %d times", Integer.valueOf(fastCrashCount));
return false;
}