Dynamic update a11y settings when a11y service target is disabled

Root cause: A11y settings only handle the package install/uninstall/update, but it does not observe the component status.
Solution: Add onPackageModified() to refresh the list.

Bug: 264697450
Test: Manual test
Change-Id: I779c4ba87c6f54616e9c4c6378db91d9ff611b24
This commit is contained in:
menghanli
2023-01-07 09:20:49 +08:00
parent 58c3318e19
commit 556bfd4c60

View File

@@ -31,6 +31,7 @@ import android.text.TextUtils;
import android.util.ArrayMap;
import android.view.accessibility.AccessibilityManager;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
@@ -113,6 +114,11 @@ public class AccessibilitySettings extends DashboardFragment {
sendUpdate();
}
@Override
public void onPackageModified(@NonNull String packageName) {
sendUpdate();
}
@Override
public void onPackageAppeared(String packageName, int reason) {
sendUpdate();