OSDN Git Service

android-x86/frameworks-native.git
5 years agoAdd missing error checks in tests.
Alan Stokes [Tue, 5 Feb 2019 17:53:24 +0000 (17:53 +0000)]
Add missing error checks in tests.

To ensure we don't get tests spuriously passing when setup has failed.

Test: atest installd_service_test
Bug: 78442602
Change-Id: I32c8dc4f3d2b9d6dc0f289b170fd13198c87cac3

5 years agoMerge "installd_service_test: fix ServiceTest.CreateAppDataSnapshot_ClearsCache"
Treehugger Robot [Tue, 5 Feb 2019 17:00:28 +0000 (17:00 +0000)]
Merge "installd_service_test: fix ServiceTest.CreateAppDataSnapshot_ClearsCache"

5 years agoinstalld_service_test: fix ServiceTest.CreateAppDataSnapshot_ClearsCache
Nikita Ioffe [Sat, 2 Feb 2019 17:26:18 +0000 (17:26 +0000)]
installd_service_test: fix ServiceTest.CreateAppDataSnapshot_ClearsCache

This test is failing on cf_x86_phone-userdebug target, with an error:
Failed copying /data/local/tmp/user_de/0/com.foo to /data/local/tmp/misc_de/0/rollback'

Logs shows that cp fails with "No such file or directory error":
02-05 08:37:49.444 12746 12746 I cp      : cp: /data/local/tmp/misc_de/0/rollback: No such file or directory
02-05 08:37:49.445 12746 12746 I cp      : cp terminated by exit(1)

Testcase is failing, because it doesn't create
/data/local/tmp/misc_de/0/rollback directory. It is hard to spot, because
other testcases in installd_service_test also create that directory, meaning
that depending on the order in which testcases are run,
CreateAppDataSnapshot_ClearsCache will either fail or succeed.

Verified that this is the case by running only
CreateAppDataSnapshot_ClearsCache testcase:
./data/nativetest/installd_service_test/installd_service_test --gtest_filter=*CreateAppDataSnapshot_ClearsCache*

Bug: 123631551
Fixes: 123631551
Test: ./data/nativetest/installd_service_test/installd_service_test --gtest_filter=*CreateAppDataSnapshot_ClearsCache*
Change-Id: I8277efe6076bac28fd07ea3705a21aae6b8cab14

5 years agoMerge "Use sh_binary instead of cc_prebuilt_binary for shell scripts"
Alexander Smundak [Tue, 5 Feb 2019 02:04:18 +0000 (02:04 +0000)]
Merge "Use sh_binary instead of cc_prebuilt_binary for shell scripts"

5 years agoUse sh_binary instead of cc_prebuilt_binary for shell scripts
Sasha Smundak [Mon, 4 Feb 2019 19:20:58 +0000 (11:20 -0800)]
Use sh_binary instead of cc_prebuilt_binary for shell scripts

Bug: 123829926
Test: treehugger
Change-Id: If9d2da84b30aebf8881c6da12efbe99549f5e0cc

5 years agoMerge "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX."
Roland Levillain [Mon, 4 Feb 2019 13:40:17 +0000 (13:40 +0000)]
Merge "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX."

5 years agoMerge "Add handling for PH property dex2oat_resolve_startup_strings"
Mathieu Chartier [Sat, 2 Feb 2019 01:14:50 +0000 (01:14 +0000)]
Merge "Add handling for PH property dex2oat_resolve_startup_strings"

5 years agoMerge "Add "ls -l /data/anr" output to bugreport"
Treehugger Robot [Fri, 1 Feb 2019 21:29:39 +0000 (21:29 +0000)]
Merge "Add "ls -l /data/anr" output to bugreport"

5 years agoAdd handling for PH property dex2oat_resolve_startup_strings
Mathieu Chartier [Thu, 31 Jan 2019 20:59:39 +0000 (12:59 -0800)]
Add handling for PH property dex2oat_resolve_startup_strings

Added unit test to verify the property is passed to the oat file.

Test: adb shell /data/nativetest64/installd_dexopt_test/installd_dexopt_test
Bug: 116059983
Bug: 123524494

Change-Id: Ib4fe5401d58c6ac05ef3011bef04e38d1b6d4ba9

5 years agoAdd "ls -l /data/anr" output to bugreport
Makoto Onuki [Fri, 1 Feb 2019 01:08:59 +0000 (17:08 -0800)]
Add "ls -l /data/anr" output to bugreport

Bug: 123720446
Test: with adb bugreport
Change-Id: I2a00d370b8e61b4f0059cdf2d8d67136968a9f20

5 years agoMerge "Refactor the APEX package activation/deactivation logic in `otapreopt_chroot`."
Roland Levillain [Fri, 1 Feb 2019 16:29:22 +0000 (16:29 +0000)]
Merge "Refactor the APEX package activation/deactivation logic in `otapreopt_chroot`."

