Commit Graph

4599 Commits

Author SHA1 Message Date
Ian Kasprzak
df6b2f6989 Remove android-support-test lib from testutils.
Fixed dependencies as needed.

Fixes apct/net/networking_framework_unit_test broken
in aosp/919393.

Test: m tests, checkbuild and Forrest (via gerritt) testing
Bug: 127910239

Change-Id: Ida0ca8012ede9227d204935b11002ddfa2f134ff
Merged-In: Ia825e0926b46855f9056739441cb21a065692076
(Manual partial cherry-pick of ec6bcbceee)
2019-03-11 20:09:29 +00:00
Brett Chabot
8091d9e6d9 Migrate frameworks/base/tests/testables and its users to androidx.test
See go/jetpack-test-android-migration

Test: atest TestablesTests NetworkStackTests FrameworksServicesTests SystemUITests FrameworksUiServicesTests ExtServicesUnitTests
Exempt-From-Owner-Approval: already reviewed
Change-Id: I083fcdaa71b503535aa2b3c257740f3ecf055373
Merged-In: Ib04d80954bd8536914d88c66b28e6632e60a6245
2019-03-01 17:23:42 +00:00
Nicolas Geoffray
653356f114 Support dexopting shared libraries.
Test: adb shell setprop dalvik.vm.boot-image /system/framework/apex.art && see compilations in dalvik-cache
Test: BackgroundDexOptServiceIntegrationTests
Test: DexoptUtilsTest
Bug: 119800099
Change-Id: I3445b8743d576e09c9a339602307ba3a219db1fc
2019-03-01 10:27:35 +00:00
Neil Fuller
ee15067180 Merge "Update RulesManagerService after APEX files" 2019-02-22 18:32:13 +00:00
Neil Fuller
a1ae02519d Update RulesManagerService after APEX files
Context
=======

The "time zone updates via APK" feature was implemented in O-MR1 to enable
devices to take time zone updates via an APK update and without needing
an OTA. RulesManagerService is an important part of the time zone updates via
APK feature. When RulesManagerService was implemented things were simple; there
was a copy of time zone data in /system. A new (optional) copy was introduced
in /data that could be managed / updated by the RulesManagerService.
Since there were only two copies the /system copy was referred to as the
"system" data.

With the introduction of the runtime APEX and time zone data APEX things
have become more complicated. Android devices can have time zone data in
several places:

1 The copy in /system/usr/share/zoneinfo/ is partially complete and remains
  for legacy usecases, e.g. binaries that "know" about the /system path and
  cannot be updated, or binaries which run before /apex paths are mounted.

2 The copy in /apex/com.android.runtime/ is a complete set of time zone
  data that can be used by libraries on the device.

3 The copy in /apex/com.android.tzdata/ is the "overlay" copy for use when
  the time zone data APEX can be updated. For devices that can take APEX
  updates it will be present and is expected to start with the same version as
  present in /apex/com.android.runtime. Note: Nothing in the code *requires*
  this copy to be present but it is expected to be present in most cases.

RulesManagerService is being kept around for devices that may not have the
capability of updating their APEX files but which still want to update time
zone data without taking an OTA. It is assumed that RulesManagerService will
*only* be turned on in these situations and *not* when the time zone
data in /apex/com.android.tzdata/ might actually be updated independently of
the copy in /apex/com.android.runtime/.

The RulesManagerService therefore adds the fourth copy of the data that *could*
be present:

4 The copy /data/misc/zoneinfo/ managed by RulesManagerService.

Important libraries / binaries on device know about all 4 copies and
prioritize them in order 4, 3, 2, 1. i.e. the libraries will use the
first copy of data found in that order.

In scenarios where RulesManagerService is disabled, 4 will not be present
and therefore 3 will be used (or 2 if 3 is also not present).

In scenarios where RulesManagersService is enabled, 4 is present iff an
APK update has been received. It is assumed that *if* /apex/com.android.tzdata/
is present, it contains the same version of tz data as in
/apex/com.android.runtime/, will never be updated, and can therefore
be ignored by RulesManagerService.

The changes
===========

This commit and others in the same topic do the following:

1) Change RulesManagerService references to "system" data to "base" data in a
   valiant attempt to limit confusion until it can be removed.
