moved some Intent extra constants into more appropriate places, some basic preparations to test thread-pausing during decryption/encryption to deal with certain situations, mainly an unknown signature key

This commit is contained in:
Thialfihar
2010-09-11 23:21:53 +00:00
parent bc50ca0093
commit b91f9397d9
13 changed files with 97 additions and 33 deletions

View File

@@ -0,0 +1,35 @@
package org.thialfihar.android.apg;
public class PausableThread extends Thread {
private boolean mPaused = false;
public PausableThread(Runnable runnable) {
super(runnable);
}
public void pause() {
synchronized (this) {
mPaused = true;
while (mPaused) {
try {
wait();
} catch (InterruptedException e) {
// ignore
}
}
}
}
public void unpause() {
synchronized (this) {
mPaused = false;
notify();
}
}
public boolean isPaused() {
synchronized (this) {
return mPaused;
}
}
}