issue #2304:accelerometer fix of mac
Merge pull request #2936 from minggo/iss2304-refator-cclayer

issue #2304:accelerometer fix of mac