OSDN Git Service

android-x86/frameworks-base.git
9 years agoMerge "Re-enable -Wall and -Werror that were lost in a merge"
Colin Cross [Thu, 9 Apr 2015 00:49:55 +0000 (00:49 +0000)]
Merge "Re-enable -Wall and -Werror that were lost in a merge"

9 years agoRe-enable -Wall and -Werror that were lost in a merge
Colin Cross [Thu, 9 Apr 2015 00:29:00 +0000 (17:29 -0700)]
Re-enable -Wall and -Werror that were lost in a merge

-Wall and -Werror were lost during a merge when they were added to
aaptCFLAGS instead of aaptCFlags.  Fix the typo, and the warnings
that crept in while it was disabled.

Change-Id: Ib944b8d6149278e4f3861c1acac277bcd95cc7c2

9 years agoMerge "Prevent windows from freezing screen while timeout"
Olawale Ogunwale [Wed, 8 Apr 2015 21:56:09 +0000 (21:56 +0000)]
Merge "Prevent windows from freezing screen while timeout"

9 years agoMerge "Add more digests to AndroidKeyStore API."
Alex Klyubin [Wed, 8 Apr 2015 21:32:08 +0000 (21:32 +0000)]
Merge "Add more digests to AndroidKeyStore API."

9 years agoAdd more digests to AndroidKeyStore API.
Alex Klyubin [Wed, 8 Apr 2015 21:15:57 +0000 (14:15 -0700)]
Add more digests to AndroidKeyStore API.

This adds MD5, SHA-1, SHA-224, SHA-384, and SHA-512. SHA-256 was
already there.

MD5 is not exposed for HMAC on purpose, because MD5 has been
deprecated for years.

Bug: 18088752
Change-Id: I4df3d3f6cf10805c7910a1bdb577a91c85055945

9 years agoMerge "Fix typo"
Alex Klyubin [Wed, 8 Apr 2015 18:16:36 +0000 (18:16 +0000)]
Merge "Fix typo"

9 years agoFix typo
Alex Klyubin [Wed, 8 Apr 2015 18:08:37 +0000 (11:08 -0700)]
Fix typo

Change-Id: I1c47ade98ad3ae41dc55e7bcafcad6901b559c89

9 years agoMerge "Refuse to reuse IV in encryption mode in AndroidKeyStore."
Alex Klyubin [Wed, 8 Apr 2015 18:04:38 +0000 (18:04 +0000)]
Merge "Refuse to reuse IV in encryption mode in AndroidKeyStore."

9 years agoMerge "Add BlockMode.GCM constant to AndroidKeyStore API."
Alex Klyubin [Wed, 8 Apr 2015 17:51:12 +0000 (17:51 +0000)]
Merge "Add BlockMode.GCM constant to AndroidKeyStore API."

9 years agoRefuse to reuse IV in encryption mode in AndroidKeyStore.
Alex Klyubin [Wed, 8 Apr 2015 16:42:16 +0000 (09:42 -0700)]
Refuse to reuse IV in encryption mode in AndroidKeyStore.

This makes IV-using Cipher implementations backed by AndroidKeyStore
refuse to be reused. After Cipher.doFinal completes, invoking update
or doFinal will raise an exception. This is to make it harder to
violate the security best practice of not reusing IV in encryption
mode.

Bug: 18088752
Change-Id: I5102f9e8b2ff428254294703e48948ea8576603d

9 years agoPrevent windows from freezing screen while timeout
tiger_huang [Tue, 7 Apr 2015 09:35:13 +0000 (17:35 +0800)]
Prevent windows from freezing screen while timeout

The original logic lets windows be able to freeze screen again (by
setting win.mOrientationChanging=true) after WINDOW_FREEZE_TIMEOUT is
triggered before mInnerFields.mOrientationChangeComplete is set to
true. In this case, we would lose the protection of
WINDOW_FREEZE_TIMEOUT. If the app never finishes drawing the window,
the screen would keep freezing that the user cannot operate the
device.

Change-Id: I45a0a9e4b3f8d5b0b0043229bfa4890236ae8ab2

9 years agoMerge "[ActivityManager] Avoid NullPointerException if no crash info"
Olawale Ogunwale [Wed, 8 Apr 2015 16:07:44 +0000 (16:07 +0000)]
Merge "[ActivityManager] Avoid NullPointerException if no crash info"

9 years agoMerge "[ActivityManager] Finish the failed-to-pause activity"
Olawale Ogunwale [Wed, 8 Apr 2015 12:51:11 +0000 (12:51 +0000)]
Merge "[ActivityManager] Finish the failed-to-pause activity"

9 years ago[ActivityManager] Avoid NullPointerException if no
louis_chang [Wed, 8 Apr 2015 10:04:11 +0000 (18:04 +0800)]
[ActivityManager] Avoid NullPointerException if no
crash info

