[SettingsProvider] fix memory usage counting when owning packages change

Previously, we didn't consider the case where a setting can be owned by
package A, and then owned by package B. The memory usage counting for
both packages should be updated accordingly.

FIXES: 277595081
Test: atest com.android.providers.settings.SettingsStateTest

Change-Id: I6eb5adc4ee571f88380ad2be8f40170e169db820
2 files changed