First, startTime's default value is -1 and not 0, so use it to test
if the startTime is set. Also, startTime isn't being set when connecting
legacy VPN; this change fixes that too.
Bug: 10985174
Change-Id: Ibf52b8f489b18c96efba501b76aa73e9a9e0e3e8
The activity manager can create a new task under certain
circumstances in resetTargetTaskIfNeededLocked(). In that case the
window manager was not told to create a new task. This fix creates the
task in window manager when it recognizes that there is a new task
required.
Fixes bug 10412588.
Change-Id: Ife9ecfeb7f53f9df5950322c9359c836adc258a2
The main problem here was a mistake when turning a single process
structure to a multi-package-process structure with a common
process. When we cloned the original process state, if there were
any services already created for the process for that package, they
would be left with their process pointer still referencing the
original now common process instead of the package-specific process,
allowing the active counts to get bad. Now we switch any of those
processes over to the new package-specific process.
There was also another smaller issue with how ServiceRecord is
associated with a ServiceState -- we could be waiting for an
old ServiceRecord to be destroyed while at the same time creating
a new ServiceRecord for that same service class. These would share
the same ServiceState, so when the old record finally finished
destroying itself it would trample over whatever the new service
is doing.
This is fixed by changing the model to instead of using an "active"
reference count, we have an object identifying the current owner
of the ServiceState. Then when the old ServiceRecord is cleaning
up, we know if it is still the owner at that point.
Also some other small things along the way -- new Log.wtfStack()
method that is convenient, new suite of Slog.wtf methods, fixed
some services to use Slog.wtf when catching exceptions being
returned to the caller so that we actually know about them.
Change-Id: I75674ce38050b6423fd3c6f43d1be172b470741f
Previously we relied on having a continue stream of sensor
events from which to detect whether the device is moving or
at rest. However, if the sensor HAL is broken in some way
then we might not receive enough sensor events to actually
finish the detection process. When this happens, we'll
just sit there holding a wakelock indefinitely.
Instead of relying on the sensor event stream, post a delayed
message to explicitly finish detection.
Bug: 10769163
Change-Id: Ia2ed66fe5e7c41a8832df76da9104c13554e1398
- Call in all circumstances but only set launchHomeTaskNext for
focused stack. Previous version didn't call handleAppDiedLocked for
non-focused stack.
- Rearrange logic to run down the top task and make sure that all
remaining activities belong to the dying app. Previous version just
looked at the top non-finishing activity and based its behavior on
that.
Fixes bug 11029560.
Change-Id: Ic3a7c873c4c975577d6b390a8955ff41729bdfde
Should fix the array index out of bounds. valueAt() is when we have the
index, not the key.
Bug: 11014210
Change-Id: Icb53fe763782befbd5de1b3df6630b87cda72e84
If two activities are started at the same time the first activity can
add a starting window but never start. In that case there is no event
that will clear the starting window. This change adds a 10 second
timeout for the starting window to be cleared after which it will
clear the starting window automatically.
Fixes bug 10797865.
Change-Id: I1d59c3058c63367ff688d426474e8a6f006b2e0d
All ContentProvider calls are currently blocking, making it hard for
an app to recover when a remote provider is wedged. This change adds
hidden support to ContentProviderClient to timeout remote calls,
treating them as ANRs. This behavior is disabled by default.
Update DocumentsUI to use a 20 second timeout whenever interacting
with a storage provider.
Bug: 10993301, 10819461, 10852518
Change-Id: I10fa3c425c6a7225fff9cb7a0a07659028230cd3
It is possible that a print job is scheduled for handling, i.e. it is
queued, after the target print service is uninstalled or disabled.
In case like this we fail the print job with an appropriate error
message. Now the user can cancel the job when he/she sees the notification
or the status in the print settings. Trying to restart such a job will
end up failing it again with the same error message. So the user will
just have to canel the print job.
This apporach quarantees that the user is informed for the failure and
also is much simpler than trying to update the UI when print job's
target serivce is uninstalled. For example, the settings UI has to
be updated as well as the notifications. Also due to the async nature
of the system this we cannot completely avoid having a restart option
for a print job whose target service is gone. This scenario is very
unlikely but still we have to handle it.
bug:11012251
Change-Id: Id8c8c3cff75e0b6325552676b130ff1406edc069
Bug: 10916655
Add a stash where the SyncHandler can copy and place
msgs rather than run them. After boot is complete
we iterate through the stash in order and send the
messages off.
Change-Id: I9c175ee79fe60952346003a29225b8687979b44e
Fixes jank exposed in 10881705. Specifically background activity
animating up along with translucent activity. Repro steps on manta:
1. From home start Settings.
2. Press home.
3. From home start Downloads (translucent activity that takes 85% of
screen).
4. Observe that as Downloads zooms up the 15% boundary that should be
dimly transparent are showing Settings.
The cause was that there is a finishing activity in the Downloads task
that was used to launch the DownloadsActivity. The existence of that
activity kept the logic from recognizing that the home activity was
behind the DownloadsActivity, not the Settings activity.
This fix descends through all of the activities in a task sitting on
home and makes sure that they only keep home from showing if such
activities are not finishing and visible.
Change-Id: I607afce6b0000b4db634f2ce40a6c37fcee369d7
Not dealing with the case where there is a null list.
Also fixed some bugs I found while looking at this:
- When resetting the stats, we would use a newly computed time stamp
for the total durations rather than the one we used to reset the
proc/service entries. This would result in them being able to be
slightly > 100%.
- There was a bug in how we split a single process state into its
per-package representation, where we would but the cloned process
state into the new package's entry (instead of properly for its
own package entry), to be immediately overwritten by the new
process state we make for that package. This could result in
bad data for processes that have multiple packages.
- There was a bug in resetting service stats, where we wouldn't
update the overall run timestamp, allowing that time to sometimes
be > 100%.
- There was a bug in computing pss data for processes with multiple
packages, where the pss data was not distributed across all of the
activity per-package process states.
- There was a bug in computing the zram information that would cause
it to compute the wrong value, and then never be displayed.
Finally a little code refactoring so that ProcessState and ServiceState
can now share a common implementation for the table of duration values.
Change-Id: I5e0f4e9107829b81f395dad9419c33257b4f8902