am dc89dafa: am 339a9bbf: Merge "Use realActivity as indicator for task locking" into mnc-dev
* commit 'dc89dafaa3d95fe88eaa82b888098ffe9f07e4f5':
Use realActivity as indicator for task locking
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 7e2ad29..9da30bf 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -786,7 +786,8 @@
}
boolean isLockTaskWhitelistedLocked() {
- if (mCallingPackage == null) {
+ String pkg = (realActivity != null) ? realActivity.getPackageName() : null;
+ if (pkg == null) {
return false;
}
String[] packages = mService.mLockTaskPackages.get(userId);
@@ -794,7 +795,7 @@
return false;
}
for (int i = packages.length - 1; i >= 0; --i) {
- if (mCallingPackage.equals(packages[i])) {
+ if (pkg.equals(packages[i])) {
return true;
}
}