OSDN Git Service

android-x86/frameworks-native.git
5 years agoMerge "Mark libandroid_runtime_lazy as double_loadable"
Treehugger Robot [Fri, 29 Mar 2019 04:40:01 +0000 (04:40 +0000)]
Merge "Mark libandroid_runtime_lazy as double_loadable"

5 years agoMark libandroid_runtime_lazy as double_loadable
Jooyung Han [Wed, 27 Mar 2019 02:50:49 +0000 (11:50 +0900)]
Mark libandroid_runtime_lazy as double_loadable

Because of following two conditions,
- libmediandk(LL-NDK) depends on it.
- libandroid_runtime_lazy is vendor_available:true.

This lib is vendor_available but actually it is not supposed
to be used by vendor processes (which are not app_process and
there is no android_runtime).

If the vendor variant of this lib is loaded
and the delegate functions are called, then dlopen will fail as
expected.

Bug: 125550121
Test: m -j
Change-Id: I7f417d771ccff0679018f9533a5bf1c2b3b43f00
Merged-In: I7f417d771ccff0679018f9533a5bf1c2b3b43f00

5 years agoMerge "Lite bugreports(wifi/telephony) don't need screenshots"
Abhijeet Kaur [Wed, 27 Mar 2019 13:52:15 +0000 (13:52 +0000)]
Merge "Lite bugreports(wifi/telephony) don't need screenshots"

5 years agoLite bugreports(wifi/telephony) don't need screenshots
Abhijeet Kaur [Mon, 25 Mar 2019 12:04:16 +0000 (12:04 +0000)]
Lite bugreports(wifi/telephony) don't need screenshots

Set do_fb to false for lite bugreports to not take screenshots.

Also, add a nonempty check for screenshot files before broadcasting to
notification. This way while sharing or uploading to drive/gmail by
clicking the "Share" button would not show empty file (Not able to
upload) error.

Update unit tests to check for do_fb set to false for wifi/telephony.