Symptom:
This issue happens because the ANR process got killed
(because it crashed) before the ANR dialog dismissed.
In that case, the process record is marked as crashed
(ProcessRecord.crashing = true). When the ANR dialog
dismissed by user, it will cause NullPointerException
when writeToParcel while performing IPC because there
is no crash info (ApplicationErrorReport.crashInfo = null)

Solution:
Check crashinfo before access it

Change-Id: I2995de57684c1e13aab8297f5eea1e82ca3b7ad8

9 years ago[ActivityManager] Finish the failed-to-pause activity
louis_chang [Wed, 8 Apr 2015 08:35:55 +0000 (16:35 +0800)]
[ActivityManager] Finish the failed-to-pause activity

Symptom:
In some scenario, the mPausingActivity may be replaced by other
activity. When previous activity paused, the completePausedLocked()
won't be invoked because it is no longer the mPausingActivity. If
the activity is also pending to finish, it would never be done
because the activity kept in PAUSING state. Since the activity's
window also remain visible and is above on Wallpaper, user would
see it when back to home.

Solution:
Finish the failed-to-pause activity if the activity is pending to
finish.

A Real Case:
(1) Screen turn off
(2) The top activity T1 crashed
(3) When finish activity T1, the next top activity T2 will be
    scheduled to resume and pause (due to screen off).
(4) The activity T2 is also set to finishing due to T1 crashed.
(5) Before T2 paused and before paused timeout occurs, there has
    a new process started which brings up the next top activity T3
    to resume and pause. So the pausing activity is now replaced.
(6) When activity T2 paused, it cannot completed the pause operation
    T2 will remain in PAUSING and finishing state with its window
    visible. The process won't be killed because the oomadj stays
    at 1 (Visible).

Change-Id: Ib10fded891b21c774b26a93071c717fa50516e22

9 years agoMerge "Prevent possible memory leak in SpanSet"
Romain Guy [Wed, 8 Apr 2015 06:56:24 +0000 (06:56 +0000)]
Merge "Prevent possible memory leak in SpanSet"

9 years agoMerge "third part apps can disable the secret lockscreen"
Jim Miller [Tue, 7 Apr 2015 22:41:17 +0000 (22:41 +0000)]
Merge "third part apps can disable the secret lockscreen"

9 years agoAdd BlockMode.GCM constant to AndroidKeyStore API.
Alex Klyubin [Tue, 7 Apr 2015 22:09:12 +0000 (15:09 -0700)]
Add BlockMode.GCM constant to AndroidKeyStore API.

GCM mode is not yet implemented. This is just adding a constant to
KeyStoreKeyConstraints.BlockMode.

Bug: 18088752
Change-Id: Ibba5b393f56ab9f6bb96d994f110687ab8d65ff3

9 years agoMerge "Fixed memory leak in ExtractEditLayout finish()"
Adam Powell [Tue, 7 Apr 2015 20:56:47 +0000 (20:56 +0000)]
Merge "Fixed memory leak in ExtractEditLayout finish()"

9 years agoMerge "ProgressBar: Fix error of process bar cannot update on some condition."
Adam Powell [Tue, 7 Apr 2015 20:56:33 +0000 (20:56 +0000)]
Merge "ProgressBar: Fix error of process bar cannot update on some condition."

9 years agoMerge "Move cache dir to its own class."
Tim Murray [Tue, 7 Apr 2015 20:33:33 +0000 (20:33 +0000)]
Merge "Move cache dir to its own class."

9 years agoMove cache dir to its own class.
Tim Murray [Tue, 7 Apr 2015 20:24:14 +0000 (13:24 -0700)]
Move cache dir to its own class.

This prevents us from loading the RS static initializer all the time.

Change-Id: I8cea7540e50251aba8c2f199f06f344f991e7d7f

9 years agoPrevent possible memory leak in SpanSet
Romain Guy [Tue, 7 Apr 2015 17:39:45 +0000 (10:39 -0700)]
Prevent possible memory leak in SpanSet

If SpanSet.init() is called several times in a row with different
values, it is possible to change "numberOfSpans" in a way that
will prevent SpanSet.recycle() from nulling out all the spans.