2) Switch RulesManagerService over from using the data in
   /system/usr/share/zoneinfo/ as base data to the data in
   /apex/com.android.runtime/.  As part of this change, the RulesManagerService
   can now use the tz_version file to identify the version of tzdb in "base"
   rather than reading the header of the tzdata file, so that is done
   here too.
3) Update imports neccessary to meet pre-upload check requirements.

Note: tzdatacheck, an independent binary that manages time zone data
after OTA, was updated to use /apex/com.android.runtime/ instead of
/system/usr/share/zoneinfo/ in commit c6a2737e0861472d1726ed472708d7762ab1e802.

Bug: 119293618
Bug: 113373927
Test: atest FrameworksCoreTests:android.app.timezone
Test: atest FrameworksServicesTests:com.android.server.timezone
Test: CTS: run cts-dev -m CtsLibcoreTestCases -t libcore.libcore.timezone.ZoneInfoDBTest
Test: CTS: run cts-dev -m CtsLibcoreTestCases -t libcore.libcore.icu.TimeZoneIntegrationTest
Change-Id: Idabe245c7ad337938c202b1796ce9d89ec68bbd6
2019-02-22 15:43:39 +00:00
Xin Li
4ba3b12efb Merge changes from topic "PPRL.190205.001"
* changes:
  Fix merge problems with cherry-picking "Add notification settings to backup&restore" change into pi-dev
  DO NOT MERGE - Merge PPRL.190205.001 into master
2019-02-20 16:25:58 +00:00
Dmitry Dementyev
18cccec624 Merge "Lazely initialize AccountManager debug table." 2019-02-19 19:49:13 +00:00
Dmitry Dementyev
d7eb5d48e5 Lazely initialize AccountManager debug table.
Prevent crash if the database cannot be opened.
Guard not thread safe SQLiteStatement.

Test: atest com.android.server.accounts
Change-Id: Idab30703facacb469a568361998c59c039d3dd2a
Merged-In: I2af9074e50bddc5a1d18ea781cc6f56934f21302
2019-02-15 22:56:05 +00:00
Remi NGUYEN VAN
ddd14b357d Merge "Remove deps from framework on netd interfaces"
am: d36e3df7b0

Change-Id: I341533244d9c7cd2c1cf8315f0806695310ba03c
2019-02-14 19:29:49 -08:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Remi NGUYEN VAN
dacee147b4 Remove deps from framework on netd interfaces
If included in framework.jar, the interfaces conflict with any app that
needs to depend on them, including the NetworkStack.

Bug: 124033493
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I2db9f87b7154130726d4700b241d55b041635d98
Merged-In: I0ecae20d514bf888f3a80331f19369ceb1c52aa3
2019-02-14 17:26:59 +09:00
Neil Fuller
963fea9056 Revert "Minimum viable TimeZoneDetectorService"
Remove the stubbed TimeZoneDetectorService. Priorities
dictated that it not be worked on so it has never been
used.

This reverts commit 7fb88c3928.

Bug: 112827764
Bug: 78217059
Test: build / boot
Change-Id: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
Merged-In: I39ed2fc7f8de8d4b2c0d883cd264cc126579af27
(cherry picked from commit f4894d391b)
2019-02-01 13:21:55 +00:00
Howard Chen
f17f42b0df Add the DynamicAndroid Service
Define the DynamicAndroid with AIDL.
  Add a java implementation.
  Start a service instance in the system server.
  Add a permission test.

Bug: 122015653
Test: Build & Test on a pixel phone with following command \
  ./frameworks/base/services/tests/runtests.py -e class com.android.server.DynamicAndroidTest

Merged-In: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
2019-01-31 15:10:21 +08:00
Kweku Adams
3d64c041f4 Informing app idle listeners on enabled state changes.
Currently, if AppStandbyController is enabled after some listeners have
already registered, the listeners will be told that the system is in a
state of parole even though AppStandbyController thinks it's not in
parole. This change informs AppIdleStateChangeListeners when
AppStandbyController's enabled state changes as well so that they can be
in the correct state.

I also removed the call to setAppIdleEnabled() in onBootPhase() since
updateSettings() is called right afterwards and that also calls
setAppIdleEnabled().

Bug: 112329453
Test: atest AppStandbyControllerTests
also check logs to confirm that NetworkPolicyManagerService and
JobSchedulerService's listeners switch from ON to OFF when the system is
ready.

