Handle remote categories in a ForeignDBRepo setup

Depends on core patch Ice972f023c676b5857707ccf58ee108585a7f021

Bug: 56598
Change-Id: Icbffecfa4d3679c1a5a3560ac085dd3775290a6d