summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
* Add Intents to notify when USB audio devices or accessories are attachedMike Lockwood2012-04-061-0/+34
| | | | | | | In this change, only the USB audio accessory support is implemented. Change-Id: Id9b411319b07a96dc56649ca74cc5f3f89a55a7c Signed-off-by: Mike Lockwood <lockwood@google.com>
* Merge "Fix so that windows again animate when moving."Craig Mautner2012-04-061-20/+21
|\
| * Fix so that windows again animate when moving.Dianne Hackborn2012-04-051-20/+21
| | | | | | | | Change-Id: I2441d0c892687b8cda239815caf77837cd21093e
* | Move some APIs from window manager to input manager.Jeff Brown2012-04-052-307/+118
| | | | | | | | | | | | | | | | | | | | Simplified input injection API down to just one call. Removed all input state reading API. It was only used by the window manager policy and required a permission that applications could not obtain. READ_INPUT_STATE is now unused and deprecated. Change-Id: I41278141586ddee9468cae0fb59ff0dced6cbc00
* | Fix looping to turn off dimming.Craig Mautner2012-04-052-7/+6
| | | | | | | | | | | | | | | | | | | | Dimming was constantly being turned off if it wasn't time to turn it on. This caused endless reentry into the Window Manager and consumed lots of CPU. Fixes bug 6293953. Change-Id: Id87e60c7c70e96e66ce0b6297442f5ac0d2ff477
* | Merge "Enhance Cell Location Api."John Wang2012-04-051-0/+37
|\ \
| * | Enhance Cell Location Api.John Wang2012-04-051-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To boost accurary and enhance capability of cell location api, two new APIs, TelephonyManager.getAllCellInfo() and TelephonyManager.listen(LISTEN_CELL_INFO), are added. Two new Class, CellInfo and CellIdentity, are created. This API change returns all information of one cell locaiton at the same time. It also provides additional LTE and timestamp information. Change-Id: I4d0f813107e625ec4ac88c8d980ffd171aa5fc30
* | | Merge "Dump KSM stats in the meminfo."Dianne Hackborn2012-04-051-0/+23
|\ \ \
| * | | Dump KSM stats in the meminfo.Dianne Hackborn2012-04-051-0/+23
| | |/ | |/| | | | | | | Change-Id: I077dcb137ed743ea10fde1dbba4e86c340dec432
* | | Merge "Support metered Wi-Fi NetworkPolicy."Jeff Sharkey2012-04-057-65/+91
|\ \ \
| * | | Support metered Wi-Fi NetworkPolicy.Jeff Sharkey2012-04-057-65/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add networkId field to NetworkIdentity to identify Wi-Fi networks by SSID. Add support for policies without usage cycles. Only apply mobile policies when SIM state is ready, which is cleaner than just checking for airplane mode. Also avoids creating no-op default policies when subscriberId is null. Bug: 3001465, 3291052 Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7
* | | | Merge "Refactor input system into its own service."Jeff Brown2012-04-0519-576/+558
|\ \ \ \
| * | | | Refactor input system into its own service.Jeff Brown2012-04-0519-575/+557
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extracted the input system from the window manager service into a new input manager service. This will make it easier to offer new input-related features to applications. Cleaned up the input manager service JNI layer somewhat to get rid of all of the unnecessary checks for whether the input manager had been initialized. Simplified the callback layer as well. Change-Id: I3175d01307aed1420780d3c093d2694b41edf66e
* | | | Merge "Lockscreen settings per user"Amith Yamasani2012-04-051-0/+15
|\ \ \ \
| * | | | Lockscreen settings per userAmith Yamasani2012-04-051-0/+15
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move all lockscreen related settings to LockSettingsService. LockPatternUtils uses this through IPC instead of Secure settings. Migrate old settings to new database managed by LockSettingsService. Passwords and patterns are stored in a new per-user location, except for the primary user, for backward compatibility. KeyguardViewMediator and LockPatternKeyguardView listen for changes to user and updates the lockscreen. Settings provider will look for Lock settings in the LockSettings service now for the entries that used to be stored in Settings. Change-Id: I956cd5b95e2d9d45a6401af7e270e6a5aa2dcc98
* | | | Fix failure to animate away exiting AppWindowTokenCraig Mautner2012-04-051-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | A previous check in changed the collection we were pulling exiting AppWindowTokens from. Instead of pulling them from mExitingAppTokens they came from mAppTokens and hence were not animated away. Fixes bug 6296433. Change-Id: I23347085658fce5412abb8ea119ce7e6152cab8b
* | | Merge "TaskStackBuilder and Activity navigation features for framework"Adam Powell2012-04-051-6/+101
|\ \ \
| * | | TaskStackBuilder and Activity navigation features for frameworkAdam Powell2012-04-051-6/+101
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Promote navigation helpers from the support library to the core platform. The support library's meta-data element has been replaced with a first-class parentActivityName attribute. This attribute is valid on both activity and activity-alias elements. An activity-alias will inherit the target activity's parentActivityName if one is not explicitly specified. Automatic Up navigation for Activities Add the public method onNavigateUp() to Activity. The default implementation will use the metadata supplied in the manifest about an activity's hierarchical parent (parentActivityName) to do the right thing. If any activities in the parent chain require special Intent arguments, the Activity subclass should override onNavigateUp() to properly implement Up navigation for the app, supplying such arguments as needed. If automatic Up navigation within the same task can't find an activity matching the supplied intent in the current task stack, it will act as an in-app "home" and return to the root activity (presumably the app's front page) in that task. (From this state, pressing "back" with default behavior will return to the launcher.) Change-Id: If163e27e59587f7af36975a09c986cb117ec3bc6
* | | Clean up status bar, system bar, navigation bar management.Dianne Hackborn2012-04-042-11/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The status bar and navigation bar are two completely separate elements, with their own semantics. The system bar now classifies itself as a navigation bar, since that is really how it behaves. This required rewriting the HDMI resizing code, so that it is all done by PhoneWindowManager since that is what is responsible for the size of the navigation bar (and thus now system bar). This actually gets rid of a fair amount of code, and means we can also do the same thing for a pure navigation bar. Likewise the system bar now has the navigation bar ability to be hidden when requested by system UI flags. To get the behavior we want on Xoom, we only allow the nav bar to be hidden when it will help provide a better aspect ratio for showing widescreen videos. Finally the nav/system bar now animates when hidden and shown. Change-Id: Ie927154b68376a0b61802f99171ff56b8da92e7a
* | Merge "Add initial framework for DNS service discovery"Irfan Sheriff2012-04-042-0/+279
|\ \
| * | Add initial framework for DNS service discoveryIrfan Sheriff2012-04-042-0/+279
| | | | | | | | | | | | Change-Id: I53c0b7ebfd75e520ebb7553612f1aa8413b6b79b
* | | Merge "First separation of animation from AppWindowToken."Craig Mautner2012-04-046-369/+414
|\ \ \
| * | | First separation of animation from AppWindowToken.Craig Mautner2012-04-046-369/+414
| | | | | | | | | | | | | | | | | | | | | | | | New class AppWindowAnimator pulls animation out of AppWindowToken. Change-Id: Ic1ccb6ec2bf091f1f901fe3c20cbeb242376ae6b
* | | | Merge "Move more items between layout and animate sides."Craig Mautner2012-04-046-97/+227
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | Move more items between layout and animate sides.Craig Mautner2012-04-046-97/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Isolate DimAnimator animation from the layout side. - Isolate mWallpaperForceHidingChanged and mOrientationChangeComplete from the animation side. - Eliminate a redundant setting of mOrientationChangeComplete to true. It was already true at that point. - Synchronize changes to mWindows and mAppTokens on mAnimator. This is a nop until we go to multiple threads. - Synchronize AppWindowToken.freezingScreen on mAnimator. - Modification to repeat layout debugging including temporary enabling of spew on layout repeats. Change-Id: Ic8d82b1c197144aaf6957caa5f71e175288220f2
* | | Merge "usea socketpair instead of a pipe in BitTube"Mathias Agopian2012-04-031-7/+4
|\ \ \ | |_|/ |/| |
| * | usea socketpair instead of a pipe in BitTubeMathias Agopian2012-04-021-7/+4
| | | | | | | | | | | | | | | Bug: 6252830 Change-Id: I363cc7e9f73a5b7d8bbccee312c6d8938c84e99a
* | | Merge commit 'bc52ca2'Mike Lockwood2012-04-031-4/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: services/java/com/android/server/am/ActivityManagerService.java Change-Id: I6da33a191a4ac13d08d8350a432b205e3dff85da
| * | | Stop ANR dialogs from appearing when ActivityManager dialogs should not be shownJustin Koh2012-03-291-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop ANR dialogs from appearing on devices where the ActivityManager dialogs should not be shown. Instead, kill the process. This is preferable because the user can't actually do anything on the device. TESTED = runs on device with that config, simulated ANR using test app. Change-Id: I6267000afd12ef929f0c625220184c6ab0139552
| * | | TimedAudio: Fix a cause of audio popping.John Grossman2012-03-272-20/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix an issue with buffer lifecycle management which could cause audio pops on timed outputs. There were two issues at work here. 1) During trim operations for the queued timed audio data, buffers were being trimmed based on their starting PTS instead of when the chunk of audio data actually ended. This means that if you have a very large chunk of audio data (larger than the mixer lead time), then a buffer at the head of the queue could be eligible to be trimmed before its data had been completely mixed into the output stream, even though the output stream was fully buffered and in no danger of underflow. 2) The implementation of getNextBuffer and releaseBuffer for timed audio tracks was not keeping anything like a reference to the data that it handed out to the mixer. The original architecture here seemed to be expecting a ring buffer design, but timed audio tracks use a packet based design. Pieces of packets are handed out to the mixer which then frequently will hold onto that chunk of data across two mix operations, using the first part of the chunk to finish a mix buffer and then using the end of the chunk for the start of the next mix buffer. If the buffer that the mixer is holding a piece of got trimmed before the start of the next mix operation, it would return to its heap and could be filled with who knows what by the time it actually got mixed. On debug builds, they seem to get zero'ed out as they go back to the heap causing obvious pops in presentation. This change addresses both issues. Trim operations are now based on ending presentation time for a chunk of audio, not the start. Also, when the head of the queue is in flight to the mixer, it can no longer be trimmed immediately, merely flagged for trim by the mixer when the mixer finally does call releaseBuffer. Signed-off-by: John Grossman <johngro@google.com> Change-Id: Ia1ba08cb9dea35a698723ab2d9bcbf804f1682fe
| * | | Make immersive mode public & imply update lockingChristopher Tate2012-03-191-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Activity.setImmersive(boolean) / android:immersive="bool" are now public. In addition, if the foreground activity is immersive then an update lock will be held on its behalf. This lets applications such as movie players suppress the display of intrusive notifications, OTA-availability dialogs, and the like while they are displaying content that ought not to be rudely interrupted. The update lock aspect of this mode is *advisory*, not binding -- the update mechanism is not actually constrained; it simply uses this information in deciding whether/when to prompt the user. It's more a guideline than a rule. Bug 6154438 Change-Id: Ibd3491fc437077f3fa0d9708ed91955121e8c877
| * | | am 14958e21: Merge "audioflinger: fix issue with camcorder and A2DP" into ↵Eric Laurent2012-03-191-1/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ics-mr1 * commit '14958e21c12f922d7501d32c3bec05109eb342d5': audioflinger: fix issue with camcorder and A2DP
| * \ \ \ am ce06c000: Merge "Debugging code for #6169553: Make Phone launch faster" ↵Dianne Hackborn2012-03-163-12/+151
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into ics-mr1 * commit 'ce06c000b4133c63414c3244c3325e25315ab179': Debugging code for #6169553: Make Phone launch faster
| * \ \ \ \ am 0e873700: Remove the country detector loggingDaniel Lehmann2012-03-122-2/+7
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0e87370077b322b3a88c345a44c6bf3d56617071': Remove the country detector logging
| * | | | | | fix setting only usb modeRoboErik2012-03-071-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you cleared the last usb mode it would fail (and so would setting it if you started with none). This fixes it to set and unset the last property correctly. Change-Id: I8aa62a65ccda5f3872d2995f30d80426f07a281c
| * | | | | | Merge "Do not assume that there is always a running activity (Necessary for ↵Kevin Hester-Chow2012-03-071-1/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | headless devices)" into ics-aah
| | * | | | | | Do not assume that there is always a running activityKevin Hester-Chow2012-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Necessary for headless devices) Change-Id: I61969ebfdd4aa02a3661272a0bcd0aa67667f115
| * | | | | | | Detect (at runtime) kernel support for the "hdmi_audio" switch.John Grossman2012-03-061-43/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new switch was introduced in AndroidAtHome to deal with a race condition between the WiredAccessoryObserver and the HW composer HAL. When the new switch ("hdmi_audio") is present, we want to pay attention to it instead of paying attention to the old switch ("hdmi"). This change checks at startup for the presence or absence of the new switch and uses it if available, otherwise it falls back on classic behavior. see change ID I960cfc2f3e8df5342e7248a26fd313fdad2ca322 for the kernel side changes. see bug 6023647 for a discussion of the issue. Change-Id: Ia2f2c399c3d85896ede0fff57ecbd51f332b3e0e Signed-off-by: John Grossman <johngro@google.com>
| * | | | | | | Send UpdateLock broadcasts to manifest receiversChristopher Tate2012-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that e.g. the system update service doesn't need to run all the time. Bug 5543442 Change-Id: Icd0fcc7f771f7ba92ff190ffed0f0debba4bd911
| * | | | | | | Merge "Introduce UpdateLocks - "now is not a good time for non-interactive ↵Christopher Tate2012-02-292-0/+133
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | OTA"" into ics-aah
| | * | | | | | | Introduce UpdateLocks - "now is not a good time for non-interactive OTA"Christopher Tate2012-02-282-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An "UpdateLock" works similarly to a wake lock in API: the caller is providing a hint to the OS that now is not a good time to interrupt the user/device in order to do intrusive work like applying OTAs. This is particularly important for headless or kiosk-like products where ordinarily the update process will be automatically scheduled and proceed without user or administrator intervention. UpdateLocks require that the caller hold the new signatureOrSystem permission android.permission.UPDATE_LOCK. acquire() and release() will throw security exceptions if this is not the case. The "is now convenient?" state is expressed to interested parties by way of a sticky broadcast sent only to registered listeners. The broadcast is protected; only the system can send it, so listeners can trust it to be accurate. The broadcast intent also includes a timestamp (System.currentTimeMillis()) to help inform listeners that wish to implement scheduling policies based on when the device became idle. The API change here is a tiny one: a dump(PrintWriter) method has been added to the TokenWatcher class to facilitate getting information out of it for dumpsys purposes. UpdateLock itself is still @hide. Bug 5543442 Change-Id: Ic1548dd43935f45d4efc67f970abdc290a45f715
| * | | | | | | | am 27e20ccd: Merge "Fix issue #6073913: onActivityResult() not getting ↵Dianne Hackborn2012-02-282-33/+31
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | called..." into ics-mr1 * commit '27e20ccd9ac4dd1f9bf902ed2b359cc8beff7c9b': Fix issue #6073913: onActivityResult() not getting called...
| * \ \ \ \ \ \ \ \ am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" ↵Dianne Hackborn2012-02-241-33/+78
| |\ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into ics-mr1 * commit '133dc2d7aecc68990c363c861716b134910a4ced': Fix issue #6048808: sometimes auto-correct is inactive
| * | | | | | | | | am 01011c3d: Fix issue #6037252: Screen shifts after all apps are upgradedDianne Hackborn2012-02-212-2/+8
| |\ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '01011c3d7ce4f76c1a76b33a04fc63da784ddbea': Fix issue #6037252: Screen shifts after all apps are upgraded
| * | | | | | | | | Merge "New clock sync control loop." into ics-aahKent Ryhorchuk2012-02-157-205/+151
| |\ \ \ \ \ \ \ \ \
| | * | | | | | | | | New clock sync control loop.Kent Ryhorchuk2012-02-147-205/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change clock sync control to velicity form PI loop. Tuned for office LAN and WiFi conditions, will probably perform better in clean environments. Improve packet filtering to prevent clock sync on bad rtt. Changed diag interface to take rtt times, P, I, D are no longer supported. Change-Id: Id7758262c5f987f07d7091aba6c0874d7c19f387
| * | | | | | | | | | am c8711ca7: Merge "Stop using shared DUN APN when tethering stops." into ↵Robert Greenwalt2012-02-141-11/+25
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ics-mr1 * commit 'c8711ca7eb962072ccd6175be3cfa861195ba6cd': Stop using shared DUN APN when tethering stops.
| * \ \ \ \ \ \ \ \ \ \ am ffc89899: Merge "Don\'t pulse LED on new notification unless notification ↵Mike Lockwood2012-02-141-1/+3
| |\ \ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has LED flag set" into ics-mr1 * commit 'ffc89899652f5c815b6d156f55a909001420891e': Don't pulse LED on new notification unless notification has LED flag set
| * | | | | | | | | | | Put a bandaid on a segfault in timed audio track handling.John Grossman2012-02-121-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a bandaid to prevent a segfault which can occur while handling timed audio buffers. There is a deeper problem which should eventually be addressed, but for now this fix should prevent any crashing. The deeper problem is as follows. When the AudioFlinger mixer gets data to mix from an AudioTrack, it ends up getting a structure filled out which points into an IMemory region owned by the AudioTrack. Unfortunately, this structure is not holding a refcount on the IMemory which it points into. If the IMemory refcount hits 0 and the chunk of RAM is retuned to the binder heap it came from, there can still be a Buffer object being held by the AudioFlinger mixer which points into the region of memory which was retuned to the binfer heap. If AF reads from this buffer, it could read corrupt data (if the region of memory gets handed back out to a writer), or it could segfault (if the heap has been freed and the pages unmapped). Similar problems could happen if AF attempts to write to the buffer, heap corruption in one case, segfaulting in the other. In the past, this has not been an issue for AF, because tracks allocate a single IMemory (which serves as a ring buffer) and the IMemory lives for as long as the track lives. As an artifact of the way the code came out, the mixer cannot be holding a Buffer structure pointing into the IMemory which used to be owned by a track if the track no longer exists. Tracks cannot come into or out of existence during a mix operation, which is the only thing which makes this safe. TimedTracks work differently, however. Timed tracks each allocate a small binder heap, and then hand out IMemory instances broken out of this heap. The heap lives as long as the track, so the worst which could happen here is that a TimedTrack's IMemory gets returned to the heap while there is still a buffer structure in flight pointing into the memory region, then the region gets handed out again and overwritten by new data causing the mixer to mix the wrong audio. The timing to cause this to happen is very difficult to encounter, and you to generate the timing conditions required, you need to be in a pretty bad failure state where audio is already breaking up and skipping, so its unlikely that anyone would notice (which is why I'm band-aiding the segfault and letting the deeper issue slide for now). In general, however, it might be a good idea to revisit this buffering design. On principal, if someone is going to hold pointers into a refcounted object, they should be holding a ref on the object at the same time. Failure to do this will usually lead to a situation where there are corruption or segfault issues, or to a system where the refcounted object's lifetime must be implicitly managed very carefully in ways which are usually non-obvious and are easy to break by new engineers on a project. Change-Id: Ib391075395ed0ef46a03c37aa38a82d09e88abeb
| * | | | | | | | | | | am 197fe269: Merge "Add OEM specific USB mode enumeration based on ↵Wink Saville2012-02-101-1/+69
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ro.bootmode property" into ics-mr1 * commit '197fe26940022be75384f4038dd789f446d33122': Add OEM specific USB mode enumeration based on ro.bootmode property