Cherry-picked from aosp into lmp-dev.
Sympton:
Next activity only adds to history but does not launch/resume then results ANR.
Root Cause:
In a rare timing, some windows are switched at the same time,
it will cause some finishing records on the top temporarily,
then set startIt to false that skip to resume the real top activty.
Solution:
If all activities in a task are finishing, do not use it to check.
The behavior/checking is the same concept as in JellyBean:
// If starting in an existing task, find where that is...
boolean startIt = true;
for (int i = NH-1; i >= 0; i--) {
ActivityRecord p = mHistory.get(i);
if (p.finishing) { // <--
continue;
}
Change-Id: I9d81a7b5182400c52e173da23eee61c74692beee
Conflicts:
services/java/com/android/server/am/ActivityStack.java
Fix bug where we kept a reference to the old Notification when
we re-use notification entries on updates.
Bug: 16513124
Change-Id: I066ff7447952516e27e122df57d4e6e67ee1cea3
* changes:
Cherry pick Cleanup debug messages in WebViewFactory and WebViewUpdateService DO NOT MERGE
Cherry pick Move startIsolatedProcess implementation in ActivityManagerService DO NOT MERGE
CHerry pick Find WebView package name from a config resource. DO NOT MERGE
Cherry pick Remove dependency on WebView native library path. DO NOT MERGE
Cherry pick Make WebViewUpdateService a SystemService. DO NOT MERGE
Cherry pick Refactor ActivityManagerService and make WebViewFactory more pedantic. DO NOT MERGE
Cherry pick Refactor native library path logic in WebViewFactory DO NOT MERGE
Cherry pick Append WebView assets to AssetManager when loading the WebView. DO NOT MERGE
Cherry pick Introduce startIsolatedProcess private API in ActivityManager DO NOT MERGE
Cherry pick Load the WebView Java code from an APK. DO NOT MERGE
This is just a cleanup CL which fixes:
- Some erroneous debug messages about the relro creator process.
- The condition checked in WebViewUpdateService, to prevent the
WebView to be used from the SystemServer (it now looks at the
process id, previously it was erroneously looking at the uid).
- Adds a 5s. timeout to the waitForRelroCreationCompleted.
Original BUG:16403706
Original Change-Id: I43a953949050d7df5fe334cfa7257315ee6db071
Bug: 16723226
Change-Id: I2f40be3622b8e6c68b2b52cae7f4d3a95e148cbf
This CL addresses the comments in CL 512432, moving the implementation
of startIsolatedProcess in the outer ActivityManagerService class and
making the entry point in the ActivityManagerInternal sublcass just
a proxy method.
This change also addresses a potential NPE, due to startProcessLocked
returning null in some failure cases.
Original BUG:16403706
Original Change-Id: I21eff88c23221653f552cfc171647a839e42a802
Bug: 16723226
Change-Id: I4af9fd7eea10b11e06a5c37d8160c220376b3ed1
Use a config resource to determine the package name for the WebView
implementation to allow it to be changed by a resource overlay.
Original Bug: 16329371
Original Change-Id: I5977691c0223347e0382d584c3d3ee4428660180
Bug: 16723226
Change-Id: Ib0b4245f26cbf93f364aa0f30b231786931f9f16
This CL removes the final use of the hardcoded WebView
library path from WebViewFactory. We now use a system
property to set the amount of address space to reserve
in the zygote rather than stat'ing the file.
See also I07ad5a774623c1899eb50474d999a2b1447783f0
Original Change-Id: Id3c1e3cc2e2a06c1021ad0260a37abcd07d78fd6
Bug: 16723226
Change-Id: I55acad96b6d9ee69f14b84d772abf7740ea96b94
Migrate WebViewUpdateService to the newer SystemService approach instead
of ServiceManager.addService.
Original Bug: 16403706
Original Change-Id: I21aa67a41c22c3c20ba9e82eb87e5d610fe130e8
Bug: 16723226
Change-Id: Id276b71ee547e683f0756bcee0f4978ce342c2af
This CL adds more robustness to the logic in WebViewFactory, checking
whether the isolated process did start at all and catching exceptions
in its java side.
Also, this addresses the refactor comments received in CL 509840.
Original BUG:16403706
Original Change-Id: Iaaea6d36142ece6d974c2438259edf421fce9f2e
Bug: 16723226
Change-Id: Id308f2ffde9b67a3eb4719c7b81b4f46421f0c2e
This CL changes the relro creation and loading logic.
Instead of using a hardcoded path, now WebViewFactory queries the
package manager to get the lib path, which will be either
/system/priv-app/webview/lib/ or /data/app/... depending on the
presence of an update apk.
Original BUG:16403706
Original Change-Id: Icceb95da98e69032a19ac2ae8fe72ba1439e50ad
Bug: 16723226
Change-Id: Ia3155f72a735d75a566a8cc4c8c892d43b6cd371
This makes the code loading the WebView Java code from the .apk
also load the WebView assets into the current AssetManager.
Original BUG: 11505352
Original Change-Id: Ib6203f79b98805012ffa20b233037b7da221624c
Bug: 16723226
Change-Id: Ie7b0b22df9727c72debfb9ccfcd84c95bf41e039
The new API spawns a isolated process, using a custom uid, entrypoint and
abi. Such API is used by the WebViewFactory to spawn its unpriviledged
but trusted process (hence the fixed uid) which rewrites the rerlo file
on boot / when an update occurs.
Since both the ActivityManager service and the WebViewUpdate service
live in the SystemServer their calls be dispatched locally and no
binder interface needs to be exposed for the new startIsolatedProcess API.
Original BUG:16403706
Original Change-Id: I327b59735c12698595e0dbcc4da5d759c9103b0a
Bug: 16723226
Change-Id: Iecb49888e11eec9d302d9712953fd498db5821af
Use the WebView APK to load the Java code via createPackageContext.
Original Bug: 16329371
Original Change-Id: I1292edab639d85c2027dc8ebb52def8c36d41cde
Bug: 16723226
Change-Id: I8e692a5e12706f91a8af0a8b385bac336ce60913
Crop out a notification_panel_width by notification_max_height
section of the screenshot for the preview.
This will only save about 25% of the bytes on a phone-like device over
the existing square crop, but on a tablet-like device the savings will be
more significant: above 75%.
Bug: 16631778
Change-Id: I05d4d402e44f7700f17b8b97018f6c00c3b0196d