Change-Id: I88bc293c70b459f54f75f92126ad306d6ab8d9b7
Merged-In: I88bc293c70b459f54f75f92126ad306d6ab8d9b7
2019-01-30 09:50:23 +00:00
Tadashi G. Takaoka
0f224efb5e Add generic SelectTest JUnit filter and CoreTestsFilter
The JUnit filter com.android.test.filters.SelectTest is a generic test
filter that can supersede |-e package| and |-e class| options of
AndroidJUnitRunner.

The com.android.server.wm.test.filters.CoreTestsFilter extends SelectTest
filter to filter out Window Manager Service releated tests in
FrameworksCoreTests.

Bug: 122451194
Test: Can select some tests from WmTests.
  $ adb shell am instrument -w \
      -e filter com.android.test.filters.SelectTest \
      -e selectTest com.android.test.filters.,com.android.server.wm.DummyTests \
      com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Test: CoreTestsFilter works for FrameworksCoreTests.
  $ adb shell am instrument -w \
      -e filter com.android.server.wm.test.filters.CoreTestsFilter \
      -e selectTest_verbose true \
      com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic72637997bf17debef914e2596049f6cf3e753de
Merged-In: Ic72637997bf17debef914e2596049f6cf3e753de
2019-01-23 23:04:03 +09:00
David James
ff4e52f31d Mark AppStateTrackerTest#testAllListeners as Flaky.
This test is ~10% flaky everywhere but git_master. Marking as flaky on aosp-master,  git_pi-dev-plus-aosp, and git_stage-aosp-master. I will roll back this change on git_master after it merges there.

Bug: b/114098433
Change-Id: I4d8365de4a4e2112848c9721836ca2289f7e2804
2019-01-13 21:01:16 +00:00
Nicolas Geoffray
bab4c2c2a7 Remove notion of skip library check in framework.
bug: 111174995
Test: m

(cherry picked from commit 03dba3ba8c)
Merged-In: Id4d69258116696db3662ac7678f6d235fcccabc7

Change-Id: I5d66f4ad60869c7946a781bfc0741717cb839138
2019-01-09 15:18:20 +00:00
Julia Reynolds
172458e014 Merge "Check if notification is valid before it finally vibrates because it can be canceled as soon as enqeued" 2019-01-03 19:43:36 +00:00
Seungho Lee
0e97ae68b2 Check if notification is valid before it finally vibrates because it can be canceled as soon as enqeued
Test: Build and run StatusBarTest/_NotifyBuilder
Test: Set notification sound and vibration
Test: Make notification with + button, and cancel it with - button quickly
TEst: Check notification not vibrating

Change-Id: Ia21f45c165f863ed4143da3707b492c89e58387c
Merged-In: Ia21f45c165f863ed4143da3707b492c89e58387c
Signed-off-by: Seungho Lee <shiny.lee@samsung.com>
2018-12-21 15:21:04 +00:00
Elliott Hughes
36c37f3ceb Merge "No-one should need libunwind in 2018..." 2018-12-13 17:48:41 +00:00
Elliott Hughes
fc885bbc64 No-one should need libunwind in 2018...
Test: builds
Change-Id: I40c2326e2f11532aaae6e6a489ec7b7d4a02a9d8
2018-12-12 14:09:08 -08:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Luke Huang
9677dde14a Merge "Migrate INetd to stable aidl" 2018-12-10 03:07:08 +00:00
Luke Huang
734c4cea3c Migrate INetd to stable aidl
Del the linking of old lib file and add new one.

Test: runtest frameworks-net passes
Change-Id: I7258f7c51718ff5f07e7bfe301b6c5f242b9da5a
2018-12-07 10:40:45 +00:00
Adrian Roos
ebf84c264a FRP: save password quality in DPM.resetPassword
When setting a password from DPM.resetPassword(), the actual quality of the
password was not passed to LockSettingsService (instead, the minimum required
quality was passed which is often UNSPECIFIED). As a result, during FRP we
would see inconsistent state and skip it.

Bug: 110172241
Test: Set credential via DPM.resetPassword(), factory reset device to trigger FRP, verify FRP shows.
Change-Id: I54376f60ac53451ace22965d331b47cd8c2e614e
2018-12-06 19:29:39 +01:00
Nicolas Geoffray
e7753e084f Merge "Start using shared libraries class loader." 2018-12-02 20:39:38 +00:00
Nicolas Geoffray
972b39e4e4 Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.

