Exclude packages that's not installed from the hash for role.

Otherwise we won't detect the change when a package is set to
installed for an user.

Also added the number of enabled components to the hash so that when
an enabled component get disabled but the order didn't change, we can
still detect the change.

Fixes: 129004850
Test: follow the repro step in b/129004850 and confirm it's fixed
Change-Id: I87d62daf0f6a4d34939ee03ee783e9bdb19bf558
3 files changed