Home
last modified time | relevance | path

Searched refs:mInjector (Results 1 – 25 of 26) sorted by relevance

12

/art/libartservice/service/javatests/com/android/server/art/prereboot/
DPreRebootStatsReporterTest.java57 @Mock private PreRebootStatsReporter.Injector mInjector; field in PreRebootStatsReporterTest
69 lenient().when(mInjector.getFilename()).thenReturn(mTempFile.getAbsolutePath()); in setUp()
71 lenient().when(mInjector.getPackageManagerLocal()).thenReturn(mPackageManagerLocal); in setUp()
72 lenient().when(mInjector.getArtManagerLocal()).thenReturn(mArtManagerLocal); in setUp()
77 var reporter = new PreRebootStatsReporter(mInjector); in testSuccess()
79 doReturn(50l).when(mInjector).getCurrentTimeMillis(); in testSuccess()
88 doReturn(200l).when(mInjector).getCurrentTimeMillis(); in testSuccess()
102 var reporterInChroot = new PreRebootStatsReporter(mInjector); in testSuccess()
120 doReturn(300l).when(mInjector).getCurrentTimeMillis(); in testSuccess()
138 doReturn(400l).when(mInjector).getCurrentTimeMillis(); in testSuccess()
[all …]
/art/libartservice/service/java/com/android/server/art/
DArtManagerLocal.java131 @NonNull private final Injector mInjector; field in ArtManagerLocal
146 mInjector = new Injector(); in ArtManagerLocal()
161 mInjector = new Injector(this, context); in ArtManagerLocal()
167 mInjector = injector; in ArtManagerLocal()
187 return new ArtShellCommand(this, mInjector.getPackageManagerLocal(), mInjector.getContext()) in handleShellCommand()
215 try (var pin = mInjector.createArtdPin()) { in deleteDexoptArtifacts()
218 mInjector.getArtFileManager().getWritableArtifacts(pkgState, pkg, in deleteDexoptArtifacts()
224 freedBytes += mInjector.getArtd().deleteArtifacts(artifacts); in deleteDexoptArtifacts()
227 freedBytes += mInjector.getArtd().deleteRuntimeArtifacts(runtimeArtifacts); in deleteDexoptArtifacts()
270 mInjector.getArtFileManager().getDexAndAbis(pkgState, pkg, in getDexoptStatus()
[all …]
DPreRebootDexoptJob.java69 @NonNull private final Injector mInjector; field in PreRebootDexoptJob
94 mInjector = injector; in PreRebootDexoptJob()
100 JobInfo pendingJob = mInjector.getJobScheduler().getPendingJob(JOB_ID); in onStartJob()
162 mInjector.getStatsReporter().recordJobNotScheduled( in onUpdateReadyStartNow()
166 mInjector.getStatsReporter().recordJobScheduled(false /* isAsync */, isOtaUpdate()); in onUpdateReadyStartNow()
172 mInjector.getPreRebootDriver().test(); in test()
204 mInjector.getStatsReporter().recordJobNotScheduled( in scheduleLocked()
229 result = mInjector.getJobScheduler().schedule(info); in scheduleLocked()
236 mInjector.getStatsReporter().recordJobScheduled(true /* isAsync */, isOtaUpdate()); in scheduleLocked()
240 mInjector.getStatsReporter().recordJobNotScheduled( in scheduleLocked()
[all …]
DDexopter.java74 @NonNull protected final Injector mInjector; field in Dexopter
84 mInjector = injector; in Dexopter()
121 if (mInjector.isPreReboot() && !isDexFileFound(dexInfo)) { in dexopt()
130 mInjector.getDexMetadataHelper().getDexMetadataInfo(buildDmPath(dexInfo)); in dexopt()
158 mInjector.getArtd().deleteProfile(profile); in dexopt()
211 if (mInjector.isPreReboot()) { in dexopt()
216 if (mInjector.getArtd().getArtifactsVisibility(existingArtifacts) in dexopt()
250 && mInjector.getStorageManager().getAllocatableBytes( in dexopt()
261 mInjector.getArtd().createCancellationSignal(); in dexopt()
321 if (profileMerged && !mInjector.isPreReboot()) { in dexopt()
[all …]
DArtFileManager.java59 @NonNull private final Injector mInjector; field in ArtFileManager
67 mInjector = injector; in ArtFileManager()
85 if (!mInjector.isSystemOrRootOrShell() in getDexAndAbis()
86 && !mInjector.getCallingUserHandle().equals(dexInfo.userHandle())) { in getDexAndAbis()
108 boolean isInDalvikCache = Utils.isInDalvikCache(pkgState, mInjector.getArtd()); in getWritableArtifacts()
149 GetDexoptStatusResult result = mInjector.getArtd().getDexoptStatus( in getUsableArtifacts()
191 curProfiles.addAll(mInjector.isSystemOrRootOrShell() in getProfiles()
193 mInjector.getUserManager(), pkgState, dexInfo) in getProfiles()
195 List.of(mInjector.getCallingUserHandle()), pkgState, in getProfiles()
202 if (!mInjector.isSystemOrRootOrShell() in getProfiles()
[all …]
DBackgroundDexoptJob.java72 @NonNull private final Injector mInjector; field in BackgroundDexoptJob
85 mInjector = injector; in BackgroundDexoptJob()
146 mInjector.getConfig().getScheduleBackgroundDexoptJobCallback(); in schedule()
159 return mInjector.getJobScheduler().schedule(info) == JobScheduler.RESULT_SUCCESS in schedule()
170 mInjector.getJobScheduler().cancel(JOB_ID); in unschedule()
233 try (var snapshot = mInjector.getPackageManagerLocal().withFilteredSnapshot()) { in run()
234 dexoptResultByPass = mInjector.getArtManagerLocal().dexoptPackages(snapshot, in run()
245 long freedBytes = mInjector.getArtManagerLocal().cleanup(snapshot); in run()
DDexMetadataHelper.java45 @NonNull private final Injector mInjector; field in DexMetadataHelper
53 mInjector = injector; in DexMetadataHelper()
63 try (var zipFile = mInjector.openZipFile(realDmPath)) { in getDexMetadataInfo()
DArtdRefCache.java56 @NonNull private final Injector mInjector; field in ArtdRefCache
76 mInjector = injector; in ArtdRefCache()
77 mDebouncer = new Debouncer(CACHE_TIMEOUT_MS, mInjector::createScheduledExecutor); in ArtdRefCache()
98 IArtd artd = mInjector.getArtd(); in getArtd()
DPrimaryDexopter.java86 return Utils.isInDalvikCache(mPkgState, mInjector.getArtd()); in isInDalvikCache()
109 || mInjector.getDexUseManager().isPrimaryDexUsedByOtherApps( in needsToBeShared()
123 return mInjector.getArtd().getDexFileVisibility(dexInfo.dexPath()) in isDexFileFound()
172 mSharedGid, isPublic, mInjector.isPreReboot()); in buildOutputProfile()
178 return PrimaryDexUtils.getCurProfiles(mInjector.getUserManager(), mPkgState, dexInfo); in getCurProfiles()
DDumpHelper.java56 @NonNull private final Injector mInjector; field in DumpHelper
64 mInjector = injector; in DumpHelper()
95 mInjector.getArtManagerLocal() in dumpPackage()
99 mInjector.getDexUseManager() in dumpPackage()
150 mInjector.getDexUseManager().getPrimaryDexLoaders(packageName, dexPath), in dumpPrimaryDex()
173 -> mInjector.getDexUseManager().getSecondaryClassLoaderContext( in dumpSecondaryDex()
DDexoptHelper.java72 @NonNull private final Injector mInjector; field in DexoptHelper
80 mInjector = injector; in DexoptHelper()
185 mInjector.getConfig().getDexoptDoneCallbacks()) { in dexoptPackages()
238 mInjector.getPrimaryDexopter(pkgState, pkg, params, cancellationSignal) in dexoptPackage()
248 mInjector.getSecondaryDexopter(pkgState, pkg, params, cancellationSignal) in dexoptPackage()
263 return Utils.canDexoptPackage(pkgState, mInjector.getAppHibernationManager()); in canDexoptPackage()
DDexUseManagerLocal.java117 @NonNull private final Injector mInjector; field in DexUseManagerLocal
162 mInjector = injector; in DexUseManagerLocal()
163 mDebouncer = new Debouncer(INTERVAL_MS, mInjector::createScheduledExecutor); in DexUseManagerLocal()
169 Utils.check(!mInjector.isPreReboot()); in systemReady()
170 mInjector.getArtManagerLocal().systemReady(); in systemReady()
173 mInjector.getContext().registerReceiver(new BroadcastReceiver() { in systemReady()
404 long lastUsedAtMs = mInjector.getCurrentTimeMillis(); in notifyDexContainersLoaded()
531 Utils.check(!mInjector.isPreReboot()); in save()
541 var file = new File(mInjector.getFilename()); in save()
565 Utils.check(!mInjector.isPreReboot()); in maybeSaveAsync()
[all …]
DSecondaryDexopter.java70 return mInjector.getDexUseManager().getCheckedSecondaryDexInfo( in getDexInfoList()
137 dexInfo.dexPath(), uid, uid, isPublic, mInjector.isPreReboot()); in buildOutputProfile()
/art/libartservice/service/javatests/com/android/server/art/
DArtdRefCacheTest.java51 @Mock private ArtdRefCache.Injector mInjector; field in ArtdRefCacheTest
62 .when(mInjector.createScheduledExecutor()) in setUp()
64 lenient().when(mInjector.getArtd()).thenReturn(mArtd); in setUp()
68 mArtdRefCache = new ArtdRefCache(mInjector); in setUp()
76 verify(mInjector, never()).getArtd(); in testNoGetArtd()
91 verify(mInjector, times(2)).getArtd(); in testNoPin()
104 verify(mInjector, times(1)).getArtd(); in testSingleScope()
121 verify(mInjector, times(3)).getArtd(); in testMultipleScopesCacheTimeout()
138 verify(mInjector, times(1)).getArtd(); in testMultipleScopesCacheHit()
155 verify(mInjector, times(1)).getArtd(); in testMultipleScopesNoUnpinAfterTimeout()
[all …]
DPrimaryDexopterTestBase.java62 @Mock protected PrimaryDexopter.Injector mInjector; field in PrimaryDexopterTestBase
86 lenient().when(mInjector.getArtd()).thenReturn(mArtd); in setUp()
87 lenient().when(mInjector.isSystemUiPackage(any())).thenReturn(false); in setUp()
88 lenient().when(mInjector.isLauncherPackage(any())).thenReturn(false); in setUp()
89 lenient().when(mInjector.getUserManager()).thenReturn(mUserManager); in setUp()
90 lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManager); in setUp()
91 lenient().when(mInjector.getStorageManager()).thenReturn(mStorageManager); in setUp()
92 lenient().when(mInjector.getArtVersion()).thenReturn(ART_VERSION); in setUp()
93 lenient().when(mInjector.getConfig()).thenReturn(mConfig); in setUp()
94 lenient().when(mInjector.getDexMetadataHelper()).thenReturn(mDexMetadataHelper); in setUp()
[all …]
DDexoptHelperTest.java95 @Mock private DexoptHelper.Injector mInjector; field in DexoptHelperTest
140 .when(mInjector.getPrimaryDexopter(any(), any(), any(), any())) in setUp()
145 .when(mInjector.getSecondaryDexopter(any(), any(), any(), any())) in setUp()
157 lenient().when(mInjector.getAppHibernationManager()).thenReturn(mAhm); in setUp()
158 lenient().when(mInjector.getConfig()).thenReturn(mConfig); in setUp()
160 mDexoptHelper = new DexoptHelper(mInjector); in setUp()
176 when(mInjector.getPrimaryDexopter(same(mPkgStateLibbaz), any(), any(), any())) in testDexopt()
204 InOrder inOrder = inOrder(mInjector); in testDexopt()
205 inOrder.verify(mInjector).getPrimaryDexopter( in testDexopt()
207 inOrder.verify(mInjector).getSecondaryDexopter( in testDexopt()
[all …]
DDexUseManagerTest.java98 @Mock private DexUseManagerLocal.Injector mInjector; field in DexUseManagerTest
163 lenient().when(mInjector.getArtd()).thenReturn(mArtd); in setUp()
164 lenient().when(mInjector.getCurrentTimeMillis()).thenReturn(0l); in setUp()
165 lenient().when(mInjector.getFilename()).thenReturn(mTempFile.getPath()); in setUp()
167 .when(mInjector.createScheduledExecutor()) in setUp()
169 lenient().when(mInjector.getContext()).thenReturn(mContext); in setUp()
170 lenient().when(mInjector.getAllPackageNames()).thenReturn(mPackageStates.keySet()); in setUp()
171 lenient().when(mInjector.isPreReboot()).thenReturn(false); in setUp()
172 lenient().when(mInjector.getArtManagerLocal()).thenReturn(mArtManagerLocal); in setUp()
174 mDexUseManager = new DexUseManagerLocal(mInjector); in setUp()
[all …]
DPreRebootDexoptJobTest.java69 @Mock private PreRebootDexoptJob.Injector mInjector; field in PreRebootDexoptJobTest
88 .when(mInjector.getDeviceConfigBoolean( in setUp()
97 lenient().when(mInjector.getJobScheduler()).thenReturn(mJobScheduler); in setUp()
98 lenient().when(mInjector.getPreRebootDriver()).thenReturn(mPreRebootDriver); in setUp()
100 .when(mInjector.getStatsReporter()) in setUp()
131 mPreRebootDexoptJob = new PreRebootDexoptJob(mInjector); in setUp()
198 .when(mInjector.getDeviceConfigBoolean( in testScheduleEnabledByPhenotypeFlag()
214 .when(mInjector.getDeviceConfigBoolean( in testScheduleForceDisabledByPhenotypeFlag()
217 when(mInjector.getDeviceConfigBoolean(eq(DeviceConfig.NAMESPACE_RUNTIME), in testScheduleForceDisabledByPhenotypeFlag()
DSecondaryDexopterTest.java107 @Mock private SecondaryDexopter.Injector mInjector; field in SecondaryDexopterTest
142 lenient().when(mInjector.getArtd()).thenReturn(mArtd); in setUp()
143 lenient().when(mInjector.isSystemUiPackage(any())).thenReturn(false); in setUp()
144 lenient().when(mInjector.isLauncherPackage(any())).thenReturn(false); in setUp()
145 lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManager); in setUp()
146 lenient().when(mInjector.getConfig()).thenReturn(mConfig); in setUp()
147 lenient().when(mInjector.getDexMetadataHelper()).thenReturn(mDexMetadataHelper); in setUp()
171 mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in setUp()
DBackgroundDexoptJobTest.java79 @Mock private BackgroundDexoptJob.Injector mInjector; field in BackgroundDexoptJobTest
101 lenient().when(mInjector.getArtManagerLocal()).thenReturn(mArtManagerLocal); in setUp()
102 lenient().when(mInjector.getPackageManagerLocal()).thenReturn(mPackageManagerLocal); in setUp()
103 lenient().when(mInjector.getConfig()).thenReturn(mConfig); in setUp()
104 lenient().when(mInjector.getJobScheduler()).thenReturn(mJobScheduler); in setUp()
106 mBackgroundDexoptJob = new BackgroundDexoptJob(mInjector); in setUp()
DPrimaryDexopterTest.java154 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in setUp()
368 when(mInjector.isPreReboot()).thenReturn(true); in testDexoptMergesProfilesPreReboot()
412 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in testDexoptMergesProfilesForceMerge()
456 when(mInjector.isPreReboot()).thenReturn(true); in testDexoptUsesDmProfilePreReboot()
545 when(mInjector.isPreReboot()).thenReturn(true); in testDexoptUsesEmbeddedProfilePreReboot()
759 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in testDexoptBaseApk()
781 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in testDexoptSplitApk()
804 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in testDexoptStorageLow()
842 new PrimaryDexopter(mInjector, mPkgState, mPkg, mDexoptParams, mCancellationSignal); in testDexoptDexStatus()
865 when(mInjector.isPreReboot()).thenReturn(true); in testDexoptPreRebootDexNotFound()
[all …]
DDumpHelperTest.java69 @Mock private DumpHelper.Injector mInjector; field in DumpHelperTest
89 lenient().when(mInjector.getArtManagerLocal()).thenReturn(mArtManagerLocal); in setUp()
90 lenient().when(mInjector.getDexUseManager()).thenReturn(mDexUseManagerLocal); in setUp()
102 mDumpHelper = new DumpHelper(mInjector); in setUp()
DArtManagerLocalTest.java128 @Mock private ArtManagerLocal.Injector mInjector; field in ArtManagerLocalTest
169 lenient().when(mInjector.getPackageManagerLocal()).thenReturn(mPackageManagerLocal); in setUp()
170 lenient().when(mInjector.getArtd()).thenReturn(mArtd); in setUp()
171 lenient().when(mInjector.createArtdPin()).thenReturn(mArtdPin); in setUp()
172 lenient().when(mInjector.getDexoptHelper()).thenReturn(mDexoptHelper); in setUp()
173 lenient().when(mInjector.getConfig()).thenReturn(mConfig); in setUp()
174 lenient().when(mInjector.getAppHibernationManager()).thenReturn(mAppHibernationManager); in setUp()
175 lenient().when(mInjector.getUserManager()).thenReturn(mUserManager); in setUp()
176 lenient().when(mInjector.isSystemUiPackage(any())).thenReturn(false); in setUp()
177 lenient().when(mInjector.isLauncherPackage(any())).thenReturn(false); in setUp()
[all …]
/art/libartservice/service/java/com/android/server/art/prereboot/
DPreRebootStatsReporter.java70 @NonNull private final Injector mInjector; field in PreRebootStatsReporter
79 mInjector = injector; in PreRebootStatsReporter()
88 statsBuilder.setJobScheduledTimestampMillis(mInjector.getCurrentTimeMillis()); in recordJobScheduled()
110 JobRun.newBuilder().setJobStartedTimestampMillis(mInjector.getCurrentTimeMillis()); in recordJobStarted()
157 mInjector.getCurrentTimeMillis()); in recordJobEnded()
210 ArtManagerLocal artManagerLocal = mInjector.getArtManagerLocal(); in report()
215 try (var snapshot = mInjector.getPackageManagerLocal().withFilteredSnapshot(); in report()
216 var pin = mInjector.createArtdPin()) { in report()
245 mInjector.writeStats(ArtStatsLog.PREREBOOT_DEXOPT_JOB_ENDED, in report()
308 try (InputStream in = new FileInputStream(mInjector.getFilename())) { in load()
[all …]
DPreRebootDriver.java70 @NonNull private final Injector mInjector; field in PreRebootDriver
78 mInjector = injector; in PreRebootDriver()
163 mInjector.getDexoptChrootSetup().setUp(otaSlot, mapSnapshotsForOta); in setUp()
164 if (!mInjector.getArtd().checkPreRebootSystemRequirements(CHROOT_DIR)) { in setUp()
167 mInjector.getDexoptChrootSetup().init(); in setUp()
185 mInjector.getDexoptChrootSetup().tearDown(); in tearDown()
216 mInjector.getContext(), cancellationSignal); in runFromChroot()

12