Less indents and code -> better readable
Also removed a useless variable
This commit is contained in:
parent
e5fd24b0d1
commit
403154b2e1
1 changed files with 26 additions and 26 deletions
|
@ -128,9 +128,10 @@ public final class CheckForNewAppVersion extends IntentService {
|
||||||
final String versionName,
|
final String versionName,
|
||||||
final String apkLocationUrl,
|
final String apkLocationUrl,
|
||||||
final int versionCode) {
|
final int versionCode) {
|
||||||
final int notificationId = 2000;
|
if (BuildConfig.VERSION_CODE >= versionCode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (BuildConfig.VERSION_CODE < versionCode) {
|
|
||||||
// A pending intent to open the apk location url in the browser.
|
// A pending intent to open the apk location url in the browser.
|
||||||
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl));
|
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl));
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
@ -153,8 +154,7 @@ public final class CheckForNewAppVersion extends IntentService {
|
||||||
|
|
||||||
final NotificationManagerCompat notificationManager
|
final NotificationManagerCompat notificationManager
|
||||||
= NotificationManagerCompat.from(application);
|
= NotificationManagerCompat.from(application);
|
||||||
notificationManager.notify(notificationId, notificationBuilder.build());
|
notificationManager.notify(2000, notificationBuilder.build());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isReleaseApk(@NonNull final App app) {
|
public static boolean isReleaseApk(@NonNull final App app) {
|
||||||
|
|
Loading…
Reference in a new issue