Loading services/core/java/com/android/server/appop/AppOpsService.java +3 −2 Original line number Diff line number Diff line Loading @@ -1059,7 +1059,7 @@ public class AppOpsService extends IAppOpsService.Stub { if (Flags.enableAllSqliteAppopsAccesses()) { mHistoricalRegistry = new HistoricalRegistrySql(context); } else { mHistoricalRegistry = new HistoricalRegistry(this, context); mHistoricalRegistry = new LegacyHistoricalRegistry(this, context); } } Loading Loading @@ -7011,7 +7011,8 @@ public class AppOpsService extends IAppOpsService.Stub { mHistoricalRegistry = new HistoricalRegistrySql( (HistoricalRegistrySql) mHistoricalRegistry); } else { mHistoricalRegistry = new HistoricalRegistry((HistoricalRegistry) mHistoricalRegistry); mHistoricalRegistry = new LegacyHistoricalRegistry( (LegacyHistoricalRegistry) mHistoricalRegistry); } mHistoricalRegistry.systemReady(mContext.getContentResolver()); Loading services/core/java/com/android/server/appop/DiscreteOpsRegistry.java +2 −3 Original line number Diff line number Diff line Loading @@ -82,9 +82,8 @@ import java.util.Set; * INITIALIZATION: We can initialize persistence only after the system is ready * as we need to check the optional configuration override from the settings * database which is not initialized at the time the app ops service is created. This class * relies on {@link HistoricalRegistry} for controlling that no calls are allowed until then. All * outside calls are going through {@link HistoricalRegistry}. * * relies on {@link LegacyHistoricalRegistry} for controlling that no calls are allowed until then. * All outside calls are going through {@link LegacyHistoricalRegistry}. */ abstract class DiscreteOpsRegistry { private static final String TAG = DiscreteOpsRegistry.class.getSimpleName(); Loading services/core/java/com/android/server/appop/DiscreteOpsXmlRegistry.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ import java.util.Set; * THREADING AND LOCKING: * For in-memory transactions this class relies on {@link DiscreteOpsXmlRegistry#mInMemoryLock}. * It is assumed that the same lock is used for in-memory transactions in {@link AppOpsService}, * {@link HistoricalRegistry}, and {@link DiscreteOpsXmlRegistry }. * {@link LegacyHistoricalRegistry}, and {@link DiscreteOpsXmlRegistry }. * {@link DiscreteOpsRegistry#recordDiscreteAccess} must only be called while holding this lock. * {@link DiscreteOpsXmlRegistry#mOnDiskLock} is used when disk transactions are performed. * It is very important to release {@link DiscreteOpsXmlRegistry#mInMemoryLock} as soon as Loading services/core/java/com/android/server/appop/HistoricalRegistry.java→services/core/java/com/android/server/appop/LegacyHistoricalRegistry.java +10 −10 Original line number Diff line number Diff line Loading @@ -128,11 +128,11 @@ import java.util.concurrent.TimeUnit; */ // TODO (bug:122218838): Make sure we handle start of epoch time // TODO (bug:122218838): Validate changed time is handled correctly final class HistoricalRegistry implements HistoricalRegistryInterface { final class LegacyHistoricalRegistry implements HistoricalRegistryInterface { private static final boolean DEBUG = false; private static final boolean KEEP_WTF_LOG = Build.IS_DEBUGGABLE; private static final String LOG_TAG = HistoricalRegistry.class.getSimpleName(); private static final String LOG_TAG = LegacyHistoricalRegistry.class.getSimpleName(); private static final String PARAMETER_DELIMITER = ","; private static final String PARAMETER_ASSIGNMENT = "="; Loading Loading @@ -200,7 +200,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { private final Context mContext; HistoricalRegistry(@NonNull Object lock, Context context) { LegacyHistoricalRegistry(@NonNull Object lock, Context context) { mInMemoryLock = lock; mContext = context; if (Flags.enableSqliteAppopsAccesses()) { Loading @@ -210,7 +210,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { } } HistoricalRegistry(@NonNull HistoricalRegistry other) { LegacyHistoricalRegistry(@NonNull LegacyHistoricalRegistry other) { this(other.mInMemoryLock, other.mContext); mMode = other.mMode; mBaseSnapshotInterval = other.mBaseSnapshotInterval; Loading Loading @@ -805,7 +805,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { private void schedulePersistHistoricalOpsMLocked(@NonNull HistoricalOps ops) { final Message message = PooledLambda.obtainMessage( HistoricalRegistry::persistPendingHistory, HistoricalRegistry.this); LegacyHistoricalRegistry::persistPendingHistory, LegacyHistoricalRegistry.this); message.what = MSG_WRITE_PENDING_HISTORY; IoThread.getHandler().sendMessage(message); mPendingWrites.offerFirst(ops); Loading Loading
services/core/java/com/android/server/appop/AppOpsService.java +3 −2 Original line number Diff line number Diff line Loading @@ -1059,7 +1059,7 @@ public class AppOpsService extends IAppOpsService.Stub { if (Flags.enableAllSqliteAppopsAccesses()) { mHistoricalRegistry = new HistoricalRegistrySql(context); } else { mHistoricalRegistry = new HistoricalRegistry(this, context); mHistoricalRegistry = new LegacyHistoricalRegistry(this, context); } } Loading Loading @@ -7011,7 +7011,8 @@ public class AppOpsService extends IAppOpsService.Stub { mHistoricalRegistry = new HistoricalRegistrySql( (HistoricalRegistrySql) mHistoricalRegistry); } else { mHistoricalRegistry = new HistoricalRegistry((HistoricalRegistry) mHistoricalRegistry); mHistoricalRegistry = new LegacyHistoricalRegistry( (LegacyHistoricalRegistry) mHistoricalRegistry); } mHistoricalRegistry.systemReady(mContext.getContentResolver()); Loading
services/core/java/com/android/server/appop/DiscreteOpsRegistry.java +2 −3 Original line number Diff line number Diff line Loading @@ -82,9 +82,8 @@ import java.util.Set; * INITIALIZATION: We can initialize persistence only after the system is ready * as we need to check the optional configuration override from the settings * database which is not initialized at the time the app ops service is created. This class * relies on {@link HistoricalRegistry} for controlling that no calls are allowed until then. All * outside calls are going through {@link HistoricalRegistry}. * * relies on {@link LegacyHistoricalRegistry} for controlling that no calls are allowed until then. * All outside calls are going through {@link LegacyHistoricalRegistry}. */ abstract class DiscreteOpsRegistry { private static final String TAG = DiscreteOpsRegistry.class.getSimpleName(); Loading
services/core/java/com/android/server/appop/DiscreteOpsXmlRegistry.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ import java.util.Set; * THREADING AND LOCKING: * For in-memory transactions this class relies on {@link DiscreteOpsXmlRegistry#mInMemoryLock}. * It is assumed that the same lock is used for in-memory transactions in {@link AppOpsService}, * {@link HistoricalRegistry}, and {@link DiscreteOpsXmlRegistry }. * {@link LegacyHistoricalRegistry}, and {@link DiscreteOpsXmlRegistry }. * {@link DiscreteOpsRegistry#recordDiscreteAccess} must only be called while holding this lock. * {@link DiscreteOpsXmlRegistry#mOnDiskLock} is used when disk transactions are performed. * It is very important to release {@link DiscreteOpsXmlRegistry#mInMemoryLock} as soon as Loading
services/core/java/com/android/server/appop/HistoricalRegistry.java→services/core/java/com/android/server/appop/LegacyHistoricalRegistry.java +10 −10 Original line number Diff line number Diff line Loading @@ -128,11 +128,11 @@ import java.util.concurrent.TimeUnit; */ // TODO (bug:122218838): Make sure we handle start of epoch time // TODO (bug:122218838): Validate changed time is handled correctly final class HistoricalRegistry implements HistoricalRegistryInterface { final class LegacyHistoricalRegistry implements HistoricalRegistryInterface { private static final boolean DEBUG = false; private static final boolean KEEP_WTF_LOG = Build.IS_DEBUGGABLE; private static final String LOG_TAG = HistoricalRegistry.class.getSimpleName(); private static final String LOG_TAG = LegacyHistoricalRegistry.class.getSimpleName(); private static final String PARAMETER_DELIMITER = ","; private static final String PARAMETER_ASSIGNMENT = "="; Loading Loading @@ -200,7 +200,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { private final Context mContext; HistoricalRegistry(@NonNull Object lock, Context context) { LegacyHistoricalRegistry(@NonNull Object lock, Context context) { mInMemoryLock = lock; mContext = context; if (Flags.enableSqliteAppopsAccesses()) { Loading @@ -210,7 +210,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { } } HistoricalRegistry(@NonNull HistoricalRegistry other) { LegacyHistoricalRegistry(@NonNull LegacyHistoricalRegistry other) { this(other.mInMemoryLock, other.mContext); mMode = other.mMode; mBaseSnapshotInterval = other.mBaseSnapshotInterval; Loading Loading @@ -805,7 +805,7 @@ final class HistoricalRegistry implements HistoricalRegistryInterface { private void schedulePersistHistoricalOpsMLocked(@NonNull HistoricalOps ops) { final Message message = PooledLambda.obtainMessage( HistoricalRegistry::persistPendingHistory, HistoricalRegistry.this); LegacyHistoricalRegistry::persistPendingHistory, LegacyHistoricalRegistry.this); message.what = MSG_WRITE_PENDING_HISTORY; IoThread.getHandler().sendMessage(message); mPendingWrites.offerFirst(ops); Loading