Fix error checking in MemoryFile.

mmap returns MAP_FAILED on failures, not 0 (NULL).
Also, convert some C style casts to C++ since they
make intent clearer.

Change-Id: I367993c73e9ee576f11ebe76e530d2c2f27c662d
Fix to NullPointerException on move back in ActivityStack.

In ActivityTask.moveTaskToBackLocked NullPointerException may occur
when moving back with only current Activity in stack. This due to a
condition that may trigger despite a TaskRecord being null and then
attempt accessing the TaskRecord.mOnTopOfHome variable.

TaskRecord task may be set to null when no resumed activity remain.

Resolved by assuring that flag mOnTopOfHome is instead set to false
for current TaskRecord in case where there are no remaining activities
above home.

The above bug has already been corrected in the following commit,
ada62fca51d314cefe2c5da4e007df5b9abf320d, but it does not set the
cottect value to mTopOfHome for the current taks, see below.

Variable mOnTopOfHome will not be set to false in situations where
stack is of size 1 or less and task is null, perhaps from already
having finished current activity.

To avoid current TaskRecord maintaining value mOnTopOfHome to true
after launching Home this variable is set to false.

Impact should not be major due to correction earlier that makes sure
that there is always a TaskRecord.mOnTopOfHome set to true above Home
activity but if not correctly set for current task still gives a
possibility of bad behavior.

Change-Id: Ie86ad99c188aaa05b0de9d58eaa16c42b6fc4341
ProcessList: use different polling interval when screen off

We are using the same time interval for both screen off and screen on.
For process on top: ActivityManager.PROCESS_STATE_TOP, we will poll PSS
information every 120 sec.
During polling PSS, we are grep /proc/%d/smaps which is a 10k lines file.
This cost quite a lot of CPU resource. But when screen off, we don't need to update
TOP process PSS so frequently since we are not operating it. Lower polling
circle to every 15min to reduce power.

Change-Id: Ia4cd26290d44d066f034d5270ce5523650a3c493
aapt: Support for mxmf file playback

mxmf files couldn't be played.
Added .mxmf file ext to kNoCompressExt array
CRs-Fixed: 465437

Change-Id: I4473380c0aa13f7c18b59aa48f07a87f7849a74c