19721 Commits

Author SHA1 Message Date
Jeff Brown
a4db1b7278 am 642de92b: am 9058435d: Merge "Fix races when content providers are acquired and released." into ics-mr1
* commit '642de92b3500446ab2d2a84fbe4ff9c083e8c1af':
  Fix races when content providers are acquired and released.
2011-11-15 11:29:59 -08:00
Daisuke Miyakawa
2b6517cd2c am f2213aca: am d8f5e6ba: Merge "Allow ContactsProvider to remove dulicates" into ics-mr1
* commit 'f2213acaae5073ea3b4f3f566f0e8c7dc976765b':
  Allow ContactsProvider to remove dulicates
2011-11-15 11:29:51 -08:00
Jeff Brown
ddaa9ac896 Fix races when content providers are acquired and released.
This change fixes race conditions that occur very regularly when
content providers are accessed from multiple threads at the same
time.

When a content provider is not already in the application's cache,
the application needs to ask the ActivityManager to obtain it.
Meanwhile, another thread can come along and do the same thing.
This can cause problems because the application attempts to
install two copies of the provider and the reference counts
and other bookkeeping can get muddled.

Similarly, there are races between releasing the last reference
to a content provider and acquiring the content provider.  It's
possible for one thread to snatch the content provider from the
jaws of death.  We need to handle this explicitly to ensure that
the content provider does not accidentally get released right
after it was acquired by the other thread.

This change ensures that the reference count bookkeeping and
provider map are maintained in parallel while holding the same lock.
Previously because the lock was dropped and reacquired in the
middle of acquisition and removal, it was possible for a
content provider with a zero reference count to be returned
to the application.  Likewise, it was possible for a content
provider with a non-zero reference count to be disposed!

This change also performs compensatory actions when races are
detected to ensure that the necessary invariants are maintained
throughout.  In particular, it ensures that the application
drops a duplicate reference to a content provider when no
longer needed.

Another way to solve this problem would be to explicitly prevent
the races from happening in the first place by maintaining a
table of content providers that are in the process of being
acquired.  The first thread to attempt to acquire the provider
would store a record.  The next thread would find the record
and block until the first thread was finished.  I chose not
to implement the code in that manner because we would still
have needed to perform compensatory actions in the case where
the same provider binder has multiple logical names.  Also,
it could cause deadlocks if the attempt to acquire
a content provider were re-entrant for some bizarre reason.

Bug: 5547357
Change-Id: I2ad39a8acc30aaf7ae5354decd0a0a41e9b9c3da
2011-11-14 18:31:13 -08:00
Daisuke Miyakawa
d8f5e6badb Merge "Allow ContactsProvider to remove dulicates" into ics-mr1 2011-11-14 17:54:17 -08:00
Adam Cohen
e23a588eb5 am 621f9716: am 6066a2b4: Merge "Fix uncaught exception in WindowManager#setWallpaperOffsets (issue 5613241)" into ics-mr1
* commit '621f971691e3e819ddcd95898f4f93498e00c2ad':
  Fix uncaught exception in WindowManager#setWallpaperOffsets (issue 5613241)
2011-11-14 14:38:30 -08:00
Adam Cohen
6066a2b4de Merge "Fix uncaught exception in WindowManager#setWallpaperOffsets (issue 5613241)" into ics-mr1 2011-11-14 14:33:06 -08:00
Adam Cohen
8e2e572224 Fix uncaught exception in WindowManager#setWallpaperOffsets (issue 5613241)
Change-Id: I4646095f4cde9514425be8ab2dbf805d9788aa5c
2011-11-14 13:28:50 -08:00
Daisuke Miyakawa
19352e0852 Allow ContactsProvider to remove dulicates
Bug: 5484956
Change-Id: Ie88af0c3d21919ca201f4fcdd46ca09e9f8d94c0
2011-11-14 13:16:07 -08:00
Dave Burke
28a5ec9613 am 2cfb873c: am 9d66da8a: Merge "Revert "Discard framebuffer rendering queues when discarding layers"" into ics-mr1
* commit '2cfb873c9f0b56f2c7d694a21c968511223933af':
  Revert "Discard framebuffer rendering queues when discarding layers"
