debug logging in release builds for disappearing F-Droid
This commit is contained in:
parent
c327cd788b
commit
eac85e725f
@ -641,7 +641,13 @@ public class AppDetails2 extends AppCompatActivity
|
||||
Log.e(TAG, "uninstall aborted with errorMessage: " + errorMessage);
|
||||
|
||||
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails2.this);
|
||||
alertBuilder.setTitle(R.string.uninstall_error_notify_title);
|
||||
Uri uri = intent.getData();
|
||||
if (uri == null) {
|
||||
alertBuilder.setTitle(getString(R.string.uninstall_error_notify_title, ""));
|
||||
} else {
|
||||
alertBuilder.setTitle(getString(R.string.uninstall_error_notify_title,
|
||||
uri.getSchemeSpecificPart()));
|
||||
}
|
||||
alertBuilder.setMessage(errorMessage);
|
||||
alertBuilder.setNeutralButton(android.R.string.ok, null);
|
||||
alertBuilder.create().show();
|
||||
|
@ -10,6 +10,7 @@ import android.content.pm.Signature;
|
||||
import android.net.Uri;
|
||||
import android.os.Process;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
import org.acra.ACRA;
|
||||
import org.fdroid.fdroid.AppUpdateStatusManager;
|
||||
import org.fdroid.fdroid.Hasher;
|
||||
@ -290,6 +291,7 @@ public class InstalledAppProviderService extends IntentService {
|
||||
* into the database when under test.
|
||||
*/
|
||||
static void insertAppIntoDb(Context context, PackageInfo packageInfo, String hashType, String hash) {
|
||||
Log.d(TAG, "insertAppIntoDb " + packageInfo.packageName);
|
||||
Uri uri = InstalledAppProvider.getContentUri();
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(InstalledAppTable.Cols.Package.NAME, packageInfo.packageName);
|
||||
@ -307,6 +309,7 @@ public class InstalledAppProviderService extends IntentService {
|
||||
}
|
||||
|
||||
static void deleteAppFromDb(Context context, String packageName) {
|
||||
Log.d(TAG, "deleteAppFromDb " + packageName);
|
||||
Uri uri = InstalledAppProvider.getAppUri(packageName);
|
||||
context.getContentResolver().delete(uri, null, null);
|
||||
}
|
||||
|
@ -4,8 +4,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.fdroid.fdroid.Utils;
|
||||
import android.util.Log;
|
||||
import org.fdroid.fdroid.data.InstalledAppProviderService;
|
||||
|
||||
/**
|
||||
@ -28,12 +27,12 @@ public class PackageManagerReceiver extends BroadcastReceiver {
|
||||
InstalledAppProviderService.insert(context, intent.getData());
|
||||
} else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
|
||||
if (TextUtils.equals(context.getPackageName(), intent.getData().getSchemeSpecificPart())) {
|
||||
Utils.debugLog(TAG, "Ignoring request to remove ourselves from cache.");
|
||||
Log.i(TAG, "Ignoring request to remove ourselves from cache.");
|
||||
} else {
|
||||
InstalledAppProviderService.delete(context, intent.getData());
|
||||
}
|
||||
} else {
|
||||
Utils.debugLog(TAG, "unsupported action: " + action + " " + intent);
|
||||
Log.i(TAG, "unsupported action: " + action + " " + intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user