am a17c5bac: am dc89dafa: am 339a9bbf: Merge "Use realActivity as indicator for task locking" into mnc-dev

* commit 'a17c5bac6efff8365c1f2019311778413598e37c':
  Use realActivity as indicator for task locking
This commit is contained in:
Benjamin Franz
2015-08-06 19:32:43 +00:00
committed by Android Git Automerger

View File

@@ -786,7 +786,8 @@ final class TaskRecord {
} }
boolean isLockTaskWhitelistedLocked() { boolean isLockTaskWhitelistedLocked() {
if (mCallingPackage == null) { String pkg = (realActivity != null) ? realActivity.getPackageName() : null;
if (pkg == null) {
return false; return false;
} }
String[] packages = mService.mLockTaskPackages.get(userId); String[] packages = mService.mLockTaskPackages.get(userId);
@@ -794,7 +795,7 @@ final class TaskRecord {
return false; return false;
} }
for (int i = packages.length - 1; i >= 0; --i) { for (int i = packages.length - 1; i >= 0; --i) {
if (mCallingPackage.equals(packages[i])) { if (pkg.equals(packages[i])) {
return true; return true;
} }
} }