summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java34
1 files changed, 20 insertions, 14 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 862070adbeee..880f236cbe76 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -216,9 +216,12 @@ final class AutofillManagerServiceImpl {
serviceComponent = ComponentName.unflattenFromString(componentName);
serviceInfo = AppGlobals.getPackageManager().getServiceInfo(serviceComponent,
0, mUserId);
+ if (serviceInfo == null) {
+ Slog.e(TAG, "Bad AutofillService name: " + componentName);
+ }
} catch (RuntimeException | RemoteException e) {
- Slog.e(TAG, "Bad autofill service name " + componentName + ": " + e);
- return;
+ Slog.e(TAG, "Error getting service info for '" + componentName + "': " + e);
+ serviceInfo = null;
}
}
try {
@@ -228,21 +231,24 @@ final class AutofillManagerServiceImpl {
if (sDebug) Slog.d(TAG, "Set component for user " + mUserId + " as " + mInfo);
} else {
mInfo = null;
- if (sDebug) Slog.d(TAG, "Reset component for user " + mUserId);
- }
- final boolean isEnabled = isEnabled();
- if (wasEnabled != isEnabled) {
- if (!isEnabled) {
- final int sessionCount = mSessions.size();
- for (int i = sessionCount - 1; i >= 0; i--) {
- final Session session = mSessions.valueAt(i);
- session.removeSelfLocked();
- }
+ if (sDebug) {
+ Slog.d(TAG, "Reset component for user " + mUserId + " (" + componentName + ")");
}
- sendStateToClients(false);
}
} catch (Exception e) {
- Slog.e(TAG, "Bad AutofillService '" + componentName + "': " + e);
+ Slog.e(TAG, "Bad AutofillServiceInfo for '" + componentName + "': " + e);
+ mInfo = null;
+ }
+ final boolean isEnabled = isEnabled();
+ if (wasEnabled != isEnabled) {
+ if (!isEnabled) {
+ final int sessionCount = mSessions.size();
+ for (int i = sessionCount - 1; i >= 0; i--) {
+ final Session session = mSessions.valueAt(i);
+ session.removeSelfLocked();
+ }
+ }
+ sendStateToClients(false);
}
}