diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-10 21:09:10 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-10 21:09:10 +0200 |
commit | 33a4d6852008c81070adabb2795c256ea34cac55 (patch) | |
tree | ee2aa0782a5bcda114672738f7a134e8dee6c3df /OpenKeychain/src | |
parent | c981902abab0a95067937384a89efcea6ca35f14 (diff) | |
download | open-keychain-33a4d6852008c81070adabb2795c256ea34cac55.tar.gz open-keychain-33a4d6852008c81070adabb2795c256ea34cac55.tar.bz2 open-keychain-33a4d6852008c81070adabb2795c256ea34cac55.zip |
More fixes for decryption progress
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 46e69afc4..b38caa80e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -471,7 +471,7 @@ public class PgpDecryptVerify { InputStream dataIn = literalData.getInputStream(); - int alreadyWritten = 0; + long alreadyWritten = 0; long wholeSize = mData.getSize() - mData.getStreamPosition(); Log.d(Constants.TAG, "mData.getStreamPosition(): " + mData.getStreamPosition()); Log.d(Constants.TAG, "wholeSize: " + wholeSize); @@ -494,14 +494,12 @@ public class PgpDecryptVerify { alreadyWritten += length; if (wholeSize > 0) { - int progress = 100 * alreadyWritten / (int) wholeSize; - Log.d(Constants.TAG, "progress: " + progress); - - // stop at 100 for buggy sizes... + long progress = 100 * alreadyWritten / wholeSize; + // stop at 100% for wrong file sizes... if (progress > 100) { progress = 100; } - progressScaler.setProgress(progress, 100); + progressScaler.setProgress((int) progress, 100); } else { // TODO: slow annealing to fake a progress? } |