Fix the wrong package name to return the wrong resources.
It should pass mSuspendingPackage instead of mSuspendedPackage as the
parameter of the getResourcesForApplication.
Root cause: The intellij is very smart to provide the autocomplete
options and the developer choose the wrong option.
Solution:
* Add file_pattern in TEST_MAPPING to trigger the CTS tests.
* The developer should take the autocomplete option very
carefully especially the options are very alike.
Fixes: 171835218
Fixes: 171779738
Test: atest CtsSuspendAppsTestCases
Test: atest -p frameworks/base/core/java/com/android/internal/app
Change-Id: I0a213e5fcbf207b89f203e25cf1ace1b8406a879
This commit is contained in:
@@ -193,7 +193,7 @@ public class SuspendedAppActivity extends AlertActivity
|
||||
try {
|
||||
mSuspendingAppResources = createContextAsUser(
|
||||
UserHandle.of(mUserId), /* flags */ 0).getPackageManager()
|
||||
.getResourcesForApplication(mSuspendedPackage);
|
||||
.getResourcesForApplication(mSuspendingPackage);
|
||||
} catch (PackageManager.NameNotFoundException ne) {
|
||||
Slog.e(TAG, "Could not find resources for " + mSuspendingPackage, ne);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"presubmit": [
|
||||
{
|
||||
"name": "CtsSuspendAppsTestCases",
|
||||
"file_patterns": ["(/|^)SuspendedAppActivity\\.java"]
|
||||
}
|
||||
],
|
||||
"postsubmit": [
|
||||
{
|
||||
"name": "FrameworksCoreTests",
|
||||
@@ -17,4 +23,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user