mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-17 07:30:14 -05:00
More fixes for decryption progress
This commit is contained in:
parent
c981902aba
commit
33a4d68520
@ -471,7 +471,7 @@ public class PgpDecryptVerify {
|
|||||||
|
|
||||||
InputStream dataIn = literalData.getInputStream();
|
InputStream dataIn = literalData.getInputStream();
|
||||||
|
|
||||||
int alreadyWritten = 0;
|
long alreadyWritten = 0;
|
||||||
long wholeSize = mData.getSize() - mData.getStreamPosition();
|
long wholeSize = mData.getSize() - mData.getStreamPosition();
|
||||||
Log.d(Constants.TAG, "mData.getStreamPosition(): " + mData.getStreamPosition());
|
Log.d(Constants.TAG, "mData.getStreamPosition(): " + mData.getStreamPosition());
|
||||||
Log.d(Constants.TAG, "wholeSize: " + wholeSize);
|
Log.d(Constants.TAG, "wholeSize: " + wholeSize);
|
||||||
@ -494,14 +494,12 @@ public class PgpDecryptVerify {
|
|||||||
|
|
||||||
alreadyWritten += length;
|
alreadyWritten += length;
|
||||||
if (wholeSize > 0) {
|
if (wholeSize > 0) {
|
||||||
int progress = 100 * alreadyWritten / (int) wholeSize;
|
long progress = 100 * alreadyWritten / wholeSize;
|
||||||
Log.d(Constants.TAG, "progress: " + progress);
|
// stop at 100% for wrong file sizes...
|
||||||
|
|
||||||
// stop at 100 for buggy sizes...
|
|
||||||
if (progress > 100) {
|
if (progress > 100) {
|
||||||
progress = 100;
|
progress = 100;
|
||||||
}
|
}
|
||||||
progressScaler.setProgress(progress, 100);
|
progressScaler.setProgress((int) progress, 100);
|
||||||
} else {
|
} else {
|
||||||
// TODO: slow annealing to fake a progress?
|
// TODO: slow annealing to fake a progress?
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user