(cherry picked from commit 8d144eb8bd)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d

Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
2018-12-02 20:39:29 +00:00
Colin Cross
372fa2ed21 Merge "Convert frameworks/base/services/tests to Android.bp" 2018-11-28 04:49:51 +00:00
Colin Cross
1d3245d64d Convert frameworks/base/services/tests to Android.bp
See build/soong/README.md for more information.

Bug: 119809391
Test: atest FrameworksServicesTests FrameworksMockingServicesTests FrameworksUiServicesTests
Change-Id: Id28d25cc36df47e2f533ae878fb0d2745164fbfb
Merged-In: Id28d25cc36df47e2f533ae878fb0d2745164fbfb
(cherry picked from commit 35be4249e2)
2018-11-26 10:10:46 -08:00
Neil Fuller
80a2e6e628 Merge "Track changes in system/timezone / libcore" 2018-11-19 11:38:14 +00:00
Neil Fuller
0ac8df0e9a Track changes in system/timezone / libcore
The version information about time zone formats is moving
to a new libcore class TzDataSetVersion.

Bug: 119026403
Test: build
Change-Id: I6f80f16f9cd7e37fc04d75c89483497f4f00a6a5
2018-11-18 15:52:02 +00:00
Nicolas Geoffray
5e498b087a Make shared library dependencies explicit in SharedLibraryInfo
bug: 112405321
Test: boots, PackageParserTest
(cherry picked from commit 10b0779df8)

Change-Id: I506cdfdf0d2cb7948eacd3e2658d187f6259f4b9
Merged-In: I591c29f72ad95b2a8adb4a2242f1e764e0e29007
2018-11-15 20:31:31 +00:00
Nicolas Geoffray
103454f0d6 Attach SharedLibraryInfo to a Package.
bug: 112405321
Test: boots, PackageParserTest
Change-Id: Ib218dac8f554505188990436cae4147666f3aece
Merged-In: Ib218dac8f554505188990436cae4147666f3aece
(cherry picked from commit abcd58e4a2)
2018-11-15 13:26:26 +00:00
Treehugger Robot
f2d5ace011 Merge "DexLoadReporter needs to handle arbitrary class loaders." 2018-11-09 11:02:20 +00:00
Alan Stokes
6e4ceb1e50 Fix test that was failing due to a cast error.
Bug: 113800711
Test: atest ActivityStackTests
Change-Id: I12c8ba8ecfbebe810a06ab0dc6306b69d5586c7b
Merged-In: Ic08609436b480c0e3f493e2790398344d3122031
2018-11-07 16:38:59 +00:00
Alan Stokes
b6c3a604b0 DexLoadReporter needs to handle arbitrary class loaders.
Also made sure we can handle null classpaths.

Test: atest -p services/core/java/com/android/server/pm/dex
Bug: 111336847
Change-Id: Idabf3fb9a09a0764e805679ac29cd8455e8dc267
2018-11-07 12:00:42 +00:00
Alex Light
84faaf8ec6 Correct illegal mockito usage.
According to the mockito FAQ use of thenReturn(mock(...)) is
forbidden. This fixes that pattern in the setup for
ZenModeFilteringTest.

https://github.com/mockito/mockito/wiki/FAQ#can-i-thenreturn-an-inlined-mock-

Test: runtest systemui-notification
Bug: 119063276
Change-Id: Ic62b18063e5837240255e1dd0f5e0feb450f22cb
2018-11-06 14:15:54 -08:00
Tadashi G. Takaoka
f1e9db0cbe Merge "Fix missing showWhenLocked activity attribute" 2018-11-06 16:57:36 +00:00
Tadashi G. Takaoka
0b590e6ab9 Fix missing showWhenLocked activity attribute
This attribute will stabilize ScreenDecorWindowTests since this test
needs activity is shown even on locked device.

Fixes: 119041502
Bug: 119037340
Test: On sleeping DUT.
  atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Change-Id: I98ef00ba32c792c396f3abba447dd20628902492
Merged-In: I8fc2683ad65e627c4e002b767fd23a4dd9f16223
2018-11-06 13:40:49 +09:00
Alan Stokes
6dba50d633 Stop recording unsupported class loaders.
Don't record anything if any of the classloaders in the chain are
unsupported.  (This is slightly unsubtle, but matchs the existing
behavior - see below.) We can't correctly DexOpt secondary dex files
in this case anyway.

