diff options
| author | 2020-10-29 13:59:32 +0800 | |
|---|---|---|
| committer | 2020-10-29 15:44:27 +0800 | |
| commit | d168885c0770a0a20d80de3b3940461d675a8e76 (patch) | |
| tree | d93f0edaca6f8bbca3c6a2ae740cb27e7128960a | |
| parent | 68e9f0229d4a2dbdb6ca656393f1bae1bc467773 (diff) | |
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
| -rw-r--r-- | core/java/com/android/internal/app/SuspendedAppActivity.java | 2 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/TEST_MAPPING | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/com/android/internal/app/SuspendedAppActivity.java b/core/java/com/android/internal/app/SuspendedAppActivity.java index 52dc7e646d29..762297d15e6d 100644 --- a/core/java/com/android/internal/app/SuspendedAppActivity.java +++ b/core/java/com/android/internal/app/SuspendedAppActivity.java @@ -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); } diff --git a/core/java/com/android/internal/app/TEST_MAPPING b/core/java/com/android/internal/app/TEST_MAPPING index 373a5d9413a5..8bd791297e9d 100644 --- a/core/java/com/android/internal/app/TEST_MAPPING +++ b/core/java/com/android/internal/app/TEST_MAPPING @@ -1,4 +1,10 @@ { + "presubmit": [ + { + "name": "CtsSuspendAppsTestCases", + "file_patterns": ["(/|^)SuspendedAppActivity\\.java"] + } + ], "postsubmit": [ { "name": "FrameworksCoreTests", @@ -17,4 +23,4 @@ ] } ] -}
\ No newline at end of file +} |