The variable ActivityRecord.mLaunchHomeTaskNext was used to indicate
that the home task should be launched when the activity completed.
This only mattered when it was at the end of a task. As the activity
launched other activities within the same task it needed to be
migrated from activity to activity and task to task. This became
too complicated and was at the wrong level to begin with.
By moving the flag to TaskRecord.mOnTopOfHome the logic is simpler
and the results more predictable.
Fixes bug 10602256.
Change-Id: If0b752522b77be9918f1dba221d0ff670fc01af8
...caused runtime restart
There were some situations where the package list could be set
with process stats when it shouldn't. Not sure if this is causing
the problem, since there is no repro.
Also some improvements to debug output -- new commands to clear
all stats, print full details of stats, and print a one-day
summary (which should match what the UI shows).
Change-Id: I9581db4059d7bb094f79f2fe06c1ccff3e1a4e74
Add a test for emptiness before accessing either mTaskHistory[0] or
TaskRecord.mActivities[0]. This will keep us from hitting
IndexOutOfBoundsException.
Fixes bug 10789624.
Change-Id: If726df888a2c8b393788793b6220a6bffe2df883
The InputMethod window was being assigned to the bottommost
window as a fall-through situation when no window could receive
input. This fix changes that so that if the bottommost window
cannot receive IME input then the InputMethod will be unassigned.
In most ANRs associated with bug 10689184 mInputMethodTarget
was assigned to the Wallpaper window and the InputMethod was
placed directly above it. When the ANR occurred the window that
was awaiting focused was then always placed immediately above the
InputMethod. This fix will keep that situation from happening.
Change-Id: Ic247e8132a907f2712a9f8a89e43c099142ec851
NPE at com.android.server.am.ProcessRecord.resetPackageList(ProcessRecord.java:596)
Take care of some more cases now that baseProcessTracker can be null.
Change-Id: I394c0b7802788118c3ad6bcac5dfdd23eeda8d58
...while setting up a new user from settings.
The delayed service start stuff was too aggressive -- it would
allow a process to be killed between the an onReceive() that calls
startService() and that service being started. This means that
apps that set up global state that they expect to remain set up
during that time could be lost.
This is the first part of a fix, which tightens up when we allow
services to be delayed. Now we will immediately start the service
as long as it currently as a process running that is not in the
cached state. (Previously we would delay if the process was in
the receiver state.)
This unfortunately means that our service start delay is much
less effective. To address that, there will be a follow-on change
to tie broadcast delivery into this to see if we can delay the
finish of a broadcast as long as there are background services
starting in that process.
Change-Id: I2bba2295d10699ee3479375bbe87114b2cbb0826
We now expect that the transport service's host process will be
OOM-killed sometimes, but will come back automatically because we
still hold the binding. So, we no longer drop it as the
expected-to-be-current transport when that happens.
Bug 10728767
Change-Id: I5e756e8942e7c4c3567632f10460ee31b9618d75
1. The UI of a printing app was freezing a little when calling the print
method since the print manager service was waiting for it to bind to the
print spooler which generated the print job id (and the initial print
job info really). Now the print manager service is responsible for job
id generation and does not not wait for the print spooler to spin. Hence,
the app UI is not blocked at all. Note that the print manager initiates
the binding to the spooler and as soon as it completes the spooler shows
the print UI which is hosted in its process. It is not possible to show
the print UI before the system is bound to the spooler since during this
binding the system passes a callback to the spooler so the latter can
talk to the system.
2. Changed the print job id to be an opaque class allowing us to vary the
way we generate print job ids in the future.
3. The queued print job state was hidden but the print job returned by the
print method of the print manager is in that state. Now now hidden.
4. We were incorrecly removing print job infos if they are completed or
cancelled. Doing that is problematic since the print job returned by
the print method allows the app to query for the job info after the
job has been say completed. Hence, an app can initiate printing and
get a print job whose state is "created" and hold onto it until after
the job is completed, now if the app asks for the print job info it
will get an info in "created" state even though the job is "completed"
since the spooler was not retaining the completed jobs. Now the spooler
removes the PDF files for the completed and cancelled print jobs but
keeps around the infos (also persisting them to disc) so it can answer
questions about them. On first boot or switch to a user we purge the
persisted print jobs in completed/cancelled state since they
are obsolete - no app can have a handle to them.
5. Removed the print method that takes a file since we have a public
PrintDocumentAdapter implementation for printing files. Once can
instantiate a PrintFileDocumentAdapter and pass it to the print
method. This class also allows overriding of the finish method to
know when the data is spooled and deleted the file if desired, etc.
6. Replaced the wrong code to slice a large list of parcelables to
use ParceledListSlice class.
bug:10748093
Change-Id: I1ebeeb47576e88fce550851cdd3e401fcede6e2b
Haven't found the underlying cause, but this will give us more
information when we get into the bad state.
Change-Id: I9aebd3a025a7c0d931f43098461b64ee3c220746
Bug: 9520957
DevicePolicyManagerService will play dumb if the feature is not installed.
Continue to keep track of failed password attempts for keyguard's use.
Change-Id: I28d258dc09a8b4976b188da6f453d8daabcc4bdd
We now have the activity manager kill long-running processes
during idle maintanence.
This involved adding some more information to the activity manager
about the current memory state, so that it could know if it really
should bother killing anything. While doing this, I also improved
how we determine when memory is getting low by better ignoring cases
where processes are going away for other reasons (such as now idle
maintenance). We now won't raise our memory state if either a process
is going away because we wanted it gone for another reason or the
total number of processes is not decreasing.
The idle maintanence killing also uses new per-process information
about whether the process has ever gone into the cached state since
the last idle maintenance, and the initial pss and current pss size
over its run time.
Change-Id: Iceaa7ffb2ad2015c33a64133a72a272b56dbad53
Multi project change:
The changes in this project add the new (hidden) default sms application
setting to Settings.Secure and updates AppOps to support the concept
of an op defaulting to something other than allowed. OP_WRITE_SMS is set
to default to MODE_IGNORED.
Bug: 10449618
Change-Id: I37619784ac70c27cf9fbcbfcac1b263398bc4e01
While enabling Portable Wifi hotspot in Settings, a null WifiConfiguration
is provided. This null config is on purpose and meanful, and it should bypass
the validation test to avoid the NullPointerException.
Bug: 10780414
Change-Id: Ic507ecae463946c925b3d5fb5a1d185b37db410f
In the case where the top task is finishing and another task is
launching make sure that the next task will be launched once the
top task actually completes pausing.
In the case of b/10550460 the top task, Dialtacts, was finishing
but had not yet completed pausing. It was configured to return to
the home screen (mLaunchHomeTaskNext true) but because its finishing
flag was set all the tests we have thought that the InCallActivity
task was the top task. When it finally did complete the
mLaunchHomeTaskNext flag caused the home activity to be started
instead of the InCallActivity.
If the InCallActivity task had been moved above the Dialtacts task
at the time it was judged to be the top task the home activity
would not have been launched when Dialtacts completed. This fix
moves the judged top task over the finishing top task.
Fixes bug 10550460.
Change-Id: I14052ad2282008679b560dd7fb16b216664ec24d
The check to validate incoming configurations is flagging a correct
API usage as well - which doesn't provide any configuration to test.
Fixing code to accommodate this.
Bug: 10749041
Change-Id: I972f0edbdfa14aaa3edb34e4c6784b436c288383
When a bundled app is upgraded, only reprocess ungranted 'system'
permissions if the bundled apk is privileged.
Also adds the 'privileged' flag to the dumpsys flag summary.
Bug 10503183
Change-Id: Ic6560fc904e5970fc871a155c898744a6607f851
1. If a print service dies, is restarted and at the time of the
restart the service has neither print jobs nor a discovery
serssion it gets stuck into a bound state. Now it unbinds if
after binding and ensuring it is in the lifecycle state right
before the death there are no active print jobs and no discovery
session.
Also when a print service dies we fail all of its print jobs
but did not update the service that all of its print jobs are
handled, i.e. it has no active print jobs.
2. Fixed a null pointer exception in UserState
bug:10696723
Change-Id: Id0a67846093fca5d4c1e10843eaf6aa90169d942
Add the condition that the connected network needs to be TYPE_MOBILE.
This eliminates checking on connecting to secondary networks like
FOTA, MMS, SUPL ...
This reduces unnecessary attempts to bring up multiple connections at
the same time. Especially in the light of the trouble we're having with HFA
on Sprint, where we don't want to connect to any other network until HFA
has completed.
Bug: 10758001
Change-Id: Id294536b70304a51de4752bc1a4ffac734f10f1a
1. If a print service does not export its activities for settings and
adding printers the print spooler ignores them instead of crashing.
Also if the service is not enabled its activities are now ignored.
2. Added a dedicated permission for a print service to optionally
protect its settings and add printer activities such that only the
system can bind to them.
3. Fixed a crash in the print dialog if its content is detached
from the window and animators are running.
bug:10680224
Change-Id: I20b57d6622a15f9b2352ba78d04c44e67b316a15
Dumb typo was clearing the wrong service array, causing
us to sometimes forget we were launching a service.
Change-Id: Ie1aba0e07d19e85a104a5985e3cead5f28a0556a
This significantly reworks the logging we do when
all cached processes are killed:
- We now collect the list of processes in-place so we
have a snapshot of exactly when the low memory situation
happened.
- In that snapshot we include the key process state: oom
adj, proc state, adj reasons.
- The report then asynchronously collects pss information
for those processes.
- The ultimate data printed to the log looks like a mix
between the "dumpsys meminfo" and "dumpsys activity"
output. This code no longer uses "dumpsys meminfo"
itself, so some of that data is no longer included,
in particular pss organized by allocation type.
In doing this, I realized that the existing code that is
supposed to run "procstats" is not currently working. And
at that point I realized, really, when we are collecting
this pss data we'd really like to include all those native
processes using ghod-only-knows how much RAM. And guess
what, we have a list of processes available in
ProcessCpuTracker.
So we now also collect and print information for native
processes, and we also do this for "dumpsys meminfo" which
really seems like a good thing when we are printing summaries
of all pss and such.
I also improved the code for reading /proc/meminfo to be
able to load all the interesting fields from there, and
am now printing that as well.
Change-Id: I9e7d13e9c07a8249c7a7e12e5433973b2c0fdc11
Because recents sits on the same stack as launcher it can sometimes be
above launcher. When we were launching home activity because the flag
told us to we would sometimes launch recents instead. This fix makes
sure that the home activity is on the top when it is supposed to be
launched next.
Previously this was fixed by having recents move itself to the back
of the stack after it launched an activity (b/9750207 and ag/336019).
But that solution caused the AppTransition to be set to
TRANSIT_TASK_TO_BACK which left the SOFT_INPUT_IS_FORWARD_NAVIGATION
flag unset. This in turn caused IMEs to remain unlaunched when
returning from recents (b/10240567).
Fixes bug 10240567.
Change-Id: I35c6619af0e68d0e6d9ab87cad06ea7c27e11e27