Also discard any existing records of unsupported classloaders on read.

Currently this is almost a no-op: BaseDexClassLoader doesn't notify if
there are any unknown class loaders, since
5ac512c07cfa80160e240c359349c1390a20a981, so the new check is
reachable only if there's some sort of mismatch. But I'm going to
change that soon.

Tightened up visibility a bit too.

Bug: 111336847
Test: atest --test-mapping services/core/java/com/android/server/pm/dex
Change-Id: I6af5620a73be7b6440cbafdf6a5c1da1082cbdd4
2018-11-05 11:13:46 +00:00
Junyu Lai
89eb3e6117 Merge "Extend onDnsEvent callback to report more fields." 2018-11-05 04:29:47 +00:00
Brett Chabot
3c27826396 Replace use of deprecated androidx-test build rule.
Test: m -j checkbuild

Change-Id: I47e4761f054087694ac1126e7b9a19d57f880479
Merged-In: I6482ff8afbae39ffd0296aeac7b29ba019daf3a6
2018-11-02 13:27:59 -07:00
junyulai
4c2d2d5461 Extend onDnsEvent callback to report more fields.
When native layer reports onDnsEvent, netId, eventType and
returnCode are available only in NetdEventListenerService, but
not for the clients who register event on it.

Thus, extend the callback to give clients more detail on the
network the look up was performed on and the result of the
lookup.

Bug: 113916551
Test: 1. runtest frameworks-net
      2. runtest frameworks-services -c com.android.server. \
         net.watchlist.NetworkWatchlistServiceTests
Change-Id: If7beecea50e1baf18cb5c6775ad3ecb1a60b312a
2018-10-31 21:22:45 +08:00
Ian Kasprzak
4247a85cdb Merge "Add new test module for system service with static / final mocking" 2018-10-29 22:57:06 +00:00
Makoto Onuki
4ac1cf802a Add new test module for system service with static / final mocking
And move AppStateTrackerTest for starter.

Bug: 114096820
Bug: 118510622
Test: atest FrameworksMockingServicesTests
Change-Id: Ie5bf44322f29e9971358a706cf44bc5c8a325c30
Merged-In: Ie5bf44322f29e9971358a706cf44bc5c8a325c30
(cherry picked from commit 5f732365c6)
2018-10-29 14:02:47 -07:00
Brett Chabot
ff2af31e35 Adjust to new androidx.test beta02 rules.
Test: m -j checkbuild
Change-Id: I704324a8880c5948369ae4fa6814fd8b258d7d33
Merged-In: I6482ff8afbae39ffd0296aeac7b29ba019daf3a6
2018-10-25 10:00:27 -07:00
Dan Shi
50242ce28a Merge "Mark 4 tests as FlakyTest" 2018-10-19 22:13:34 +00:00
Dan Shi
2192b50a29 Mark 4 tests as FlakyTest
Until b/113616538 is fixed, a test class without FlakyTest, can be included in
a presubmit test mapping suite unexpectedly. Mark these 3 classes as FlakyTest
for now:
ActivityManagerServiceTest
AssistDataRequesterTest
AppErrorDialogTest

This test becomes unstable and still needs to be fixed before it can run in
presubmit:
TaskPositioningControllerTests

Bug: 117880789
Test: none
Change-Id: I3ed29bcbd30e34d6fd97169ac2913fbf312d4f70
2018-10-19 14:25:36 -07:00
Junyu Lai
43d8774f68 Merge "Add tests for the network blocked status change"
am: af0de1a2e9

Change-Id: I0f3f93807d9089239f572c487d791acd7a324a2e
2018-10-19 09:18:38 -07:00
Mike Yu
f9729757f9 Add tests for the network blocked status change
onBlockedStatusChanged is intruduced for network blocked status.
The changes in this patch are:
  - Test onBlockedStatusChanged which tells apps whether the
    network is blocked.
  - Fixed the tests which is affected by the order changed in
    onAvailable.

Test: as follows
    - runtest frameworks-net
    - runtest -x NetworkPolicyManagerServiceTest.java
Bug: 74575553
Change-Id: I383c037ed895ef69c478dc3cff69fb1e27c42845
2018-10-19 19:52:50 +08:00