diff options
author | Michael Groover <mpgroover@google.com> | 2018-08-09 16:12:42 -0700 |
---|---|---|
committer | Michael Groover <mpgroover@google.com> | 2018-08-14 16:39:47 -0700 |
commit | c76ea600852529895c0fb7bd4e067bab7ce435d7 (patch) | |
tree | da5f76ab7235c05e6491306cd4c94a392d80ba66 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 37e17e93a66b0bab9afd62776b92e1036324c973 (diff) |
Resolve NPE and unexpected error code in AccountManagerServiceTest
ag/3915086 modified AccountManagerService to use the PackageManagerInternal returned from
LocalServices. However when AccountManagerServiceTest runs tests against AccountManagerService
it is using a local instance of the object which does not have access to system's local
PackageManagerInternal. To resolve this a mock PackageManagerInternal is added to the LocalServices
with a mocked hasSignatureCapability that returns an appropriate response based on the test. This
fix also exposed an issue that appears to be introduced by ag/2959363; with the change in
checkKeyIntent to no longer throw a SecurityException the expected return code for error paths
is now AccountManager.ERROR_CODE_REMOTE_EXCEPTION.
A small change was also added to AccountsDbTest to skip testCeNotAvailableInitially on eng builds
as the Log.wtf would crash the test process when invoked on eng builds.
Test: adb shell am instrument -w -e package com.android.server.accounts \
com.android.frameworks.servicestests/\
android.support.test.runner.AndroidJUnitRunner
Bug: 80380639
Change-Id: I9438550d1c19cc86ec56991da766d71e068784ab
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions