device: input: hide categories if empty

Change-Id: I69aa2ae56cd4c8446e85baf5f8fad9691a3cf09c