Don't inline log tags, add missing TAG constants

This commit is contained in:
Daniel Martí 2015-03-30 20:52:40 +02:00
parent fdfdb0935f
commit 82f4a975bb
25 changed files with 126 additions and 87 deletions

View File

@ -16,6 +16,8 @@ import java.util.*;
// find reasons why an apk may be incompatible with the user's device. // find reasons why an apk may be incompatible with the user's device.
public class CompatibilityChecker extends Compatibility { public class CompatibilityChecker extends Compatibility {
private static final String TAG = "fdroid.Compatibility";
private Context context; private Context context;
private Set<String> features; private Set<String> features;
private String[] cpuAbis; private String[] cpuAbis;
@ -54,7 +56,7 @@ public class CompatibilityChecker extends Compatibility {
} }
cpuAbisDesc = builder.toString(); cpuAbisDesc = builder.toString();
Log.d("FDroid", logMsg.toString()); Log.d(TAG, logMsg.toString());
} }
private boolean compatibleApi(Utils.CommaSeparatedList nativecode) { private boolean compatibleApi(Utils.CommaSeparatedList nativecode) {
@ -85,7 +87,7 @@ public class CompatibilityChecker extends Compatibility {
// Don't check it! // Don't check it!
} else if (!features.contains(feat)) { } else if (!features.contains(feat)) {
Collections.addAll(incompatibleReasons, feat.split(",")); Collections.addAll(incompatibleReasons, feat.split(","));
Log.d("FDroid", apk.id + " vercode " + apk.vercode Log.d(TAG, apk.id + " vercode " + apk.vercode
+ " is incompatible based on lack of " + " is incompatible based on lack of "
+ feat); + feat);
} }
@ -95,7 +97,7 @@ public class CompatibilityChecker extends Compatibility {
for (String code : apk.nativecode) { for (String code : apk.nativecode) {
incompatibleReasons.add(code); incompatibleReasons.add(code);
} }
Log.d("FDroid", apk.id + " vercode " + apk.vercode Log.d(TAG, apk.id + " vercode " + apk.vercode
+ " only supports " + Utils.CommaSeparatedList.str(apk.nativecode) + " only supports " + Utils.CommaSeparatedList.str(apk.nativecode)
+ " while your architectures are " + cpuAbisDesc); + " while your architectures are " + cpuAbisDesc);
} }

View File

