Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ import java.util.Objects; * {@link AutofillManagerServiceImpl} itself. */ public final class AutofillManagerService extends AbstractMasterSystemService<AutofillManagerServiceImpl> { extends AbstractMasterSystemService<AutofillManagerService, AutofillManagerServiceImpl> { private static final String TAG = "AutofillManagerService"; Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ import java.util.Random; * */ final class AutofillManagerServiceImpl extends AbstractPerUserSystemService<AutofillManagerServiceImpl> { extends AbstractPerUserSystemService<AutofillManagerServiceImpl, AutofillManagerService> { private static final String TAG = "AutofillManagerServiceImpl"; private static final int MAX_SESSION_ID_CREATE_TRIES = 2048; Loading services/core/java/com/android/server/AbstractMasterSystemService.java +3 −2 Original line number Diff line number Diff line Loading @@ -62,13 +62,14 @@ import java.util.List; * <p>See {@code com.android.server.autofill.AutofillManagerService} for a concrete * (no pun intended) example of how to use it. * * @param <M> "master" service class. * @param <S> "real" service class. * * @hide */ // TODO(b/117779333): improve javadoc above instead of using Autofill as an example public abstract class AbstractMasterSystemService<S extends AbstractPerUserSystemService<S>> extends SystemService { public abstract class AbstractMasterSystemService<M extends AbstractMasterSystemService<M, S>, S extends AbstractPerUserSystemService<S, M>> extends SystemService { /** * Log tag Loading services/core/java/com/android/server/AbstractPerUserSystemService.java +7 −5 Original line number Diff line number Diff line Loading @@ -41,17 +41,19 @@ import java.io.PrintWriter; * Companion for {@link AbstractMasterSystemService}, it's the base class for the "real" service * implementation. * * @param <S> itself * @param <M> "master" service class. * @param <S> "real" service class. * * @hide */ public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSystemService<S>> { public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSystemService<S, M>, M extends AbstractMasterSystemService<M, S>> { protected final @UserIdInt int mUserId; protected final Object mLock; protected final String mTag = getClass().getSimpleName(); protected final AbstractMasterSystemService<S> mMaster; protected final M mMaster; /** * Whether service was disabled for user due to {@link UserManager} restrictions. Loading @@ -68,8 +70,8 @@ public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSyst @GuardedBy("mLock") private ServiceInfo mServiceInfo; protected AbstractPerUserSystemService(@NonNull AbstractMasterSystemService<S> master, @NonNull Object lock, @UserIdInt int userId) { protected AbstractPerUserSystemService(@NonNull M master, @NonNull Object lock, @UserIdInt int userId) { mMaster = master; mLock = lock; mUserId = userId; Loading services/intelligence/java/com/android/server/intelligence/IntelligenceManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ import java.util.List; * <p>The data collected by this service can be analyzed and combined with other sources to provide * contextual data in other areas of the system such as Autofill. */ public final class IntelligenceManagerService extends AbstractMasterSystemService<IntelligencePerUserService> { public final class IntelligenceManagerService extends AbstractMasterSystemService<IntelligenceManagerService, IntelligencePerUserService> { private static final String TAG = "IntelligenceManagerService"; Loading Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ import java.util.Objects; * {@link AutofillManagerServiceImpl} itself. */ public final class AutofillManagerService extends AbstractMasterSystemService<AutofillManagerServiceImpl> { extends AbstractMasterSystemService<AutofillManagerService, AutofillManagerServiceImpl> { private static final String TAG = "AutofillManagerService"; Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ import java.util.Random; * */ final class AutofillManagerServiceImpl extends AbstractPerUserSystemService<AutofillManagerServiceImpl> { extends AbstractPerUserSystemService<AutofillManagerServiceImpl, AutofillManagerService> { private static final String TAG = "AutofillManagerServiceImpl"; private static final int MAX_SESSION_ID_CREATE_TRIES = 2048; Loading
services/core/java/com/android/server/AbstractMasterSystemService.java +3 −2 Original line number Diff line number Diff line Loading @@ -62,13 +62,14 @@ import java.util.List; * <p>See {@code com.android.server.autofill.AutofillManagerService} for a concrete * (no pun intended) example of how to use it. * * @param <M> "master" service class. * @param <S> "real" service class. * * @hide */ // TODO(b/117779333): improve javadoc above instead of using Autofill as an example public abstract class AbstractMasterSystemService<S extends AbstractPerUserSystemService<S>> extends SystemService { public abstract class AbstractMasterSystemService<M extends AbstractMasterSystemService<M, S>, S extends AbstractPerUserSystemService<S, M>> extends SystemService { /** * Log tag Loading
services/core/java/com/android/server/AbstractPerUserSystemService.java +7 −5 Original line number Diff line number Diff line Loading @@ -41,17 +41,19 @@ import java.io.PrintWriter; * Companion for {@link AbstractMasterSystemService}, it's the base class for the "real" service * implementation. * * @param <S> itself * @param <M> "master" service class. * @param <S> "real" service class. * * @hide */ public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSystemService<S>> { public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSystemService<S, M>, M extends AbstractMasterSystemService<M, S>> { protected final @UserIdInt int mUserId; protected final Object mLock; protected final String mTag = getClass().getSimpleName(); protected final AbstractMasterSystemService<S> mMaster; protected final M mMaster; /** * Whether service was disabled for user due to {@link UserManager} restrictions. Loading @@ -68,8 +70,8 @@ public abstract class AbstractPerUserSystemService<S extends AbstractPerUserSyst @GuardedBy("mLock") private ServiceInfo mServiceInfo; protected AbstractPerUserSystemService(@NonNull AbstractMasterSystemService<S> master, @NonNull Object lock, @UserIdInt int userId) { protected AbstractPerUserSystemService(@NonNull M master, @NonNull Object lock, @UserIdInt int userId) { mMaster = master; mLock = lock; mUserId = userId; Loading
services/intelligence/java/com/android/server/intelligence/IntelligenceManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ import java.util.List; * <p>The data collected by this service can be analyzed and combined with other sources to provide * contextual data in other areas of the system such as Autofill. */ public final class IntelligenceManagerService extends AbstractMasterSystemService<IntelligencePerUserService> { public final class IntelligenceManagerService extends AbstractMasterSystemService<IntelligenceManagerService, IntelligencePerUserService> { private static final String TAG = "IntelligenceManagerService"; Loading