Merge "Check permissions on getDeviceId."