2011-11-14 12:30:04 -08:00
Dave Burke
7077506f99 Revert "Discard framebuffer rendering queues when discarding layers"
This reverts commit da96f8ac2c1c35a54f3f36e6d776cb386a251d03.
2011-11-14 11:39:30 -08:00
Mathias Agopian
3f511aaf1c am a16ee939: am 28587497: Merge "Discard framebuffer rendering queues when discarding layers Bug #5581817" into ics-mr1
* commit 'a16ee9390e1fcea8ff7cbefd253659c37f2999a3':
  Discard framebuffer rendering queues when discarding layers Bug #5581817
2011-11-14 07:49:07 -08:00
Kristian Monsen
e1d2f3cf85 Fix build
Change-Id: I8198f7a8470e7c9500ab2f6512162bbb55ea6ee7
2011-11-14 15:28:14 +00:00
Kristian Monsen
10a09dc163 Merge "Removing the ability to get native instrumentation as part of nav dump" 2011-11-14 04:28:32 -08:00
Mathias Agopian
2858749704 Merge "Discard framebuffer rendering queues when discarding layers Bug #5581817" into ics-mr1 2011-11-14 00:52:09 -08:00
Svetoslav Ganov
531ded5514 Merge "Added missing comments in Instrumentation#sendStringSync" 2011-11-11 16:52:37 -08:00
Svetoslav Ganov
f434e37945 Added missing comments in Instrumentation#sendStringSync
Change-Id: Ib20c5f9763c4ff97dec02fbb79721da93e964bc7
2011-11-11 16:50:25 -08:00
Svetoslav Ganov
55c6ccce95 Merge "Instrumentation sendStringSync(String) may try to inject obsolete events." 2011-11-11 16:46:07 -08:00
Christopher Tate
c45fa2a823 am 0fbd9eba: am c51bb4d3: Merge "XML parsing optimizations" into ics-mr1
* commit '0fbd9ebab891530290b4d52fd5e81f6b4d7278d8':
  XML parsing optimizations
2011-11-11 16:24:19 -08:00
Christopher Tate
60201f2b4e XML parsing optimizations
Traceview showed approximately 10% of total parse time inside the
synthetic 'trampoline' methods generated to provide inner classes
with access to their outer class's private fields.  The bottleneck
in this particular case is in XmlBlock and its inner class Parser.

Making the bottlneck outer-class members and methods package-scope
instead of private removes that 10% overhead being spent within
these access trampolines.

Traceview tends to overemphasize the significance of very small
methods such as these trampolines.  That said, the measured speed
gain on the ParseLargeXmlResFg op due to this patch is between
5% and 6%.

Change-Id: Ia0e3ae5408d1f9992b46e6e30dd2407090379b07
2011-11-11 16:10:42 -08:00
Jeff Brown
0f6ba9267f Merge "Seems to break text views all over. Particularly noticeable is that the labels in launcher icons appear left-justified. Multi-line text fields also wrap after every character." 2011-11-11 15:30:45 -08:00
Jeff Brown
033a001a61 Seems to break text views all over. Particularly noticeable is that the labels in launcher icons appear left-justified. Multi-line text fields also wrap after every character.
Revert "Fix bug #5387832 [UI/Visual] Address of the website is not displayed properly(second line of the address is partly shown)"

This reverts commit caa8c06de5f94db69faca35d666c04b82d3f420b
2011-11-11 15:30:16 -08:00
Dianne Hackborn
942d51f6a6 am 0b554bab: am d400d03f: Merge "Fix issue #5595933: GREF leak due to race condition in..." into ics-mr1
* commit '0b554bab585fe2d7eaaca8692106e0cbbc3aabe4':
  Fix issue #5595933: GREF leak due to race condition in...
2011-11-11 14:28:57 -08:00
Christopher Tate
951aa9d8ea am 9acae658: am 847fbbea: Merge "Localized optimizations in views and bitmaps" into ics-mr1
* commit '9acae658e179796beee91d673f9f70af49ae3c9b':
  Localized optimizations in views and bitmaps
