21365 Commits

Author SHA1 Message Date
RoboErik
d386d0f391 Merge "Route mute key events through MediaSessionService" into lmp-mr1-dev 2014-12-05 23:16:41 +00:00
Jeremy Joslin
7929484dbf Don't send the same PendingIntent more than once.
Fixing a bug where a NetworkRequest's PendingIntent can be sent more
than once when networks are rematched before the intent completes.

Added a small delay before removing the request to give the receiving
client an opportunity to put in its own request. The delay value is
configurable via Settings.Secure.

Bug: 18614074
Change-Id: Iac7c5e5a04f42f2b6794e9e22349cc631bebeab7
2014-12-05 14:58:04 -08:00
Wale Ogunwale
b503e3f287 Merge "Don't destroy surfaces of activities launched behind early." into lmp-mr1-dev 2014-12-05 22:56:13 +00:00
Filip Gruszczynski
e6a2ff2b1f Merge "Fix calculation of overscan insets in WindowState." into lmp-mr1-dev 2014-12-05 22:56:00 +00:00
Dianne Hackborn
0029f0ac36 Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev 2014-12-05 22:54:08 +00:00
Wale Ogunwale
ec533f6a55 Don't destroy surfaces of activities launched behind early.
When the launch activity behind feature was introduced in
http://ag/502868, we destroy the surfaces of windows associated with
the activity early in the last app window animation step. The causes
issues with activities that might be using the surface and not
prepared to have the surface destroyed from underneath them. We now
let the surface destruction get handled like any other window so all
the components/processes interested in the surface can be in the
right state when the surface is destroyed.

Bug: 18325222
Change-Id: I45e834a07a199b8a9e364f7392db99c871a43280
2014-12-05 14:52:04 -08:00
Dianne Hackborn
1e01d16982 Fix issue #17323751: Additional items in aggregated battery stats
- Now aggregate number of times each process has crashed and ANRed.
- Now aggregate total number of connectivity changes.
- Now record connectivity changes in the history.

Crash and ANR counts are new entries at the end of "pr" in checkin.

Connectivity change counts is a new entry at the end of "m" in checkin.

Connectivity changes in the history checkin are Ecn and include the
type of connection and its state.

Change-Id: I0c01186446034cf6c3fb97d45f5e3b5c69a0438a
2014-12-05 13:54:24 -08:00
Filip Gruszczynski
ff778fe450 Fix calculation of overscan insets in WindowState.
Bug: 18630625
Change-Id: I19b0c8627c3b9d61923e68c59fce9bddb2751c3d
2014-12-05 13:31:43 -08:00
RoboErik
7c82ced4fc Route mute key events through MediaSessionService
This sends mute keys to the MediaSessionService and handles them
by toggling the appropriate stream. Muting remote playback is still
not supported.

bug:17501993
Change-Id: I18c5b037cde2175acbb64b118dd708514acfd8c9
2014-12-05 12:41:34 -08:00
Christopher Tate
2aa909f0ab Merge "Correctly parse previous PMBA state during backup" into lmp-mr1-dev 2014-12-05 20:05:10 +00:00
Christopher Tate
8ec2dc00e5 Merge "Tune delivery and batching of alarms" into lmp-mr1-dev 2014-12-05 20:04:25 +00:00
Pavel Zhamaitsiak
b81ce34af3 Merge "Revert "Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev"" into lmp-mr1-dev 2014-12-05 19:42:11 +00:00
Fyodor Kupolov
22afe6261a Merge "Added isRemovingAdmin method" into lmp-mr1-dev 2014-12-05 19:28:12 +00:00
Amith Yamasani
43606641f6 Merge "Correct check of is user running" into lmp-mr1-dev 2014-12-05 19:11:17 +00:00
Sergii Skorokhodov
308fa0548b Correct check of is user running
Before the ActivityManagerService sends an intent or
starts an activity it checks if target user is in
mStartedUsers array.

When removing a non-owner user process the
UserStartedState instance will still be in mStartedUsers
array with mState STOPPING or SHUTDOWN.

This should be checked before sending an intent or start
an activity.

isUserRunningLocked(...) will interpret mState STOPPING
and SHUTDOWN as a non running user.

