Clean up app restrictions when removing DO or PO

+ don't send broadcast when clearing already empty restrictions.

Bug: 149075700
Test: manual, set TestDPC as a DO, set restriction, remove DO.
Test: manual, set TestDPC in COMP, set restriction, migrate to COPE.
Change-Id: Ib85ee3937c43cde1cca0dad8117cd0f8dd642fd8
5 files changed