@ -52,6 +52,8 @@ import org.fdroid.fdroid.views.swap.SwapActivity;
public class FDroid extends ActionBarActivity { public class FDroid extends ActionBarActivity {
private static final String TAG = "fdroid.FDroid";
public static final int REQUEST_APPDETAILS = 0; public static final int REQUEST_APPDETAILS = 0;
public static final int REQUEST_MANAGEREPOS = 1; public static final int REQUEST_MANAGEREPOS = 1;
public static final int REQUEST_PREFS = 2; public static final int REQUEST_PREFS = 2;
@ -321,12 +323,12 @@ public class FDroid extends ActionBarActivity {
final String TRIED_EMPTY_UPDATE = "triedEmptyUpdate"; final String TRIED_EMPTY_UPDATE = "triedEmptyUpdate";
boolean hasTriedEmptyUpdate = getPreferences(MODE_PRIVATE).getBoolean(TRIED_EMPTY_UPDATE, false); boolean hasTriedEmptyUpdate = getPreferences(MODE_PRIVATE).getBoolean(TRIED_EMPTY_UPDATE, false);
if (!hasTriedEmptyUpdate) { if (!hasTriedEmptyUpdate) {
Log.d("FDroid", "Empty app list, and we haven't done an update yet. Forcing repo update."); Log.d(TAG, "Empty app list, and we haven't done an update yet. Forcing repo update.");
getPreferences(MODE_PRIVATE).edit().putBoolean(TRIED_EMPTY_UPDATE, true).commit(); getPreferences(MODE_PRIVATE).edit().putBoolean(TRIED_EMPTY_UPDATE, true).commit();
updateRepos(); updateRepos();
return true; return true;
} else { } else {
Log.d("FDroid", "Empty app list, but it looks like we've had an update previously. Will not force repo update."); Log.d(TAG, "Empty app list, but it looks like we've had an update previously. Will not force repo update.");
return false; return false;
} }
} }

View File

@ -28,10 +28,12 @@ import org.fdroid.fdroid.data.InstalledAppProvider;
public class PackageAddedReceiver extends PackageReceiver { public class PackageAddedReceiver extends PackageReceiver {
private static final String TAG = "fdroid.PackageAddedReceiver";
@Override @Override
protected boolean toDiscard(Intent intent) { protected boolean toDiscard(Intent intent) {
if (intent.hasExtra(Intent.EXTRA_REPLACING)) { if (intent.hasExtra(Intent.EXTRA_REPLACING)) {
Log.d("FDroid", "Discarding since this PACKAGE_ADDED is just a PACKAGE_REPLACED"); Log.d(TAG, "Discarding since this PACKAGE_ADDED is just a PACKAGE_REPLACED");
return true; return true;
} }
return false; return false;
@ -41,7 +43,7 @@ public class PackageAddedReceiver extends PackageReceiver {
protected void handle(Context context, String appId) { protected void handle(Context context, String appId) {
PackageInfo info = getPackageInfo(context, appId); PackageInfo info = getPackageInfo(context, appId);
Log.d("FDroid", "Inserting installed app info for '" + appId + "' (v" + info.versionCode + ")"); Log.d(TAG, "Inserting installed app info for '" + appId + "' (v" + info.versionCode + ")");
Uri uri = InstalledAppProvider.getContentUri(); Uri uri = InstalledAppProvider.getContentUri();
ContentValues values = new ContentValues(4); ContentValues values = new ContentValues(4);

View File

@ -29,6 +29,8 @@ import org.fdroid.fdroid.data.AppProvider;
abstract class PackageReceiver extends BroadcastReceiver { abstract class PackageReceiver extends BroadcastReceiver {
private static final String TAG = "fdroid.PackageReceiver";
abstract protected boolean toDiscard(Intent intent); abstract protected boolean toDiscard(Intent intent);
abstract protected void handle(Context context, String appId); abstract protected void handle(Context context, String appId);
@ -43,7 +45,7 @@ abstract class PackageReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Log.d("FDroid", "PackageReceiver received [action = '" + intent.getAction() + "', data = '" + intent.getData() + "']"); Log.d(TAG, "PackageReceiver received [action = '" + intent.getAction() + "', data = '" + intent.getData() + "']");
if (toDiscard(intent)) { if (toDiscard(intent)) {
return; return;
} }

View File

@ -26,10 +26,12 @@ import org.fdroid.fdroid.data.InstalledAppProvider;
public class PackageRemovedReceiver extends PackageReceiver { public class PackageRemovedReceiver extends PackageReceiver {
private static final String TAG = "fdroid.PackageRemovedReceiver";
@Override @Override
protected boolean toDiscard(Intent intent) { protected boolean toDiscard(Intent intent) {
if (intent.hasExtra(Intent.EXTRA_REPLACING)) { if (intent.hasExtra(Intent.EXTRA_REPLACING)) {
Log.d("FDroid", "Discarding since this PACKAGE_REMOVED is just a PACKAGE_REPLACED"); Log.d(TAG, "Discarding since this PACKAGE_REMOVED is just a PACKAGE_REPLACED");
return true; return true;
} }
return false; return false;
@ -38,7 +40,7 @@ public class PackageRemovedReceiver extends PackageReceiver {
@Override @Override
protected void handle(Context context, String appId) { protected void handle(Context context, String appId) {
Log.d("FDroid", "Removing installed app info for '" + appId + "'"); Log.d(TAG, "Removing installed app info for '" + appId + "'");
Uri uri = InstalledAppProvider.getAppUri(appId); Uri uri = InstalledAppProvider.getAppUri(appId);
context.getContentResolver().delete(uri, null, null); context.getContentResolver().delete(uri, null, null);

View File

@ -35,6 +35,8 @@ import org.fdroid.fdroid.data.InstalledAppProvider;
*/ */
public class PackageUpgradedReceiver extends PackageReceiver { public class PackageUpgradedReceiver extends PackageReceiver {
private static final String TAG = "fdroid.PackageUpgradedReceiver";
@Override @Override
protected boolean toDiscard(Intent intent) { protected boolean toDiscard(Intent intent) {
return false; return false;
@ -44,7 +46,7 @@ public class PackageUpgradedReceiver extends PackageReceiver {
protected void handle(Context context, String appId) { protected void handle(Context context, String appId) {
PackageInfo info = getPackageInfo(context, appId); PackageInfo info = getPackageInfo(context, appId);
Log.d("FDroid", "Updating installed app info for '" + appId + "' to v" + info.versionCode + " (" + info.versionName + ")"); Log.d(TAG, "Updating installed app info for '" + appId + "' to v" + info.versionCode + " (" + info.versionName + ")");
Uri uri = InstalledAppProvider.getContentUri(); Uri uri = InstalledAppProvider.getContentUri();
ContentValues values = new ContentValues(4); ContentValues values = new ContentValues(4);

View File

@ -23,6 +23,8 @@ import java.util.Random;
*/ */
public class Preferences implements SharedPreferences.OnSharedPreferenceChangeListener { public class Preferences implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = "fdroid.Preferences";
private final SharedPreferences preferences; private final SharedPreferences preferences;
private Preferences(Context context) { private Preferences(Context context) {
@ -221,7 +223,7 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Log.d("FDroid", "Invalidating preference '" + key + "'."); Log.d(TAG, "Invalidating preference '" + key + "'.");
uninitialize(key); uninitialize(key);
if (key.equals(PREF_COMPACT_LAYOUT)) { if (key.equals(PREF_COMPACT_LAYOUT)) {
@ -293,7 +295,7 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
if (instance != null) { if (instance != null) {
String error = "Attempted to reinitialize preferences after it " + String error = "Attempted to reinitialize preferences after it " +
"has already been initialized in FDroidApp"; "has already been initialized in FDroidApp";
Log.e("FDroid", error); Log.e(TAG, error);
throw new RuntimeException(error); throw new RuntimeException(error);
} }
instance = new Preferences(context); instance = new Preferences(context);
@ -303,7 +305,7 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
if (instance == null) { if (instance == null) {
String error = "Attempted to access preferences before it " + String error = "Attempted to access preferences before it " +
"has been initialized in FDroidApp"; "has been initialized in FDroidApp";
Log.e("FDroid", error); Log.e(TAG, error);
throw new RuntimeException(error); throw new RuntimeException(error);
} }
return instance; return instance;

View File

@ -64,6 +64,8 @@ import java.util.Map;
public class UpdateService extends IntentService implements ProgressListener { public class UpdateService extends IntentService implements ProgressListener {
private static final String TAG = "fdroid.UpdateService";
public static final String RESULT_MESSAGE = "msg"; public static final String RESULT_MESSAGE = "msg";
public static final String RESULT_EVENT = "event"; public static final String RESULT_EVENT = "event";
public static final String RESULT_REPO_ERRORS = "repoErrors"; public static final String RESULT_REPO_ERRORS = "repoErrors";
@ -246,9 +248,9 @@ public class UpdateService extends IntentService implements ProgressListener {
alarm.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, alarm.setInexactRepeating(AlarmManager.ELAPSED_REALTIME,
SystemClock.elapsedRealtime() + 5000, SystemClock.elapsedRealtime() + 5000,
AlarmManager.INTERVAL_HOUR, pending); AlarmManager.INTERVAL_HOUR, pending);
Log.d("FDroid", "Update scheduler alarm set"); Log.d(TAG, "Update scheduler alarm set");
} else { } else {
Log.d("FDroid", "Update scheduler alarm not set"); Log.d(TAG, "Update scheduler alarm not set");
} }
} }
@ -298,12 +300,12 @@ public class UpdateService extends IntentService implements ProgressListener {
String sint = prefs.getString(Preferences.PREF_UPD_INTERVAL, "0"); String sint = prefs.getString(Preferences.PREF_UPD_INTERVAL, "0");
int interval = Integer.parseInt(sint); int interval = Integer.parseInt(sint);
if (interval == 0) { if (interval == 0) {
Log.d("FDroid", "Skipping update - disabled"); Log.d(TAG, "Skipping update - disabled");
return false; return false;
} }
long elapsed = System.currentTimeMillis() - lastUpdate; long elapsed = System.currentTimeMillis() - lastUpdate;
if (elapsed < interval * 60 * 60 * 1000) { if (elapsed < interval * 60 * 60 * 1000) {
Log.d("FDroid", "Skipping update - done " + elapsed Log.d(TAG, "Skipping update - done " + elapsed
+ "ms ago, interval is " + interval + " hours"); + "ms ago, interval is " + interval + " hours");
return false; return false;
} }
@ -315,7 +317,7 @@ public class UpdateService extends IntentService implements ProgressListener {
NetworkInfo.State wifi = conMan.getNetworkInfo(1).getState(); NetworkInfo.State wifi = conMan.getNetworkInfo(1).getState();
if (wifi != NetworkInfo.State.CONNECTED && if (wifi != NetworkInfo.State.CONNECTED &&
wifi != NetworkInfo.State.CONNECTING) { wifi != NetworkInfo.State.CONNECTING) {
Log.d("FDroid", "Skipping update - wifi not available"); Log.d(TAG, "Skipping update - wifi not available");
return false; return false;
} }
} }
@ -334,7 +336,7 @@ public class UpdateService extends IntentService implements ProgressListener {
// See if it's time to actually do anything yet... // See if it's time to actually do anything yet...
if (!isScheduledRun()) { if (!isScheduledRun()) {
Log.d("FDroid", "Unscheduled (manually requested) update"); Log.d(TAG, "Unscheduled (manually requested) update");
} else if (!verifyIsTimeForScheduledRun()) { } else if (!verifyIsTimeForScheduledRun()) {
return; return;
} }
@ -382,13 +384,13 @@ public class UpdateService extends IntentService implements ProgressListener {
} catch (RepoUpdater.UpdateException e) { } catch (RepoUpdater.UpdateException e) {
errorRepos.add(repo.address); errorRepos.add(repo.address);
repoErrors.add(e.getMessage()); repoErrors.add(e.getMessage());
Log.e("FDroid", "Error updating repository " + repo.address + ": " + e.getMessage()); Log.e(TAG, "Error updating repository " + repo.address + ": " + e.getMessage());
Log.e("FDroid", Log.getStackTraceString(e)); Log.e(TAG, Log.getStackTraceString(e));
} }
} }
if (!changes) { if (!changes) {
Log.d("FDroid", "Not checking app details or compatibility, because all repos were up to date."); Log.d(TAG, "Not checking app details or compatibility, because all repos were up to date.");
} else { } else {
sendStatus(STATUS_INFO, getString(R.string.status_checking_compatibility)); sendStatus(STATUS_INFO, getString(R.string.status_checking_compatibility));
@ -444,12 +446,12 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
} }
} catch (Exception e) { } catch (Exception e) {
Log.e("FDroid", Log.e(TAG,
"Exception during update processing:\n" "Exception during update processing:\n"
+ Log.getStackTraceString(e)); + Log.getStackTraceString(e));
sendStatus(STATUS_ERROR_GLOBAL, e.getMessage()); sendStatus(STATUS_ERROR_GLOBAL, e.getMessage());
} finally { } finally {
Log.d("FDroid", "Update took " Log.d(TAG, "Update took "
+ ((System.currentTimeMillis() - startTime) / 1000) + ((System.currentTimeMillis() - startTime) / 1000)
+ " seconds."); + " seconds.");
receiver = null; receiver = null;
@ -489,7 +491,7 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
private void showAppUpdatesNotification(int updates) { private void showAppUpdatesNotification(int updates) {
Log.d("FDroid", "Notifying " + updates + " updates."); Log.d(TAG, "Notifying " + updates + " updates.");
NotificationCompat.Builder builder = NotificationCompat.Builder builder =
new NotificationCompat.Builder(this) new NotificationCompat.Builder(this)
.setAutoCancel(true) .setAutoCancel(true)
@ -595,13 +597,13 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
} }
Log.d("FDroid", "Updating/inserting " + operations.size() + " apps."); Log.d(TAG, "Updating/inserting " + operations.size() + " apps.");
try { try {
executeBatchWithStatus(AppProvider.getAuthority(), operations, currentCount, totalUpdateCount); executeBatchWithStatus(AppProvider.getAuthority(), operations, currentCount, totalUpdateCount);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e("FDroid", e.getMessage()); Log.e(TAG, e.getMessage());
} catch (OperationApplicationException e) { } catch (OperationApplicationException e) {
Log.e("FDroid", e.getMessage()); Log.e(TAG, e.getMessage());
} }
} }
@ -661,13 +663,13 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
} }
Log.d("FDroid", "Updating/inserting " + operations.size() + " apks."); Log.d(TAG, "Updating/inserting " + operations.size() + " apks.");
try { try {
executeBatchWithStatus(ApkProvider.getAuthority(), operations, currentCount, totalApksAppsCount); executeBatchWithStatus(ApkProvider.getAuthority(), operations, currentCount, totalApksAppsCount);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e("FDroid", e.getMessage()); Log.e(TAG, e.getMessage());
} catch (OperationApplicationException e) { } catch (OperationApplicationException e) {
Log.e("FDroid", e.getMessage()); Log.e(TAG, e.getMessage());
} }
} }
@ -727,7 +729,7 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
long duration = System.currentTimeMillis() - startTime; long duration = System.currentTimeMillis() - startTime;
Log.d("FDroid", "Found " + toRemove.size() + " apks no longer in the updated repos (took " + duration + "ms)"); Log.d(TAG, "Found " + toRemove.size() + " apks no longer in the updated repos (took " + duration + "ms)");
if (toRemove.size() > 0) { if (toRemove.size() > 0) {
ApkProvider.Helper.deleteApks(this, toRemove); ApkProvider.Helper.deleteApks(this, toRemove);
@ -747,13 +749,13 @@ public class UpdateService extends IntentService implements ProgressListener {
for (final Repo repo : repos) { for (final Repo repo : repos) {
Uri uri = ApkProvider.getRepoUri(repo.getId()); Uri uri = ApkProvider.getRepoUri(repo.getId());
int numDeleted = getContentResolver().delete(uri, null, null); int numDeleted = getContentResolver().delete(uri, null, null);
Log.d("FDroid", "Removing " + numDeleted + " apks from repo " + repo.address); Log.d(TAG, "Removing " + numDeleted + " apks from repo " + repo.address);
} }
} }
private void removeAppsWithoutApks() { private void removeAppsWithoutApks() {
int numDeleted = getContentResolver().delete(AppProvider.getNoApksUri(), null, null); int numDeleted = getContentResolver().delete(AppProvider.getNoApksUri(), null, null);
Log.d("FDroid", "Removing " + numDeleted + " apks that don't have any apks"); Log.d(TAG, "Removing " + numDeleted + " apks that don't have any apks");
} }

View File

@ -319,7 +319,7 @@ public final class Utils {
public static String calcFingerprint(String keyHexString) { public static String calcFingerprint(String keyHexString) {
if (TextUtils.isEmpty(keyHexString) if (TextUtils.isEmpty(keyHexString)
|| keyHexString.matches(".*[^a-fA-F0-9].*")) { || keyHexString.matches(".*[^a-fA-F0-9].*")) {
Log.e("FDroid", "Signing key certificate was blank or contained a non-hex-digit!"); Log.e(TAG, "Signing key certificate was blank or contained a non-hex-digit!");
return null; return null;
} else } else
return calcFingerprint(Hasher.unhex(keyHexString)); return calcFingerprint(Hasher.unhex(keyHexString));
@ -336,7 +336,7 @@ public final class Utils {
public static String calcFingerprint(byte[] key) { public static String calcFingerprint(byte[] key) {
String ret = null; String ret = null;
if (key.length < 256) { if (key.length < 256) {
Log.e("FDroid", "key was shorter than 256 bytes (" + key.length + "), cannot be valid!"); Log.e(TAG, "key was shorter than 256 bytes (" + key.length + "), cannot be valid!");
return null; return null;
} }
try { try {
@ -351,7 +351,7 @@ public final class Utils {
ret = formatter.toString(); ret = formatter.toString();
formatter.close(); formatter.close();
} catch (Exception e) { } catch (Exception e) {
Log.w("FDroid", "Unable to get certificate fingerprint.\n" Log.w(TAG, "Unable to get certificate fingerprint.\n"
+ Log.getStackTraceString(e)); + Log.getStackTraceString(e));
} }
return ret; return ret;
@ -425,7 +425,7 @@ public final class Utils {
md.reset(); md.reset();
return hash; return hash;
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
Log.e("FDroid", "Device does not support " + algo + " MessageDisgest algorithm"); Log.e(TAG, "Device does not support " + algo + " MessageDisgest algorithm");
return null; return null;
} }
} }
@ -447,11 +447,11 @@ public final class Utils {
byte[] mdbytes = md.digest(); byte[] mdbytes = md.digest();
return toHexString(mdbytes); return toHexString(mdbytes);
} catch (IOException e) { } catch (IOException e) {
Log.e("FDroid", "Error reading \"" + apk.getAbsolutePath() Log.e(TAG, "Error reading \"" + apk.getAbsolutePath()
+ "\" to compute " + algo + " hash."); + "\" to compute " + algo + " hash.");
return null; return null;
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
Log.e("FDroid", "Device does not support " + algo + " MessageDisgest algorithm"); Log.e(TAG, "Device does not support " + algo + " MessageDisgest algorithm");
return null; return null;
} finally { } finally {
closeQuietly(fis); closeQuietly(fis);

View File

@ -8,12 +8,14 @@ import android.util.Log;
public class PackageManagerCompat extends Compatibility { public class PackageManagerCompat extends Compatibility {
private static final String TAG = "fdroid.PackageManagerCompat";
@TargetApi(11) @TargetApi(11)
public static void setInstaller(PackageManager mPm, String packageName) { public static void setInstaller(PackageManager mPm, String packageName) {
if (!hasApi(11)) return; if (!hasApi(11)) return;
try { try {
mPm.setInstallerPackageName(packageName, "org.fdroid.fdroid"); mPm.setInstallerPackageName(packageName, "org.fdroid.fdroid");
Log.d("FDroid", "Installer package name for " + Log.d(TAG, "Installer package name for " +
packageName + " set successfully"); packageName + " set successfully");
} catch (Exception e) { } catch (Exception e) {
// Many problems can occur: // Many problems can occur:
@ -22,7 +24,7 @@ public class PackageManagerCompat extends Compatibility {
// * Another app interfered in the process // * Another app interfered in the process
// * Another app already set the target's installer package // * Another app already set the target's installer package
// * ... // * ...
Log.e("FDroid", "Could not set installer package name for " + Log.e(TAG, "Could not set installer package name for " +
packageName, e); packageName, e);
} }
} }

View File

@ -13,6 +13,8 @@ import java.util.*;
public class ApkProvider extends FDroidProvider { public class ApkProvider extends FDroidProvider {
private static final String TAG = "fdroid.ApkProvider";
/** /**
* SQLite has a maximum of 999 parameters in a query. Each apk we add * SQLite has a maximum of 999 parameters in a query. Each apk we add
* requires two (id and vercode) so we can only query half of that. Then, * requires two (id and vercode) so we can only query half of that. Then,
@ -369,7 +371,7 @@ public class ApkProvider extends FDroidProvider {
break; break;
default: default:
Log.e("FDroid", "Invalid URI for apk content provider: " + uri); Log.e(TAG, "Invalid URI for apk content provider: " + uri);
throw new UnsupportedOperationException("Invalid URI for apk content provider: " + uri); throw new UnsupportedOperationException("Invalid URI for apk content provider: " + uri);
} }
@ -389,7 +391,7 @@ public class ApkProvider extends FDroidProvider {
for (Map.Entry<String,String> repoField : REPO_FIELDS.entrySet()) { for (Map.Entry<String,String> repoField : REPO_FIELDS.entrySet()) {
String field = repoField.getKey(); String field = repoField.getKey();
if (values.containsKey(field)) { if (values.containsKey(field)) {
Log.i("FDroid", "Cannot insert/update '" + field + "' field " + Log.i(TAG, "Cannot insert/update '" + field + "' field " +
"on apk table, as it belongs to the repo table. " + "on apk table, as it belongs to the repo table. " +
"This field will be ignored."); "This field will be ignored.");
values.remove(field); values.remove(field);
@ -437,7 +439,7 @@ public class ApkProvider extends FDroidProvider {
throw new UnsupportedOperationException("Can't delete individual apks."); throw new UnsupportedOperationException("Can't delete individual apks.");
default: default:
Log.e("FDroid", "Invalid URI for apk content provider: " + uri); Log.e(TAG, "Invalid URI for apk content provider: " + uri);
throw new UnsupportedOperationException("Invalid URI for apk content provider: " + uri); throw new UnsupportedOperationException("Invalid URI for apk content provider: " + uri);
} }

View File

@ -12,6 +12,8 @@ import java.util.*;
public class AppProvider extends FDroidProvider { public class AppProvider extends FDroidProvider {
private static final String TAG = "fdroid.AppProvider";
public static final int MAX_APPS_TO_QUERY = 900; public static final int MAX_APPS_TO_QUERY = 900;
public static final class Helper { public static final class Helper {
@ -610,7 +612,7 @@ public class AppProvider extends FDroidProvider {
break; break;
default: default:
Log.e("FDroid", "Invalid URI for app content provider: " + uri); Log.e(TAG, "Invalid URI for app content provider: " + uri);
throw new UnsupportedOperationException("Invalid URI for app content provider: " + uri); throw new UnsupportedOperationException("Invalid URI for app content provider: " + uri);
} }
@ -722,7 +724,7 @@ public class AppProvider extends FDroidProvider {
*/ */
private void updateSuggestedFromUpstream() { private void updateSuggestedFromUpstream() {
Log.d("FDroid", "Calculating suggested versions for all apps which specify an upstream version code."); Log.d(TAG, "Calculating suggested versions for all apps which specify an upstream version code.");
final String apk = DBHelper.TABLE_APK; final String apk = DBHelper.TABLE_APK;
final String app = DBHelper.TABLE_APP; final String app = DBHelper.TABLE_APP;
@ -754,7 +756,7 @@ public class AppProvider extends FDroidProvider {
*/ */
private void updateCompatibleFlags() { private void updateCompatibleFlags() {
Log.d("FDroid", "Calculating whether apps are compatible, based on whether any of their apks are compatible"); Log.d(TAG, "Calculating whether apps are compatible, based on whether any of their apks are compatible");
final String apk = DBHelper.TABLE_APK; final String apk = DBHelper.TABLE_APK;
final String app = DBHelper.TABLE_APP; final String app = DBHelper.TABLE_APP;
@ -798,7 +800,7 @@ public class AppProvider extends FDroidProvider {
*/ */
private void updateSuggestedFromLatest() { private void updateSuggestedFromLatest() {
Log.d("FDroid", "Calculating suggested versions for all apps which don't specify an upstream version code."); Log.d(TAG, "Calculating suggested versions for all apps which don't specify an upstream version code.");
final String apk = DBHelper.TABLE_APK; final String apk = DBHelper.TABLE_APK;
final String app = DBHelper.TABLE_APP; final String app = DBHelper.TABLE_APP;
@ -818,9 +820,9 @@ public class AppProvider extends FDroidProvider {
private void updateIconUrls() { private void updateIconUrls() {
Log.d("FDroid", "Updating icon paths for apps belonging to repos with version >= " + Repo.VERSION_DENSITY_SPECIFIC_ICONS); Log.d(TAG, "Updating icon paths for apps belonging to repos with version >= " + Repo.VERSION_DENSITY_SPECIFIC_ICONS);
String iconsDir = Utils.getIconsDir(getContext()); String iconsDir = Utils.getIconsDir(getContext());
Log.d("FDroid", "Using icon dir '"+iconsDir+"'"); Log.d(TAG, "Using icon dir '"+iconsDir+"'");
String repoVersion = Integer.toString(Repo.VERSION_DENSITY_SPECIFIC_ICONS); String repoVersion = Integer.toString(Repo.VERSION_DENSITY_SPECIFIC_ICONS);
String query = getIconUpdateQuery(); String query = getIconUpdateQuery();
String[] params = { repoVersion, iconsDir }; String[] params = { repoVersion, iconsDir };

View File

@ -109,7 +109,7 @@ public class DBHelper extends SQLiteOpenHelper {
private void populateRepoNames(SQLiteDatabase db, int oldVersion) { private void populateRepoNames(SQLiteDatabase db, int oldVersion) {
if (oldVersion < 37) { if (oldVersion < 37) {
Log.i("FDroid", "Populating repo names from the url"); Log.i(TAG, "Populating repo names from the url");
String[] columns = { "address", "_id" }; String[] columns = { "address", "_id" };
Cursor cursor = db.query(TABLE_REPO, columns, Cursor cursor = db.query(TABLE_REPO, columns,
"name IS NULL OR name = ''", null, null, null, null); "name IS NULL OR name = ''", null, null, null, null);
@ -123,7 +123,7 @@ public class DBHelper extends SQLiteOpenHelper {
String name = Repo.addressToName(address); String name = Repo.addressToName(address);
values.put("name", name); values.put("name", name);
String[] args = { Long.toString(id) }; String[] args = { Long.toString(id) };
Log.i("FDroid", "Setting repo name to '" + name + "' for repo " + address); Log.i(TAG, "Setting repo name to '" + name + "' for repo " + address);
db.update(TABLE_REPO, values, "_id = ?", args); db.update(TABLE_REPO, values, "_id = ?", args);
cursor.moveToNext(); cursor.moveToNext();
} }
@ -136,7 +136,7 @@ public class DBHelper extends SQLiteOpenHelper {
private void renameRepoId(SQLiteDatabase db, int oldVersion) { private void renameRepoId(SQLiteDatabase db, int oldVersion) {
if (oldVersion < 36 && !columnExists(db, TABLE_REPO, "_id")) { if (oldVersion < 36 && !columnExists(db, TABLE_REPO, "_id")) {
Log.d("FDroid", "Renaming " + TABLE_REPO + ".id to _id"); Log.d(TAG, "Renaming " + TABLE_REPO + ".id to _id");
db.beginTransaction(); db.beginTransaction();
try { try {
@ -178,7 +178,7 @@ public class DBHelper extends SQLiteOpenHelper {
db.execSQL("DROP TABLE " + tempTableName + ";"); db.execSQL("DROP TABLE " + tempTableName + ";");
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} catch (Exception e) { } catch (Exception e) {
Log.e("FDroid", "Error renaming id to _id: " + e.getMessage()); Log.e(TAG, "Error renaming id to _id: " + e.getMessage());
} }
db.endTransaction(); db.endTransaction();
} }
@ -247,14 +247,14 @@ public class DBHelper extends SQLiteOpenHelper {
values.put(RepoProvider.DataColumns.PRIORITY, priority); values.put(RepoProvider.DataColumns.PRIORITY, priority);
values.put(RepoProvider.DataColumns.LAST_ETAG, (String)null); values.put(RepoProvider.DataColumns.LAST_ETAG, (String)null);
Log.i("FDroid", "Adding repository " + name); Log.i(TAG, "Adding repository " + name);
db.insert(TABLE_REPO, null, values); db.insert(TABLE_REPO, null, values);
} }
@Override @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.i("FDroid", "Upgrading database from v" + oldVersion + " v" Log.i(TAG, "Upgrading database from v" + oldVersion + " v"
+ newVersion); + newVersion);
migrateRepoTable(db, oldVersion); migrateRepoTable(db, oldVersion);
@ -395,7 +395,7 @@ public class DBHelper extends SQLiteOpenHelper {
private void addLastUpdatedToRepo(SQLiteDatabase db, int oldVersion) { private void addLastUpdatedToRepo(SQLiteDatabase db, int oldVersion) {
if (oldVersion < 35 && !columnExists(db, TABLE_REPO, "lastUpdated")) { if (oldVersion < 35 && !columnExists(db, TABLE_REPO, "lastUpdated")) {
Log.i("FDroid", "Adding lastUpdated column to " + TABLE_REPO); Log.i(TAG, "Adding lastUpdated column to " + TABLE_REPO);
db.execSQL("Alter table " + TABLE_REPO + " add column lastUpdated string"); db.execSQL("Alter table " + TABLE_REPO + " add column lastUpdated string");
} }
} }

View File

@ -18,6 +18,8 @@ import java.util.Map;
public class InstalledAppProvider extends FDroidProvider { public class InstalledAppProvider extends FDroidProvider {
private static final String TAG = "fdroid.InstalledAppProvider";
public static class Helper { public static class Helper {
/** /**
@ -99,7 +101,7 @@ public class InstalledAppProvider extends FDroidProvider {
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} catch (NotFoundException e) { } catch (NotFoundException e) {
Log.d("InstalledAppProvider", "getApplicationLabel: " + e.getMessage()); Log.d(TAG, "getApplicationLabel: " + e.getMessage());
} }
return packageName; // all else fails, return id return packageName; // all else fails, return id
} }
@ -154,7 +156,7 @@ public class InstalledAppProvider extends FDroidProvider {
default: default:
String message = "Invalid URI for installed app content provider: " + uri; String message = "Invalid URI for installed app content provider: " + uri;
Log.e("FDroid", message); Log.e(TAG, message);
throw new UnsupportedOperationException(message); throw new UnsupportedOperationException(message);
} }

View File

@ -13,6 +13,8 @@ import java.util.Date;
public class Repo extends ValueObject { public class Repo extends ValueObject {
private static final String TAG = "fdroid.Repo";
public static final int VERSION_DENSITY_SPECIFIC_ICONS = 11; public static final int VERSION_DENSITY_SPECIFIC_ICONS = 11;
protected long id; protected long id;
@ -147,7 +149,7 @@ public class Repo extends ValueObject {
try { try {
lastUpdated = Utils.DATE_FORMAT.parse(dateString); lastUpdated = Utils.DATE_FORMAT.parse(dateString);
} catch (ParseException e) { } catch (ParseException e) {
Log.e("FDroid", "Error parsing date " + dateString); Log.e(TAG, "Error parsing date " + dateString);
} }
} }
} }

View File

@ -14,6 +14,8 @@ import java.util.List;
public class RepoProvider extends FDroidProvider { public class RepoProvider extends FDroidProvider {
private static final String TAG = "fdroid.RepoProvider";
public static final class Helper { public static final class Helper {
public static final String TAG = "fdroid.RepoProvider.Helper"; public static final String TAG = "fdroid.RepoProvider.Helper";
@ -179,11 +181,11 @@ public class RepoProvider extends FDroidProvider {
Uri apkUri = ApkProvider.getRepoUri(repo.getId()); Uri apkUri = ApkProvider.getRepoUri(repo.getId());
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
int apkCount = resolver.delete(apkUri, null, null); int apkCount = resolver.delete(apkUri, null, null);
Log.d("FDroid", "Removed " + apkCount + " apks from repo " + repo.name); Log.d(TAG, "Removed " + apkCount + " apks from repo " + repo.name);
Uri appUri = AppProvider.getNoApksUri(); Uri appUri = AppProvider.getNoApksUri();
int appCount = resolver.delete(appUri, null, null); int appCount = resolver.delete(appUri, null, null);
Log.d("Log", "Removed " + appCount + " apps with no apks."); Log.d(TAG, "Removed " + appCount + " apps with no apks.");
} }
public static int countAppsForRepo(Context context, long repoId) { public static int countAppsForRepo(Context context, long repoId) {
@ -271,7 +273,7 @@ public class RepoProvider extends FDroidProvider {
break; break;
default: default:
Log.e("FDroid", "Invalid URI for repo content provider: " + uri); Log.e(TAG, "Invalid URI for repo content provider: " + uri);
throw new UnsupportedOperationException("Invalid URI for repo content provider: " + uri); throw new UnsupportedOperationException("Invalid URI for repo content provider: " + uri);
} }
@ -313,7 +315,7 @@ public class RepoProvider extends FDroidProvider {
} }
long id = write().insertOrThrow(getTableName(), null, values); long id = write().insertOrThrow(getTableName(), null, values);
Log.i("FDroid", "Inserted repo. Notifying provider change: '" + uri + "'."); Log.i(TAG, "Inserted repo. Notifying provider change: '" + uri + "'.");
getContext().getContentResolver().notifyChange(uri, null); getContext().getContentResolver().notifyChange(uri, null);
return getContentUri(id); return getContentUri(id);
} }
@ -332,12 +334,12 @@ public class RepoProvider extends FDroidProvider {
break; break;
default: default:
Log.e("FDroid", "Invalid URI for repo content provider: " + uri); Log.e(TAG, "Invalid URI for repo content provider: " + uri);
throw new UnsupportedOperationException("Invalid URI for repo content provider: " + uri); throw new UnsupportedOperationException("Invalid URI for repo content provider: " + uri);
} }
int rowsAffected = write().delete(getTableName(), where, whereArgs); int rowsAffected = write().delete(getTableName(), where, whereArgs);
Log.i("FDroid", "Deleted repos. Notifying provider change: '" + uri + "'."); Log.i(TAG, "Deleted repos. Notifying provider change: '" + uri + "'.");
getContext().getContentResolver().notifyChange(uri, null); getContext().getContentResolver().notifyChange(uri, null);
return rowsAffected; return rowsAffected;
} }
@ -345,7 +347,7 @@ public class RepoProvider extends FDroidProvider {
@Override @Override
public int update(Uri uri, ContentValues values, String where, String[] whereArgs) { public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {
int numRows = write().update(getTableName(), values, where, whereArgs); int numRows = write().update(getTableName(), values, where, whereArgs);
Log.i("FDroid", "Updated repo. Notifying provider change: '" + uri + "'."); Log.i(TAG, "Updated repo. Notifying provider change: '" + uri + "'.");
getContext().getContentResolver().notifyChange(uri, null); getContext().getContentResolver().notifyChange(uri, null);
return numRows; return numRows;
} }

View File

@ -9,6 +9,8 @@ import java.util.Date;
abstract class ValueObject { abstract class ValueObject {
private static final String TAG = "fdroid.ValueObject";
protected void checkCursorPosition(Cursor cursor) throws IllegalArgumentException { protected void checkCursorPosition(Cursor cursor) throws IllegalArgumentException {
if (cursor.getPosition() == -1) { if (cursor.getPosition() == -1) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
@ -23,7 +25,7 @@ abstract class ValueObject {
try { try {
date = Utils.DATE_FORMAT.parse(string); date = Utils.DATE_FORMAT.parse(string);
} catch (ParseException e) { } catch (ParseException e) {
Log.e("FDroid", "Error parsing date " + string); Log.e(TAG, "Error parsing date " + string);
} }
} }
return date; return date;

View File

@ -112,7 +112,7 @@ public class LocalRepoService extends Service {
private ChangeListener localRepoHttpsChangeListener = new ChangeListener() { private ChangeListener localRepoHttpsChangeListener = new ChangeListener() {
@Override @Override
public void onPreferenceChange() { public void onPreferenceChange() {
Log.i("localRepoHttpsChangeListener", "onPreferenceChange"); Log.i(TAG, "onPreferenceChange");
if (localHttpd.isAlive()) { if (localHttpd.isAlive()) {
new AsyncTask<Void, Void, Void>() { new AsyncTask<Void, Void, Void>() {
@Override @Override

View File

@ -110,7 +110,7 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener {
try { try {
hasher = new Hasher(curApk.hashType, localFile); hasher = new Hasher(curApk.hashType, localFile);
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
Log.e("FDroid", "Error verifying hash of cached apk at " + localFile + ". " + Log.e(TAG, "Error verifying hash of cached apk at " + localFile + ". " +
"I don't understand what the " + curApk.hashType + " hash algorithm is :("); "I don't understand what the " + curApk.hashType + " hash algorithm is :(");
hasher = null; hasher = null;
} }
@ -133,10 +133,10 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener {
private boolean verifyOrDeleteCachedVersion() { private boolean verifyOrDeleteCachedVersion() {
if (localFile.exists()) { if (localFile.exists()) {
if (hashMatches()) { if (hashMatches()) {
Log.d("FDroid", "Using cached apk at " + localFile); Log.d(TAG, "Using cached apk at " + localFile);
return true; return true;
} else { } else {
Log.d("FDroid", "Not using cached apk at " + localFile); Log.d(TAG, "Not using cached apk at " + localFile);
deleteLocalFile(); deleteLocalFile();
} }
} }
@ -228,7 +228,7 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener {
@Override @Override
public void onErrorDownloading(String localisedExceptionDetails) { public void onErrorDownloading(String localisedExceptionDetails) {
Log.e("FDroid", "Download failed: " + localisedExceptionDetails); Log.e(TAG, "Download failed: " + localisedExceptionDetails);
sendError(ERROR_DOWNLOAD_FAILED); sendError(ERROR_DOWNLOAD_FAILED);
deleteLocalFile(); deleteLocalFile();
} }
@ -248,7 +248,7 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener {
// the installer actually installing it. // the installer actually installing it.
FileCompat.setReadable(localFile, true, false); FileCompat.setReadable(localFile, true, false);
Log.d("FDroid", "Download finished: " + localFile); Log.d(TAG, "Download finished: " + localFile);
sendCompleteMessage(); sendCompleteMessage();
} }

View File

@ -32,6 +32,8 @@ import javax.xml.parsers.SAXParserFactory;
abstract public class RepoUpdater { abstract public class RepoUpdater {
private static final String TAG = "fdroid.RepoUpdater";
public static final String PROGRESS_TYPE_PROCESS_XML = "processingXml"; public static final String PROGRESS_TYPE_PROCESS_XML = "processingXml";
public static final String PROGRESS_DATA_REPO_ADDRESS = "repoAddress"; public static final String PROGRESS_DATA_REPO_ADDRESS = "repoAddress";
@ -103,7 +105,7 @@ abstract public class RepoUpdater {
if (downloader.isCached()) { if (downloader.isCached()) {
// The index is unchanged since we last read it. We just mark // The index is unchanged since we last read it. We just mark
// everything that came from this repo as being updated. // everything that came from this repo as being updated.
Log.d("FDroid", "Repo index for " + getIndexAddress() + " is up to date (by etag)"); Log.d(TAG, "Repo index for " + getIndexAddress() + " is up to date (by etag)");
} }
} catch (IOException e) { } catch (IOException e) {
@ -207,20 +209,20 @@ abstract public class RepoUpdater {
// next time we update, we have to download the signed index // next time we update, we have to download the signed index
// in its entirety, regardless of if it contains the same // in its entirety, regardless of if it contains the same
// information as the unsigned one does not... // information as the unsigned one does not...
Log.d("FDroid", Log.d(TAG,
"Public key found - switching to signed repo for future updates"); "Public key found - switching to signed repo for future updates");
values.put(RepoProvider.DataColumns.PUBLIC_KEY, handler.getPubKey()); values.put(RepoProvider.DataColumns.PUBLIC_KEY, handler.getPubKey());
usePubkeyInJar = false; usePubkeyInJar = false;
} }
if (handler.getVersion() != -1 && handler.getVersion() != repo.version) { if (handler.getVersion() != -1 && handler.getVersion() != repo.version) {
Log.d("FDroid", "Repo specified a new version: from " Log.d(TAG, "Repo specified a new version: from "
+ repo.version + " to " + handler.getVersion()); + repo.version + " to " + handler.getVersion());
values.put(RepoProvider.DataColumns.VERSION, handler.getVersion()); values.put(RepoProvider.DataColumns.VERSION, handler.getVersion());
} }
if (handler.getMaxAge() != -1 && handler.getMaxAge() != repo.maxage) { if (handler.getMaxAge() != -1 && handler.getMaxAge() != repo.maxage) {
Log.d("FDroid", Log.d(TAG,
"Repo specified a new maximum age - updated"); "Repo specified a new maximum age - updated");
values.put(RepoProvider.DataColumns.MAX_AGE, handler.getMaxAge()); values.put(RepoProvider.DataColumns.MAX_AGE, handler.getMaxAge());
} }

View File

@ -8,13 +8,15 @@ import java.io.File;
public class UnsignedRepoUpdater extends RepoUpdater { public class UnsignedRepoUpdater extends RepoUpdater {
private static final String TAG = "fdroid.UnsignedRepoUpdater";
public UnsignedRepoUpdater(Context ctx, Repo repo) { public UnsignedRepoUpdater(Context ctx, Repo repo) {
super(ctx, repo); super(ctx, repo);
} }
@Override @Override
protected File getIndexFromFile(File file) throws UpdateException { protected File getIndexFromFile(File file) throws UpdateException {
Log.d("FDroid", "Getting unsigned index from " + getIndexAddress()); Log.d(TAG, "Getting unsigned index from " + getIndexAddress());
return file; return file;
} }

View File

@ -174,7 +174,7 @@ public class ManageReposActivity extends ActionBarActivity {
private void markChangedIfRequired(Intent intent) { private void markChangedIfRequired(Intent intent) {
if (hasChanged()) { if (hasChanged()) {
Log.i("FDroid", "Repo details have changed, prompting for update."); Log.i(TAG, "Repo details have changed, prompting for update.");
intent.putExtra(REQUEST_UPDATE, true); intent.putExtra(REQUEST_UPDATE, true);
} }
} }
@ -612,7 +612,7 @@ public class ManageReposActivity extends ActionBarActivity {
@Override @Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
Uri uri = RepoProvider.getContentUri(); Uri uri = RepoProvider.getContentUri();
Log.i("FDroid", "Creating repo loader '" + uri + "'."); Log.i(TAG, "Creating repo loader '" + uri + "'.");
String[] projection = new String[] { String[] projection = new String[] {
RepoProvider.DataColumns._ID, RepoProvider.DataColumns._ID,
RepoProvider.DataColumns.NAME, RepoProvider.DataColumns.NAME,

View File

@ -30,6 +30,8 @@ abstract public class AppListFragment extends ThemeableListFragment implements
Preferences.ChangeListener, Preferences.ChangeListener,
LoaderManager.LoaderCallbacks<Cursor> { LoaderManager.LoaderCallbacks<Cursor> {
private static final String TAG = "fdroid.AppListFragment";
public static final String[] APP_PROJECTION = { public static final String[] APP_PROJECTION = {
AppProvider.DataColumns._ID, // Required for cursor loader to work. AppProvider.DataColumns._ID, // Required for cursor loader to work.
AppProvider.DataColumns.APP_ID, AppProvider.DataColumns.APP_ID,
@ -122,12 +124,12 @@ abstract public class AppListFragment extends ThemeableListFragment implements
SharedPreferences prefs = getActivity().getPreferences(Context.MODE_PRIVATE); SharedPreferences prefs = getActivity().getPreferences(Context.MODE_PRIVATE);
boolean hasTriedEmptyUpdate = prefs.getBoolean(TRIED_EMPTY_UPDATE, false); boolean hasTriedEmptyUpdate = prefs.getBoolean(TRIED_EMPTY_UPDATE, false);
if (!hasTriedEmptyUpdate) { if (!hasTriedEmptyUpdate) {
Log.d("FDroid", "Empty app list, and we haven't done an update yet. Forcing repo update."); Log.d(TAG, "Empty app list, and we haven't done an update yet. Forcing repo update.");
prefs.edit().putBoolean(TRIED_EMPTY_UPDATE, true).commit(); prefs.edit().putBoolean(TRIED_EMPTY_UPDATE, true).commit();
UpdateService.updateNow(getActivity()); UpdateService.updateNow(getActivity());
return true; return true;
} else { } else {
Log.d("FDroid", "Empty app list, but it looks like we've had an update previously. Will not force repo update."); Log.d(TAG, "Empty app list, but it looks like we've had an update previously. Will not force repo update.");
return false; return false;
} }
} }

View File

@ -33,6 +33,9 @@ import java.util.List;
public class AvailableAppsFragment extends AppListFragment implements public class AvailableAppsFragment extends AppListFragment implements
LoaderManager.LoaderCallbacks<Cursor> { LoaderManager.LoaderCallbacks<Cursor> {
private static final String TAG = "fdroid.AvailableAppsFragment";
public static final String PREFERENCES_FILE = "CategorySpinnerPosition"; public static final String PREFERENCES_FILE = "CategorySpinnerPosition";
public static final String CATEGORY_KEY = "Selection"; public static final String CATEGORY_KEY = "Selection";
public static String DEFAULT_CATEGORY; public static String DEFAULT_CATEGORY;
@ -194,7 +197,7 @@ public class AvailableAppsFragment extends AppListFragment implements
private void setCurrentCategory(String category) { private void setCurrentCategory(String category) {
currentCategory = category; currentCategory = category;
Log.d("FDroid", "Category '" + currentCategory + "' selected."); Log.d(TAG, "Category '" + currentCategory + "' selected.");
getLoaderManager().restartLoader(0, null, AvailableAppsFragment.this); getLoaderManager().restartLoader(0, null, AvailableAppsFragment.this);
} }

View File

@ -113,7 +113,7 @@ public class RepoDetailsFragment extends Fragment {
repo = loadRepoDetails(); repo = loadRepoDetails();
if (repo == null) { if (repo == null) {
Log.e("FDroid", "Error showing details for repo '" + getRepoId() + "'"); Log.e(TAG, "Error showing details for repo '" + getRepoId() + "'");
return new LinearLayout(container.getContext()); return new LinearLayout(container.getContext());
} }