Bug: 7462778
Change-Id: I1b51bcdb62bdd0f6dbe05dab4d529d4ad40d0d44
2014-12-05 11:02:41 -08:00
Amith Yamasani
0702752cf8 Merge "Potential fix for accidental deactivation of profile owner" into lmp-mr1-dev 2014-12-05 18:56:55 +00:00
Erik Kline
e660e27603 Revert "Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev"
This is the revert of ag/572619.

This reverts commit 9261d9d64548f0221de50eb99f3675488a4176a4, reversing
changes made to 32b61ab28f54e5b00f472b2166f9b1100375e4ff.

Bug: 18609055
Bug: 17769720
Change-Id: I122eba200f2071d4e5777ec34c1d04fb567345a8
2014-12-05 18:02:56 +00:00
Zoltan Szatmary-Ban
469c15d6af When switching to default USB function set, check restriction
The user restriction DISALLOW_USB_FILE_TRANSFER has to be respected
when switching USB function set.

Bug: 18532487
Change-Id: I16fda6358027a659e3bfa0c5f3bf6b3918d0bced
2014-12-05 17:14:43 +00:00
Benjamin Franz
fb967585cc Merge "Change the routing path of bluetooth headset connections." into lmp-mr1-dev 2014-12-05 12:04:03 +00:00
Jinsuk Kim
de7a4248d8 CEC: Avoid setting op in disabled mode
In disabled HDMI control mode, TV local device is gone, for which
setting operation is not possible. Does the check against the tv instance
when TV setting update is notified. The settings is picked up when
the control is enabled back, so notification is not lost.

Bug: 18580387
Change-Id: Id8891bfa54d851ec1aff280fc99be8e428f4e0cf
2014-12-05 15:57:37 +09:00
Dongwon Kang
9e094efa93 Merge "TIF: handle a race condition when a session is crashed" into lmp-mr1-dev 2014-12-05 04:08:25 +00:00
Christopher Tate
22192ada99 Correctly parse previous PMBA state during backup
Bug 18628030

Change-Id: Iefa23de50dd9e1b27cfa5d887f117876d57e4083
2014-12-04 19:38:55 -08:00
Christopher Tate
81f9882b5a Tune delivery and batching of alarms
* Inexact alarms no longer coalesce with exact alarms.  The motivation here
is that exact alarms are far more likely to be wall-clock aligned, and in
general pulling all alarms toward wall-clock alignment is a bad idea.

* Wakeup times are now fuzzed within the target batch's allowed window
rather than being hard pinned at the start of the window.

Bug 18631821

Change-Id: Iefaf34eee3f2a6546abefc27e177ee2fdcff935f
2014-12-04 19:16:56 -08:00
Filip Gruszczynski
26af8c197c am 26b18771: Merge "Private Window flag to disable touch events in WallpaperService." into lmp-sprout-dev
* commit '26b187711fdf6224e14df465a58f30f510011b49':
  Private Window flag to disable touch events in WallpaperService.
2014-12-05 02:34:26 +00:00
Fyodor Kupolov
96fb932666 Added isRemovingAdmin method
Added isRemovingAdmin method, so that clients can query if device
admin is currently being removed.

Bug: 17609838
Change-Id: I82547a9eeb228fcf8ac2a6e639ca1a75fa41d161
2014-12-04 17:53:45 -08:00
Dongwon Kang
fdce9e541e TIF: handle a race condition when a session is crashed
Currently, TIMS has a logic for handling session crash (binderDied).
However, this can be racy if the client calls an operation right before it gets
ITvInputClient.onSessionReleased() callback. This change handles those request
gracefully without causing a crash in the client side.

Bug: 18612616
Change-Id: I37241e05d53f3cca693e0239fc9ad5dce02fc925
2014-12-05 10:37:14 +09:00
Dianne Hackborn
25d2c2d61b Merge "Fix issue #18593636: Turn on "kill important processes that..." into lmp-mr1-dev 2014-12-05 01:35:21 +00:00
Svetoslav
3a0d878ab5 Ensure all events from a showing window are dispatched.
Accessibility services may opt-in to introspect the interactive
windows on the screen. If window introspection is enabled there
is a case where some events from a showing window are received
before the updated window state from the window manager. Now the
window manager sends over the windows before notifying the app
for the focus change.

bug:18625996