5 years agoHave `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX.
Roland Levillain [Thu, 31 Jan 2019 18:30:17 +0000 (18:30 +0000)]
Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX.

Have `otapreopt_chroot` bind-mount Bionic artifacts (`linker(64)`,
`libc.so`, `libm.so`, `libdl.so`) from the Runtime APEX
(`/postinstall/apex/com.android.runtime`) into `/postinstall/bionic/`,
much the same way `init` sets up Bionic bind-mounts in the default
mount namespace.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120266448
Change-Id: Ie254a94ae35e62f88375bc89380456f15796566a

5 years agoRefactor the APEX package activation/deactivation logic in `otapreopt_chroot`.
Roland Levillain [Fri, 1 Feb 2019 13:15:58 +0000 (13:15 +0000)]
Refactor the APEX package activation/deactivation logic in `otapreopt_chroot`.

This is in prevision of reusing the package deactivation logic as a
clean-up step upon Bionic bind-mounting failure.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120266448
Change-Id: I17b2d57252af7aca1fc27b4c051d6cc9d373c223

5 years agoMerge "installd: remove restored ce_data if de_data rollback failed"
Nikita Ioffe [Fri, 1 Feb 2019 12:59:55 +0000 (12:59 +0000)]
Merge "installd: remove restored ce_data if de_data rollback failed"

5 years agoMerge "installd: Add destroyAppDataSnapshot and corresponding binder API"
Nikita Ioffe [Fri, 1 Feb 2019 11:50:12 +0000 (11:50 +0000)]
Merge "installd: Add destroyAppDataSnapshot and corresponding binder API"

5 years agoinstalld: Add destroyAppDataSnapshot and corresponding binder API
Nikita Ioffe [Fri, 25 Jan 2019 13:54:43 +0000 (13:54 +0000)]
installd: Add destroyAppDataSnapshot and corresponding binder API

- destroyAppDataSnapshot: deletes both ce and de snapshots (controlled
  via storageFlags), for ce snapshot fallbacks to deleting it by it's
  inode in case snapshot is not accessible (user hasn't unlocked the
  phone yet).
- snapshotAppData: in case ce snapshot was requested, it will now return
  inode if a folder with the snapshot. Otherwise it will return 0.

Passing ceSnapshotInode to destroyAppDataSnapshot should make logic
inside RollbackManagerService a bit easier. Since it will be able to
delete ce snapshot regardless of user unlocking their phone.

Bug: 112431924
Test: installd_service_test installd_utils_test
Change-Id: I015de12593b87f3000f004cc0a901a9208d0b693
Merged-In: I015de12593b87f3000f004cc0a901a9208d0b693

5 years agoMerge "Installd: Refactor binder tests"
Treehugger Robot [Thu, 31 Jan 2019 22:14:21 +0000 (22:14 +0000)]
Merge "Installd: Refactor binder tests"

5 years agoMerge "libbinder_ndk: ScopedAResource into impl namespace"
Steven Moreland [Thu, 31 Jan 2019 19:35:33 +0000 (19:35 +0000)]
Merge "libbinder_ndk: ScopedAResource into impl namespace"

5 years agoInstalld: Refactor binder tests
Andreas Gampe [Thu, 31 Jan 2019 17:22:27 +0000 (09:22 -0800)]
Installd: Refactor binder tests

Add helper macros to automatically print return status errors.

Bug: 123631551
Test: atest --test-mapping frameworks/native/cmds/installd
Merged-In: I4ab448fabbab91cc608c318a07f9bf95547062fc
Change-Id: I4ab448fabbab91cc608c318a07f9bf95547062fc

5 years agoMerge "Fix regression in startBugreport flow"
Treehugger Robot [Thu, 31 Jan 2019 12:48:36 +0000 (12:48 +0000)]
Merge "Fix regression in startBugreport flow"

5 years agoMerge "Ensure only one bugreport is in progress in dumpstate"
Nandana Dutt [Thu, 31 Jan 2019 10:31:43 +0000 (10:31 +0000)]
Merge "Ensure only one bugreport is in progress in dumpstate"

5 years agoMerge "installd: Create "lib" symlink with the correct label."
Treehugger Robot [Thu, 31 Jan 2019 10:22:02 +0000 (10:22 +0000)]
Merge "installd: Create "lib" symlink with the correct label."

5 years agoMerge "Add OWNERS to inputflinger"
Treehugger Robot [Thu, 31 Jan 2019 03:44:38 +0000 (03:44 +0000)]
Merge "Add OWNERS to inputflinger"

5 years agoMerge "libbinder_ndk: remove draft status"
Steven Moreland [Thu, 31 Jan 2019 00:51:57 +0000 (00:51 +0000)]
Merge "libbinder_ndk: remove draft status"

5 years agoAdd OWNERS to inputflinger
Michael Wright [Wed, 30 Jan 2019 22:00:04 +0000 (22:00 +0000)]
Add OWNERS to inputflinger

Test: N/A
Change-Id: If16fbe675557cb01770bdc2d6cbc55c46c384d9c

5 years agoinstalld: Create "lib" symlink with the correct label.
Nick Kralevich [Wed, 30 Jan 2019 20:32:21 +0000 (12:32 -0800)]
installd: Create "lib" symlink with the correct label.

When installing an application which has a 32 bit ABI, system_server
(via installd) creates a compatibility "lib" symlink in the application
home directory. See:

https://android.googlesource.com/platform/frameworks/base/+/d5d7492040c1730899cccef9916541176004635c/services/core/java/com/android/server/pm/PackageManagerService.java#22876
and
https://android.googlesource.com/platform/frameworks/native/+/6b8e52c805f124f8b1d7e511ae68d01d0769c32b/cmds/installd/InstalldNativeService.cpp#2077

When a process creates a filesystem object within a directory, in
inherits the directory type, but DOES NOT inherit the directory MLS
categories. See

* https://www.spinics.net/lists/selinux/msg21893.html
* https://www.spinics.net/lists/selinux/msg21897.html

for more details on this behavior.

Without subsequent fixup, an installd created symlink in an
application home directory will have incorrect SELinux MLS categories,
and as a result, may be unreadable to the application.

Modify installd to assign the "lib" label the same MLS categories as
the enclosing parent directory.

Steps to reproduce:

  1) adb shell
  2) su
  3) ls -laZ /data/data/*/lib

Expected:

  crosshatch:/ # ls -laZ /data/data/*/lib
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c177,c256,c512,c768 46 2019-01-30 12:46 /data/data/com.android.chrome/lib -> /system/product_services/app/Chrome/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c512,c768           38 2019-01-30 12:46 /data/data/com.android.omadm.service/lib -> /system/priv-app/DMService/lib/arm
  lrwxrwxrwx 1 root root u:object_r:privapp_data_file:s0:c512,c768       54 2019-01-30 12:46 /data/data/com.android.vending/lib -> /system/product_services/priv-app/Phonesky/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c141,c256,c512,c768 30 2019-01-30 12:46 /data/data/com.google.android.apps.tycho/lib -> /product/app/Tycho/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c512,c768           46 2019-01-30 12:46 /data/data/com.google.android.videos/lib -> /system/product_services/app/Videos/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c180,c256,c512,c768 58 2019-01-30 12:46 /data/data/com.google.android.webview/lib -> /system/product_services/app/TrichromeWebView/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c512,c768           34 2019-01-30 12:46 /data/data/com.qti.ltebc/lib -> /system/app/QAS_DVC_MSP/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0:c512,c768           38 2019-01-30 12:46 /data/data/com.qualcomm.ltebc_vzw/lib -> /system/app/QAS_DVC_MSP_VZW/lib/arm

Actual:

  crosshatch:/ # ls -laZ /data/data/*/lib
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     46 2019-01-30 12:36 /data/data/com.android.chrome/lib -> /system/product_services/app/Chrome/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     38 2019-01-30 12:36 /data/data/com.android.omadm.service/lib -> /system/priv-app/DMService/lib/arm
  lrwxrwxrwx 1 root root u:object_r:privapp_data_file:s0 54 2019-01-30 12:36 /data/data/com.android.vending/lib -> /system/product_services/priv-app/Phonesky/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     30 2019-01-30 12:36 /data/data/com.google.android.apps.tycho/lib -> /product/app/Tycho/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     46 2019-01-30 12:36 /data/data/com.google.android.videos/lib -> /system/product_services/app/Videos/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     58 2019-01-30 12:36 /data/data/com.google.android.webview/lib -> /system/product_services/app/TrichromeWebView/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     34 2019-01-30 12:36 /data/data/com.qti.ltebc/lib -> /system/app/QAS_DVC_MSP/lib/arm
  lrwxrwxrwx 1 root root u:object_r:app_data_file:s0     38 2019-01-30 12:36 /data/data/com.qualcomm.ltebc_vzw/lib -> /system/app/QAS_DVC_MSP_VZW/lib/arm

Bug: 123350324
Test: manual
Change-Id: Id09846556cb0ba7e39fbc57f9039f072d6a752a1

5 years agolibbinder_ndk: ScopedAResource into impl namespace
Steven Moreland [Wed, 30 Jan 2019 20:29:53 +0000 (12:29 -0800)]
libbinder_ndk: ScopedAResource into impl namespace

This is an implementation detail that may change in the future.

Fixes: 123601615
Test: atest android.binder.cts
Change-Id: I006d8bf8b64228a2cc27bee671b6a9838e8df492

5 years agoFix regression in startBugreport flow
Nandana Dutt [Wed, 30 Jan 2019 13:13:52 +0000 (13:13 +0000)]
Fix regression in startBugreport flow

Ensure what's passed to the background thread is around.

BUG: 123617758
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Test: manual test of API via a test client
Change-Id: I161c0d378c04cf925778fdb8712b1bd68901fb91

5 years agoMerge "Use screenshot file descriptor if available"
Nandana Dutt [Wed, 30 Jan 2019 10:55:37 +0000 (10:55 +0000)]
Merge "Use screenshot file descriptor if available"

5 years agoMerge "Fix/suppress google-explicit-constructor warnings"
Treehugger Robot [Wed, 30 Jan 2019 01:58:55 +0000 (01:58 +0000)]
Merge "Fix/suppress google-explicit-constructor warnings"

5 years agoFix/suppress google-explicit-constructor warnings
Chih-Hung Hsieh [Thu, 20 Dec 2018 23:54:30 +0000 (15:54 -0800)]
Fix/suppress google-explicit-constructor warnings

* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I5c73437ecee0d672863664cc8c2970b099597f77

5 years agoMerge "installd: clear app's cache before doing a snapshot"
Treehugger Robot [Tue, 29 Jan 2019 21:11:50 +0000 (21:11 +0000)]
Merge "installd: clear app's cache before doing a snapshot"

5 years agolibbinder_ndk: remove draft status
Steven Moreland [Tue, 29 Jan 2019 19:51:13 +0000 (11:51 -0800)]
libbinder_ndk: remove draft status

So that it is included in future NDK releases.

Fixes: 123299014
Test: N/A
Change-Id: I118b3190ce01147af84a33156ac01cdcde54a20d

5 years agoMerge "Restore security context of `/postinstall/apex` earlier in otapreopt_chroot."
Roland Levillain [Tue, 29 Jan 2019 18:07:59 +0000 (18:07 +0000)]
Merge "Restore security context of `/postinstall/apex` earlier in otapreopt_chroot."

5 years agoUse screenshot file descriptor if available
Nandana Dutt [Tue, 29 Jan 2019 16:10:45 +0000 (16:10 +0000)]
Use screenshot file descriptor if available

Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
BUG: 123576130
Fixes: 123576130

Change-Id: I2ac2dc3bfc7920a00e4148ca29169c171558de3a

5 years agoEnsure only one bugreport is in progress in dumpstate
Nandana Dutt [Tue, 29 Jan 2019 15:59:38 +0000 (15:59 +0000)]
Ensure only one bugreport is in progress in dumpstate

BUG: 123571915
Test: current bugreport flows work
Test: interactive bugreport
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Test: adb shell /data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test
Change-Id: I1145a27ed6dde43142789d876902e32d1a286bb2

5 years agoMerge "Convert Android.mk file to Android.bp"
Treehugger Robot [Tue, 29 Jan 2019 15:56:47 +0000 (15:56 +0000)]
Merge "Convert Android.mk file to Android.bp"

5 years agoinstalld: clear app's cache before doing a snapshot
Nikita Ioffe [Wed, 23 Jan 2019 14:32:48 +0000 (14:32 +0000)]
installd: clear app's cache before doing a snapshot

Bug: 112431924
Test: installd_service_test
Change-Id: I4a6c3bbf071dcee007e48ece40e5009c1a43ecca

5 years agoMerge "installd: Validate volumeUuid in snapshotAppData and restoreAppDataSnapshot"
Treehugger Robot [Tue, 29 Jan 2019 11:13:16 +0000 (11:13 +0000)]
Merge "installd: Validate volumeUuid in snapshotAppData and restoreAppDataSnapshot"

5 years agoMerge "Add vendor dumpsys."
Treehugger Robot [Tue, 29 Jan 2019 01:46:08 +0000 (01:46 +0000)]
Merge "Add vendor dumpsys."

5 years agoRestore security context of `/postinstall/apex` earlier in otapreopt_chroot.
Roland Levillain [Thu, 24 Jan 2019 10:51:30 +0000 (10:51 +0000)]
Restore security context of `/postinstall/apex` earlier in otapreopt_chroot.

Invoke `selinux_android_restorecon` on `/postinstall/apex` just after
mounting a tmpfs filesystem in it, so that this directory is correctly
labeled (with type `postinstall_apex_mnt_dir`) and may be manipulated
in following operations (`chmod`, `chown`, etc.) following updated
policies restricted to `postinstall_apex_mnt_dir` (instead of
`tmpfs`).

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I0b243a00e0443e439afda055d3b12aa9eefe0503

5 years agoMerge "Update filesystem permissions for task tracepoints."
Treehugger Robot [Mon, 28 Jan 2019 22:04:58 +0000 (22:04 +0000)]
Merge "Update filesystem permissions for task tracepoints."

5 years agoinstalld: Validate volumeUuid in snapshotAppData and restoreAppDataSnapshot
Nikita Ioffe [Mon, 21 Jan 2019 17:56:03 +0000 (17:56 +0000)]
installd: Validate volumeUuid in snapshotAppData and restoreAppDataSnapshot

Only supported values are nullptr and "TEST".

Bug: 112431924
Test: installd_service_test
Change-Id: I27260a3554d009053206d8e3d1e213306ff3d7d5

5 years agoUpdate filesystem permissions for task tracepoints.
Carmen Jackson [Fri, 25 Jan 2019 01:31:25 +0000 (17:31 -0800)]
Update filesystem permissions for task tracepoints.

These tracepoints are used for memory debugging, and should be enabled
for user builds.

Bug: 123367055
Test: manual: took a trace with Traceur and verified that these
tracepoints appear.

Change-Id: I31fafc11d60a96f2a4c58f2670decb2480c0ec78
Merged-In: I31fafc11d60a96f2a4c58f2670decb2480c0ec78

5 years agoMerge "Remove unused DumpstateOptions parcel"
Nandana Dutt [Mon, 28 Jan 2019 17:20:45 +0000 (17:20 +0000)]
Merge "Remove unused DumpstateOptions parcel"

5 years agoMerge "installd: clear existing snapshots before performing a new one"
Nikita Ioffe [Mon, 28 Jan 2019 12:09:47 +0000 (12:09 +0000)]
Merge "installd: clear existing snapshots before performing a new one"

5 years agoRemove unused DumpstateOptions parcel
Nandana Dutt [Fri, 16 Nov 2018 17:28:25 +0000 (17:28 +0000)]
Remove unused DumpstateOptions parcel

Now using bugreport mode to indicate runtime options.

BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Change-Id: I1890323394a5f146a8e0e971914b8b7437e75547

5 years agoMerge "Load libandroid_runtime lazily."
Steven Moreland [Sat, 26 Jan 2019 03:28:52 +0000 (03:28 +0000)]
Merge "Load libandroid_runtime lazily."

5 years agoAdd vendor dumpsys.
Steven Moreland [Sat, 26 Jan 2019 03:14:27 +0000 (19:14 -0800)]
Add vendor dumpsys.

$ adb shell /vendor/bin/dumpsys -l
<hangs>
$ adb shell /vendor/bin/sh -c "/vendor/bin/dumpsys -l"
Currently running services:
...
$ adb root
$ adb shell /vendor/bin/dumpsys -l
Currently running services:
...

Bug: 123433249
Test: manual (see above)
Change-Id: I4d74be3ef43e7d65154be27c4cf85ab32e09dfef

5 years agoLoad libandroid_runtime lazily.
Steven Moreland [Wed, 23 Jan 2019 00:02:02 +0000 (16:02 -0800)]
Load libandroid_runtime lazily.

Memory/performance for low-level processes that do not need this.

Bug: 118783779 # follow-up to cleanup
Bug: 123284997
Test: atest android.binder.cts
Change-Id: Ie8de0a082dfb75786a45a448185fedb317daa94e

5 years agoConvert Android.mk file to Android.bp
Sasha Smundak [Fri, 25 Jan 2019 07:20:47 +0000 (23:20 -0800)]
Convert Android.mk file to Android.bp

See build/soong/README.md for more information.

Bug: 122332691
Test: treehugger
Change-Id: I2146596aad99baa128511d07ab73470885319d49

5 years agoMerge "Add jwcai and tianyuj to the owner's file of libs/ui"
Jiwen Cai [Fri, 25 Jan 2019 18:42:22 +0000 (18:42 +0000)]
Merge "Add jwcai and tianyuj to the owner's file of libs/ui"

5 years agoMerge "DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_pol...
Suren Baghdasaryan [Fri, 25 Jan 2019 17:09:02 +0000 (17:09 +0000)]
Merge "DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy include"""

5 years agoDO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy...
Suren Baghdasaryan [Fri, 25 Jan 2019 05:29:23 +0000 (05:29 +0000)]
DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency and fix sched_policy include""

This reverts commit f145309d9c1549b06029bb00a3d5fe2bf459ed02.

Reason for revert: AOSP is fixed with new vendor image

Change-Id: If522adf1ea36e7792b1ae26234ec2bdb2756bdfd
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoinstalld: remove restored ce_data if de_data rollback failed
Nikita Ioffe [Fri, 25 Jan 2019 11:44:36 +0000 (11:44 +0000)]
installd: remove restored ce_data if de_data rollback failed

I think it's clearer (and safer) if failed rollback leaves app devoid of
any data rather that with only ce_data.
LMK if you disagree, I will just abandon this change then. :)

I tried adding a test to make de_rollback fail (while keeping
ce_rollback successful), but failed to.
Only idea I have in mind is to intercept calls to /system/bin/cp, which
doesn't look like a unit test anymore (and also I'm not sure how
feasible it is).

Test: existing tests in installd_service_test pass
Bug: 112431924

Change-Id: I3c6214d70bac682874ea846a01294b5361470f93

5 years agoinstalld: clear existing snapshots before performing a new one
Nikita Ioffe [Wed, 23 Jan 2019 16:32:13 +0000 (16:32 +0000)]
installd: clear existing snapshots before performing a new one

Bug: 112431924
Test: installd_service_test
Change-Id: I23a97f113e8a7423a7c509ee06d1436a2c2c961f

5 years agoMerge "Refactor paths to Android Runtime binaries in directory `cmds/installd/`."
Roland Levillain [Fri, 25 Jan 2019 12:23:17 +0000 (12:23 +0000)]
Merge "Refactor paths to Android Runtime binaries in directory `cmds/installd/`."

5 years agoMerge changes from topics "runtime-apex-otapreopt_chroot-tear-down", "runtime-apex...
Roland Levillain [Fri, 25 Jan 2019 11:56:30 +0000 (11:56 +0000)]
Merge changes from topics "runtime-apex-otapreopt_chroot-tear-down", "runtime-apex-installd-support", "runtime-apex-otapreopt_chroot-support"

* changes:
  Implement a tear-down phase in otapreopt_chroot.
  Revert^2 "Have installd use ART binaries from the Android Runtime APEX."
  Revert^2 "Have `otapreopt_chroot` mount APEX packages in the chroot dir."

5 years agoMerge "Use the consent service to check if user has consented to taking a bugreport"
Treehugger Robot [Thu, 24 Jan 2019 15:14:05 +0000 (15:14 +0000)]
Merge "Use the consent service to check if user has consented to taking a bugreport"

5 years agoUse the consent service to check if user has consented to taking a
Nandana Dutt [Fri, 18 Jan 2019 17:13:52 +0000 (17:13 +0000)]
Use the consent service to check if user has consented to taking a
bugreport

Test: verified current flows of bugreport generation still work
Test: TBD test the new flow
Change-Id: I5fc154905515db664f76d1453c9d79364dc2f01e

5 years agoMerge "Add IIncidentCompanion binder API."
Treehugger Robot [Thu, 24 Jan 2019 12:16:35 +0000 (12:16 +0000)]
Merge "Add IIncidentCompanion binder API."

5 years agoMerge "installd: Implement support for userdata snapshot and restore."
Narayan Kamath [Thu, 24 Jan 2019 10:25:00 +0000 (10:25 +0000)]
Merge "installd: Implement support for userdata snapshot and restore."

5 years agoMerge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy...
Suren Baghdasaryan [Thu, 24 Jan 2019 06:57:55 +0000 (06:57 +0000)]
Merge "DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include""

5 years agoDO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include"
Suren Baghdasaryan [Thu, 24 Jan 2019 04:53:17 +0000 (20:53 -0800)]
DO NOT MERGE: Revert "Add libprocessgroup dependency and fix sched_policy include"

This reverts commit dc9078de949983a91b04dedc78e4089645f8626d.

Reason for revert: Broke AOSP

Change-Id: Ia5cb6e8f829669a6e0dd01260605b986a1282c85
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoMerge "Add FEATURE_TELEPHONY_IMS feature definition"
Treehugger Robot [Thu, 24 Jan 2019 04:50:18 +0000 (04:50 +0000)]
Merge "Add FEATURE_TELEPHONY_IMS feature definition"

5 years agoAdd FEATURE_TELEPHONY_IMS feature definition
Brad Ebinger [Wed, 23 Jan 2019 22:59:46 +0000 (14:59 -0800)]
Add FEATURE_TELEPHONY_IMS feature definition

Add an IMS feature definition so that telephony doesn't
bring up unnecessary resources or run GTS tests on a device
that doesn't support it.

Bug: 118823723
Test: manual

Change-Id: I359f9e337ec785745f5d0ca778615d12c61faedf

5 years agoAdd IIncidentCompanion binder API.
Joe Onorato [Tue, 11 Dec 2018 22:24:49 +0000 (14:24 -0800)]
Add IIncidentCompanion binder API.

It's in frameworks/native because dumpstate uses it.

BUG: 111441001
Test: builds
Change-Id: I0897bec8882395d3444f46a145e9f91f4e9da32d

5 years agoRefactor paths to Android Runtime binaries in directory `cmds/installd/`.
Roland Levillain [Wed, 23 Jan 2019 15:59:50 +0000 (15:59 +0000)]
Refactor paths to Android Runtime binaries in directory `cmds/installd/`.

Have `dexopt` and `otapreopt` use the same set of definitions.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I94e55a831c68b67cb81cfa91281b2feb0cc4b365

5 years agoMerge "[view compilation] Add viewcompiler support to installd"
Mathieu Chartier [Wed, 23 Jan 2019 17:02:31 +0000 (17:02 +0000)]
Merge "[view compilation] Add viewcompiler support to installd"

5 years agoMerge "Dumpstate aidl: add cancelBugreport"
Treehugger Robot [Wed, 23 Jan 2019 17:00:48 +0000 (17:00 +0000)]
Merge "Dumpstate aidl: add cancelBugreport"

5 years agoDumpstate aidl: add cancelBugreport
Nandana Dutt [Wed, 23 Jan 2019 08:29:23 +0000 (08:29 +0000)]
Dumpstate aidl: add cancelBugreport

This allows adding a cancel method to the bugreporting API. Note that it
is implemented on the java side.

Also removed unused args from onFinished.

BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test

Change-Id: I6a3a0d652c89dc157de4a4056ccddc40e5d6e549

5 years agoAdd jwcai and tianyuj to the owner's file of libs/ui
Tianyu Jiang [Tue, 22 Jan 2019 22:18:13 +0000 (14:18 -0800)]
Add jwcai and tianyuj to the owner's file of libs/ui

for the development of BufferHub project. OWNERS file is out of sync.
This change syncs the file and added jwcai and tianyuj to the OWNERS.

Bug: None
Test: None
Change-Id: I817d3dc323e46aa7417a583d1faa8e0bbb87c3df

5 years agoMerge "Add a flag that makes dumpstate wait for options"
Treehugger Robot [Tue, 22 Jan 2019 23:30:39 +0000 (23:30 +0000)]
Merge "Add a flag that makes dumpstate wait for options"

5 years agoAdd a flag that makes dumpstate wait for options
Nandana Dutt [Tue, 22 Jan 2019 12:10:16 +0000 (12:10 +0000)]
Add a flag that makes dumpstate wait for options

There are 2 ways of running bugreports. Running dumpstate binary
directly with command line options (existing flow), or running the
binary to start the binder service, which waits for a caller to supply
arguments like file descriptors to write output to (new flow to support
the bugreport triggering API).

Support the second flow with a new commandline flag.

Also add a new service that uses the flag, to be used in the API.

BUG:111441001
Test: adb shell setprop "ctl.start" "bugreportd" -> starts service &
waits.
Test: interactive bugreport still works
Change-Id: I64cd03d15f45a896692d7462998d4faa6e413ef1

5 years agoMerge "Add libprocessgroup dependency and fix sched_policy include"
Suren Baghdasaryan [Tue, 22 Jan 2019 20:58:15 +0000 (20:58 +0000)]
Merge "Add libprocessgroup dependency and fix sched_policy include"

5 years agoinstalld: Implement support for userdata snapshot and restore.
Narayan Kamath [Mon, 14 Jan 2019 15:21:52 +0000 (15:21 +0000)]
installd: Implement support for userdata snapshot and restore.

Adds two binder APIs:
- snapshotAppData: Makes a copy of the apps credential encrypted
  and/or device encrypted data for a given user to one of
  /data/misc_[ce|de]/rollback. This path is writable only by
  installd.
- restoreAppDataSnapshot: Restores a copy of the apps credential
  encrypted and/or device encrypted data from a snapshot, if one
  exists.

Implemented for use from RollbackManagerService, which will make
a transient copy of an app package as well as its data in order to
roll them back within a specified window.

Bug: 112431924
Test: installd_utils_test, installd_service_test

Change-Id: I3e4d36c11e52fb885b585b1946e215cf986206fd
Merged-In: I3e4d36c11e52fb885b585b1946e215cf986206fd

5 years agoImplement a tear-down phase in otapreopt_chroot.
Roland Levillain [Fri, 18 Jan 2019 11:56:50 +0000 (11:56 +0000)]
Implement a tear-down phase in otapreopt_chroot.

Collect the list of APEX packages activated by `otapreopt_chroot` and
deactivate them after executing `otapreopt` (in its own process).

Also share android::installd::Exec between `otapreopt` and
`otapreopt_chroot`.

This tear-down phase ensures loop devices associated during by
`otapreopt_chroot` are detached before `otapreopt_chroot` exits.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I236ac49bb698fb672e7a4f9de9903229e535e9c6

5 years agoRevert^2 "Have installd use ART binaries from the Android Runtime APEX."
Roland Levillain [Wed, 12 Dec 2018 15:06:16 +0000 (15:06 +0000)]
Revert^2 "Have installd use ART binaries from the Android Runtime APEX."

This reverts commit 3a77febd0b57dcaceee2bb13b4bccddffb25ffc8.

Test: Device boot test (with Android Runtime APEX).
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: Ib22f91b5f8916f13b31bcd630600a86b9d86e25d

5 years agoRevert^2 "Have `otapreopt_chroot` mount APEX packages in the chroot dir."
Roland Levillain [Tue, 18 Dec 2018 12:15:12 +0000 (12:15 +0000)]
Revert^2 "Have `otapreopt_chroot` mount APEX packages in the chroot dir."

We need at least the Android Runtime APEX to be able to run `dex2oat`
in `otapreopt`. For simplicity, reuse `apexd`'s logic and mount all
the APEX packages found on the system partition in /postinstall/apex.

This is a temporary change. The final design will integrate A/B OTA
updates and `apexd`.

This reverts commit 00b5b3f01b7b6bf96d0d66d650ede8aa4734bf3f.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: Ifa45c282d04ae443e55bd41d8c9cbb4ea5f837d4

5 years agoAdd libprocessgroup dependency and fix sched_policy include
Suren Baghdasaryan [Sat, 3 Nov 2018 02:15:37 +0000 (19:15 -0700)]
Add libprocessgroup dependency and fix sched_policy include

surfaceflinger, installd and libvrflinger are using set_sched_policy
which is moved into libprocessgroup. Add libprocessgroup dependency
and include required headers.

Exempt-From-Owner-Approval: janitorial

Bug: 111307099
Test: builds, boots

Merged-In: Iccb7c54a85ca148d44ce687fe05e89ad4369e104
Change-Id: Iccb7c54a85ca148d44ce687fe05e89ad4369e104
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
5 years agoMerge "Remove outfile option from dumpstate"
Treehugger Robot [Tue, 22 Jan 2019 11:25:12 +0000 (11:25 +0000)]
Merge "Remove outfile option from dumpstate"

5 years agoMerge "Fix dumpstate test instructions"
Treehugger Robot [Tue, 22 Jan 2019 09:09:34 +0000 (09:09 +0000)]
Merge "Fix dumpstate test instructions"

5 years agoMerge "Delay start of surfaceflinger until after the Runtime APEX is mounted."
Nicolas Geoffray [Tue, 22 Jan 2019 08:43:55 +0000 (08:43 +0000)]
Merge "Delay start of surfaceflinger until after the Runtime APEX is mounted."

5 years agoDelay start of surfaceflinger until after the Runtime APEX is mounted.
Martin Stjernholm [Thu, 17 Jan 2019 21:19:14 +0000 (21:19 +0000)]
Delay start of surfaceflinger until after the Runtime APEX is mounted.

It depends on libdexfile_external which is provided by the Runtime APEX.

Test: flash and boot
Test: atest CtsJdwpTestCases
Bug: 113373927
Change-Id: Ic3af21d74854cce02180d3d2e9e3b1b338456e46
Exempt-From-Owner-Approval: Trying this CL out for gathering numbers - will revert if substantial.

5 years agoRemove outfile option from dumpstate
Nandana Dutt [Mon, 21 Jan 2019 15:56:48 +0000 (15:56 +0000)]
Remove outfile option from dumpstate

Remove the ability to write to any directory. Instead support only
writing to its internal directory (currently /bugreports, which points
to Shell app's directory), or a caller-specified file fd.

We cannot expect all callers to supply an fd, because in the poweruser
case where the bugreport is triggered with combo keys, the API is
bypassed and dumpstate binary will be run.

This should be a safe change since sepolicy should not allow dumpstate
to write to arbitrary directories anyway.

This keeps the API lean and keeps the user consent for sharing more
focused.

Note that the current callers all pass in /data/user_de/0/com.android.shell/files/bugreports/bugreport
as the outfile argument already, which is the location /bugreports
symlink points to, so it should work just as before.

BUG:111441001
Test: adb bugreport
Test: adb shell bugreport
Test: interactive bugreport
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Change-Id: Iae8593dc4745147b7bdae25738fcd69b3c20aaf0

5 years agoFix dumpstate test instructions
Nandana Dutt [Mon, 21 Jan 2019 17:47:09 +0000 (17:47 +0000)]
Fix dumpstate test instructions

Amend command to copy all tests including smoke tests
Test: verified instruction

Change-Id: I107be21f2acab3a9965a114fb2219e3d21c871b1

5 years agoMerge "Add calling uid and calling package to startBugreport"
Treehugger Robot [Sat, 19 Jan 2019 13:48:29 +0000 (13:48 +0000)]
Merge "Add calling uid and calling package to startBugreport"

5 years agoAdd calling uid and calling package to startBugreport
Nandana Dutt [Wed, 16 Jan 2019 17:45:18 +0000 (17:45 +0000)]
Add calling uid and calling package to startBugreport

This is so they can be passed to the consent service which will present
the user with a dialog and get their consent to share the bugreport with
the calling package.

Also update a few TODOs.

BUG: 111441001
Test: builds
Change-Id: I0a72c8e2d697f8a25f307cfce73c8f03ed1746e2

5 years ago[view compilation] Add viewcompiler support to installd
Eric Holk [Thu, 10 Jan 2019 02:17:27 +0000 (18:17 -0800)]
[view compilation] Add viewcompiler support to installd

This change adds methods to installd to call viewcompiler and generate
precompiled layouts when requested either by `pm compile --compile-layouts`,
package install, or package upgrade.

Bug: 111895153
Test: manual
Change-Id: Ic021d7a41c15642664f44542653170ad24055f22

5 years agoMerge "Fix typo cpu6 -> cpu7"
Hector Dearman [Fri, 18 Jan 2019 17:04:05 +0000 (17:04 +0000)]
Merge "Fix typo cpu6 -> cpu7"

5 years agoFix typo cpu6 -> cpu7
Hector Dearman [Fri, 18 Jan 2019 14:00:32 +0000 (14:00 +0000)]
Fix typo cpu6 -> cpu7

This prevented perfetto from clearing the ftrace buffer for cpu7
(and only cpu7). Seems a copy paste error.

Test: Untested.
Bug: 122609457
Change-Id: I2096dc333880d94cb25ba5ce50272444e8ae999e

5 years agoMerge "Remove ftrace dumping from dumpstate"
Treehugger Robot [Fri, 18 Jan 2019 01:39:21 +0000 (01:39 +0000)]
Merge "Remove ftrace dumping from dumpstate"

5 years agoMerge "Fix/suppress sensor google-explicit-constructor warnings"
Treehugger Robot [Fri, 18 Jan 2019 01:08:40 +0000 (01:08 +0000)]
Merge "Fix/suppress sensor google-explicit-constructor warnings"

5 years agoRemove ftrace dumping from dumpstate
Primiano Tucci [Thu, 17 Jan 2019 15:51:14 +0000 (15:51 +0000)]
Remove ftrace dumping from dumpstate

When capturing a bug report, dumpstate checks if ftrace
is on, and if so, steals the trace from the buffer.
This feature doesn't seem to be actually used, getting
rid of unnecessary complexity and unnecessary permissions.
Furthermore, stealing the trace is bad for iorapd, studio
perfetto, Traceur and all the other trace users.
Matching selinux change: aosp/875395

Bug: 122987614
Test: run dumpstate before and after patch,
      file sizes are comparable,
      observed no tracing-related errors.
Change-Id: I8bcd478c9bde776a2ec21b5e9a97aedaaa3681fd

5 years agoFix/suppress sensor google-explicit-constructor warnings
Chih-Hung Hsieh [Thu, 20 Dec 2018 23:49:36 +0000 (15:49 -0800)]
Fix/suppress sensor google-explicit-constructor warnings

* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I63e196797c287182fe8ccdad0e896f864a10bf76

5 years agoMerge "Add filemap events for iorapd"
Treehugger Robot [Thu, 17 Jan 2019 21:06:33 +0000 (21:06 +0000)]
Merge "Add filemap events for iorapd"

5 years agoMerge "NFC: Switch ATRACE_BUFFER_INDEX to be a more friendly macro statement."
Pirama Arumuga Nainar [Thu, 17 Jan 2019 06:00:54 +0000 (06:00 +0000)]
Merge "NFC: Switch ATRACE_BUFFER_INDEX to be a more friendly macro statement."

5 years agoMerge "Call new dumpstate listener methods"
Treehugger Robot [Wed, 16 Jan 2019 16:46:24 +0000 (16:46 +0000)]
Merge "Call new dumpstate listener methods"

5 years agoMerge "Move to C API of libnativeloader."
Nicolas Geoffray [Wed, 16 Jan 2019 15:05:53 +0000 (15:05 +0000)]
Merge "Move to C API of libnativeloader."

5 years agoCall new dumpstate listener methods
Nandana Dutt [Tue, 15 Jan 2019 14:11:12 +0000 (14:11 +0000)]
Call new dumpstate listener methods

The old listener methods are still connected, but will be removed soon.

Also fixed the progress debug logs, which rarely work since the guard
condition is rarely met.

BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Change-Id: I29b95685df89d0bbebde7d95d496500bf51f4aaa