2011-11-11 14:28:55 -08:00
Dianne Hackborn
d400d03f4a Merge "Fix issue #5595933: GREF leak due to race condition in..." into ics-mr1 2011-11-11 14:24:58 -08:00
Christopher Tate
847fbbeaf9 Merge "Localized optimizations in views and bitmaps" into ics-mr1 2011-11-11 14:24:53 -08:00
Nick Pelly
34059a9125 am 4780228f: am 48b651cb: Merge "Changes for access control." into ics-mr1
* commit '4780228fb2476304e29ddf9a118c460ac4eb96ee':
  Changes for access control.
2011-11-11 13:59:09 -08:00
Matthew Xie
44ada1845d am 5a8ad071: am a303f0ec: Merge "Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect" into ics-mr1
* commit '5a8ad0717dad332cab4b2d9f7a6030b76cb8d6bb':
  Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect
2011-11-11 13:42:42 -08:00
Nick Pelly
48b651cb2a Merge "Changes for access control." into ics-mr1 2011-11-11 13:06:44 -08:00
Christopher Tate
1373a8eb58 Localized optimizations in views and bitmaps
* Don't call context.getResources() redundantly when unnecessary;
  similarly for Resources.getCompatibilityInfo()

* During bitmap creation, don't bother clearing to 0: it's unnecessary
  because now that the raw bits are stored in a VM-side byte array, it
  was cleared at initialization time.  Also, don't use the sanity-
  checking public entry point to erase to a color, because we know
  that we're by definition in a "legal" path to erase to the initial
  contents and don't need to incur the overhead of the (inappropriate)
  sanity checking.

Change-Id: Idaca4d64fdecefd5d51337646ead32e1db510e02
2011-11-11 12:46:48 -08:00
Dianne Hackborn
5a6ef737ed Fix issue #5595933: GREF leak due to race condition in...
...LoadedApk.ServiceDispatcher.connected , LoadedApk.forgetServiceDispatcher

Don't be stupid if we receive a new binding to a ServiceConnection after it
has already been unbound.

Change-Id: I85a49de97372bf9af55542a89031f0b7a2ac8fbb
2011-11-11 12:31:52 -08:00
Matthew Xie
a303f0ecfc Merge "Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect" into ics-mr1 2011-11-11 12:16:41 -08:00
Matthew Xie
98f06da8ed Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect
Send CONNECT_OTHER_PROFILE to Device profile for low priority hfp and a2dp
incoming connect. In the case when HFP autoconnect is off but a2dp autoconnect
is on, if HF autoconnect to HFP, phone will reject HFP but connect a2dp.
Before this fix, phone reject HFP. A2dp will not get connected unless the HF do
media auto-connect, which most carkits do not do.
Also do similar change for incoming a2dp connection
bug 5091838

Change-Id: Ife1815f527bcd94e0d9ffc645028484fa9c49a43
2011-11-11 12:11:35 -08:00
Narayan Kamath
e5fe1b302d am 405fcc87: am 754c72ed: Notifiy callers when a speech synthesis error occurs.
* commit '405fcc87b247d91ce2b54623f351e91b740813c0':
  Notifiy callers when a speech synthesis error occurs.
2011-11-11 11:51:07 -08:00
Matthew Xie
99164b4209 Merge "Add more comments to the file header to explain the state diagram" 2011-11-11 11:20:43 -08:00
Matthew Xie
cef4cb20c3 Add more comments to the file header to explain the state diagram
The state diagram does not capture every messages. Here we explain
the missing parts to make the diagram clearer.

Change-Id: Ic5de5eb0556be4339d98023b0e7947d6e2cb30d1
2011-11-11 11:15:21 -08:00
Svetoslav Ganov
c350f1604f Instrumentation sendStringSync(String) may try to inject obsolete events.
KeyEvents returned by KeyCharacterMap.getEvents() have the same time stamp
and the system rejects too old events. Hence, it is possible for an event
to become stale before it is injected if it takes too long to inject the
preceding ones. Now the time of the event is set just before injecting it.

