1. 27 Sep, 2016 8 commits
    • Tadashi G. Takaoka's avatar
      Catch all exceptions when parsing IME meta data · f30cfcb2
      Tadashi G. Takaoka authored
      Bug: 30568284
      Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
      (cherry picked from commit dddc438e)
      f30cfcb2
    • Sudheer Shanka's avatar
      Fix deadlock in AcitivityManagerService. · df4b2f6b
      Sudheer Shanka authored
      Don't hold mPidsSelfLocked lock when calling
      cleanUpApplicationRecordLocked.
      
      Bug: 31463143
      Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
      (cherry picked from commit 67e05b4d)
      df4b2f6b
    • Hongming Jin's avatar
      Only return password for account session flow if the caller is signed · aa8226a3
      Hongming Jin authored
      with system key and have get_password permission.
      
      Bug: 30455516
      Change-Id: I78484c59e4de1dff685ab91a0a8e7a756fffd9bf
      (cherry picked from commit 9342e137)
      aa8226a3
    • John Reck's avatar
      Ensure munmap matches mmap · 7dc39697
      John Reck authored
      Bug: 31350622
      Change-Id: I6d3f9faec32d54360caa6706d17405e20b50966c
      (cherry picked from commit aa394dd4)
      7dc39697
    • Marie Janssen's avatar
      Fix setPairingConfirmation permissions issue (2/2) · 5dd5769b
      Marie Janssen authored
      setPairingConfirmation was set to only require BLUETOOTH_ADMIN
      permission which shouldn't be able to set the confirmation itself.
      
      This is restricted to BLUETOOTH_PRIVILEGED permission.
      
      Bug: 29043989
      Change-Id: I887de32d156e672ec44aa0b286cd7ea7f9f8ad55
      (cherry picked from commit 93326cfd)
      5dd5769b
    • Sungsoo's avatar
      DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change · 6ff2f449
      Sungsoo authored
      ExifInterface object can be created with a unsupported file format.
      If saveAttribute is called with an unsupported file format, ExifInterface
      makes the file corrupted. This CL prevents those cases by throwing
      an exception before making any change on the file.
      
      Bug: 30936376
      Change-Id: I115a42601c774062485974042464abb0d65c35e9
      (cherry picked from commit a8f9a075)
      (cherry picked from commit 56ea7b49)
      6ff2f449
    • Narayan Kamath's avatar
      Backport changes to whitelist sockets opened by the zygote. · 388c9b2e
      Narayan Kamath authored
      This is the backport of the following commits :
      
      Reopen whitelisted zygote file descriptors after a fork.
      
      We don't want these descriptors to be shared post-fork, so we'll
      have to close and reopen them when the zygote forks. The set of
      open descriptors is checked against a whitelist and it is a fatal
      error if a non whitelisted FD is opened. It is also a fatal error
      if anything other than a regular file / character device or socket
      is opened at the time of forking.
      
      This work is done in two stages :
      - An initial list of FDs is constructed and cached prior to the
        first zygote fork.
      
      - On each subsequent fork, we check whether the list of open FDs
        has changed. We are currently tolerant of changes, but in the
        longer term, it should be a fatal error if the set of open file
        descriptors in the zygote changes.
      
      - Post fork, we traverse the list of open descriptors and reopen
        them if necessary.
      
      bug: 30963384
      
      (cherry picked from commit c5f27a7c)
      
      Fix clang build breakage (-Werror -Wformat).
      
      Use %zd for size_t. Note that this will break only on (-plus-)aosp because
      clang is disabled on the N development branches.
      
      bug: 30963384
      
      (cherry picked from commit b334c33d)
      
      Add a whitelist of sockets on fork.
      
      Maintain a whitelist of AF_UNIX sockets that are permitted
      to exist at the time of forking. If an open socket does not belong
      to the whitelist (or is not AF_UNIX), the process will abort. If an
      open socket is whitelisted, it will be redirected to /dev/null after
      a sucessful fork. This allows us to unify our handling of the special
      zygote sockets (/dev/socket/zygote[_secondary]) with the existing
      whitelist of non socket file descriptors.
      
      This change also removes non-fatal ALOGW messages since they have the
      side effect of reopening the logging socket.
      
      bug: 30963384
      
      (cherry picked from commit 3764a260)
      
      fd_utils: Remove whitelist for "/dev/pmsg0".
      
      We're now calling __android_log_close prior to a fork, so this file
      shouldn't need to be open.
      
      bug: 31243313
      bug: 30963384
      
      (cherry picked from commit 8dee0541)
      
      fd_utils: Fix broken usage of iterators.
      
      There were two separate issues here :
      - RestatInternal was using an iterator after a call to erase(). This
        will not work because it will be invalidated.
      - The "standard" for loop idiom for iterating over a map while making
        structural changes to it is broken. Switch to a while loop and treat
        cases where elements are erased differently from cases where they
        aren't.
      
      bug: 31092930
      bug: 30963384
      
      (cherry picked from commit 0b76d6a2)
      
      add dri device to zygote whitelisted FDs
      
      The driver can be used just like /dev/ion for graphic buffers.
      
      (cherry picked from commit 8977e424)
      (cherry picked from commit a1252ccb)
      388c9b2e
    • Robin Lee's avatar
      DO NOT MERGE Stop work challenge freeform bypass · 63c82e40
      Robin Lee authored
      Bypassing work challenge in freeform mode was trivial by just keeping
      work apps open in freeform mode and then switching focus to them from
      another app.
      
      Because the only interception point is startActivity this never
      triggered work challenge.
      
      The solution is to trigger the check on focus change events and also to
      allow passing the result back into the freeform stack instead of dumping
      our user out into the homescreen.
      
      Change-Id: I141ecf90b5f0e708a21d27141b6fec6074e5d475
      Fix: 30693465
      (cherry picked from commit 0737c2b4)
      63c82e40
  2. 26 Sep, 2016 1 commit
    • Jeff Sharkey's avatar
      Use "all_downloads" instead of "my_downloads". · df0de20e
      Jeff Sharkey authored
      Fix Merge Conflict into nyc-release
      We can no longer return the "my_downloads" paths: if those Uris were
      shared beyond the app that requested the download, access would be
      denied.  Instead, we need to switch to using "all_downloads" Uris so
      that permission grants can be issued to third-party viewer apps.
      
      Since an app requesting a download doesn't normally have permission
      to "all_downloads" paths, DownloadProvider now issues narrow grants
      toward the owner of each download, both at device boot and when new
      downloads are started.
      
      Bug: 30537115, 30945409
      Change-Id: I533125b36444877f54373d88922f2acc777e250b
      (cherry picked from commit 9fab683c)
      df0de20e
  3. 12 Sep, 2016 2 commits
    • Wyatt Riley's avatar
      LocationManager - Handle Shutdown for right User · 81a0e13e
      Wyatt Riley authored
      Only process a shutdown when it is for all users (whole system),
      not a single user
      
      Change-Id: Id51b7fb4606460462c2f6749e5ac3984bdd8319f
      Bug: 30646142
      (cherry picked from commit 1b24fb17)
      (cherry picked from commit a8037fff)
      81a0e13e
    • Eino-Ville Talvala's avatar
      DO NOT MERGE ANYWHERE: ImageReader: Add discardFreeBuffers method · 9725a591
      Eino-Ville Talvala authored
      This method (currently @hide) discards all cached buffers for
      the ImageReader, which can be useful to free up memory at the
      cost of reallocation time if more buffers are needed later.
      
      It has no effect on acquired Images, filled Images waiting to be
      acquired, or buffers being actively used by the source rendering to the
      Surface.
      
      Bug: 28695173
      Change-Id: I427a8ba4ad73a267083f843dbf228bfc53a730d9
      (cherry picked from commit e175aa82)
      9725a591
  4. 01 Sep, 2016 29 commits
    • Svetoslav Ganov's avatar
      Properly close fd backing a MemoryIntArray · b439040b
      Svetoslav Ganov authored
      Use ParcelFileDescriptor only as an IPC transport
      to make sure MemoryIntArray manges its backing fd.
      
      Bug:30310689
      
      Change-Id: Ib3cc13ef4ae2a744e5f7a96099570e0431847bce
      (cherry picked from commit fe2462f3)
      (cherry picked from commit e257d6e1)
      b439040b
    • Jason Monk's avatar
      Backup system QS tiles DO NOT MERGE · 6c7bda6d
      Jason Monk authored
      Add QS tiles to the backup list.  Non-system tiles will get removed
      since they won't be installed when restore happens.
      
      Change-Id: Iccf6e773384c45bd4d1f10c21aa8af356b3920d2
      Bug: 28782938
      (cherry picked from commit 37bd2be1)
      6c7bda6d
    • Paul Jensen's avatar
      Sanity check ICMP6 router advertisement packets · 628bf238
      Paul Jensen authored
      There is a chance a packet can slip by before we install the filter
      on our socket listening for RAs, so add some basic sanity checking
      to make sure we've recieved an RA.
      
      Change-Id: I14cf84a0814896a41e00f50af376dfc4988d36cb
      Fixes: 29586253
      (cherry picked from commit a3621386)
      628bf238
    • Todd Kennedy's avatar
      update shared libraries for system apps · 8da0528c
      Todd Kennedy authored
      After removing updates for a system package, we weren't updating its
      shared libraries when we should have. Make it so.
      
      NOTE: This didn't affect device boot because we update all of the
      shared libraries for all system applications after scanning packages.
      
      Bug: 30266503
      Change-Id: I8edf4344228fb3e793e7648ea70a041cb5db6af6
      (cherry picked from commit 6058df65)
      (cherry picked from commit 85a91def)
      8da0528c
    • Chris Craik's avatar
      Cherry pick TextureView fixes · a8a86751
      Chris Craik authored
      The following changes are in this commit:
      
      Avoid destroying TextureView surfaces for onStop
      
      bug:30238922
      
      TextureViews will hold onto their backing surfaces, which will allow
      them to resume gracefully when the app's surfaces are saved.
      
      Now only resources that are destroyed for onStop are DisplayLists.
      
      (cherry picked from commit 391d5604)
      
      TextureView: destroy layer on destroyHardwareResources event
      
      bug:30468770
      
      (cherry picked from commit 1c16c37d)
      
      Fix NPE in TextureView
      
      Bug: 30651595
      
      (cherry picked from commit 3c2587f2)
      
      Fix NPE in TextureView
      
      Bug: 30779663
      
      (cherry picked from commit 7e237189)
      
      Fix maps resume being blank
      
      Bug: 30889568
      
      Fixes an issue where mLayer didn't have
      the mSurface set on it in certain resume
      scenarios.
      
      (cherry picked from commit 03df0834)
      (cherry picked from commit 2e8a8a24)
      a8a86751
    • Christopher Tate's avatar
      Eliminate next-alarm-clock broadcast flapping · 6f761da7
      Christopher Tate authored
      When multiple alarm clocks are scheduled at the same time, we would
      flap among the alternatives for considering them the 'next upcoming
      alarm clock', which in turn would generate [many] spurious broadcasts
      about changes to the upcoming alarm situation.  This is now fixed;
      once we have found the soonest upcoming alarm clock, we stick with
      that one until it becomes unavailable, eliminating the spurious
      broadcast traffic.
      
      Bug 29501073
      
      Change-Id: Ice1892490bb339e05fa8bd9d324fa1c6718b4942
      (cherry picked from commit 76389c00)
      (cherry picked from commit c60da1ed)
      6f761da7
    • Andrii Kulian's avatar
      DO NOT MERGE -- Fix finishing activity in non-focused stack · 496a5815
      Andrii Kulian authored
      This CL explicitly checks if we're finishing activity in non-focused
      stack as there are other cases except this one when we finish paused
      activities in FINISH_AFTER_VISIBLE mode.
      
      Bug: 29007436
      Bug: 29458854
      Change-Id: I67744d23cd72f2fe8861180008bfdd284a7b5e26
      (cherry picked from commit 995fa2bd)
      (cherry picked from commit 772c598f)
      496a5815
    • Yohei Yukawa's avatar
      Make sure IME focus is synced to View focus · ed429599
      Yohei Yukawa authored
      This CL fixes an edge case that my previous CL [1] forgot to handle.
      
      The goal of my previous CL was to avoid InputMethodManager from getting
      confused by a false focus-in event from temporarily detached Views.
      However, my CL forgot to take care of the case where the temporarily
      detached View is still focused even after the temporary detach mode is
      done.
      
      The bad news is that such a situation is relatively easy to trigger by
      having a ListView that has EditText as follows, which seems to be
      known to be a common technique in Android developer community to put an
      EditText in a ListView.
        ListView#listView.addHeaderView(new EditText(context), null, true);
      
      If the ListView is initialized as above, and the EditText has input
      focus, View focus and IME focus start to disagree immediatelly after the
      ListView's layout is re-evaluated.  This is really easy to trigger, for
      example just by dismissing the IME window.
      
      In summary, the root cause is that InputMethodManager#focusIn(View) is
      now always ignored as long as the View is temporarily detached, under an
      assumption that IMM#focusIn(View) will be called back again with a View
      that is not temporarily detached when everything is stable.  Hence the
      fix is to do so by hooking up View#dispatchFinishTemporaryDetach() to
      call IMM#focusIn(View) again when the View is actually focused in the
      final state.
      
       [1]: Ia79bbd8468f768d546354382b47b39dd31ef7bb5
            a4ed0cfc
      
      Bug: 30022872
      Bug: 30578745
      Bug: 30706985
      Change-Id: Iecbdb00dcef8c72e4f7b31035c9bf0f4a40a578f
      (cherry picked from commit dd228fbb)
      (cherry picked from commit 8eb07090)
      ed429599
    • Jason Monk's avatar
      Fix double status bar icons · 086ec0f6
      Jason Monk authored
      Don't allow the status bar icon slot list to be changed because
      it confuses the relationship between StatusBarIconList and
      StatusBarIconController.  Set it in the constructor to enforce
      this.
      
      Change-Id: Ieeea0a9efad88179d1cccc0e5702899333de2e72
      Fixes: 28524184
      (cherry picked from commit c6fe61c5)
      (cherry picked from commit 12124d7e)
      086ec0f6
    • Adam Powell's avatar
      Force AlertDialogLayout to have gravity start|top · d7789d08
      Adam Powell authored
      AlertDialogLayout overrides LinearLayout#onMeasure but not onLayout,
      meaning that some state initialized for the handling of gravity may
      not be valid in LinearLayout#onLayout. As this is an internal class
      never used directly by apps, explicitly specify the default gravity of
      start|top in @layout/alert_dialog_material to avoid this bug. Apps
      that do things like set gravity in their theme (for whatever reason)
      could otherwise change its behavior.
      
      Bug 30494039
      
      Change-Id: I71a8be1829a7fe24cf7714a3bd5ed732f85eb887
      (cherry picked from commit 39e0bf23)
      (cherry picked from commit 00c4f7ba)
      d7789d08
    • Yuichi Biwa's avatar
      ChooserActivity: Cannot start app that the icon overflows the layout · 535eb072
      Yuichi Biwa authored
      Symptom:
      When sharing an image from Album, ChooserActivity can be shown.
      But then the app to be located to the bottom part of the list may not
      be started even if user tap it.
      
      Root cause:
      ChooserActivity uses ResolverDrawerLayout. And ResolverDrawerLayout
      can display only some items on the list (known as "Collapse mode").
      When the item clipping along the bottom edge is tapped by the user,
      ResolverDrawerLayout tries to expand the list and scroll it to a
      better position, instead of starting an application.
      In this problem case, ResolverDrawerLayout continues to try to expand
      the list whenever tapping, so an application will never start.
      
      Solution:
      Change a condition so that mOpenOnClick becomes true only when the list
      has been collapsed (mCollapseOffset > 0).
      
      Bug: 30153542
      
      Change-Id: I576fb6c8b6a91d79c1e0d46d069146779f4dbd17
      (cherry picked from commit 4f3a843e)
      (cherry picked from commit cb3e1237)
      535eb072
    • Abodunrinwa Toki's avatar
      FloatingActionMode: Fix screen coordinates. · 37e98676
      Abodunrinwa Toki authored
      Use application context to get the screen's display metrics.
      
      Bug: 30127070
      Change-Id: I2c453c494ef210c12d89fc7e3ff026728f9ecb0f
      (cherry picked from commit afb38c5c)
      (cherry picked from commit 99c340ca)
      37e98676
    • Alan Viverette's avatar
      Set up view state before attaching, jump drawables if needed · b341e023
      Alan Viverette authored
      View attachment calls jumpDrawablesToCurrentState(), so the view state
      needs to be set up prior to attachment. For views that are already
      attached but are being moved to a new position, manually jump.
      
      Cleans up comments in methods that were modified.
      
      Bug: 29978498
      Change-Id: Ica27b2c60ad7ee98b9d1e4912c4f8b8c248af88d
      (cherry picked from commit 26489e16)
      (cherry picked from commit c328f042)
      b341e023
    • Selim Cinek's avatar
      Fixed a bug where notifications could reappear · 33c9b5f9
      Selim Cinek authored
      With sensitive notifications a user could get into
      a situation where the groupsummary would not be cleared
      because its dismissability was never updated and based
      on the visibility of the veto button. This is now corrected.
      
      This Cl also cleans up the veto button handling overall and
      ensures that there's no stale state arond it.
      
      Change-Id: Ic7df8d382146d7863ee551c1daa8ba5ed384c7b5
      Fixes: 30056258
      (cherry picked from commit 9e624e73)
      (cherry picked from commit f3b64692)
      33c9b5f9
    • Selim Cinek's avatar
      Fixed a bug where the headsup would be stuck disappearing · 7f5d46a8
      Selim Cinek authored
      Change-Id: I56d6be69f6e59c1bec647e7e70e50a36b793f895
      Fixes: 30120962
      (cherry picked from commit a4155bb7)
      7f5d46a8
    • Raph Levien's avatar
      Enforce consistent sizes for arrays in SpannableStringInternal · c662295d
      Raph Levien authored
      The grow logic in SpannableStringInternal#setSpan assumes that the
      size of mSpanData is consistent with that of mSpans, in particular
      that if the latter doesn't need to grow, neither does the former.
      The copySpans() method didn't enforce this, creating an mSpanData
      array only big enough to hold the data.
      
      This patch documents the invariant in a comment and enforces it.
      
      Bug: 30359314
      Change-Id: Ie25db70a76836e97af8476a7f5c10cb4b976c1cf
      (cherry picked from commit 83549088)
      (cherry picked from commit 9cde7244)
      c662295d
    • Andrii Kulian's avatar
      DO NOT MERGE -- Correctly finish activity in non-focused stack · 5a5b2a49
      Andrii Kulian authored
      When activity is finished we first looked for next activity to
      show in focused stack. If real next activity to show in place
      of finishing one is in the same non-focused stack, we didn't
      fully complete the dismissal process and activity was stuck in
      FINISHING state.
      This CL checks if we're trying to finish visible activity in
      paused state and destroy it immediately if top running activity
      is visible - same as we do for pinned activities.
      
      Bug: 29458854
      Change-Id: I0d5ceb2daa45c0628d89417c8456e132996bcea9
      (cherry picked from commit 7318d63b)
      (cherry picked from commit 620040db)
      5a5b2a49
    • Jim Miller's avatar
      Fix vulnerability in LockSettings service · d7a94a8e
      Jim Miller authored
      Fixes bug 30003944
      
      Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
      (cherry picked from commit 2d71384a)
      d7a94a8e
    • Amith Yamasani's avatar
      DO NOT MERGE: Clean up when recycling a pid with a pending launch · 97a619d4
      Amith Yamasani authored
      Fix for accidental launch of a broadcast receiver in an
      incorrect app instance.
      
      Bug: 30202481
      Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
      (cherry picked from commit 55eacb94)
      97a619d4
    • Phil Weaver's avatar
      Limit capabilities of a11y gesture dispatch. · 9e96728e
      Phil Weaver authored
      Changing the service side to accept descriptions of
      motion events, not motion events themselves, so we can
      control their creation.
      
      Bug: 30647115
      Change-Id: Ia6772a1fc05df91818e3f88959d1e2b4a35fe0cc
      (cherry picked from commit a8918f23)
      (cherry picked from commit 157f416a)
      9e96728e
    • Narayan Kamath's avatar
      Process: Fix communication with zygote. · 9b0ae9fe
      Narayan Kamath authored
      Don't write partial requests, and don't return (or throw) early after
      partially reading a response.
      
      bug: 30143607
      Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
      (cherry picked from commit 448be0a6)
      9b0ae9fe
    • David Christie's avatar
      DO NOT MERGE: Fix vulnerability where large GPS XTRA data can be · 1d482ed7
      David Christie authored
      injected.
      -Can potentially crash system with OOM.
      Bug: 29555864
      
      Change-Id: I7157f48dddf148a9bcab029cf12e26a58d8054f4
      (cherry picked from commit 79375723f0f201a6759ddbfda57d491ff3fea64e)
      1d482ed7
    • Jim Miller's avatar
      Bind fingerprint when we start authentication · 6ced0505
      Jim Miller authored
      This fixes a bug where it was possible to authenticate the wrong user.
      We now bind the userId when we start authentication and confirm it when
      authentication completes.
      
      Fixes bug 30744668
      
      (Cherry pick from Change-Id: I346d92c301414ed81e11fa9c171584c7ae4341c2)
      
      Change-Id: I3584790c39eb2e8c435ad1b2d887bf9b8ebd36fe
      (cherry picked from commit 837d052ed4b5b75dfd4af44f5ad268e683bf2e13)
      6ced0505
    • gitbuildkicker's avatar
    • Jim Miller's avatar
      Fix vulnerability in LockSettings service · 38ba9686
      Jim Miller authored
      Fixes bug 30003944
      
      Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
      (cherry picked from commit 2d71384a)
      38ba9686
    • Amith Yamasani's avatar
      DO NOT MERGE: Clean up when recycling a pid with a pending launch · d2448876
      Amith Yamasani authored
      Fix for accidental launch of a broadcast receiver in an
      incorrect app instance.
      
      Bug: 30202481
      Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
      (cherry picked from commit 55eacb94)
      d2448876
    • Phil Weaver's avatar
      Limit capabilities of a11y gesture dispatch. · d9a7562a
      Phil Weaver authored
      Changing the service side to accept descriptions of
      motion events, not motion events themselves, so we can
      control their creation.
      
      Bug: 30647115
      Change-Id: Ia6772a1fc05df91818e3f88959d1e2b4a35fe0cc
      (cherry picked from commit a8918f23)
      (cherry picked from commit 157f416a)
      d9a7562a
    • Narayan Kamath's avatar
      Process: Fix communication with zygote. · c8a462e8
      Narayan Kamath authored
      Don't write partial requests, and don't return (or throw) early after
      partially reading a response.
      
      bug: 30143607
      Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
      (cherry picked from commit 448be0a6)
      c8a462e8
    • Baligh Uddin's avatar