Change-Id: Ic481e01efbe12dc92f090f799feeb236672fc7b3
2014-12-05 00:37:38 +00:00
Jinsuk Kim
6074797441 Merge "CEC: Introduce the retry for commands on the new device discovery." into lmp-mr1-dev 2014-12-05 00:05:11 +00:00
Filip Gruszczynski
b8c0694ae8 Private Window flag to disable touch events in WallpaperService.
Change-Id: I18b46340f89cbea0b6daeb1efe9c31656f4e1a5d
2014-12-04 15:02:18 -08:00
Amith Yamasani
a0116afeaf Potential fix for accidental deactivation of profile owner
This is a safeguard to only check for changing packages when
re-validating active admins.
1. If package is being removed, only check if it's not being
   replaced.
2. If package is changing, only check the changing package that
   matches one of the active admins.
3. If package is being added and is a replacement (update), then
   check if it affects any matching active admins and verify the
   validity of the receivers.

If by any chance some package broadcast was occuring at a time when
an admin was being updated, or the package removed broadcast was
coming in much before the update was registered with package manager
then this will help in avoiding accidental deactivation.

Bug: 18590558
Change-Id: I7f4897e8836f81aa037b8be87d399942ce78b1a2
2014-12-04 14:49:24 -08:00
Wale Ogunwale
6b54d38a2c Merge "Add support from restoring recent's backup." into lmp-mr1-dev 2014-12-04 21:58:51 +00:00
Dianne Hackborn
57a873fcaa Fix issue #18593636: Turn on "kill important processes that...
...have ballooned" for all devices

Actually, this was supposed to be on for all devices, but it was no
longer being run due to changes in the idle maintenance code in L.
So now we run it again.  And moved the idle maintenance window to 3am.

Change-Id: I8e90723e1431b82896d261cf90f8bf84f43b0bf2
2014-12-04 13:58:46 -08:00
Craig Mautner
afca4dba31 Merge "bug fix possible NPE while startProcessLocked()" into lmp-mr1-dev 2014-12-04 21:55:02 +00:00
Craig Mautner
9052862ebb Merge "[ActivityManager] Invalidate last screenshot when activity relaunched" into lmp-mr1-dev 2014-12-04 21:53:42 +00:00
Craig Mautner
799cb73029 Merge "[ActivityManager] Fix race condition in pss collection" into lmp-mr1-dev 2014-12-04 21:52:06 +00:00
Craig Mautner
e0dc40c0f2 Merge "ANR caused by incorrect cleanup in BroadcastQueue." into lmp-mr1-dev 2014-12-04 21:50:46 +00:00
Craig Mautner
c2cae50b83 Merge "Reset killedByAm flag at attachApplicationLocked" into lmp-mr1-dev 2014-12-04 21:45:21 +00:00
Craig Mautner
1289a3b2d3 Merge "[ActivityManager] Fix NPE when start activity" into lmp-mr1-dev 2014-12-04 21:44:39 +00:00
louis_chang
1864a509b0 [ActivityManager] Invalidate last screenshot when activity relaunched
Symptom:
The task thumbnail is not updated when activity relaunched.

