How to identify whether the device on AWS devicefarm where the scripts are running is tablet or phone

I am executing my appium java test cases on AWS devicefarm but the size of screen in tablet and phone is different due to which the script is failing as locator is also changing.
So locally I have fetched the details of device whether it is tablet or phone then accordingly I have executed the script.
But when I ran the script on the AWS device farm it became difficult.
I have used below capability to fetch the device info

driver.getCapabilities().getCapability(“deviceType”) → it is returning nullpointerexception
driver.getCapabilities().getCapability(“deviceName”) → it is returning some random number which looks like the device Id
driver.getCapabilities().getCapability(“deviceModel”) or driver.getCapabilities().getCapability(“model”) → it is returning nullpointerexception

How to resolve this issue

with iOS you have

with android i see