Use Timber instead of Android.Log

This commit is contained in:
Vincent Breitmoser
2018-01-20 02:12:43 +01:00
parent 73b65bf50b
commit 22c65f2ab8
161 changed files with 782 additions and 947 deletions

View File

@@ -34,10 +34,9 @@ import android.os.Binder;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.util.OpenPgpApi;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
/**
@@ -86,13 +85,13 @@ public class ApiPermissionHelper {
return null;
} else {
String packageName = getCurrentCallingPackage();
Log.d(Constants.TAG, "isAllowed packageName: " + packageName);
Timber.d("isAllowed packageName: " + packageName);
byte[] packageCertificate;
try {
packageCertificate = getPackageCertificate(packageName);
} catch (NameNotFoundException e) {
Log.e(Constants.TAG, "Should not happen, returning!", e);
Timber.e(e, "Should not happen, returning!");
// return error
Intent result = new Intent();
result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR);
@@ -100,7 +99,7 @@ public class ApiPermissionHelper {
new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage()));
return result;
}
Log.e(Constants.TAG, "Not allowed to use service! return PendingIntent for registration!");
Timber.e("Not allowed to use service! return PendingIntent for registration!");
PendingIntent pi = piFactory.createRegisterPendingIntent(data, packageName, packageCertificate);
@@ -112,7 +111,7 @@ public class ApiPermissionHelper {
return result;
}
} catch (WrongPackageCertificateException e) {
Log.e(Constants.TAG, "wrong signature!", e);
Timber.e(e, "wrong signature!");
PendingIntent pi = piFactory.createErrorPendingIntent(data, mContext.getString(R.string.api_error_wrong_signature));
@@ -159,7 +158,7 @@ public class ApiPermissionHelper {
// No plans to support sharedUserIds due to many bugs connected to them:
// http://java-hamster.blogspot.de/2010/05/androids-shareduserid.html
String currentPkg = callingPackages[0];
Log.d(Constants.TAG, "currentPkg: " + currentPkg);
Timber.d("currentPkg: " + currentPkg);
return currentPkg;
}
@@ -187,7 +186,7 @@ public class ApiPermissionHelper {
}
}
Log.e(Constants.TAG, "Uid is NOT allowed!");
Timber.e("Uid is NOT allowed!");
return false;
}
@@ -197,16 +196,16 @@ public class ApiPermissionHelper {
* @throws WrongPackageCertificateException
*/
public boolean isPackageAllowed(String packageName) throws WrongPackageCertificateException {
Log.d(Constants.TAG, "isPackageAllowed packageName: " + packageName);
Timber.d("isPackageAllowed packageName: " + packageName);
byte[] storedPackageCert = mApiDao.getApiAppCertificate(packageName);
boolean isKnownPackage = storedPackageCert != null;
if (!isKnownPackage) {
Log.d(Constants.TAG, "Package is NOT allowed! packageName: " + packageName);
Timber.d("Package is NOT allowed! packageName: " + packageName);
return false;
}
Log.d(Constants.TAG, "Package is allowed! packageName: " + packageName);
Timber.d("Package is allowed! packageName: " + packageName);
byte[] currentPackageCert;
try {
@@ -217,7 +216,7 @@ public class ApiPermissionHelper {
boolean packageCertMatchesStored = Arrays.equals(currentPackageCert, storedPackageCert);
if (packageCertMatchesStored) {
Log.d(Constants.TAG,"Package certificate matches expected.");
Timber.d("Package certificate matches expected.");
return true;
}

View File

@@ -32,7 +32,7 @@ import android.os.RemoteException;
import org.openintents.openpgp.util.OpenPgpApi;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -158,7 +158,7 @@ public class CryptoInputParcelCacheService extends Service {
case MSG_GET_NOT_FOUND:
throw new InputParcelNotFound();
default:
Log.e(Constants.TAG, "timeout!");
Timber.e("timeout!");
throw new InputParcelNotFound("should not happen!");
}
}
@@ -206,19 +206,19 @@ public class CryptoInputParcelCacheService extends Service {
try {
messenger.send(msg);
} catch (RemoteException e) {
Log.e(Constants.TAG, "CryptoInputParcelCacheService: Sending message failed", e);
Timber.e(e, "CryptoInputParcelCacheService: Sending message failed");
}
break;
}
default: {
Log.e(Constants.TAG, "CryptoInputParcelCacheService: Intent or Intent Action not supported!");
Timber.e("CryptoInputParcelCacheService: Intent or Intent Action not supported!");
break;
}
}
if (mCache.size() <= 0) {
// stop whole service if cache is empty
Log.d(Constants.TAG, "CryptoInputParcelCacheService: No passphrases remaining in memory, stopping service!");
Timber.d("CryptoInputParcelCacheService: No passphrases remaining in memory, stopping service!");
stopSelf();
}
@@ -229,13 +229,13 @@ public class CryptoInputParcelCacheService extends Service {
public void onCreate() {
super.onCreate();
mContext = this;
Log.d(Constants.TAG, "CryptoInputParcelCacheService, onCreate()");
Timber.d("CryptoInputParcelCacheService, onCreate()");
}
@Override
public void onDestroy() {
super.onDestroy();
Log.d(Constants.TAG, "CryptoInputParcelCacheService, onDestroy()");
Timber.d("CryptoInputParcelCacheService, onDestroy()");
}
@Override

View File

@@ -54,7 +54,8 @@ import org.sufficientlysecure.keychain.provider.KeychainExternalContract.Autocry
import org.sufficientlysecure.keychain.provider.KeychainExternalContract.EmailStatus;
import org.sufficientlysecure.keychain.provider.SimpleContentResolverInterface;
import org.sufficientlysecure.keychain.util.CloseDatabaseCursorFactory;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class KeychainExternalProvider extends ContentProvider implements SimpleContentResolverInterface {
private static final int EMAIL_STATUS = 101;
@@ -135,7 +136,7 @@ public class KeychainExternalProvider extends ContentProvider implements SimpleC
@Override
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
Log.v(Constants.TAG, "query(uri=" + uri + ", proj=" + Arrays.toString(projection) + ")");
Timber.v("query(uri=" + uri + ", proj=" + Arrays.toString(projection) + ")");
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
@@ -349,8 +350,7 @@ public class KeychainExternalProvider extends ContentProvider implements SimpleC
}
}
Log.d(Constants.TAG,
"Query: " + qb.buildQuery(projection, selection, groupBy, null, orderBy, null));
Timber.d("Query: " + qb.buildQuery(projection, selection, groupBy, null, orderBy, null));
return cursor;
}

