change scala code for DeviceType for API 1.3