pre kitkat audio legacy poliy fix for hotword (ok google)

Change-Id: I5bb90fb90f373461a98609226a5cea50ac5266e9
DO NOT MERGE - NuPlayer: open audio sink in offload mode when resuming from timeout teardown.

Also always recheck if a new stream can do offload.

Bug: 18154425
Change-Id: I121877834bd963eeeba91a2b951fd30d5dc36a8b
nuplayer: Fix build

 * Fix call to canOffloadStream. Wrong patch version got merged.

Change-Id: I568b9182b70797a8545003880cb726fa5cd09a96
Fix double close.

This patch will fix the double close issue in SoundPool::doLoad():

        status = MediaPlayer::decode(mFd, mOffset, mLength, &sampleRate, &numChannels, &format,
                                     mHeap, &mSize);
        ALOGV("close(%d)", mFd);
        ::close(mFd);
        mFd = -1;

In MediaPlayerService::decode() which is called directly by
MediaPlayer::decode(), the fd will be closed, and after it return, the
mFd will be closed again.

When the system is idle, the second close will fail with EBADFD, but if
the system is busy, the mFd will be reused with another open/socket/pipe
system call, and the second close will cause errors.

Change-Id: If709515392cd490fea569658202524c51f8df785
Signed-off-by: Bao Haojun <baohaojun@gmail.com>
Signed-off-by: Wang Liang <wangliang@smartisan.cn>