version:
fix:优化请求次数 update:
This commit is contained in:
@@ -1058,7 +1058,7 @@ public class JGYUtils {
|
||||
if (packageInfo == null || packageInfo.versionCode < versionCode) {
|
||||
Utils.ariaDownload(mContext, url, object);
|
||||
} else {
|
||||
Log.e("installAPK", "已是最新版本");
|
||||
Log.e("installAPK", app_name + ": 已是最新版本");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1584,17 +1584,17 @@ public class JGYUtils {
|
||||
}
|
||||
|
||||
public interface GetAppPlatformCallback {
|
||||
void AppPlatform(int platform);
|
||||
void getAppPlatform(int platform);
|
||||
}
|
||||
|
||||
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
|
||||
String platform = BuildConfig.platform;
|
||||
if ("MTK".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTKPlatform);
|
||||
getAppPlatformCallback.getAppPlatform(MTKPlatform);
|
||||
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
|
||||
getAppPlatformCallback.getAppPlatform(ZhanruiPlatform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
getAppPlatformCallback.getAppPlatform(UnknowPlatform);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1960,4 +1960,41 @@ public class JGYUtils {
|
||||
bootIntent.setComponent(new ComponentName(PACKAGE_APPSTORE, CLASS_APPSTORE));
|
||||
mContext.sendBroadcast(bootIntent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断网络连接状态
|
||||
*
|
||||
* @return true:网络已链接, false:网络已断开连接
|
||||
*/
|
||||
public boolean isNetworkConnected() {
|
||||
if (mContext != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) mContext
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo mNetworkInfo = mConnectivityManager
|
||||
.getActiveNetworkInfo();
|
||||
if (mNetworkInfo != null) {
|
||||
return mNetworkInfo.isAvailable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void cleanLauncher3Cache() {
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(mContext, "com.android.launcher3");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onReceive: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanAoleLauncher3Cache() {
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(mContext, "com.aoleyun.os");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onReceive: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user