For secure content the MM heap should never be
mapped in userspace. Add a flag to avoid
doing this for rotator which does not need
userspace mapping.
(cherry picked from commit 8d9f2fa336564d5a021dd932f5619b5f389d5fad)
Change-Id: I17d1faa40859e261518d928089f2ce86084d31fd
CRs-fixed: 332402
It is possible to use this object from multiple threads
and there could be a race between a failure in one thread
and another method call from a different thread which would
result in system calls being called with an invalid fd.
(cherry picked from commit 560ca6e8feb4f52c9aade34fa7cfcfed55288083)
Change-Id: Iefb94ba1ee7177ab20600bee4374daf8e818bdb9
Several ioctl calls were returning -1 instead of -errno,
which may confuse upper layers, especially when the error
is -ENOMEM. Also move some existing "err = -errno" calls
to the top of if statements so that errno cannot change
by libc calls in the error handling code.
(cherry picked from commit a8eda532452651eb1fbae419319455de2a078ef0)
Change-Id: I181f98d5a261e8e3e1b3f6ecd3ba288e7b4b5607