Copy from intel aosp project.