This fixes a problem where applications could ask the location
manager to do very heavy-weight things (like... say... update
location every minute), which would get accounted against the
system instead of the application because ultimately it is the
system making the heavy calls (wake locks, etc).
To solve this, we introduce a new class WorkSource representing
the source of some work. Wake locks and Wifi locks allow you
to set the source to use (but only if you are system code and thus
can get the permission to do so), which is what will be reported
to the battery stats until the actual caller.
For the initial implementation, the location manager keeps track
of all clients requesting periodic updates, and tells its providers
about them as a WorkSource param when setting their min update time.
The network location provider uses this to set the source on the
wake and wifi locks it acquires, when doing work because of the
update period.
This should also be used elsewhere, such as in the GPS provider,
but this is a good start.
Change-Id: I2b6ffafad9e90ecf15d7c502e2db675fd52ae3cf
- Use a constant input level to the reverb engine and implement volume control in the
insert reverb. This avoids the volume spikes when an effect that was inserted after
the reverb is disabled or removed.
- Fix clicks (one silent buffer) at the end of the reverb disable period.
- Modified volume management in audioflinger so that the volume ramp is also done by
the insert effect if present when the track is paused (avoids clicks).
- Increased room level for all presets.
Also fixed problems with output stage session (-1):
- effect bundle wrapper was not designed to support session -1
- the permission check in audioflinger for using session -1 failed due to a wrong usage of
getCallingPid()
Change-Id: Id1ff51327263364bf71d3f2668fa5cde4311d84f
This change is essentially a rewrite of the main input dispatcher loop
with the target identification folded in. Since the input dispatcher now
has all of the window state, it can make better decisions about
when to ANR.
Added a .5 second deadline for processing app switch keys. This behavior
predates Gingerbread but had not previously been ported.
Fixed some timing inaccuracies in the ANR accounting that could cause
applications to ANR sooner than they should have.
Added a mechanism for tracking key and motion events that have been
dispatched to a window so that appropriate cancelation events can be
synthesized when recovering from ANR. This change helps to keep
applications in sync so they don't end up with stuck buttons upon
recovery from ANRs.
Added more comments to describe the tricky parts of PollLoop.
Change-Id: I13dffca27acb436fc383980db536abc4d8b9e6f1
Moves the remoteNativeLibrariesLI call to NativeLibraryHelper to prepare
for being able to symlink the /data/data/<package>/lib dir to the ASEC
container.
Change-Id: Ie3648509c6b6293a8d9bdd815610ab408df5047f
During boot-up we weren't paying attention to the nativeLibraryPath that
was read from the package settings XML file which reset the path to the
default /data/data/<package>/lib directory.
This adds nativeLibraryPath as an argument to the PackageSettings
constructor and related functions that will pull that value in from the
settings file.
It also removes the call to nativeLibraryDir.mkdir() which installd does
by itself.
Change-Id: I53db73c3b1bc90997a4a73f7f2fbaee125e6f67e
We weren't logging strictmode violation in the system_server process
in non-user builds (only system apps), even though the rest of the
strictmode logging supports it.
Also add a missing lock in ActivityManagerService.
Change-Id: If2af96a7e4fdde604a647b836097f0029ef1334b
The activity manager looks for cases where one app launches immediately
after another. If this happens, a brief toast is shown telling the user
when app is actually running and what was originally starting.
Change-Id: If94cf5bd393dd0bc0f09789dae044fde1386c481
Apps can report if they like their connection to the nets
and we display either not-really-connected or fully-connected
icons. Final icons TBD.
bug:2978624
Change-Id: I28be52085edfe54571c0d4559aba0df883548654
For the duration of the wake lock, 50% of all CPU usage is now
accounted against the app(s) holding partial wake locks, evenly
distributed between them. This is only while the device is on
battery and screen off.
Change-Id: I3e5c978b792b6ef17bf8540705bfe8343dadd464
Fix for bug 2382830: new incoming SMS should not be rejected when
running low on internal phone storage.
Testing revealed that the /data partition should have at least 256 KiB
available in order to prevent random app crashes (including system apps)
due to SQLite transaction failures. With 256 KiB free, the device should
safely boot without storage full errors. This takes into account the
36-40 KiB that the YAFFS2 filesystem reports as available even after
the partition has been completely filled. I've set the default full
threshold to 1 MiB to provide a generous safety margin.
For this bug, I changed the DeviceStorageMonitorService demon to send
two new hidden notifications for device storage "full" and "not full",
when the free space falls below the full threshold (default 1 MiB,
but configurable as a system setting), in addition to the existing
storage low/okay notifications sent when the storage crosses the threshold
of 90% full (also configurable).
The SMS code was changed to use these new notifications so that it can
accept messages until the data partition has been filled to the maximum
safe capacity rather than stopping when it hits 90% full. There should
be no negative impact on battery life because the additional check in
the storage polling service should be offset by an optimization to cache
the free threshold values which were previously being computed every time
through the loop.
While testing this change, I discovered that SMSDispatcher was being
instantiated twice, the first time in GSMPhone/CDMAPhone, and the second
time in SimSmsInterfaceManager / RuimSmsInterfaceManager. Changed the code
to pass the original SMSDispatcher to the Sim/RuimSmsInterfaceManager
constructor.
Change-Id: Ie0c6d05294778ab6ee42e0fa01313af96d824c77
Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the
input manager whenever another visible window is partly or wholly obscured
the target of a touch event so that applications can filter touches
accordingly.
Added a "filterTouchesWhenObscured" attribute to View which can be used to
enable filtering of touches when the view's window is obscured.
Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
Up the blocking queue maximum to twice the number of containers we
allow which should let "asec list" complete without blocking the thread
several times.
Change the threads for the NativeDaemonConnector to vold and netd to be
more descriptive instead of the same name.
Bug: 2501075
Change-Id: I7e7949845a6c70a3d619aec0fa79ceef3c17a4be
The buffer was being compacted in the read loop, but the start offset on
the compacted buffer wasn't being considered after the next read.
Bug: 2501075
Change-Id: I163297d751cf800d0bbc66df66b1a0fa0785de49
The *pReplyData argument of the command() function was left unitialized by EffectHandle::command()
when command was EFFECT_CMD_ENABLE, EFFECT_CMD_DISABLE and EFFECT_CMD_SET_PARAM_COMMIT.
Change-Id: I91a19817ead2a8cfbdd8e2d77ca270c7ce9d5bd4
A logic error would allow not deleting data when uninstalling a system
app upgrade that's of a newer release than the on on the system
partition. If the system app had a database upgrade and this happened,
you might be in trouble.
Luckily it appears no one ever does this in code. You'd have to manually
get there doing:
adb uninstall -k updated.system.package
Change-Id: I3110fedf2d147975a0635c71898d985dd642a2c1
A few lines down "ps" is run through a null check, so apparently there
could be some screwy system conditions where this is encountered. And,
in fact, this was encountered through an updated system pacakge that
managed to delete the package from /system/app during testing. It left
the PackageSetting in mDisabledSysPackages which would cause a deference
of a null variable.
Change-Id: Ic7faca569abd16a87a8a69c20df08c11a274a001
- Collect data at better times.
- Collect per-thread CPU usage as soon as possible after the ANR, and print
in log.
- Based on new per-thread CPU usage, limit the number of processes we
collect stacks from to not include inactive not interesting procs.
- Improve the way ProcessStats compute and reports its data.
Change-Id: I12b17fb47d593d175be69bb792c1f57179bf4fdf
- Fixed click when re-enabling effect during the turn off phase:
make sure the effect states where effect is processed are the same
where volume control is delegated to effect.
- Fixed click when effect is deleted while still active: do not apply
volume ramp if an effect having volume control was just removed from the
effect chain.
Also fixed a crash when PCM dump is enabled in effect bundle wrapper.
Change-Id: Ib562f5cf75c69af75df0e862536262e2514493e4
Finished the input device capability API.
Added a mechanism for calibrating touch devices to obtain more
accurate information about the touch contact area.
Improved pointer location to show new coordinates and capabilities.
Optimized pointer location display and formatting to avoid allocating large
numbers of temporary objects. The GC churn was causing the application to
stutter very badly when more than a couple of fingers were down).
Added more diagnostics.
Change-Id: Ie25380278ed6f16c5b04cd9df848015850383498
Also removes the artifical restriction that only one apply() can be in
flight at once. That was old from when I thought it'd end up being
required, but wasn't.
Change-Id: I3540ea8be6e0760d6a51d218186f71655c2f3f55
* Add native library tests during package move
* Fix omission that let PackageSettings and ApplicationInfo get out of
sync.
Change-Id: Ic4958f971cb2c9cfd270522fdc120b4031c1124a