Reproduce Steps:
1. Put device in portrait
2. Launch Calculator
3. Launch Recent App (the Calculator's screenshot is correct)
4. Rotate device to landscape
5. Click Calculator in Recent App to return to Calculator (Calculator has relaunched to landsacpe ui)
6. Launch Recent App again (the Calculator's screenshot is not updated)

Change-Id: I92e951ea2ee215c52ca6e50cf6f9e02deb787bce
2014-12-04 13:35:02 -08:00
younghwan1.kim
bc0975b3af bug fix possible NPE while startProcessLocked()
In case, process doesn't create well while startingProcessLocked().
There is possibility to make NPE.
Setting app's crash handler needs to be assigned after null check routine.

Change-Id: I67fb6427f72d93f79fed36eb44c47d37eafdac31
2014-12-04 13:32:41 -08:00
louis_chang
71e737c8e8 [ActivityManager] Fix race condition in pss collection
Symptom:
There has a race condition that two threads are accessing
the mPendingPssProcesses simultaneously. One of the thread
is collecting the process pss by looping the mPendingPssProcesses.
The other thread is requesting to collect pss of all processes,
which clears mPendingPssProcesses and adding processes back.

Solution:
Avoid race condition by adding synchornized protection.

Change-Id: Ifb090eda9c4a1b8e3fd980fe0171e9dd77773b46
2014-12-04 13:30:12 -08:00
Kazuki Nakayama
8920e1cabb Reset killedByAm flag at attachApplicationLocked
Cherry picked from aosp.

Fixes bug 18593309.

ActivityManager reuses a process record object that killed
by him under some situation. That reused process record inherits
a killedByAm flag unexpectedly.
The killedByAm flag must be reset otherwise ActivityManager can't
judge the process can be killed or not.

Change-Id: If95137d91939cc44882ad2813131bcde0edd0c1b
2014-12-04 13:28:10 -08:00
louis_chang
cd5d198d7e [ActivityManager] Fix NPE when start activity
Cherry picked from aosp.

Fixes bug 18593457.

Symptom:
NPE occurs in line 1184 (resultStack.sendActivityResultLocked)
because resultStack is null.

Root cause:
When starting activity with FLAG_ACTIVITY_FORWARD_RESULT flag,
the resultRecord could be updated, but the resultStack is not
updated as well. In that case, the resultStack is still be
null. The exception will occurs if the activity is not
granted to launch due to permission denied.

Solution:
Update resultStack when resultRecord updates.

Change-Id: I91634e4f713c2e8dbd1a71f358a8fd9beed83ec7
2014-12-04 13:06:05 -08:00
Wale Ogunwale
18795a2299 Add support from restoring recent's backup.
Bug: 15986349
Change-Id: I899f81d317fcd5277a75db7ba50ecca14112df26
2014-12-04 12:37:53 -08:00
Svetoslav
6e7bf935b4 Merge "Notify accessibility for window changes after an app animation end." into lmp-mr1-dev 2014-12-04 20:29:57 +00:00
Guobin Zhang
53964dac4b ANR caused by incorrect cleanup in BroadcastQueue.
Pulled from aosp.

Fixes bug 18593454.

Two broadcasts could be sent to the same app simultaneously:
one foreground, one background. For example, LOCALE_CHANGED
and PACKAGE_CHANGED are delievered to com.android.vending
at the same time.
1. AMS started new vending process to handle LOCALE_CHANGED.
   And set app.curReceiver = LOCALE_CHANGED.
2. Before LOCALE_CHANGED is handled by vending process,
   PACKAGE_CHANGED was delievered to vending process too.
   AMS set app.curReceiver = PACKAGE_CHANGED. Bad!
3. Vending process finished handling LOCALE_CHANGED.
   AMS clear app.curReceiver = NULL. Bad!
   And Vending process  killed itself without handling
   PACKAGE_CHANGED.
4. AMS known vending process has died, but didn't know that
   BgBroadcastQueue was still waiting for finish message
   for PACKAGE_CHANGED.
At last, BgBroadcastQueue reported ANR for PACKAGE_CHANGED.

This patch adds protection before clearing app.curReceiver,
only set to NULL if the finishing receiver = app.curReceiver
So handleAppDied would know that PACKAGE_CHANGED was not
finished yet, it will abort the broadcast and continue.

Change-Id: Ic4f31b35e21823d4a3c27712391ecbede213a494
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
2014-12-04 12:26:53 -08:00
Craig Mautner
224904e01a Merge "Prevent ANR when broadcast receiver is killed" into lmp-mr1-dev 2014-12-04 19:46:20 +00:00
Paul Jensen
efb81b9e96 Merge "Remember to cancel lingering when a network again satsifies a NetworkRequest." into lmp-mr1-dev 2014-12-04 19:27:52 +00:00
Kenji Sugimoto
d088027ff1 Prevent ANR when broadcast receiver is killed
Cherry-picked from aosp

Fixes bug 18613138.

If the process of a BroacastReceiver is dying at the same time
as the system is trying to send an ordered broadcast to the
receiver, the system will try to start the process again. The
BroadcastQueue will store the BroadcastRecord in mPendingBroadcast
to be able to handle it again when the process is awake. A
timeout Message is posted to the handler of the BroadcastQueue.

As part of the shutdown sequence skipCurrentReceiver is called for
the ProcessRecord. This will check if there is a curReceiver set
for the application and make sure to finish the receiver.

Each of the foreground and background BroadcastQueues have their
own handler for managing broadcast timeouts. If the wrong
BroadcastQueue finishes the receiver, the pending timeout Message
will never be cancelled, leading to an ANR report for a receiver
that has already been finished.

Change-Id: I960c0d8f1a8b739b54a8f09f496b32a3498b9e9a
2014-12-04 11:02:36 -08:00