issue #2304:use function to simplify acceremeter call back
Merge pull request #2929 from minggo/iss2304-refator-cclayer

issue #2304:use function to simplify acceremeter call back