copied from galaxy-nexus