Let RuntimeInit use an UncaughtExceptionPreHandler to log an exception
rather than relying on UncaughtHandler, which apps can replace. This
makes it easier to diagnose application death, especially during app
compatibility testing for a new version of Android.
Test: Verified manually, with the help of a small sample app (not
checked in), that stacktraces for RuntimeExceptions thrown on main
or background threads are logged even when the app set a default
UncaughtExceptionHandler that swallows the exception with no action.
Note that such an inappropriate UncaughtExceptionHandler will still
cause threads to die without the app being killed, which it should be.
In an exception then happens on the main thread, the app will freeze
until the ANR dialog kicks in after a few seconds. I have manually
verified that this behavior is unchanged from before this CL.
No new integration tests are included because the default system
behavior has not changed.
Bug: 29624607
Change-Id: Ie87377b0bcadc3ba4083a8ab1bedb8f3dd95a4bd
-> Android Framework changes to add support for
an API to send indicator change in AG.
-> Added a system intent for broadcasting assigned number(ID)
of the supported HF indicators and their values (if received)
Bug: 19983867
Change-Id: If26a7ae5da5686da72ebca9ec3decfe086e2ffb6
(cherry picked from commit 0d98ebf997)
According to the Bluetooth Core specification v4.2, Vol 3, Part G,
section 4.12.3: "The Attribute Protocol WRITE REQUEST is used
for this sub-procedure".
Change-Id: I141dd24ed5911d5d485b52a1b661835b9960921a
When "handling" an uncaught exception, make an attempt to stop
profiling. In case profiling was active, this will avoid losing
the profiling buffer.
This change is required as a base in order for
https://android-review.googlesource.com/#/c/249721/
to merge cleanly.
(Cherry picked from commit 4c79fea9ef)
Bug: 26291225
Change-Id: I35f352e5f28eafe4702da9eae587c3b65c360b3a
The previous patch (ef23bf19 Allow leading slash in path...) made
a single slash path unmatchable.
To solve it, this patch stops removing a slash character if the path
only has a slash character.
Now, a single slash is a matchable path for a URI without path string.
Bug: 29524484
Change-Id: I90b357aa48be1a3e0cf36e75ed2a9d6532908972
The when the timerfd alarm logic was added to the kernel, an oversight was made
and the interface does not check for the CAP_WAKE_ALARM permissions as required
via other kernel methods to trigger an alarm timer.
In v4.8-rc kernels, the change 2895a5e5b3a ("timerfd: Reject ALARM timerfds
without CAP_WAKE_ALARM") was added by Eric Caruso <ejcaruso@google.com>.
After this change (which may be backported to -stable), the AlarmManager will
fail on the first timerfd_create call, and will not be able to set the time
or handle other necessary functions.
The solution here is to add CAP_WAKE_ALARM to the system_server process.
Change-Id: Ifdb16f3ef42711e553f727165de3922d484b5be4
Signed-off-by: John Stultz <john.stultz@linaro.org>
- Use com.android.okhttp.Dns in place of com.android.okhttp.internal.Network
- Specify TimeUnit.MILLISECONDS for timeouts which 2.7.5 allows and
brings us closer to 3+
Change-Id: I95b5d72a94ebe1389f7c2e8d95903aa1aadd944b
* Removed "synchronized" statements that are not needed
* Replaced "synchronized" statements with Read/Write lock as
appropriate. The lock protects the access to and the setting of
BluetoothAdapter.mService and BluetoothManagerService.mBluetooth and
associated state.
Bug: 28734075
Bug: 28799467
Change-Id: I8f8281c505f0a1ae0add1e14a3caba1f5b2a98e4
(cherry picked from commit eb50a39e98)
Instead of in activity thread. That way, we can warm up (ie,
precompute cached values) this provider and AndroidBCWorkaroundProvider
(which are installed together) so that the computation doesn't
happen in the app. As a result, the time spent in the first call to
SSLSocketFactory.getDefault() decreases by ~5ms in angler userdebug.
Measured with an app calling SSLSocketFactory.getDefault in onCreate
and timed it with System.currentTimeMillis() .
(cherry picked from commit 69de32071c)
Bug: 28545496
Change-Id: Ic4e11d058fb404eaa92db925a3e765fc3bef7ae2
As pointed out here:
https://code.google.com/p/android/issues/detail?id=69834
registerApp() causes onClientRegistered() to happen before autoConnect
is set. This patch fixes that.
Bug: 28861330
Change-Id: Ie1174c0f224f5084178439420b383164d22d542c
Upstream ICU caches use SoftReferences. On Android this means
that useful cached data initialized in the Zygote are "lost" when
the Zygote GCs and cannot be shared with apps. This change makes use
of an Android patch to ICU to ensure References created during
Zygote initialization are "strong". i.e. they are never collected.
This prevents them being GCd and ensures they can be shared between
applications.
After switching ICU to use strong references, this change
also creates DecimalFormatSymbols objects for common ULocales
(ROOT, US and the user's default, if different). DecimalFormatSymbols
makes use of an ICU Reference cache and this alone has been shown to
improve the construction time of java.text.DecimalFormat by 1-1.5
milliseconds on a Seed device. This saving applies the first time one
is created in each app for each locale, and again if SoftReferences
have been cleared.
The cost to the heap size of the Zygote has been measured at ~107k.
This value will change as more caches are switched to use the new
CacheValue class.
Formatting is typically performed on the UI thread and the intention
of this change is to reduce app start up time and jank in apps like
the Dialer which do a lot of formatting when scrolling lists. The
change may also enable more virtual memory page-sharing between
apps, though this is not the specific goal.
Bug: 28326526
Change-Id: Ia2c73f6525f05b1aa81e57a31eed1616decf6bb5
This makes the time spent in the first call of an app to
SSLSocketFactory.getDefault() drop from ~240 ms to ~50 ms. In M
it was around ~6ms. This is due to the fact that, while instantiating
the default factory, all providers are initialized.
In order to obtain the timings above, I created an app calling
SSLSocketFactory.getDefault in onCreate and timed it
with System.currentTimeMillis() .
(cherry picked from commit 6cb7b1c476)
Bug: 28545496
Change-Id: Ic5aab3ece609d9fef06fee4ccb83d8371af075b2
Correct and clarify the documentation for ContentValues.
Change-Id: Iddf54da093e97c32da2568eab8802b1b2715303b
Signed-off-by: Steve Pomeroy <steve@staticfree.info>
The documentation incorrectly states that, "[insertWithOnConflict
returns] the primary key of the existing row if the input param
'conflictAlgorithm' = CONFLICT_IGNORE". Unfortunately, SQLite does
not provide such functionality.
Close: https://code.google.com/p/android/issues/detail?id=13045
Change-Id: Ife919c4dcf7bf703b692d338d1fb5844a532dd39
Signed-off-by: Steve Pomeroy <steve@staticfree.info>
Default writeType for GATT characteristic was not being
serialized into Parcel. This cause errors when trying to
write into Characteristic.
Bug: 27910548
Change-Id: Ib2f88cf991123eaea244f16fa36deb0d773c5a33
Calling Objects.hash with a byte[] will call the identity hashCode on
the byte[] and this doesn't agree with the use of Objects.deepEquals
in equals.
Bug caught by error prone.
Also, replaced usage of Objects.deepEquals(mServiceDataUuid, ...) with
Objects.equals(mServiceDataUuid, ...), because mServiceDataUuid
is an Object of type ParcelUuid.
Bug: 28585195
Change-Id: Id92734874339985fedafe1a28286a6a4dcd88d3b
To be able to reuse this code when creating a classloader for
the system_server.
Bug: http://b/27245894
Bug: http://b/27702070
Change-Id: I928175a39a1beb0446d863a5b8f5edf94686e768
Replaced Boolean.valueOf() -> parseBoolean() across frameworks/base
(not including Am.java, which I'm leaving for a separate change).
Also fixed a couple of other valueOf()s in SyncStorageEngine.
Bug: 28289401
Change-Id: I2c6fb39a465885e7e625ed8894b1b9f8a30da5bc
Replace usages where the Long is immediately unboxed or thrown
away with Long.parseLong().
In TaskRecord.java, I also fixed up similar uses of
{Boolean,Integer}.valueOf()
Tested: built frameworks/base successfully.
Bug: 28289401
Change-Id: I1fad536853a68c7b0707cbf02989aca155064843
The keys used in the example for the Doze timeouts does
not match any real key. To avoid confusion the example
should match the existing keys.
Change-Id: I0306c542dac9e38aea7d172a3e0f7472d327c73c
According to the Bluetooth Core specification v4.2, Vol 3, Part G,
section 4.12.3: "The Attribute Protocol WRITE REQUEST is used used
for this sub-procedure".
Change-Id: I86e4e1d3a8bfd7d78dfed8419f8abd2d7e89b2bc