This can lead to memory leaks of large objects through spans
references. User @piwai reported this leak:

     com.squareup.marketfont.MarketSpan
     `-[1] of array android.text.style.CharacterStyle[]
       `-spans of object android.text.SpanSet
         `-mCharacterStyleSpanSet of object android.text.TextLine
           `-[1] of array android.text.TextLine[]
             `-sCached of class android.text.TextLine

The MarketSpan instance is kept alive through a recycled TextLine
which itself contains a SpanSet.

Change-Id: Idfb2233ca16895dbe735c312662eaf0b4a2ecd65

9 years agoMerge "Unnecessary dexopt in installPackageLI"
Fyodor Kupolov [Tue, 7 Apr 2015 18:03:34 +0000 (18:03 +0000)]
Merge "Unnecessary dexopt in installPackageLI"

9 years agoMerge "Make the new AndroidKeyStore API conformant."
Alex Klyubin [Tue, 7 Apr 2015 17:39:06 +0000 (17:39 +0000)]
Merge "Make the new AndroidKeyStore API conformant."

9 years agoMerge "Load libraries directly from apk"
Dmitriy Ivanov [Tue, 7 Apr 2015 17:28:15 +0000 (17:28 +0000)]
Merge "Load libraries directly from apk"

9 years agoLoad libraries directly from apk
Dmitriy Ivanov [Tue, 30 Sep 2014 22:10:48 +0000 (15:10 -0700)]
Load libraries directly from apk

 Introduced new 'extractNativeLibs' attribute to manifest/application.
 Setting it to false prevents installer from extracting library from apk.

 The default value for extractNativeLibs is true.

Bug: 8076853
(cherry picked from commit ff193d642eea7128faad837d19e347cd25212c27)
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1

9 years agoMerge "Add a timeout state to frozen windows"
Olawale Ogunwale [Tue, 7 Apr 2015 17:14:31 +0000 (17:14 +0000)]
Merge "Add a timeout state to frozen windows"

9 years agoMake the new AndroidKeyStore API conformant.
Alex Klyubin [Mon, 6 Apr 2015 22:36:25 +0000 (15:36 -0700)]
Make the new AndroidKeyStore API conformant.

This makes the new AndroidKeyStore API conform with the latest
Keymaster API changes as well as the latest Android framework API
design guidelines.

Keymaster changes:
* Multiple paddings, block modes, and digests can be set on a key.
* "max uses per boot" and "min seconds between use" restrictions will
  not be exposed in the framework API.
* Padding scheme ZERO will not be exposed.

Changes due to Android framework design guidelines:
* Sets of enum values have been replaced with bitsets represented as
  ints.
* Integer has been replaced with int, with null being represented
  with a special value (e.g., -1 or 0) where possible.

Bug: 18088752
Change-Id: Ib21739aa9b42d48895cb7a681e836a5c6d972ac6

9 years agoAdd a timeout state to frozen windows
Craig Mautner [Fri, 6 Mar 2015 01:41:23 +0000 (17:41 -0800)]
Add a timeout state to frozen windows

When an activity stops drawing following a rotation the rotation
screenshot would become stuck on top of all the other windows. The
timeout was being acknowledged but mWindowsFreezingScreen was set to
true which kept stopFreezingDisplayLocked() from dismissing the
screen rotation animation.

By changing mWindowsFreezingScreen from a two state variable to a
three state variable, including a timeout state we allow
stopFreezingDisplayLocked() to continue and dismiss the screen
rotation animtion.

This change also reduces the APP_FREEZING_TIMOEOUT from 5 seconds to
2 seconds.

Bug: 15664090

Change-Id: Ida5aca002a82ec8fe1ea99f0ced814c5c8f01a95

9 years agoMerge "[ActivityManager] Improve task order of getRunningTasks."
Olawale Ogunwale [Tue, 7 Apr 2015 12:45:34 +0000 (12:45 +0000)]
Merge "[ActivityManager] Improve task order of getRunningTasks."

9 years agoMerge "[ActivityManager] Do not add service to reschedule after removing users."
Olawale Ogunwale [Tue, 7 Apr 2015 03:36:29 +0000 (03:36 +0000)]
Merge "[ActivityManager] Do not add service to reschedule after removing users."

9 years ago[ActivityManager] Improve task order of getRunningTasks.
riddle_hsu [Tue, 7 Apr 2015 03:30:09 +0000 (11:30 +0800)]
[ActivityManager] Improve task order of getRunningTasks.

Symptom:
During switching task in same stack, the first result
of getRunningTasks will be the behind stack's top task.
e.g.
 App Task X is starting task Y, the first entry may be home.

Root Cause:
TaskRecord's lastActiveTime is updated when pausing
or resuming. When X task launch a new task Y, Y is
on the top of task history, before X complete pause,
Y's lastActiveTime will be 0 because it is a new task.
Then when comparing the front task with other stack,
other stack will be regarded as the newer one.

Solution:
If the stack is focused stack, give the top task with the last time.

Change-Id: I0adc07608e03d333e0120a0dbc52a0fbbbb12f34

9 years agoUnnecessary dexopt in installPackageLI
Fyodor Kupolov [Tue, 7 Apr 2015 02:04:08 +0000 (19:04 -0700)]
Unnecessary dexopt in installPackageLI

When a new package is created, installNewPackageLI does not need to call
dexopt, since it has already been made.

Bug: 19550105
Bug: 20087446
Change-Id: If6b05bea590eea5f95efebb22a67ccd8cdf632c2

9 years agoMerge "Fix minor blur doc bug"
Jason Sams [Mon, 6 Apr 2015 23:38:05 +0000 (23:38 +0000)]
Merge "Fix minor blur doc bug"

9 years agoMerge "Rewrote FieldPack::createFieldPack for alignment"
Yang Ni [Mon, 6 Apr 2015 23:28:18 +0000 (23:28 +0000)]
Merge "Rewrote FieldPack::createFieldPack for alignment"

9 years agoRewrote FieldPack::createFieldPack for alignment
Yang Ni [Thu, 2 Apr 2015 00:29:14 +0000 (17:29 -0700)]
Rewrote FieldPack::createFieldPack for alignment

b/20032217

Some data types requires data alignment. This has an impact on the
total data size for the FieldPack. Fixed createFiledPack()
implementation to handle this correctly.

Change-Id: I241da19df69bf51cfdaf3b3a1381b446eaacb7fb

9 years agoMerge "Fix memory leak in Connectivity Service when phone app crashes"
Robert Greenwalt [Mon, 6 Apr 2015 17:34:48 +0000 (17:34 +0000)]
Merge "Fix memory leak in Connectivity Service when phone app crashes"

9 years agoMerge "[ActivityManager] Fix ServiceRecord leakage"
Olawale Ogunwale [Mon, 6 Apr 2015 15:25:03 +0000 (15:25 +0000)]
Merge "[ActivityManager] Fix ServiceRecord leakage"

9 years agoMerge "[ActivityManager] Examine bad process before clean up application record"
Olawale Ogunwale [Mon, 6 Apr 2015 15:24:40 +0000 (15:24 +0000)]
Merge "[ActivityManager] Examine bad process before clean up application record"

9 years agoMerge "[ProcessStas] fix index out of bounds when add duration."
Olawale Ogunwale [Mon, 6 Apr 2015 15:23:29 +0000 (15:23 +0000)]
Merge "[ProcessStas] fix index out of bounds when add duration."

9 years agoFix memory leak in Connectivity Service when phone app crashes
Maunik Shah [Mon, 30 Mar 2015 06:06:42 +0000 (11:36 +0530)]
Fix memory leak in Connectivity Service when phone app crashes

Upon crash of com.android.phone process, NetworkFactoryInfo is
not getting removed from HashMap and will get accumulated on
every start of the process.

Change-Id: Iafde28daddfc82728c03208522682b1efc85a121

9 years agoMerge "Remove the window whose client process has died or become zombie"
Olawale Ogunwale [Sat, 4 Apr 2015 16:12:39 +0000 (16:12 +0000)]
Merge "Remove the window whose client process has died or become zombie"

9 years agoMerge "Frameworks/base: Pass variant and feature-set to runtime"
Andreas Gampe [Sat, 4 Apr 2015 04:23:11 +0000 (04:23 +0000)]
Merge "Frameworks/base: Pass variant and feature-set to runtime"

9 years agoFrameworks/base: Pass variant and feature-set to runtime
Andreas Gampe [Fri, 3 Apr 2015 06:12:56 +0000 (23:12 -0700)]
Frameworks/base: Pass variant and feature-set to runtime

This is required so we pick up the settings correctly when compiling
the boot image on device, or compile any dex files through a
DexClassLoader.

Bug: 20055104
Change-Id: Ia3ab2e48855060894b36f7fd360fe17b978e45a6

9 years agoMerge "Only Windows doesn't have %zd."
Elliott Hughes [Fri, 3 Apr 2015 20:16:21 +0000 (20:16 +0000)]
Merge "Only Windows doesn't have %zd."

9 years agoOnly Windows doesn't have %zd.
Elliott Hughes [Fri, 3 Apr 2015 19:56:45 +0000 (12:56 -0700)]
Only Windows doesn't have %zd.

Change-Id: I0e4b0fdc61641c5ecb724fd096bd2315dcf8ed4a

9 years agoMerge "Load fewer classes when AndroidKeyStore provider is installed."
Alex Klyubin [Fri, 3 Apr 2015 19:47:17 +0000 (19:47 +0000)]
Merge "Load fewer classes when AndroidKeyStore provider is installed."

9 years agoLoad fewer classes when AndroidKeyStore provider is installed.
Alex Klyubin [Fri, 3 Apr 2015 19:32:39 +0000 (12:32 -0700)]
Load fewer classes when AndroidKeyStore provider is installed.

This avoids loading all AndroidKeyStore crypto SPI classes when the
AndroidKeyStore provider is instantiated and installed. This provider
is installed early on during the initialization of each app. Most apps
don't need these classes loaded.

Bug: 18088752
Change-Id: Ib43c9dd6a7d434b128916e0f9c8652ba61df0d47

9 years agoMerge "Rename KeymasterException to KeyStoreException."
Alex Klyubin [Fri, 3 Apr 2015 19:13:49 +0000 (19:13 +0000)]
Merge "Rename KeymasterException to KeyStoreException."

9 years agoMerge "Mark all test keys as no auth required"
Chad Brubaker [Fri, 3 Apr 2015 19:13:18 +0000 (19:13 +0000)]
Merge "Mark all test keys as no auth required"

9 years agoMerge "Obtain SPI without using Reflection."
Alex Klyubin [Fri, 3 Apr 2015 19:13:15 +0000 (19:13 +0000)]
Merge "Obtain SPI without using Reflection."

9 years agoObtain SPI without using Reflection.
Alex Klyubin [Fri, 3 Apr 2015 16:44:39 +0000 (09:44 -0700)]
Obtain SPI without using Reflection.

Bug: 18088752
Change-Id: I76d42e17f5f28af6fd9a96ee812d286f6c6a085b

9 years agoMerge "[RenderScript] update exception reporting for copyTo() after autoPadding added."
Miao Wang [Fri, 3 Apr 2015 17:38:13 +0000 (17:38 +0000)]
Merge "[RenderScript] update exception reporting for copyTo() after autoPadding added."

9 years ago[RenderScript] update exception reporting for copyTo() after
Miao Wang [Fri, 3 Apr 2015 16:15:39 +0000 (09:15 -0700)]
[RenderScript] update exception reporting for copyTo() after
autoPadding added.

 - This CL fixes recent CTS failures about copyPadded after
   lmp-mr1-dev changes pushed to aosp.

Change-Id: Ica1f4fd934cd83ca4357ea7e7c82dcc7f844b689

9 years agoMerge "Support for storing OAT files in app directory"
Fyodor Kupolov [Thu, 2 Apr 2015 23:11:10 +0000 (23:11 +0000)]
Merge "Support for storing OAT files in app directory"

9 years ago[ActivityManager] Do not add service to reschedule after removing users.
younghwan1.kim [Thu, 2 Apr 2015 10:15:11 +0000 (19:15 +0900)]
[ActivityManager] Do not add service to reschedule after removing users.

Some service which has persistent attribute has restarted again and
again after removing users.
but it dies right after launching because it is not valid in owner mode.

This patch will check service's userId whether userId is alive or not.
And then if userId is not alive, then service will bring down.

Change-Id: Id99bf3c651b88e377f1fd6bec8aaad81318d7579

9 years agoRename KeymasterException to KeyStoreException.
Alex Klyubin [Thu, 2 Apr 2015 22:53:46 +0000 (15:53 -0700)]
Rename KeymasterException to KeyStoreException.

The code in question talks to KeyStore which returns error codes
which are a mix of keystore and keymaster error codes. To better
match the layering of KeyStore on top of keystore and keymaster,
this CL renames KeymasterException into KeyStoreException. It also
adds human-readable error messages to exceptions raised by keystore
rather than keymaster (e.g., key not found).

Bug: 18088752
Change-Id: I4cd1235e16518c9f2e8c5557a457774c6e687b88

9 years agoMark all test keys as no auth required
Chad Brubaker [Thu, 2 Apr 2015 21:41:37 +0000 (14:41 -0700)]
Mark all test keys as no auth required

Now that auth token checks are in keystore keys without any auth tags
are invalid.

Also adds a test to check that a key with auth required fails when none
is present.

Change-Id: I0d5d44d70a849978e9b2e809675b8343c6650ff2

9 years agoFix minor blur doc bug
Jason Sams [Thu, 2 Apr 2015 21:10:53 +0000 (14:10 -0700)]
Fix minor blur doc bug

Change-Id: I4c129d9d3c93d8a36c887e5c594b4402aca5745e

9 years agoMerge "Improve the AndroidKeyStore-backed HMAC state machine."
Alex Klyubin [Thu, 2 Apr 2015 21:06:27 +0000 (21:06 +0000)]
Merge "Improve the AndroidKeyStore-backed HMAC state machine."

9 years agoMerge "Expose new key use constraints in KeyPairGeneratorSpec."
Alex Klyubin [Thu, 2 Apr 2015 21:03:11 +0000 (21:03 +0000)]
Merge "Expose new key use constraints in KeyPairGeneratorSpec."

9 years agoMerge "Add exception types for AndroidKeyStore key validity issues."
Alex Klyubin [Thu, 2 Apr 2015 20:24:47 +0000 (20:24 +0000)]
Merge "Add exception types for AndroidKeyStore key validity issues."

9 years agoExpose new key use constraints in KeyPairGeneratorSpec.
Alex Klyubin [Thu, 2 Apr 2015 16:58:08 +0000 (09:58 -0700)]
Expose new key use constraints in KeyPairGeneratorSpec.

The constraints are currently ignored.

Bug: 18088752
Change-Id: Iabd2018200afb2bf8ac1748d1def47af74bfb9d3

9 years agoMerge "[ActivityManager] Avoid improper resume top activity."
Olawale Ogunwale [Thu, 2 Apr 2015 16:39:18 +0000 (16:39 +0000)]
Merge "[ActivityManager] Avoid improper resume top activity."

9 years ago[ActivityManager] Avoid improper resume top activity.
riddle_hsu [Thu, 2 Apr 2015 08:43:13 +0000 (16:43 +0800)]
[ActivityManager] Avoid improper resume top activity.

When there is a process died, only resume top if
it contains visible activity.

This can fix case 1 in
https://android-review.googlesource.com/#/c/120901/

Change-Id: I45584e76f9e863980d04bbb593d7d26a8900acd0

9 years agoRemove the window whose client process has died or become zombie
tiger_huang [Fri, 11 Jul 2014 10:41:48 +0000 (18:41 +0800)]
Remove the window whose client process has died or become zombie

Window Manager Service would fail to report window-resized to the
process which has become zombie. This would cause the window to
freeze screen continuously. In this case, we assume the process has
died and remove its window to recycle resources and to prevent it from
freezing the screen.

Change-Id: Ic7384731bf9a1fa8b9602d4f1dbee7492db126c5

9 years agoMerge "Early return in RemoteViewsAdapter is too late"
Elliott Hughes [Wed, 1 Apr 2015 23:34:24 +0000 (23:34 +0000)]
Merge "Early return in RemoteViewsAdapter is too late"

9 years agoAdd exception types for AndroidKeyStore key validity issues.
Alex Klyubin [Wed, 1 Apr 2015 23:22:00 +0000 (16:22 -0700)]
Add exception types for AndroidKeyStore key validity issues.

Bug: 18088752
Change-Id: I7494cb6a793e2b57bb849a4253bba2803778c161

9 years agoImprove the AndroidKeyStore-backed HMAC state machine.
Alex Klyubin [Wed, 1 Apr 2015 23:03:03 +0000 (16:03 -0700)]
Improve the AndroidKeyStore-backed HMAC state machine.

This defers the start of a new KeyStore operation after Mac.doFinal
until the next Mac.update or .doFinal. Previously, the a new KeyStore
operation was started immediately, at the end of doFinal.

Bug: 18088752
Change-Id: I2d594067ef261f519631d09f7a6087b715801656

9 years agoMerge "Cleanse HTTP, HTTPS, and FTP URLs in Uri.toSafeString."
Alex Klyubin [Wed, 1 Apr 2015 20:15:52 +0000 (20:15 +0000)]
Merge "Cleanse HTTP, HTTPS, and FTP URLs in Uri.toSafeString."

9 years agoCleanse HTTP, HTTPS, and FTP URLs in Uri.toSafeString.
Alex Klyubin [Wed, 1 Apr 2015 17:59:29 +0000 (10:59 -0700)]
Cleanse HTTP, HTTPS, and FTP URLs in Uri.toSafeString.

This makes the hidden API android.net.Uri.toSafeString omit most parts
of HTTP, HTTPS, and FTP URLs to avoid leaking anything unsafe. Only
the host and port are retained for these URLs.

Bug: 19215516
Change-Id: I2e9e33d9afaa9de5dd07a40532d56f0a2179f62a

9 years agoMerge "Use Keymaster-friendly validity dates."
Alex Klyubin [Wed, 1 Apr 2015 20:01:00 +0000 (20:01 +0000)]
Merge "Use Keymaster-friendly validity dates."

9 years agoMerge "Frameworks/base: Use system property for cache prune counter"
Andreas Gampe [Wed, 1 Apr 2015 19:52:26 +0000 (19:52 +0000)]
Merge "Frameworks/base: Use system property for cache prune counter"

9 years agoFrameworks/base: Use system property for cache prune counter
Andreas Gampe [Tue, 31 Mar 2015 23:15:17 +0000 (16:15 -0700)]
Frameworks/base: Use system property for cache prune counter

Expose ART's -Xzygote-max-boot-retry through a new system property
dalvik.vm.zygote.max-boot-retry.

Bug: 19983101
Change-Id: Ib88f807e0082d71292c14c7af38e02cca5a5602c

9 years agoUse Keymaster-friendly validity dates.
Alex Klyubin [Wed, 1 Apr 2015 03:19:54 +0000 (20:19 -0700)]
Use Keymaster-friendly validity dates.

Keymaster HAL currently requires that key validity start and end dates
always be specified. The framework API does not. This CL expresses
the framework API's "not specified" instants to Keymaster as instants
in distant past or future.

Bug: 18088752
Change-Id: Ia9d66d5e57bfca30628cdef6e0925a2781a3acfb

9 years agoMerge "Hook in user authenticators and their exceptions."
Alex Klyubin [Wed, 1 Apr 2015 17:34:36 +0000 (17:34 +0000)]
Merge "Hook in user authenticators and their exceptions."

9 years agoMerge "A way to obtain KeyStore operation handle from crypto primitives."
Alex Klyubin [Wed, 1 Apr 2015 17:34:08 +0000 (17:34 +0000)]
Merge "A way to obtain KeyStore operation handle from crypto primitives."

9 years agoMerge "[ActivityManager] Reduce report wrong anr activity"
Olawale Ogunwale [Wed, 1 Apr 2015 17:32:37 +0000 (17:32 +0000)]
Merge "[ActivityManager] Reduce report wrong anr activity"

9 years agoMerge "idmap: scan missing include for sys/stat.h"
Mark Salyzyn [Wed, 1 Apr 2015 16:53:53 +0000 (16:53 +0000)]
Merge "idmap: scan missing include for sys/stat.h"

9 years agoidmap: scan missing include for sys/stat.h
Mark Salyzyn [Wed, 1 Apr 2015 14:48:34 +0000 (07:48 -0700)]
idmap: scan missing include for sys/stat.h

scan.cpp gets sys/stat.h inherited from
private/android_filesystem_config.h it should
not rely on this in the future. The intent is
to move fs_config function into libcutils and
thus deprecate any need for sys/stat.h in this
include file.

Bug: 19908228
Change-Id: If547e86513b06c536972138ae571c3d9c714ffe9

9 years agoMerge "app_main missing include for sys/stat.h"
Mark Salyzyn [Wed, 1 Apr 2015 16:28:04 +0000 (16:28 +0000)]
Merge "app_main missing include for sys/stat.h"

9 years ago[ProcessStas] fix index out of bounds when add duration.
Ronnie Leng [Wed, 25 Mar 2015 15:57:24 +0000 (10:57 -0500)]
[ProcessStas] fix index out of bounds when add duration.

Root Cause:
There is a defect in current ProcessStats design
and following is the scenario:
1. Process A is started due to activity with
name of A
2. Process A creates ProessState with application
uid of A
3. Process B is started due to isolated service
declared in application A with name of A
4. Process B uses ProcessState of Process A as
it uses same application uid of A
5. Process B is finished and it leads to
ProcessState marked as dead
6. Process A still keeps using the invalid
ProcessState in dead state
7. IndexOutOfBoundsException is triggered when
system tries to update process state of Process A

Resolution:
use process uid to replace application uid for
getProcessStatLocked.

Change-Id: I881ad9fc492c9e1a892c9e957180cebcfef8352d
Signed-off-by: Ronnie Leng <ronnie.leng@gmail.com>
9 years agoapp_main missing include for sys/stat.h
Mark Salyzyn [Wed, 1 Apr 2015 14:36:23 +0000 (07:36 -0700)]
app_main missing include for sys/stat.h

app_main.c gets sys/stat.h inherited from
private/android_filesystem_config.h it should
not rely on this in the future. The intent is
to move fs_config function into libcutils and
thus deprecate any need for sys/stat.h in this
include file.

Bug: 19908228
Change-Id: I477b825e582742113f849aaa1df50c41e496b6f6

9 years agoMerge "[ActivityManager] Improve multi-thread access the same provider"
Olawale Ogunwale [Wed, 1 Apr 2015 14:58:20 +0000 (14:58 +0000)]
Merge "[ActivityManager] Improve multi-thread access the same provider"

9 years ago[ActivityManager] Reduce report wrong anr activity
riddle_hsu [Wed, 1 Apr 2015 10:58:07 +0000 (18:58 +0800)]
[ActivityManager] Reduce report wrong anr activity

Symptom:
Report ANR on wrong activity.

Reproduce steps:
 (All launchMode, taskAffinity are default and
  without additional intent flag)
 Case 1:
  1.Launch activity A from launcher.
  2.Activity A starts B activity.
  3.Press home key.
  4.Launch activity A from launcher (B is top).
  5.Press back key twice to finish B and A,
    A sleep 10s in onResume.
  6.ANR will report on launcher.

 Case 2:
  1.Launch activity A from launcher.
  2.Press home key.
  3.Kill process of A.
  4.Launch activity A from launcher.
  5.A sleep 10s in onResume, press back key immediately.
  6.ANR will report on launcher.

Possible root cause:
Focused activity will not be updated every time when activity
resumed. (the condition to call setFocusedActivityLocked)

Case 1:
Launcher was stopped and not waitingVisible due to launcher
is not the previous one, then getWaitingHistoryRecordLocked
has no chance to correct the real ANR activity.

Case 2:
Due to process of next activity is died, bring existed
task will not set mResumedActivity (it will be set when its
process is started), so when assigning waitingVisible from
processStoppingActivitiesLocked, the return value of
allResumedActivitiesVisible will be true even there is no
mResumedActivity. That results set waitingVisible to false
to previous activity (e.g. launcher), then also cannot
correct ANR target as case 1.

Change-Id: I0b24f46a8fab266382ebc6e2ed84ebeca9358768

9 years ago[ActivityManager] Improve multi-thread access the same provider
riddle_hsu [Wed, 1 Apr 2015 07:06:18 +0000 (15:06 +0800)]
[ActivityManager] Improve multi-thread access the same provider

Application may use many threads to load data from provider.
If the target provider needs to start process, each access
will occupy one binder thread of system server until the
provider process started and published.

Sometimes application uses more than 16 threads to access
the same provider, and the provider process needs a little
long time to start, then all binder threads of system server
are waiting. But when the provider is ready, it is unable to
publish to notify those waiting threads because no availabe
binder thread to use. And device will become almost hang.

Improvement:
If there is already a thread acquiring provider, let other threads
(which try to acquire the same provider) wait the result of the
first one. That reduces IPC to save binder thread of system server.

Remove calling removeContentProvider in installProvider because
we have ensured only get one provider holder for the same provider,
the original race that gets a new useless holder will not happen.

Change-Id: I521f2603db8ced56912f5dc54342a70451e68381

9 years agoA way to obtain KeyStore operation handle from crypto primitives.
Alex Klyubin [Wed, 1 Apr 2015 03:55:10 +0000 (20:55 -0700)]
A way to obtain KeyStore operation handle from crypto primitives.

This adds AndroidKeyStore.getKeyStoreOperationHandle method which can
be used to obtain the KeyStore operation handle corresponding to the
provided JCA cryto primitive (provided it's backed by
AndroidKeyStore).

Bug: 18088752
Change-Id: Iaa3b6f9b2281b2ec2de8fd5946d353dc7fdb3d2d

9 years agoHook in user authenticators and their exceptions.
Alex Klyubin [Wed, 1 Apr 2015 02:50:13 +0000 (19:50 -0700)]
Hook in user authenticators and their exceptions.

Bug: 18088752
Change-Id: I2835dbe51d09587a3081597c6aaf536aa1427e24

9 years agoMerge "UNSUPPORTED_TAG_LENGTH -> UNSUPPORTED_MAC_LENGTH"
Alex Klyubin [Wed, 1 Apr 2015 00:47:00 +0000 (00:47 +0000)]
Merge "UNSUPPORTED_TAG_LENGTH -> UNSUPPORTED_MAC_LENGTH"

9 years agoUNSUPPORTED_TAG_LENGTH -> UNSUPPORTED_MAC_LENGTH
Alex Klyubin [Wed, 1 Apr 2015 00:16:31 +0000 (17:16 -0700)]
UNSUPPORTED_TAG_LENGTH -> UNSUPPORTED_MAC_LENGTH

This is to follow naming from keymaster_defs.h

Bug: 18088752
Change-Id: If2bc91dde54f1cefcd4325d1f62d0e0b77fc5d59

9 years agoMerge "Add license banner to recently added AndroidKeyStore files."
Alex Klyubin [Tue, 31 Mar 2015 23:52:45 +0000 (23:52 +0000)]
Merge "Add license banner to recently added AndroidKeyStore files."

9 years agoAdd license banner to recently added AndroidKeyStore files.
Alex Klyubin [Tue, 31 Mar 2015 23:50:37 +0000 (16:50 -0700)]
Add license banner to recently added AndroidKeyStore files.

Bug: 18088752
Change-Id: I027f9530a02cca081aae8eb94833d2fdcb678e9a

9 years agoMerge "Add SecretKeyFactory backed by AndroidKeyStore."
Alex Klyubin [Tue, 31 Mar 2015 23:32:40 +0000 (23:32 +0000)]
Merge "Add SecretKeyFactory backed by AndroidKeyStore."

9 years agoAdd SecretKeyFactory backed by AndroidKeyStore.
Alex Klyubin [Tue, 31 Mar 2015 22:26:56 +0000 (15:26 -0700)]
Add SecretKeyFactory backed by AndroidKeyStore.

This factory provides a way to obtain information about a SecretKey
backed by AndroidKeyStore. The information is provided in a form of an
instance of KeyStoreKeySpec class.

EXAMPLE

SecretKeyFactory factory = SecretKeyFactory.getInstance(
        key.getAlgorithm(), "AndroidKeyStore");
KeyStoreKeySpec keySpec =
    factory.getKeySpec(key, KeyStoreKeySpec.class);

Bug: 18088752
Change-Id: I26c9dd544f80230fe7039501eeb471eaf875452b

9 years agoMerge "Clear the previous states before setting the new app visibility"
Craig Mautner [Tue, 31 Mar 2015 22:22:46 +0000 (22:22 +0000)]
Merge "Clear the previous states before setting the new app visibility"

9 years agoMerge "Fix value size data type in closure creation."
Yang Ni [Tue, 31 Mar 2015 21:32:23 +0000 (21:32 +0000)]
Merge "Fix value size data type in closure creation."

9 years agoMerge "Add unauthenticated AES ciphers backed by AndroidKeyStore."
Alex Klyubin [Tue, 31 Mar 2015 21:00:16 +0000 (21:00 +0000)]
Merge "Add unauthenticated AES ciphers backed by AndroidKeyStore."

9 years agoAdd unauthenticated AES ciphers backed by AndroidKeyStore.
Alex Klyubin [Tue, 31 Mar 2015 20:39:38 +0000 (13:39 -0700)]
Add unauthenticated AES ciphers backed by AndroidKeyStore.

This adds the following AES transformations:
* AES/ECB/NoPadding
* AES/ECB/PKCS7Padding
* AES/CBC/NoPadding
* AES/CBC/PKCS7Padding
* AES/CTR/NoPadding

Bug: 18088752
Change-Id: I3e4702e59868f8f2225c31b1c159d20008b9999d

9 years agoMerge "Include operation handle in OperationResult"
Chad Brubaker [Tue, 31 Mar 2015 17:49:15 +0000 (17:49 +0000)]
Merge "Include operation handle in OperationResult"