Change-Id: I72b60d261f8bda857b331d0f1b1bd97f9f15def3
2011-11-11 10:43:13 -08:00
Scott Main
8b4e2ccf15 Merge "docs: some helpful javadocs for network info" 2011-11-11 09:49:23 -08:00
Jesse Wilson
9f7ff11268 Merge "Document our potentially suprising behavior on date ranges ending at midnight." 2011-11-11 09:38:46 -08:00
Jeff Hamilton
bb951c8939 Changes for access control.
The package name is now required when using the
NFC extras APIs so the context is stored away
and used to derive the package name to be sent
to the NfcService.

Bug: 4515759
Change-Id: I1a3aba3fc026e0090a914b0686fc4b8dec25b927
2011-11-11 08:55:26 -08:00
Jesse Wilson
8d7fad5e67 Merge "Warn about changed behavior around '+' characters." 2011-11-11 08:22:33 -08:00
Jesse Wilson
41e0839b13 Warn about changed behavior around '+' characters.
Bug: http://code.google.com/p/android/issues/detail?id=21064
Change-Id: I086c2c8433f05185a1496e2662734d239d8cbb74
2011-11-11 11:16:17 -05:00
Kristian Monsen
a3c157eef0 Removing the ability to get native instrumentation as part of nav dump
This is to be able to remove ANDROID_INSTRUMENTATION code.

Note that it would only print useful information if webcore
was compiled with ANDROID_INSTRUMENTATION on.

There is an open bug for problems with ANDROID_INSTRUMENTATION:
http://b/issue?id=2816327

Needs Browser CL:
https://android-git.corp.google.com/g/#/c/149442

Change-Id: Ie8c3c3a08a8bb15936831e25faac3155906bae70
2011-11-11 16:11:36 +00:00
Jesse Wilson
99a64f4b1d Document our potentially suprising behavior on date ranges ending at midnight.
Bug: http://code.google.com/p/android/issues/detail?id=18512
Change-Id: I968ca1cfcef79273ee856624a640d56b038b96be
2011-11-11 11:03:21 -05:00
Akwasi Boateng
1333742bed am cb0db030: Merge branch \'ics-mr1-plus-aosp\' of ssh://android-git:29418/platform/frameworks/base into ics-mr1-plus-aosp
* commit 'cb0db0306b5849a35d3d99eea1b34ce019c6f0d8':
  Make the overridden ImageView#setVisibility remotable
  Clamp non-monotonic stats instead of dropping.
  DO NOT MERGE. Fix leak in LayoutTransition
  Fix lastVisible/global rects
  Fix Wimax-less build.
  Fix leak in LayoutTransition
  Deferring wallpaper update to improve workspace scrolling (issue 5506959)
  Terminate EGL when an app goes in the background
  boot animation is dithered and scaled
  Fix NdefRecord byte-stream constructor.
  PopupWindow dismiss() can get into a recursive loop.
  Fold WiMAX state into the mobile RSSI.
  Remove dedicated wimax icon to fix RSSI layout.
2011-11-11 15:34:19 +00:00
Narayan Kamath
754c72ed9e Notifiy callers when a speech synthesis error occurs.
bug:5589877
Change-Id: Ideca8966ea1caa6789b3273e388dd1f25c1e2758
2011-11-11 14:21:43 +00:00
Svetoslav Ganov
d00e75e94d am 7b8bec28: Merge "PopupWindow dismiss() can get into a recursive loop." into ics-mr0
* commit '7b8bec280f20e8a5863d8214bbc195497335eba6':
  PopupWindow dismiss() can get into a recursive loop.
2011-11-11 08:02:27 +00:00
Svetoslav Ganov
7b8bec280f Merge "PopupWindow dismiss() can get into a recursive loop." into ics-mr0 2011-11-11 00:00:02 -08:00
Jeff Sharkey
51c00a57f4 Merge "Clamp non-monotonic stats instead of dropping." into ics-mr1 2011-11-10 20:31:03 -08:00
Adam Powell
0ddcad0b4e Merge "Make the overridden ImageView#setVisibility remotable" into ics-mr1 2011-11-10 19:56:03 -08:00
Adam Powell
b241b4c6ab Make the overridden ImageView#setVisibility remotable
Change-Id: Idaf061ea8c2a06ec8abaf74cf865446d9092afa2
2011-11-10 19:48:23 -08:00