am eaf3f545: am 03340feb: Merge "Update Naskh font names to match upstream and add Tibetan." into mnc-dev
* commit 'eaf3f545c742c5d2a892806f0d464379b367db84':
Update Naskh font names to match upstream and add Tibetan.
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java
index 5e7bd0d..b80fc86 100644
--- a/core/java/android/app/AlarmManager.java
+++ b/core/java/android/app/AlarmManager.java
@@ -796,7 +796,7 @@
}
/**
- * Returns an intent intent that can be used to show or edit details of the alarm clock in
+ * Returns an intent that can be used to show or edit details of the alarm clock in
* the application that scheduled it.
*
* <p class="note">Beware that any application can retrieve and send this intent,
diff --git a/core/java/android/security/IKeystoreService.aidl b/core/java/android/security/IKeystoreService.aidl
index b0779c0..30ea8e7 100644
--- a/core/java/android/security/IKeystoreService.aidl
+++ b/core/java/android/security/IKeystoreService.aidl
@@ -30,33 +30,29 @@
* @hide
*/
interface IKeystoreService {
- int test();
+ int getState(int userId);
byte[] get(String name);
int insert(String name, in byte[] item, int uid, int flags);
int del(String name, int uid);
int exist(String name, int uid);
- String[] saw(String namePrefix, int uid);
+ String[] list(String namePrefix, int uid);
int reset();
int onUserPasswordChanged(int userId, String newPassword);
- int lock();
+ int lock(int userId);
int unlock(int userId, String userPassword);
- int zero();
+ int isEmpty(int userId);
int generate(String name, int uid, int keyType, int keySize, int flags,
in KeystoreArguments args);
int import_key(String name, in byte[] data, int uid, int flags);
byte[] sign(String name, in byte[] data);
int verify(String name, in byte[] data, in byte[] signature);
byte[] get_pubkey(String name);
- int del_key(String name, int uid);
int grant(String name, int granteeUid);
int ungrant(String name, int granteeUid);
long getmtime(String name);
int duplicate(String srcKey, int srcUid, String destKey, int destUid);
int is_hardware_backed(String string);
int clear_uid(long uid);
- int reset_uid(int uid);
- int sync_uid(int sourceUid, int targetUid);
- int password_uid(String password, int uid);
// Keymaster 0.4 methods
int addRngEntropy(in byte[] data);
diff --git a/core/java/com/android/internal/app/ProcessStats.java b/core/java/com/android/internal/app/ProcessStats.java
index fe79eff..4cd12c6 100644
--- a/core/java/com/android/internal/app/ProcessStats.java
+++ b/core/java/com/android/internal/app/ProcessStats.java
@@ -3365,10 +3365,11 @@
+ pkgList.keyAt(index) + "/" + proc.mUid
+ " for multi-proc " + proc.mName + " version " + proc.mVersion);
}
+ String savedName = proc.mName;
proc = pkg.mProcesses.get(proc.mName);
if (proc == null) {
throw new IllegalStateException("Didn't create per-package process "
- + proc.mName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
+ + savedName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
}
holder.state = proc;
}
diff --git a/data/keyboards/Android.mk b/data/keyboards/Android.mk
index 898efe8..4616838 100644
--- a/data/keyboards/Android.mk
+++ b/data/keyboards/Android.mk
@@ -32,7 +32,7 @@
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps uncondionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 06f5b06..72eda23 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -146,10 +146,10 @@
}
}
- public State state() {
+ public State state(int userId) {
final int ret;
try {
- ret = mBinder.test();
+ ret = mBinder.getState(userId);
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
throw new AssertionError(e);
@@ -163,6 +163,10 @@
}
}
+ public State state() {
+ return state(UserHandle.myUserId());
+ }
+
public boolean isUnlocked() {
return state() == State.UNLOCKED;
}
@@ -211,15 +215,26 @@
return contains(key, UID_SELF);
}
- public String[] saw(String prefix, int uid) {
+ /**
+ * List all entries in the keystore for {@code uid} starting with {@code prefix}.
+ */
+ public String[] list(String prefix, int uid) {
try {
- return mBinder.saw(prefix, uid);
+ return mBinder.list(prefix, uid);
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return null;
}
}
+ public String[] list(String prefix) {
+ return list(prefix, UID_SELF);
+ }
+
+ public String[] saw(String prefix, int uid) {
+ return list(prefix, uid);
+ }
+
public String[] saw(String prefix) {
return saw(prefix, UID_SELF);
}
@@ -233,15 +248,25 @@
}
}
- public boolean lock() {
+ /**
+ * Attempt to lock the keystore for {@code user}.
+ *
+ * @param user Android user to lock.
+ * @return whether {@code user}'s keystore was locked.
+ */
+ public boolean lock(int userId) {
try {
- return mBinder.lock() == NO_ERROR;
+ return mBinder.lock(userId) == NO_ERROR;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
}
}
+ public boolean lock() {
+ return lock(UserHandle.myUserId());
+ }
+
/**
* Attempt to unlock the keystore for {@code user} with the password {@code password}.
* This is required before keystore entries created with FLAG_ENCRYPTED can be accessed or
@@ -267,15 +292,22 @@
return unlock(UserHandle.getUserId(Process.myUid()), password);
}
- public boolean isEmpty() {
+ /**
+ * Check if the keystore for {@code userId} is empty.
+ */
+ public boolean isEmpty(int userId) {
try {
- return mBinder.zero() == KEY_NOT_FOUND;
+ return mBinder.isEmpty(userId) != 0;
} catch (RemoteException e) {
Log.w(TAG, "Cannot connect to keystore", e);
return false;
}
}
+ public boolean isEmpty() {
+ return isEmpty(UserHandle.myUserId());
+ }
+
public boolean generate(String key, int uid, int keyType, int keySize, int flags,
byte[][] args) {
try {
@@ -306,12 +338,7 @@
}
public boolean delKey(String key, int uid) {
- try {
- return mBinder.del_key(key, uid) == NO_ERROR;
- } catch (RemoteException e) {
- Log.w(TAG, "Cannot connect to keystore", e);
- return false;
- }
+ return delete(key, uid);
}
public boolean delKey(String key) {
@@ -404,36 +431,6 @@
}
}
- public boolean resetUid(int uid) {
- try {
- mError = mBinder.reset_uid(uid);
- return mError == NO_ERROR;
- } catch (RemoteException e) {
- Log.w(TAG, "Cannot connect to keystore", e);
- return false;
- }
- }
-
- public boolean syncUid(int sourceUid, int targetUid) {
- try {
- mError = mBinder.sync_uid(sourceUid, targetUid);
- return mError == NO_ERROR;
- } catch (RemoteException e) {
- Log.w(TAG, "Cannot connect to keystore", e);
- return false;
- }
- }
-
- public boolean passwordUid(String password, int uid) {
- try {
- mError = mBinder.password_uid(password, uid);
- return mError == NO_ERROR;
- } catch (RemoteException e) {
- Log.w(TAG, "Cannot connect to keystore", e);
- return false;
- }
- }
-
public int getLastError() {
return mError;
}
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
index b20a122..71fdb69 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreProvider.java
@@ -111,6 +111,7 @@
*
* @throws IllegalArgumentException if the provided primitive is not supported or is not backed
* by AndroidKeyStore provider.
+ * @throws IllegalStateException if the provided primitive is not initialized.
*/
public static long getKeyStoreOperationHandle(Object cryptoPrimitive) {
if (cryptoPrimitive == null) {
@@ -118,15 +119,17 @@
}
Object spi;
if (cryptoPrimitive instanceof Mac) {
- spi = ((Mac) cryptoPrimitive).getSpi();
+ spi = ((Mac) cryptoPrimitive).getCurrentSpi();
} else if (cryptoPrimitive instanceof Cipher) {
- spi = ((Cipher) cryptoPrimitive).getSpi();
+ spi = ((Cipher) cryptoPrimitive).getCurrentSpi();
} else {
throw new IllegalArgumentException("Unsupported crypto primitive: " + cryptoPrimitive);
}
- if (!(spi instanceof KeyStoreCryptoOperation)) {
+ if (spi == null) {
+ throw new IllegalStateException("Crypto primitive not initialized");
+ } else if (!(spi instanceof KeyStoreCryptoOperation)) {
throw new IllegalArgumentException(
- "Crypto primitive not backed by AndroidKeyStore: " + cryptoPrimitive
+ "Crypto primitive not backed by AndroidKeyStore provider: " + cryptoPrimitive
+ ", spi: " + spi);
}
return ((KeyStoreCryptoOperation) spi).getOperationHandle();
diff --git a/packages/InputDevices/Android.mk b/packages/InputDevices/Android.mk
index f537022..e7190dc 100644
--- a/packages/InputDevices/Android.mk
+++ b/packages/InputDevices/Android.mk
@@ -42,7 +42,7 @@
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps unconditionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 6888d0e..428df8d 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -234,7 +234,9 @@
Log.d(TAG, "Visibility changed to visible=" + visible);
}
mVisible = visible;
- drawFrame();
+ if (visible) {
+ drawFrame();
+ }
}
}
diff --git a/services/core/java/com/android/server/job/JobServiceContext.java b/services/core/java/com/android/server/job/JobServiceContext.java
index bb4e388..d26319b 100644
--- a/services/core/java/com/android/server/job/JobServiceContext.java
+++ b/services/core/java/com/android/server/job/JobServiceContext.java
@@ -73,7 +73,7 @@
private static final long OP_TIMEOUT_MILLIS = 8 * 1000;
private static final String[] VERB_STRINGS = {
- "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING"
+ "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING", "VERB_FINISHED"
};
// States that a job occupies while interacting with the client.
@@ -81,6 +81,7 @@
static final int VERB_STARTING = 1;
static final int VERB_EXECUTING = 2;
static final int VERB_STOPPING = 3;
+ static final int VERB_FINISHED = 4;
// Messages that result from interactions with the client service.
/** System timed out waiting for a response. */
@@ -172,6 +173,7 @@
mRunningJob = null;
mParams = null;
mExecutionStartTimeElapsed = 0L;
+ mVerb = VERB_FINISHED;
removeOpTimeOut();
return false;
}
@@ -307,8 +309,8 @@
break;
case MSG_CALLBACK:
if (DEBUG) {
- Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob + " v:" +
- (mVerb >= 0 ? VERB_STRINGS[mVerb] : "[invalid]"));
+ Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob
+ + " v:" + VERB_STRINGS[mVerb]);
}
removeOpTimeOut();
@@ -524,8 +526,12 @@
* we want to clean up internally.
*/
private void closeAndCleanupJobH(boolean reschedule) {
- final JobStatus completedJob = mRunningJob;
+ final JobStatus completedJob;
synchronized (mLock) {
+ if (mVerb == VERB_FINISHED) {
+ return;
+ }
+ completedJob = mRunningJob;
try {
mBatteryStats.noteJobFinish(mRunningJob.getName(), mRunningJob.getUid());
} catch (RemoteException e) {
@@ -538,7 +544,7 @@
mWakeLock = null;
mRunningJob = null;
mParams = null;
- mVerb = -1;
+ mVerb = VERB_FINISHED;
mCancelled.set(false);
service = null;
mAvailable = true;