Fix regression in OBB key handling

Change-Id: If583cbdb8be68ffed094a5fde7ee00e1914c5841
This commit is contained in:
Kenny Root
2010-10-01 08:37:20 -07:00
parent 0a69f59760
commit 2942391801

View File

@@ -1599,6 +1599,8 @@ class MountService extends IMountService.Stub
addObbState(obbState); addObbState(obbState);
} }
String hashedKey = null;
if (key != null) {
final MessageDigest md; final MessageDigest md;
try { try {
md = MessageDigest.getInstance("MD5"); md = MessageDigest.getInstance("MD5");
@@ -1612,7 +1614,8 @@ class MountService extends IMountService.Stub
return; return;
} }
String hashedKey = HexDump.toHexString(md.digest(key.getBytes())); hashedKey = HexDump.toHexString(md.digest(key.getBytes()));
}
ObbAction action = new MountObbAction(obbState, hashedKey); ObbAction action = new MountObbAction(obbState, hashedKey);
mObbActionHandler.sendMessage(mObbActionHandler.obtainMessage(OBB_RUN_ACTION, action)); mObbActionHandler.sendMessage(mObbActionHandler.obtainMessage(OBB_RUN_ACTION, action));
@@ -1956,10 +1959,6 @@ class MountService extends IMountService.Stub
throw new IllegalArgumentException("Caller package does not match OBB file"); throw new IllegalArgumentException("Caller package does not match OBB file");
} }
if (mKey == null) {
mKey = "none";
}
boolean mounted = false; boolean mounted = false;
int rc; int rc;
synchronized (mObbState) { synchronized (mObbState) {