View File

@@ -81,8 +81,9 @@ import org.sufficientlysecure.keychain.service.BackupKeyringParcel;
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.Passphrase;
import timber.log.Timber;
public class OpenPgpService extends Service {
public static final int API_VERSION_WITH_KEY_INVALID_INSECURE = 8;
@@ -193,7 +194,7 @@ public class OpenPgpService extends Service {
throw new Exception(getString(errorMsg.mType.getMsgId()));
}
} catch (Exception e) {
Log.d(Constants.TAG, "signImpl", e);
Timber.d(e, "signImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -296,7 +297,7 @@ public class OpenPgpService extends Service {
throw new Exception(getString(errorMsg.mType.getMsgId()));
}
} catch (Exception e) {
Log.d(Constants.TAG, "encryptAndSignImpl", e);
Timber.d(e, "encryptAndSignImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -446,7 +447,7 @@ public class OpenPgpService extends Service {
}
} catch (Exception e) {
Log.e(Constants.TAG, "decryptAndVerifyImpl", e);
Timber.e(e, "decryptAndVerifyImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -486,7 +487,7 @@ public class OpenPgpService extends Service {
if (autocryptPeerUpdate.hasKeyData()) {
UncachedKeyRing uncachedKeyRing = UncachedKeyRing.decodeFromData(autocryptPeerUpdate.getKeyData());
if (uncachedKeyRing.isSecret()) {
Log.e(Constants.TAG, "Found secret key in autocrypt id! - Ignoring");
Timber.e("Found secret key in autocrypt id! - Ignoring");
return null;
}
// this will merge if the key already exists - no worries!
@@ -669,7 +670,7 @@ public class OpenPgpService extends Service {
try {
outputStream.close();
} catch (IOException e) {
Log.e(Constants.TAG, "IOException when closing OutputStream", e);
Timber.e(e, "IOException when closing OutputStream");
}
}
}
@@ -689,7 +690,7 @@ public class OpenPgpService extends Service {
return result;
}
} catch (Exception e) {
Log.d(Constants.TAG, "getKeyImpl", e);
Timber.d(e, "getKeyImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -776,7 +777,7 @@ public class OpenPgpService extends Service {
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, errorMsg);
}
} catch (Exception e) {
Log.d(Constants.TAG, "backupImpl", e);
Timber.d(e, "backupImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -797,7 +798,7 @@ public class OpenPgpService extends Service {
result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS);
return result;
} catch (Exception e) {
Log.d(Constants.TAG, "exception in updateAutocryptPeerImpl", e);
Timber.d(e, "exception in updateAutocryptPeerImpl");
return createErrorResultIntent(OpenPgpError.GENERIC_ERROR, e.getMessage());
}
}
@@ -870,7 +871,8 @@ public class OpenPgpService extends Service {
private final IOpenPgpService.Stub mBinder = new IOpenPgpService.Stub() {
@Override
public Intent execute(Intent data, ParcelFileDescriptor input, ParcelFileDescriptor output) {
Log.w(Constants.TAG, "You are using a deprecated service which may lead to truncated data on return, please use IOpenPgpService2!");
Timber.w(
"You are using a deprecated service which may lead to truncated data on return, please use IOpenPgpService2!");
return executeInternal(data, input, output);
}
@@ -900,14 +902,14 @@ public class OpenPgpService extends Service {
try {
inputStream.close();
} catch (IOException e) {
Log.e(Constants.TAG, "IOException when closing input ParcelFileDescriptor", e);
Timber.e(e, "IOException when closing input ParcelFileDescriptor");
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
Log.e(Constants.TAG, "IOException when closing output ParcelFileDescriptor", e);
Timber.e(e, "IOException when closing output ParcelFileDescriptor");
}
}
}
@@ -943,7 +945,8 @@ public class OpenPgpService extends Service {
}
case OpenPgpApi.ACTION_SIGN: {
// DEPRECATED: same as ACTION_CLEARTEXT_SIGN
Log.w(Constants.TAG, "You are using a deprecated API call, please use ACTION_CLEARTEXT_SIGN instead of ACTION_SIGN!");
Timber.w(
"You are using a deprecated API call, please use ACTION_CLEARTEXT_SIGN instead of ACTION_SIGN!");
return signImpl(data, inputStream, outputStream, true);
}
case OpenPgpApi.ACTION_DETACHED_SIGN: {

View File

@@ -23,8 +23,7 @@ import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import org.openintents.openpgp.IOpenPgpService2;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
import java.io.IOException;
import java.util.HashMap;
@@ -48,7 +47,7 @@ public class OpenPgpService2 extends OpenPgpService {
mOutputPipeMap.put(createKey(outputPipeId), pipe[1]);
return pipe[0];
} catch (IOException e) {
Log.e(Constants.TAG, "IOException in OpenPgpService2", e);
Timber.e(e, "IOException in OpenPgpService2");
return null;
}

View File

@@ -31,12 +31,11 @@ import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import org.openintents.openpgp.util.OpenPgpApi;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.provider.KeychainContract.ApiAutocryptPeer;
import org.sufficientlysecure.keychain.provider.KeychainExternalContract;
import org.sufficientlysecure.keychain.provider.KeychainExternalContract.AutocryptStatus;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
class OpenPgpServiceKeyIdExtractor {
@@ -158,7 +157,7 @@ class OpenPgpServiceKeyIdExtractor {
}
if (userIdEntries.size() != encryptionAddresses.length) {
Log.e(Constants.TAG, "Number of rows doesn't match number of retrieved rows! Probably a bug?");
Timber.e("Number of rows doesn't match number of retrieved rows! Probably a bug?");
}
allKeysConfirmed = !anyKeyNotVerified;

View File

@@ -48,6 +48,7 @@ import org.sufficientlysecure.keychain.ssh.AuthenticationOperation;
import org.sufficientlysecure.keychain.ssh.AuthenticationParcel;
import org.sufficientlysecure.keychain.ssh.AuthenticationResult;
import org.sufficientlysecure.keychain.ssh.signature.SshSignatureConverter;
import timber.log.Timber;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
@@ -412,7 +413,7 @@ public class SshAuthenticationService extends Service {
}
private Intent createErrorResult(int errorCode, String errorMessage) {
Log.e(TAG, errorMessage);
Timber.e(errorMessage);
Intent result = new Intent();
result.putExtra(SshAuthenticationApi.EXTRA_ERROR, new SshAuthenticationApiError(errorCode, errorMessage));
result.putExtra(SshAuthenticationApi.EXTRA_RESULT_CODE, SshAuthenticationApi.RESULT_CODE_ERROR);

View File

@@ -35,7 +35,6 @@ import android.widget.ImageView;
import android.widget.TextView;
import org.bouncycastle.util.encoders.Hex;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.operations.results.OperationResult;
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
@@ -43,7 +42,8 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.ui.base.BaseActivity;
import org.sufficientlysecure.keychain.ui.dialog.AdvancedAppSettingsDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class AppSettingsActivity extends BaseActivity {
private Uri mAppUri;
@@ -82,12 +82,12 @@ public class AppSettingsActivity extends BaseActivity {
Intent intent = getIntent();
mAppUri = intent.getData();
if (mAppUri == null) {
Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!");
Timber.e("Intent data missing. Should be Uri of app!");
finish();
return;
}
Log.d(Constants.TAG, "uri: " + mAppUri);
Timber.d("uri: %s", mAppUri);
loadData(savedInstanceState, mAppUri);
}
@@ -142,7 +142,7 @@ public class AppSettingsActivity extends BaseActivity {
byte[] digest = md.digest();
certificate = new String(Hex.encode(digest));
} catch (NoSuchAlgorithmException e) {
Log.e(Constants.TAG, "Should not happen!", e);
Timber.e(e, "Should not happen!");
}
AdvancedAppSettingsDialogFragment dialogFragment =
@@ -163,7 +163,7 @@ public class AppSettingsActivity extends BaseActivity {
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
Log.e(Constants.TAG, "startApp", e);
Timber.e(e, "startApp");
}
}
@@ -187,7 +187,7 @@ public class AppSettingsActivity extends BaseActivity {
mAppIconView.setImageDrawable(appIcon);
Uri allowedKeysUri = appUri.buildUpon().appendPath(KeychainContract.PATH_ALLOWED_KEYS).build();
Log.d(Constants.TAG, "allowedKeysUri: " + allowedKeysUri);
Timber.d("allowedKeysUri: " + allowedKeysUri);
startListFragments(savedInstanceState, allowedKeysUri);
}

View File

@@ -33,7 +33,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ListFragmentWorkaround;
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
@@ -41,7 +40,8 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.ui.adapter.KeyAdapter;
import org.sufficientlysecure.keychain.ui.adapter.KeySelectableAdapter;
import org.sufficientlysecure.keychain.ui.widget.FixedListView;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class AppSettingsAllowedKeysListFragment extends ListFragmentWorkaround implements LoaderManager.LoaderCallbacks<Cursor> {
private static final String ARG_DATA_URI = "uri";
@@ -143,7 +143,7 @@ public class AppSettingsAllowedKeysListFragment extends ListFragmentWorkaround i
try {
mApiDao.saveAllowedKeyIdsForApp(mDataUri, getSelectedMasterKeyIds());
} catch (RemoteException | OperationApplicationException e) {
Log.e(Constants.TAG, "Problem saving allowed key ids!", e);
Timber.e(e, "Problem saving allowed key ids!");
}
}

View File

@@ -30,10 +30,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import org.bouncycastle.util.encoders.Hex;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -100,7 +99,7 @@ public class AppSettingsHeaderFragment extends Fragment {
mPackageCertificate.setText(signature);
} catch (NoSuchAlgorithmException e) {
Log.e(Constants.TAG, "Should not happen!", e);
Timber.e(e, "Should not happen!");
}
}

View File

@@ -41,11 +41,11 @@ import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainContract.ApiApps;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class AppsListFragment extends ListFragment implements
LoaderManager.LoaderCallbacks<Cursor>, OnItemClickListener {
@@ -106,7 +106,7 @@ public class AppsListFragment extends ListFragment implements
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
Log.e(Constants.TAG, "startApp", e);
Timber.e(e, "startApp");
}
}
} else {
@@ -326,7 +326,7 @@ public class AppsListFragment extends ListFragment implements
ImageView installIcon = (ImageView) view.findViewById(R.id.api_apps_adapter_install_icon);
String packageName = cursor.getString(INDEX_PACKAGE_NAME);
Log.d(Constants.TAG, "packageName: " + packageName);
Timber.d("packageName: " + packageName);
int installed = cursor.getInt(INDEX_INSTALLED);
String name = cursor.getString(INDEX_NAME);
int iconResName = cursor.getInt(INDEX_ICON_RES_ID);

View File

@@ -25,11 +25,10 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
class RemoteRegisterPresenter {
@@ -61,7 +60,7 @@ class RemoteRegisterPresenter {
try {
setPackageInfo(packageName);
} catch (NameNotFoundException e) {
Log.e(Constants.TAG, "Unable to find info of calling app!");
Timber.e("Unable to find info of calling app!");
view.finishAsCancelled();
return;
}

View File

@@ -26,7 +26,6 @@ import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import org.openintents.openpgp.util.OpenPgpUtils.UserId;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey.SecretKeyType;
import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException;
@@ -37,7 +36,7 @@ import org.sufficientlysecure.keychain.provider.KeyRepository.NotFoundException;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.remote.ApiPermissionHelper;
import org.sufficientlysecure.keychain.remote.ApiPermissionHelper.WrongPackageCertificateException;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
class RequestKeyPermissionPresenter {
@@ -83,7 +82,7 @@ class RequestKeyPermissionPresenter {
try {
setPackageInfo(packageName);
} catch (NameNotFoundException e) {
Log.e(Constants.TAG, "Unable to find info of calling app!");
Timber.e("Unable to find info of calling app!");
view.finishAsCancelled();
return;
}

View File

@@ -25,14 +25,12 @@ import android.view.View;
import android.widget.TextView;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpUtils;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.operations.results.OperationResult;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.ui.base.BaseActivity;
import org.sufficientlysecure.keychain.ui.CreateKeyActivity;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class SelectSignKeyIdActivity extends BaseActivity {
@@ -74,10 +72,10 @@ public class SelectSignKeyIdActivity extends BaseActivity {
mPreferredUserId = intent.getStringExtra(EXTRA_USER_ID);
mData = intent.getParcelableExtra(EXTRA_DATA);
if (appUri == null) {
Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!");
Timber.e("Intent data missing. Should be Uri of app!");
finish();
} else {
Log.d(Constants.TAG, "uri: " + appUri);
Timber.d("uri: " + appUri);
startListFragments(savedInstanceState, appUri, mData, mPreferredUserId);
}
}
@@ -123,7 +121,7 @@ public class SelectSignKeyIdActivity extends BaseActivity {
// EditKeyResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
// mSelectKeySpinner.setSelectedKeyId(result.mMasterKeyId);
} else {
Log.e(Constants.TAG, "missing result!");
Timber.e("missing result!");
}
}
break;

View File

@@ -30,7 +30,6 @@ import android.support.v7.widget.LinearLayoutManager;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpUtils;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
@@ -40,7 +39,8 @@ import org.sufficientlysecure.keychain.remote.ui.adapter.SelectSignKeyAdapter;
import org.sufficientlysecure.keychain.ui.CreateKeyActivity;
import org.sufficientlysecure.keychain.ui.util.adapter.CursorAdapter;
import org.sufficientlysecure.keychain.ui.base.RecyclerFragment;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
public class SelectSignKeyIdListFragment extends RecyclerFragment<SelectSignKeyAdapter>
implements SelectSignKeyAdapter.SelectSignKeyListener, LoaderManager.LoaderCallbacks<Cursor> {
@@ -182,8 +182,8 @@ public class SelectSignKeyIdListFragment extends RecyclerFragment<SelectSignKeyA
mApiDao.addAllowedKeyIdForApp(allowedKeysUri, masterKeyId);
mResult.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, masterKeyId);
Log.d(Constants.TAG, "allowedKeyId: " + masterKeyId);
Log.d(Constants.TAG, "allowedKeysUri: " + allowedKeysUri);
Timber.d("allowedKeyId: " + masterKeyId);
Timber.d("allowedKeysUri: " + allowedKeysUri);
getActivity().setResult(Activity.RESULT_OK, mResult);
getActivity().finish();

View File

@@ -30,12 +30,11 @@ import android.support.v4.app.LoaderManager;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.Loader;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.provider.AutocryptPeerDataAccessObject;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.remote.ui.dialog.KeyLoader.KeyInfo;
import org.sufficientlysecure.keychain.remote.ui.dialog.KeyLoader.KeySelector;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
class RemoteDeduplicatePresenter implements LoaderCallbacks<List<KeyInfo>> {
@@ -68,7 +67,7 @@ class RemoteDeduplicatePresenter implements LoaderCallbacks<List<KeyInfo>> {
try {
setPackageInfo(packageName);
} catch (NameNotFoundException e) {
Log.e(Constants.TAG, "Unable to find info of calling app!");
Timber.e("Unable to find info of calling app!");
view.finishAsCancelled();
return;
}
@@ -113,11 +112,11 @@ class RemoteDeduplicatePresenter implements LoaderCallbacks<List<KeyInfo>> {
void onClickSelect() {
if (keyInfoData == null) {
Log.e(Constants.TAG, "got click on select with no data…?");
Timber.e("got click on select with no data…?");
return;
}
if (selectedItem == null) {
Log.e(Constants.TAG, "got click on select with no selection…?");
Timber.e("got click on select with no selection…?");
return;
}

View File

@@ -28,11 +28,10 @@ import android.support.v4.app.LoaderManager;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.Loader;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.remote.ui.dialog.KeyLoader.KeyInfo;
import org.sufficientlysecure.keychain.remote.ui.dialog.KeyLoader.KeySelector;
import org.sufficientlysecure.keychain.util.Log;
import timber.log.Timber;
import java.util.List;
@@ -64,7 +63,7 @@ class RemoteSelectAuthenticationKeyPresenter implements LoaderCallbacks<List<Key
try {
setPackageInfo(packageName);
} catch (NameNotFoundException e) {
Log.e(Constants.TAG, "Unable to find info of calling app!");
Timber.e("Unable to find info of calling app!");
view.finishAsCancelled();
}
}
@@ -103,11 +102,11 @@ class RemoteSelectAuthenticationKeyPresenter implements LoaderCallbacks<List<Key
void onClickSelect() {
if (keyInfoData == null) {
Log.e(Constants.TAG, "got click on select with no data…?");
Timber.e("got click on select with no data…?");
return;
}
if (selectedItem == null) {
Log.e(Constants.TAG, "got click on select with no selection…?");
Timber.e("got click on select with no selection…?");
return;
}