I understand that this answer was almost a year late, but I hope the following gives a solution for others trying to determine the orientation of their wallpaper:
((WindowManager) this.getApplication().getSystemService(Service.WINDOW_SERVICE)).getDefaultDisplay().getOrientation();
the above code will return an integer equal to Surface.ROTATION_0 , Surface.ROTATION_90 , Surface.ROTATION_180 or Surface.ROTATION_270 .
Note: this refers to WallpaperService .
source share