Add uninstall option in the capabilities confirm dialog

Uninstall option is visible only when the application of the
service is not system App. It provides an efficient way to
uninstall the App if users are shocked with the perimssions
they need to grant.

Bug: 176877955
Test: Install an App with AccessibilityService and uninstall
it with this option.

Change-Id: I6b60cc56d8d34c2983458a676b500035551ec9df
This commit is contained in:
ryanlwlin
2021-01-26 20:18:34 +08:00
parent 9a90dc1e8e
commit 4806a38516
4 changed files with 118 additions and 8 deletions

View File

@@ -381,4 +381,13 @@ final class AccessibilityUtil {
return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, screenHeightDp,
resources.getDisplayMetrics()));
}
/**
* Indicates if the accessibility service belongs to a system App.
* @param info AccessibilityServiceInfo
* @return {@code true} if the App is a system App.
*/
public static boolean isSystemApp(@NonNull AccessibilityServiceInfo info) {
return info.getResolveInfo().serviceInfo.applicationInfo.isSystemApp();
}
}