Bug: 128546970
Test: Manually take a wifi bugreport:
    * adb root
    * adb shell setprop dumpstate.options bugreportwifi
    * adb shell dumpstate
    * share bugreport from the notification to the drive
    * No upload failures (previously screenshot would show "Upload was
    unsuccessful" notification.)
Test:
    * adb shell mkdir /data/nativetest64
    * mmm -j frameworks/native/cmds/dumpstate/ &&
      adb push ${OUT}/data/nativetest64/dumpstate_test* /data/nativetest64
      && adb shell /data/nativetest64/dumpstate_test/dumpstate_test &&
      printf "\n\n#### ALL TESTS PASSED ####\n"

Change-Id: I0d2fe2a64f91dee7d090d5f8353e86d51ed5fb94

5 years agoMerge changes Ic8b33ce8,Ied6f13e5
Treehugger Robot [Tue, 26 Mar 2019 18:36:08 +0000 (18:36 +0000)]
Merge changes Ic8b33ce8,Ied6f13e5

* changes:
  installd: Avoid extra std::string copy
  dexopt: Avoid a couple std::string copies

5 years agoinstalld: Avoid extra std::string copy
Greg Kaiser [Tue, 26 Mar 2019 15:55:32 +0000 (08:55 -0700)]
installd: Avoid extra std::string copy

The method is_valid_package_name() takes a const std::string
reference, so it's inefficient to pass a std::string::c_str().

Test: TreeHugger
Change-Id: Ic8b33ce8b6c664f960b5c84f688821e9f7eddf03

5 years agodexopt: Avoid a couple std::string copies
Greg Kaiser [Tue, 26 Mar 2019 13:23:19 +0000 (06:23 -0700)]
dexopt: Avoid a couple std::string copies

There are a couple places where we're taking a std::string and
then passing the result of c_str() to function taking a
const std::string reference.  This inefficiently creates a
temporary object.  We change these to directly pass the
std::string.

Test: TreeHugger
Change-Id: Ied6f13e5e2b7b71c992d325ce285fd829bdb7ee9

5 years agoMerge "Add libandroid_runtime_lazy"
Treehugger Robot [Tue, 26 Mar 2019 04:47:32 +0000 (04:47 +0000)]
Merge "Add libandroid_runtime_lazy"

5 years agoAdd libandroid_runtime_lazy
Jooyung Han [Thu, 7 Mar 2019 07:55:04 +0000 (16:55 +0900)]
Add libandroid_runtime_lazy

Extract lazy loading of libandroid_runtime from libbinder_ndk
into its own library.

This lib loads libandroid_runtime on demand, so the clients
which don't use this can benefit.

Do not over-use this lib to mock the build system and pretend not
depending on libandroid_runtime.

Bug: 125550121
Test: m -j
Test: readelf -d $OUT/system/lib64/libbinder_ndk.so | grep NEED
        # see if there is not libandroid_runtime
Test: atest android.binder.cts

Change-Id: I4b120686ba34f45e060594641ffc74bc1496c8c9

5 years agoMerge "Installd: Add explicit test configurations"
Treehugger Robot [Tue, 26 Mar 2019 00:07:44 +0000 (00:07 +0000)]
Merge "Installd: Add explicit test configurations"

5 years agoMerge "Installd: Fix installd_dexopt_test"
Treehugger Robot [Mon, 25 Mar 2019 21:08:30 +0000 (21:08 +0000)]
Merge "Installd: Fix installd_dexopt_test"

5 years agoInstalld: Add explicit test configurations
Andreas Gampe [Mon, 25 Mar 2019 18:37:15 +0000 (11:37 -0700)]
Installd: Add explicit test configurations

Most tests require a root shell for their work.

Test: adb unroot ; atest installd_cache_test
Test: adb unroot ; atest installd_dexopt_test
Test: adb unroot ; atest installd_otapreopt_test
Test: adb unroot ; atest installd_service_test
Test: adb unroot ; atest installd_utils_test
Change-Id: I657cd276ca71dd63c5c72e13f8b2971b9031e204

5 years agoInstalld: Fix installd_dexopt_test
Andreas Gampe [Mon, 25 Mar 2019 18:20:57 +0000 (11:20 -0700)]
Installd: Fix installd_dexopt_test

The introduction of system_server_startup means we need to explicitly
move to system_server's final domain.

Bug: 129140502
Test: atest installd_dexopt_test
Change-Id: I776ed44406ad75dc27383719b9a2709c00eaced0

5 years agoMerge "Add netd and connmetrics into telephony dump"
Chiachang Wang [Mon, 25 Mar 2019 08:56:49 +0000 (08:56 +0000)]
Merge "Add netd and connmetrics into telephony dump"

5 years agoAdd netd and connmetrics into telephony dump
Chiachang Wang [Mon, 25 Mar 2019 00:59:55 +0000 (08:59 +0800)]
Add netd and connmetrics into telephony dump

In order to debug data related issues, it will need to include
both netd and connmetrics information to bugreport to
understand how the network modules behave at reported timestamp.

Bug: 129101113
Test: - Build
      - $ adb shell setprop dumpstate.options bugreporttelephony
        $ adb shell dumpstate

Change-Id: I48b5d424234c265ce25758f5014ce8a07dd3e381

5 years agoMerge changes from topic "agampe:a-b-ota:vendor-product-logical-partitions"
Andreas Gampe [Sun, 24 Mar 2019 19:45:36 +0000 (19:45 +0000)]
Merge changes from topic "agampe:a-b-ota:vendor-product-logical-partitions"

* changes:
  OtaPreopt: Add support for logical partitions
  OtaPreopt: Refactor code

5 years agoOtaPreopt: Add support for logical partitions
Andreas Gampe [Fri, 22 Mar 2019 18:21:34 +0000 (11:21 -0700)]
OtaPreopt: Add support for logical partitions

Use logical partitions prepared by update_engine if possible.

Bug: 128867786
Test: DexOptOtaTests
Change-Id: I6979487b91d24b7309c876f2bdc26a827e2fcd1e

5 years agoOtaPreopt: Refactor code
Andreas Gampe [Thu, 21 Mar 2019 18:34:19 +0000 (11:34 -0700)]
OtaPreopt: Refactor code

Create a common function for mounting vendor and product. This is in
preparation for dynamic partition support.

Bug: 128867786
Test: DexOptOtaTests
Change-Id: I020a35bcdd4b2a122c967d3a5173ea289f284689

5 years agoMerge "dexopt: Open class loader context dex files for dex2oat"
David Brazdil [Fri, 22 Mar 2019 13:48:58 +0000 (13:48 +0000)]
Merge "dexopt: Open class loader context dex files for dex2oat"

5 years agoMerge "Update otapreopt_chroot with new libapexd dependencies."
Martijn Coenen [Fri, 22 Mar 2019 07:33:25 +0000 (07:33 +0000)]
Merge "Update otapreopt_chroot with new libapexd dependencies."

5 years agoMerge "Fix installd_dexopt_test."
Andreas Gampe [Thu, 21 Mar 2019 21:57:40 +0000 (21:57 +0000)]
Merge "Fix installd_dexopt_test."

5 years agoUpdate otapreopt_chroot with new libapexd dependencies.
Martijn Coenen [Wed, 13 Mar 2019 11:59:57 +0000 (12:59 +0100)]
Update otapreopt_chroot with new libapexd dependencies.

libapexd has added dependencies to libvold_binder (static) and
libbinder/libutils (shared).

Bug: 126740531
Test: builds
Change-Id: Ia1c1a94efc98fb15aa4c7d3cd22c6229c1931b28

5 years agoFix installd_dexopt_test.
Martijn Coenen [Thu, 21 Mar 2019 12:14:59 +0000 (13:14 +0100)]
Fix installd_dexopt_test.

The way Binder status error messages are printed was changed in
I911c3a667ddbe39245e5c3bbbd09154b2902aad8. Fix tests to deal
with it.

Bug: 128555505
Test: atest installd_dexopt_test
Change-Id: I9372eccf5bc9e97fc043112fa4b463560a3ff2a5

5 years agodexopt: Open class loader context dex files for dex2oat
David Brazdil [Tue, 19 Mar 2019 11:44:21 +0000 (11:44 +0000)]
dexopt: Open class loader context dex files for dex2oat

When compiling secondary dex files, the class loader context may contain
files with 'app_data_file' selabel which dex2oat/dexoptanalyzer are not
allowed to open. Extend installd/dexopt to open these files for them and
pass in their file descriptors.

Dexopt of secondary dex files now starts by invoking dexoptanalyzer with
'--flatten-class-loader-context'. In this mode, dexoptanalyzer will only
parse the given class loader context, flatten it and print a
colon-separated list of dex files to standard output. Dexopt captures
the output and splits the string to obtain a list of context dex files.

It then continues by opening these files for dexoptanalyzer under
dropped privileges, passing the FDs using command line arguments, and
later opening the files again for dex2oat.

Bug: 126674985
Test: atest installd_dexopt_test
Change-Id: Ib9017a67c514ed711e1a03cfac313df796af6af9

5 years agoMerge changes from topic "RenderArea"
Treehugger Robot [Thu, 21 Mar 2019 06:33:46 +0000 (06:33 +0000)]
Merge changes from topic "RenderArea"

* changes:
  Respect source crop when capturing layers.
  libgui: add docs to geometry states and captureScreen
  surfaceflinger: fix captureScreen for landscape LCM
  surfaceflinger: improve RenderArea needsFiltering
  surfaceflinger: respect install orientation in DisplayRenderArea
  surfaceflinger: add install orientation to DisplayDevice
  surfaceflinger: make mPrimaryDisplayOrientation static
  surfaceflinger: clean up captureScreen
  surfaceflinger: silence some RenderArea errors
  surfaceflinger: fix race conditions in captureScreen
  surfaceflinger: remove ISurfaceComposer.h from RenderArea
  surfaceflinger: reorder width and height in RenderArea ctor
  surfaceflinger: documents RenderArea

5 years agoRespect source crop when capturing layers.
Alec Mouri [Fri, 26 Oct 2018 22:49:45 +0000 (15:49 -0700)]
Respect source crop when capturing layers.

Source crop we receive from window manager appears to be correct, no
need for this workaround.

Bug: 117892959
Test: adb shell screencap, rotation animation, power cycle display
Change-Id: I54ea3fb561ce4f2ea6f48079ad51efdd9984d186
Merged-In: I54ea3fb561ce4f2ea6f48079ad51efdd9984d186

5 years agolibgui: add docs to geometry states and captureScreen
Chia-I Wu [Wed, 22 Aug 2018 22:27:32 +0000 (15:27 -0700)]
libgui: add docs to geometry states and captureScreen

I think captureScreen is a bit fishy.  We want it to capture the
logical display, but neither of the framework or surfaceflinger is
ready.

Bug: 113041375
Test: builds
Change-Id: Id5c76a4551e5260e83e64f0ca3ed2afaa34eecb5
Merged-In: Id5c76a4551e5260e83e64f0ca3ed2afaa34eecb5

5 years agosurfaceflinger: fix captureScreen for landscape LCM
Chia-I Wu [Wed, 29 Aug 2018 16:25:59 +0000 (09:25 -0700)]
surfaceflinger: fix captureScreen for landscape LCM

Make DisplayRenderArea::getSourceCrop return the display scissor
when the source crop is empty.  Force the source crop to be empty in
captureScreen.  This makes sure the install orientation is applied
on the source crop once, not twice.

Bug: 113041375
Test: force primaryDisplayOrientation, rotate screen, and switch
      apps
Change-Id: I15006f867ff2d4a92ebccb1334ce59ab32abe69a
Merged-In: I15006f867ff2d4a92ebccb1334ce59ab32abe69a

5 years agosurfaceflinger: improve RenderArea needsFiltering
Chia-I Wu [Tue, 28 Aug 2018 18:01:44 +0000 (11:01 -0700)]
surfaceflinger: improve RenderArea needsFiltering

Compare source crop (instead of the logical render area) against
physical render area to decide whether filtering is required.  This
allows us to get rid of Layer::setFiltering.

As a result, captureLayers for Recents no longer enables filtering.
Screenshots under landscape mode no longer enables filtering.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: Ida95fdfec3a0dde7a19adf35c91bf3d570bab6bb
Merged-In: Ida95fdfec3a0dde7a19adf35c91bf3d570bab6bb

5 years agosurfaceflinger: respect install orientation in DisplayRenderArea
Chia-I Wu [Mon, 27 Aug 2018 21:54:37 +0000 (14:54 -0700)]
surfaceflinger: respect install orientation in DisplayRenderArea

DisplayRenderArea getTransform takes install orientation into
consideration.  Fix getSourceCrop and getRotationFlags to respect
install orientation as well.

This results in some changes

 - source crop is no longer rotated by install orientation for
   LayerRenderArea
 - rotation flags is no longer rotated by install orientation for
   LayerRenderArea
 - source crop is no longer set to getBounds by default for
   LayerRenderArea (it is already done in captureLayers)
 - source crop is always rotated by install orientation for
   DisplayRenderArea

AFAICT, all the changes are actually fixes.  Quickly verified by
forcing primaryDisplayOrientation to DisplayState::eOrientation90.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: If19df222ae52f6b276f9b0572e7b9bec872e3ae4
Merged-In: If19df222ae52f6b276f9b0572e7b9bec872e3ae4

5 years agosurfaceflinger: add install orientation to DisplayDevice
Chia-I Wu [Mon, 27 Aug 2018 21:38:23 +0000 (14:38 -0700)]
surfaceflinger: add install orientation to DisplayDevice

Rather than querying it from SurfaceFlinger, initialize
DisplayDevice with the install orientation.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: Ibffe47033276e938388af775749c56f170fe8c77
Merged-In: Ibffe47033276e938388af775749c56f170fe8c77

5 years agosurfaceflinger: make mPrimaryDisplayOrientation static
Chia-I Wu [Mon, 27 Aug 2018 21:38:14 +0000 (14:38 -0700)]
surfaceflinger: make mPrimaryDisplayOrientation static

The convention is to store configstore values in static variables.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: I085178803bc897e3e9201fd10bd8731cc5b617c1
Merged-In: I085178803bc897e3e9201fd10bd8731cc5b617c1

5 years agosurfaceflinger: clean up captureScreen
Chia-I Wu [Tue, 28 Aug 2018 19:57:23 +0000 (12:57 -0700)]
surfaceflinger: clean up captureScreen

dispScissor is never empty.  Remove the check and update the
comments so that the intention is clear.

It also becomes obvious that reqWidth/reqHeight is never zero when
we reach "// get screen geometry".  All code following the comment
is actually dead, which means we probably broke it since commit
06a58e22.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: Ida1430383ce62271365d9ef64ad9b055638e1eac
Merged-In: Ida1430383ce62271365d9ef64ad9b055638e1eac

5 years agosurfaceflinger: silence some RenderArea errors
Chia-I Wu [Mon, 27 Aug 2018 22:40:25 +0000 (15:40 -0700)]
surfaceflinger: silence some RenderArea errors

Allow physical size and source crop size to be larger than the
logical size.

Bug: 113041375
Test: builds
Change-Id: I5a0e2158d114a6e06c8241b48d90bbb6172216cc
Merged-In: I5a0e2158d114a6e06c8241b48d90bbb6172216cc

5 years agosurfaceflinger: fix race conditions in captureScreen
Chia-I Wu [Thu, 23 Aug 2018 19:55:44 +0000 (12:55 -0700)]
surfaceflinger: fix race conditions in captureScreen

The display was looked up without holding the state lock.  It was
also used (including indirectly from updateDimensions) without
holding the lock either.

Inline updateDimensions in captureScreen with the state lock held.
Stop calling updateDimensions in captureLayers.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: I8b361847c44373ce08930d906ec4a995efd1c21b
Merged-In: I8b361847c44373ce08930d906ec4a995efd1c21b

5 years agosurfaceflinger: remove ISurfaceComposer.h from RenderArea
Chia-I Wu [Fri, 24 Aug 2018 22:34:02 +0000 (15:34 -0700)]
surfaceflinger: remove ISurfaceComposer.h from RenderArea

RenderArea can be made more generic by removing ISurfaceComposer.h
dependency.  The caller also prefers to work with
ui::Transform::orientation_flags than ISurfaceComposer::Rotation (we
want to move updateDimensions to the caller).

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: I16e1392d5c92c2f423f98307e867918415404d26
Merged-In: I16e1392d5c92c2f423f98307e867918415404d26

5 years agosurfaceflinger: reorder width and height in RenderArea ctor
Chia-I Wu [Thu, 23 Aug 2018 20:44:43 +0000 (13:44 -0700)]
surfaceflinger: reorder width and height in RenderArea ctor

Height is before width only in a crazy world.

Bug: 113041375
Test: take screenshot, rotate screen, screencap
Change-Id: Ia10b26dbba9a6a91abb5dae9fbe20bf17cd3e78f
Merged-In: Ia10b26dbba9a6a91abb5dae9fbe20bf17cd3e78f

5 years agosurfaceflinger: documents RenderArea
Chia-I Wu [Thu, 23 Aug 2018 19:05:27 +0000 (12:05 -0700)]
surfaceflinger: documents RenderArea

Bug: 113041375
Test: builds
Change-Id: I7cf73b862aac38a782c4d0b154ed2357e1ef8dfe
Merged-In: I7cf73b862aac38a782c4d0b154ed2357e1ef8dfe

5 years agoMerge "dumpstate: remove obsolete TODO"
Nandana Dutt [Wed, 20 Mar 2019 18:11:18 +0000 (18:11 +0000)]
Merge "dumpstate: remove obsolete TODO"

5 years agodumpstate: remove obsolete TODO
Nandana Dutt [Wed, 20 Mar 2019 15:36:18 +0000 (15:36 +0000)]
dumpstate: remove obsolete TODO

The Bugreporting API only supports the case where the calling
and consuming app are the same. The TODO is obsolete.

Test: builds

Change-Id: I7a408752d2b71d9e4b0ff77f0ae3f5f3a606239c

5 years agoMerge "Add exceptionToString method into binder::Status"
Treehugger Robot [Tue, 19 Mar 2019 21:15:41 +0000 (21:15 +0000)]
Merge "Add exceptionToString method into binder::Status"

5 years agoMerge "libbinder_ndk: unlinkToDeath dead proxy"
Steven Moreland [Tue, 19 Mar 2019 19:37:39 +0000 (19:37 +0000)]
Merge "libbinder_ndk: unlinkToDeath dead proxy"

5 years agoAdd exceptionToString method into binder::Status
Jeongik Cha [Mon, 18 Mar 2019 05:38:33 +0000 (14:38 +0900)]
Add exceptionToString method into binder::Status

String exceptionToString(int32_t exceptionCode)

Add this method for logging purpose

Test: m -j
Bug: 127187108
Change-Id: I911c3a667ddbe39245e5c3bbbd09154b2902aad8

5 years agolibbinder_ndk: unlinkToDeath dead proxy
Steven Moreland [Wed, 13 Mar 2019 16:25:44 +0000 (09:25 -0700)]
libbinder_ndk: unlinkToDeath dead proxy

This CL automatically unlinks to death when a proxy dies (to clean
up additional data) and documents the behavior.

Bug: N/A
Test: ./runtests.sh
Change-Id: Ib092b25273a51f5afb12904bfe491927ad404f8d

5 years agoMerge "libbinder_ndk: fix UB memory access for race"
Steven Moreland [Fri, 15 Mar 2019 16:32:37 +0000 (16:32 +0000)]
Merge "libbinder_ndk: fix UB memory access for race"

5 years agoMerge "Check for user consent denial when dumping traces."
Nandana Dutt [Fri, 15 Mar 2019 11:16:51 +0000 (11:16 +0000)]
Merge "Check for user consent denial when dumping traces."

5 years agoCheck for user consent denial when dumping traces.
Nandana Dutt [Thu, 14 Mar 2019 10:40:17 +0000 (10:40 +0000)]
Check for user consent denial when dumping traces.

VM traces is one of the longer running operations. Check consent
periodically and return early if necessary.

BUG:128270426
Test: manual; by canceling when traces was running.
Test: verified "VM TRACES JUST NOW" shows up as expected
after refactoring in the normal flow as well.

Change-Id: Ic5282b948929857850730d6b06ec0cae8c39a99f

5 years agoMerge "Handle user consent denial sooner"
Nandana Dutt [Fri, 15 Mar 2019 09:04:16 +0000 (09:04 +0000)]
Merge "Handle user consent denial sooner"

5 years agoMerge "Revert "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime...
Treehugger Robot [Fri, 15 Mar 2019 09:02:18 +0000 (09:02 +0000)]
Merge "Revert "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX.""

5 years agoMerge "Fix a typo in an error message of dexopt."
Roland Levillain [Thu, 14 Mar 2019 19:30:29 +0000 (19:30 +0000)]
Merge "Fix a typo in an error message of dexopt."

5 years agoMerge "dumpstate: Log duration only if significant"
Treehugger Robot [Thu, 14 Mar 2019 17:15:24 +0000 (17:15 +0000)]
Merge "dumpstate: Log duration only if significant"

5 years agoFix a typo in an error message of dexopt.
Roland Levillain [Thu, 14 Mar 2019 14:31:59 +0000 (14:31 +0000)]
Fix a typo in an error message of dexopt.

Test: m
Change-Id: I881f772afa41ea0389e99d3c972cacdc5e93ed1a

5 years agoMerge "Rename data/pkg_staging to data/app-staging"
Gavin Corkery [Thu, 14 Mar 2019 14:14:38 +0000 (14:14 +0000)]
Merge "Rename data/pkg_staging to data/app-staging"

5 years agodumpstate: Log duration only if significant
Nandana Dutt [Thu, 14 Mar 2019 11:04:22 +0000 (11:04 +0000)]
dumpstate: Log duration only if significant

Ignore durations shorter than 500ms. Also adjust
the precision of the duration logged accordingly.

This is to avoid log spam.

Test: verified logcat on bugreport
Change-Id: Ibcef6b107de4327f769242c0c43d7f5317eee7f6

5 years agoHandle user consent denial sooner
Nandana Dutt [Tue, 12 Mar 2019 10:52:56 +0000 (10:52 +0000)]
Handle user consent denial sooner

Currently dumpstate prompts the user for consent rightaway when called
via the API, but does not check for the result until the entire
bugreport is generated. This can make for a poor user experience - for
e.g. the client will continue to show a progress bar for a long time
after user denied consent.

Fix by checking for user consent intermittently.

BUG: 128270426
Test: Tested canceling during each long running operation in internal
Test: bugreport from power menu (ie non-api flow) still works as
expected
Test: adb shell
/data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test &&
adb shell /data/nativetest64/dumpstate_test/dumpstate_test

Change-Id: Icbed7c510ff9c9a882a7b49eac1a92fa17727635
Merged-In: Icbed7c510ff9c9a882a7b49eac1a92fa17727635

5 years agoRename data/pkg_staging to data/app-staging
Gavin Corkery [Wed, 27 Feb 2019 12:24:19 +0000 (12:24 +0000)]
Rename data/pkg_staging to data/app-staging

Test: atest apex_e2e_tests
Bug: 126330086

(cherry picked from commit 950d5b4b8a55bda5874bfa75f3bcadf7160446a0)

Change-Id: Id98ecbad4f9452bc40a628ceb8c50ce20453d7ad
Merged-In: Id98ecbad4f9452bc40a628ceb8c50ce20453d7ad

5 years agolibbinder_ndk: fix UB memory access for race
Steven Moreland [Wed, 13 Mar 2019 16:23:18 +0000 (09:23 -0700)]
libbinder_ndk: fix UB memory access for race

AIBinder_DeathRecipient holds a strong pointer to its internal class
TransferDeathRecipient. If a user deletes a death recipient at the
same time a binder dies, the TDR still holds a reference to the
AIBinder_DeathRecipient object that may be invalidated.

Bug: N/A
Test: build, boot, and ./runtests.sh
Change-Id: Ic4cbc50c2d85ce52e36d4b157a50d0c75048e664

5 years agoMerge "Revert "libbinder: Choose the binder driver at runtime based on system/vendor...
Martijn Coenen [Wed, 13 Mar 2019 11:53:54 +0000 (11:53 +0000)]
Merge "Revert "libbinder: Choose the binder driver at runtime based on system/vendor process.""

5 years agoRevert "libbinder: Choose the binder driver at runtime based on system/vendor process."
Martijn Coenen [Wed, 13 Mar 2019 11:51:08 +0000 (11:51 +0000)]
Revert "libbinder: Choose the binder driver at runtime based on system/vendor process."

This reverts commit 46f95536bec334f8472ea92a7697c37602337398.

Reason for revert: appears to break (some?) native tests, which start looking for binder services in /dev/vndbinder

Change-Id: Id27d90e484d23a5975869729fa274213a9b1e1e4

5 years agoMerge "DO NOT MERGE - Merge PPRL.190305.001 into master"
Xin Li [Wed, 13 Mar 2019 02:26:03 +0000 (02:26 +0000)]
Merge "DO NOT MERGE - Merge PPRL.190305.001 into master"

5 years agoMerge "libbinder: Choose the binder driver at runtime based on system/vendor process."
Jayant Chowdhary [Wed, 13 Mar 2019 00:07:05 +0000 (00:07 +0000)]
Merge "libbinder: Choose the binder driver at runtime based on system/vendor process."

5 years agolibbinder: Choose the binder driver at runtime based on system/vendor process.
Jayant Chowdhary [Fri, 8 Mar 2019 18:08:20 +0000 (10:08 -0800)]
libbinder: Choose the binder driver at runtime based on system/vendor process.

This is needed since llndk libraries may cause the system variant of libbinder (and therefore
compile time checks are not enough) to be loaded in a vendor process. In that case, it should not be
initing the driver with /dev/binder. It should use /dev/vndbinder instead.

Bug: 124128212

Test: Device boots
Test: play YouTube videos, use camera to take pictures / record video (sanity) on devices supporting
      legacy vndk(sailfish) and also devices supporting current vndk.

Change-Id: Ia5581efa04c8d4adc6af39668b0aa98e84324a27
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
5 years agoMerge "Dumpstate: Refactor DumpHals"
Nandana Dutt [Tue, 12 Mar 2019 10:24:43 +0000 (10:24 +0000)]
Merge "Dumpstate: Refactor DumpHals"

5 years agoMerge "Add new emails to OWNER file"
Treehugger Robot [Mon, 11 Mar 2019 19:05:50 +0000 (19:05 +0000)]
Merge "Add new emails to OWNER file"

5 years agoDumpstate: Refactor DumpHals
Nandana Dutt [Mon, 11 Mar 2019 16:33:24 +0000 (16:33 +0000)]
Dumpstate: Refactor DumpHals

Prefactoring to handle user consent denial sooner.

BUG: 128270426
Test: "adb shell bugreport" for flat file bugreports works
Change-Id: Ifba9ec600ab7fe23b046414fd718220cd07a39d2

5 years agoAdd new emails to OWNER file
Mohammad Samiul Islam [Mon, 11 Mar 2019 15:11:58 +0000 (15:11 +0000)]
Add new emails to OWNER file

Test: builds successfully
Change-Id: I080d4cd20290f3662087ccb5034d09c43311ecfb

5 years agoDO NOT MERGE - Merge PPRL.190305.001 into master
Xin Li [Mon, 11 Mar 2019 16:13:29 +0000 (09:13 -0700)]
DO NOT MERGE - Merge PPRL.190305.001 into master

Bug: 127812889
Change-Id: I1cb1c38609ee26bb7c3e7343a9ed4c85fb4fb0a6

5 years agoMerge "Log duration to logcat always."
Treehugger Robot [Mon, 11 Mar 2019 14:18:57 +0000 (14:18 +0000)]
Merge "Log duration to logcat always."

5 years agoMerge "dumpstate: move dump_traces to Dumpstate"
Treehugger Robot [Mon, 11 Mar 2019 13:10:53 +0000 (13:10 +0000)]
Merge "dumpstate: move dump_traces to Dumpstate"

5 years agoLog duration to logcat always.
Nandana Dutt [Mon, 11 Mar 2019 11:00:58 +0000 (11:00 +0000)]
Log duration to logcat always.

Remove TODO and make the logging behavior intentional.

Rename field to make the intent clearer.

BUG:128270426

Test: took bugreport and verified log lines: adb logcat | grep "Duration was"
Change-Id: I6a9379af9ee6a03587c40c35f3f242d84ddf3bc3

5 years agodumpstate: move dump_traces to Dumpstate
Nandana Dutt [Mon, 11 Mar 2019 09:23:09 +0000 (09:23 +0000)]
dumpstate: move dump_traces to Dumpstate

Prefactoring to handle user consent denial sooner.

BUG: 128270426

Test: adb shell
/data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test &&
adb shell /data/nativetest64/dumpstate_test/dumpstate_test

Change-Id: Ifbace4391d22901480e41d3125d8a89508ebd52d

5 years agoMerge changes from topic "b127336441"
Steven Moreland [Fri, 8 Mar 2019 23:06:43 +0000 (23:06 +0000)]
Merge changes from topic "b127336441"

* changes:
  libbinder_ndk: Fix 'isRemote' value for Bn*.
  libbinder_ndk: define userdata class in headers

5 years agoSnap for 5240760 from 3ce2b66f92ea8c50005b38595bb1aed4c80135ed to pi-platform-release
android-build-team Robot [Fri, 8 Mar 2019 18:45:51 +0000 (18:45 +0000)]
Snap for 5240760 from 3ce2b66f92ea8c50005b38595bb1aed4c80135ed to pi-platform-release

Change-Id: I35689fd57b90f25332bd2e7219b3a72f3d386cab

5 years agoRevert "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX."
Jiyong Park [Thu, 7 Mar 2019 15:04:17 +0000 (15:04 +0000)]
Revert "Have `otapreopt_chroot` bind-mount Bionic artifacts from the Runtime APEX."

This reverts commit c3265aef20d4afca0eb62d0ce02fdbc8a254c421.

Reason for revert: No need to bind-mount bionic libraries

/system/lib/libc.so is a symlink directly to
/apex/com.android.runtime/lib/bootstrap/libc.so.

Bug: 125549215
Bug: 113373927
Bug: 120266448
Change-Id: I8a22d9e70ea017ff9a9f0b0f81f8a90fee3dabf2
Test: m
Test: asit/dexoptota/self_full

5 years agolibbinder_ndk: Fix 'isRemote' value for Bn*.
Steven Moreland [Wed, 6 Mar 2019 23:02:23 +0000 (15:02 -0800)]
libbinder_ndk: Fix 'isRemote' value for Bn*.

Bn* is not remote (it's local).

This wasn't noticed before since the AIDL generated method 'associate'
always wrapped a proxy, and since a wrapped Bn object will always have
a null remoteBinder, it would properly show that it was local even
though it was wrapped.

Bug: 127336441
Test: atest android.binder.cts
Change-Id: Ic4d96822a355e88bc8f3dbbc8fa602835653139e

5 years agolibbinder_ndk: define userdata class in headers
Steven Moreland [Wed, 6 Mar 2019 21:55:49 +0000 (13:55 -0800)]
libbinder_ndk: define userdata class in headers

Rather than auto-generating it for each class.

From 'struct AIBinder' comment:
                         (process boundary)
                                 |
 MyInterface ---> AIBinder_Weak  |  ProxyForMyInterface
      ^                .         |          |
      |                .         |          |
      |                v         |          v
   UserData  <---   AIBinder   <-|-      AIBinder

ICInterfaceData represents 'UserData' here.

Bug: 127336441
Test: atest android.binder.cts
Change-Id: I2ffd7533dd81f06126547e4c82ec7e1e1cb0b0d0

5 years agoMerge "libbinder_ndk: support dump"
Steven Moreland [Wed, 6 Mar 2019 00:22:37 +0000 (00:22 +0000)]
Merge "libbinder_ndk: support dump"

5 years agolibbinder_ndk: support dump
Steven Moreland [Tue, 5 Mar 2019 00:47:07 +0000 (16:47 -0800)]
libbinder_ndk: support dump

At the NDK layer:
AIBinder_Class_setOnDump (to implement dump)
AIBinder_dump (to call dump)

At the AIDL layer:
ICInterface::dump(...) to implement and call dump

Bug: 125733384
Test: atest android.binder.cts
Change-Id: I0873ad574bb7a8b9d645c7301fdfa0797e62c834

5 years agoMerge "Move PublicFormat from libandroid_runtime to libui"
Treehugger Robot [Tue, 5 Mar 2019 02:16:42 +0000 (02:16 +0000)]
Merge "Move PublicFormat from libandroid_runtime to libui"

5 years agoMerge "ip-up-vpn: Fix resource leaks in error cases"
Treehugger Robot [Tue, 5 Mar 2019 00:35:12 +0000 (00:35 +0000)]
Merge "ip-up-vpn: Fix resource leaks in error cases"

5 years agoip-up-vpn: Fix resource leaks in error cases
Greg Kaiser [Mon, 4 Mar 2019 22:00:34 +0000 (14:00 -0800)]
ip-up-vpn: Fix resource leaks in error cases

These leaks aren't really consequential since this is a standalone
command, and these "leaks" are in main().  But by putting in simple
fixes for these, we reduce the noise when using static analysis to
find leaks in Android code.

Test: TreeHugger
Change-Id: I2cbb4585c6c8d59a0eb89a72f17dfc4fbc532249

5 years agoMerge "dumpstate: handle errors gracefully"
Treehugger Robot [Mon, 4 Mar 2019 14:58:30 +0000 (14:58 +0000)]
Merge "dumpstate: handle errors gracefully"

5 years agoMove PublicFormat from libandroid_runtime to libui
Jooyung Han [Mon, 4 Mar 2019 07:28:48 +0000 (16:28 +0900)]
Move PublicFormat from libandroid_runtime to libui

PublicFormat is defined in android_view_Surface.
However this and related functions are also used in libmediandk
which is both NDK and LL-NDK. As a LL-NDK it should run without
libandroid_runtime.

By moving PublicFormat definition and its utility functions
into libui, LL-NDK can use it without cost of libandroid_runtime.
And also PublicFormat will be deprecated(b/126594675).

This is a part cutting dependency from libmediandk to
libandroid_runtime.

Note: applied clang-format

Bug: 124268753
Test: m -j
Change-Id: I7215dde607b425f7a0d47a6541b83fbe3a0deaf4
Merged-In: I7215dde607b425f7a0d47a6541b83fbe3a0deaf4

5 years agoMerge "Ensure we select the right execution binary for all dexopt commands"
Calin Juravle [Sat, 2 Mar 2019 02:36:00 +0000 (02:36 +0000)]
Merge "Ensure we select the right execution binary for all dexopt commands"

5 years agoEnsure we select the right execution binary for all dexopt commands
Calin Juravle [Fri, 1 Mar 2019 04:29:41 +0000 (20:29 -0800)]
Ensure we select the right execution binary for all dexopt commands

Some devices may not have the debug version of the binaries, so even if we
are asked to use them we can't...

Unify the logic which decides what execution binary to use and apply it to
all commands (dex2oat, profman, dexoptanalyzer).

(follow up fixes to 67a14f6584d6108c29b923ce6a77c0ed5cf347dc)

Test: installd tests
Bug: 124009579
Change-Id: Iec439c0ed63e709cdf35b7f718533eafd429b9c2

5 years agoMerge "Update fence event path for kernel 4.10+"
Treehugger Robot [Fri, 1 Mar 2019 20:56:05 +0000 (20:56 +0000)]
Merge "Update fence event path for kernel 4.10+"

5 years agoUpdate fence event path for kernel 4.10+
Jesse Hall [Tue, 26 Feb 2019 00:24:10 +0000 (16:24 -0800)]
Update fence event path for kernel 4.10+

The sysfs path for controlling dma fence events changed yet again in
Linux 4.10, see kernel commit f54d1867005c3.

Test: adb shell atrace --list_categories | grep sync
Test: external/chromium-trace/systrace.py sync, check for dma_fence
      events in trace.html's event list
Change-Id: I45905cf199d5de3d5679151f19f8aa693adea5e1

5 years agodumpstate: handle errors gracefully
Nandana Dutt [Fri, 22 Feb 2019 15:12:35 +0000 (15:12 +0000)]
dumpstate: handle errors gracefully

Return error codes instead of exiting.

Fixes: 123584708
Test: adb shell
/data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test &&
adb shell /data/nativetest64/dumpstate_test/dumpstate_test

Change-Id: I2b5fcad4e7a7369e02f0c8f5532e0fc69d45480b

5 years agoMerge "Use DEX2OATBOOTCLASSPATH in installd."
Nicolas Geoffray [Tue, 26 Feb 2019 20:38:32 +0000 (20:38 +0000)]
Merge "Use DEX2OATBOOTCLASSPATH in installd."

5 years agoMerge "Query the enable_apex_image flag from native experiment."
Nicolas Geoffray [Tue, 26 Feb 2019 15:26:17 +0000 (15:26 +0000)]
Merge "Query the enable_apex_image flag from native experiment."

5 years agoUse DEX2OATBOOTCLASSPATH in installd.
Nicolas Geoffray [Fri, 22 Feb 2019 21:42:45 +0000 (21:42 +0000)]
Use DEX2OATBOOTCLASSPATH in installd.

Bug: 119800099
Bug: 122937705
Test: dexopt_test
Change-Id: Ie31762910a51ddb1211eed6a24456f0a70379d9c

5 years agoMerge "Whitelist the staging directory in installd"
Shafik Nassar [Tue, 26 Feb 2019 10:59:50 +0000 (10:59 +0000)]
Merge "Whitelist the staging directory in installd"

5 years agoQuery the enable_apex_image flag from native experiment.
Nicolas Geoffray [Mon, 25 Feb 2019 13:31:10 +0000 (13:31 +0000)]
Query the enable_apex_image flag from native experiment.

Bug: 119800099
Test: m
Change-Id: Ibcd90840b4342fae14307ef7f30eec96d58a698b

5 years agoMerge "Rename IDumpstateListener errorcode"
Nandana Dutt [Fri, 22 Feb 2019 08:43:48 +0000 (08:43 +0000)]
Merge "Rename IDumpstateListener errorcode"

5 years agoMerge "Log duration reporter to logcat"
Treehugger Robot [Thu, 21 Feb 2019 19:00:12 +0000 (19:00 +0000)]
Merge "Log duration reporter to logcat"

5 years agoMerge "installd: parameterize user data snapshots with snapshot_id"
Treehugger Robot [Thu, 21 Feb 2019 16:28:22 +0000 (16:28 +0000)]
Merge "installd: parameterize user data snapshots with snapshot_id"

5 years agoRename IDumpstateListener errorcode
Nandana Dutt [Thu, 21 Feb 2019 16:10:10 +0000 (16:10 +0000)]
Rename IDumpstateListener errorcode

BUG:123571915
Test: adb shell /data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test --gtest_filter=DumpstateBinderTest.*
Change-Id: I5533f3bfed647a4068893b61dee371f5a4678650

5 years agoLog duration reporter to logcat
Nandana Dutt [Thu, 21 Feb 2019 13:16:07 +0000 (13:16 +0000)]
Log duration reporter to logcat

This is to help debug bugreport generation latency
BUG: 124089395
BUG: 123315882
Test: manual

Change-Id: I65b40054d48d36c7b51b3b78feac2295266a4720

5 years agoinstalld: parameterize user data snapshots with snapshot_id
Nikita Ioffe [Mon, 4 Feb 2019 11:06:37 +0000 (11:06 +0000)]
installd: parameterize user data snapshots with snapshot_id

- snapshot_id will be provided by RollbackManagerService and for a given
  rollback will be equal to its rollback_id.
- snapshotAppData now creates a folder to snapshot data to, in case it
  does not exist.
- removed ceDataInode from restoreAppDataSnapshot API, since it's only
  called if users phone is unlocked, meaning that CE data is available and
  doesn't require inode to be accessed.
- refactored installd_service_test to reduce test set up boilerplate.
- added a test to cover case when snapshots for different packages have
  the same snapshot_id.

Bug: 124029909
Test: installd_utils_test installd_service_test, RollbackTest
Change-Id: I4177a44a60cdfdc5429a28c613ce661b24482b8b
Merged-In: I4177a44a60cdfdc5429a28c613ce661b24482b8b
(cherry picked from commit b68f0d14931905472b93ad08a753a01a33bd315b)

5 years agoMerge "dumpstate: Fix IO Errors during zip writing."
Narayan Kamath [Thu, 21 Feb 2019 10:00:34 +0000 (10:00 +0000)]
Merge "dumpstate: Fix IO Errors during zip writing."