Some style/format fixes suggested by AS

This commit is contained in:
Daniel Martí 2015-04-21 19:17:14 +02:00
parent 14ae58690c
commit e367265396
4 changed files with 9 additions and 10 deletions

View File

@ -94,10 +94,10 @@ public class CompatibilityChecker extends Compatibility {
if (apk.features != null) {
for (final String feat : apk.features) {
if (ignoreTouchscreen
&& feat.equals("android.hardware.touchscreen")) {
// Don't check it!
} else if (!features.contains(feat)) {
if (ignoreTouchscreen && feat.equals("android.hardware.touchscreen")) {
continue;
}
if (!features.contains(feat)) {
Collections.addAll(incompatibleReasons, feat.split(","));
if (BuildConfig.DEBUG) {
Log.d(TAG, apk.id + " vercode " + apk.vercode

View File

@ -64,7 +64,7 @@ public class Hasher {
return hashCache;
else if (file != null) {
byte[] buffer = new byte[1024];
int read = 0;
int read;
InputStream input = null;
try {
input = new BufferedInputStream(new FileInputStream(file));

View File

@ -564,8 +564,9 @@ public class UpdateService extends IntentService implements ProgressListener {
private List<String> getKnownAppIds(List<App> apps) {
List<String> knownAppIds = new ArrayList<>();
if (apps.size() == 0) {
// Do nothing
} else if (apps.size() > AppProvider.MAX_APPS_TO_QUERY) {
return knownAppIds;
}
if (apps.size() > AppProvider.MAX_APPS_TO_QUERY) {
int middle = apps.size() / 2;
List<App> apps1 = apps.subList(0, middle);
List<App> apps2 = apps.subList(middle, apps.size());

View File

@ -97,9 +97,7 @@ public class InstalledAppCacheUpdater {
try {
context.getContentResolver().applyBatch(InstalledAppProvider.getAuthority(), ops);
Log.d(TAG, "Finished executing " + ops.size() + " CRUD operations on installed app cache.");
} catch (RemoteException e) {
Log.e(TAG, "Error updating installed app cache: " + e);
} catch (OperationApplicationException e) {
} catch (RemoteException | OperationApplicationException e) {
Log.e(TAG, "Error updating installed app cache: " + e);
}
}