Fix SystemCaptionsManagerService to re-bind after a force stop

This change also fixes a bug in AbstractMasterSystemService where
following a "force stop", the per-user service was not updated if PACKAGE_RESTART_POLICY_REFRESH_EAGER was specified. These behavior resulted with getServiceComponentName returning null and the service not being restarted.

Bug: 160735520
Bug: 160693548
Bug: 160644088
Change-Id: I2f66273bd90e9bb220f799d8ab3b024637b33c24
Test: Manually
This commit is contained in:
Nadav Bar
2020-08-06 12:25:19 +03:00
parent 9547241ba1
commit 762e0f9a2e
2 changed files with 3 additions and 2 deletions

View File

@@ -949,7 +949,7 @@ public abstract class AbstractMasterSystemService<M extends AbstractMasterSystem
if (debug) { if (debug) {
Slog.d(mTag, "Eagerly recreating service for user " + userId); Slog.d(mTag, "Eagerly recreating service for user " + userId);
} }
getServiceForUserLocked(userId); updateCachedServiceLocked(userId);
} }
} }
onServicePackageRestartedLocked(userId); onServicePackageRestartedLocked(userId);

View File

@@ -34,7 +34,8 @@ public final class SystemCaptionsManagerService extends
context, context,
com.android.internal.R.string.config_defaultSystemCaptionsManagerService), com.android.internal.R.string.config_defaultSystemCaptionsManagerService),
/*disallowProperty=*/ null, /*disallowProperty=*/ null,
/*packageUpdatePolicy=*/ PACKAGE_UPDATE_POLICY_REFRESH_EAGER); /*packageUpdatePolicy=*/ PACKAGE_UPDATE_POLICY_REFRESH_EAGER
| PACKAGE_RESTART_POLICY_REFRESH_EAGER);
} }
@Override @Override