Home
last modified time | relevance | path

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

12

/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/
DFileUpdaterTest.java65 return mInjector.injectReadFromFileTrimmed(file); in injectReadFromFileTrimmed()
70 mInjector.injectWriteToFile(file, value); in injectWriteToFile()
75 mInjector.injectWtf(message, e); in injectWtf()
99 private Injector mInjector; field in FileUpdaterTest
137 verify(mInjector, times(times)).injectWtf(anyOrNullString(), anyOrNull(Throwable.class)); in veriryWtf()
142 doReturn("111").when(mInjector).injectReadFromFileTrimmed("file1"); in testNoWrites()
143 doReturn("222").when(mInjector).injectReadFromFileTrimmed("file2"); in testNoWrites()
144 doReturn("333").when(mInjector).injectReadFromFileTrimmed("file3"); in testNoWrites()
152 verify(mInjector, times(0)).injectWriteToFile(anyOrNullString(), anyOrNullString()); in testNoWrites()
158 verify(mInjector, times(0)).injectWriteToFile(anyOrNullString(), anyOrNullString()); in testNoWrites()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DBrightnessTrackerTest.java84 private TestInjector mInjector; field in BrightnessTrackerTest
106 mInjector = new TestInjector(ensureHandler()); in setUp()
108 mTracker = new BrightnessTracker(InstrumentationRegistry.getContext(), mInjector); in setUp()
116 mInjector.mInteractive = false; in testStartStopTrackerScreenOnOff()
118 assertNull(mInjector.mSensorListener); in testStartStopTrackerScreenOnOff()
119 assertNotNull(mInjector.mBroadcastReceiver); in testStartStopTrackerScreenOnOff()
120 assertTrue(mInjector.mIdleScheduled); in testStartStopTrackerScreenOnOff()
121 mInjector.sendScreenChange(/*screen on */ true); in testStartStopTrackerScreenOnOff()
122 assertNotNull(mInjector.mSensorListener); in testStartStopTrackerScreenOnOff()
123 assertEquals(BrightnessTracker.ENABLE_COLOR_SAMPLING, mInjector.mColorSamplingEnabled); in testStartStopTrackerScreenOnOff()
[all …]
DPersistentDataStoreTest.java46 private TestInjector mInjector; field in PersistentDataStoreTest
50 mInjector = new TestInjector(); in setUp()
51 mDataStore = new PersistentDataStore(mInjector); in setUp()
77 mInjector.setReadStream(is); in testLoadingBrightnessConfigurations()
110 mInjector.setReadStream(is); in testBrightnessConfigWithInvalidCurveIsIgnored()
129 mInjector.setReadStream(is); in testBrightnessConfigWithInvalidFloatsIsIgnored()
141 mInjector.setReadStream(is); in testEmptyBrightnessConfigurationsDoesntCrash()
158 mInjector.setWriteStream(baos); in testStoreAndReloadOfBrightnessConfigurations()
160 assertTrue(mInjector.wasWriteSuccessful()); in testStoreAndReloadOfBrightnessConfigurations()
/frameworks/base/services/tests/servicestests/src/com/android/server/am/
DUserControllerTest.java121 private TestInjector mInjector; field in UserControllerTest
147 mInjector = spy(new TestInjector(getInstrumentation().getTargetContext())); in setUp()
148 doNothing().when(mInjector).clearAllLockedTasks(anyString()); in setUp()
149 doNothing().when(mInjector).startHomeActivity(anyInt(), anyString()); in setUp()
150 doReturn(false).when(mInjector).stackSupervisorSwitchUser(anyInt(), any()); in setUp()
151 doNothing().when(mInjector).stackSupervisorResumeFocusedStackTopActivity(); in setUp()
152 doNothing().when(mInjector).systemServiceManagerCleanupUser(anyInt()); in setUp()
153 doNothing().when(mInjector).activityManagerForceStopPackage(anyInt(), anyString()); in setUp()
154 doNothing().when(mInjector).activityManagerOnUserStopped(anyInt()); in setUp()
155 doNothing().when(mInjector).clearBroadcastQueueForUser(anyInt()); in setUp()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/usage/
DAppStandbyControllerTests.java116 private MyInjector mInjector; field in AppStandbyControllerTests
276 mInjector.mIsCharging = charging; in setChargingState()
283 mInjector.mIsAppIdleEnabled = enabled; in setAppIdleEnabled()
290 mInjector.mElapsedRealtime = 0; in setupController()
291 setupPm(mInjector.getContext().getPackageManager()); in setupController()
292 AppStandbyController controller = new AppStandbyController(mInjector); in setupController()
296 mInjector.setDisplayOn(false); in setupController()
297 mInjector.setDisplayOn(true); in setupController()
302 mInjector.mElapsedRealtime, false)); in setupController()
305 mInjector.mElapsedRealtime, false)); in setupController()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DNetworkManagementInternalTest.java63 private NetworkManagementService.Injector mInjector; field in NetworkManagementInternalTest
69 mInjector = service.getInjector(); in setUp()
79 mInjector.setUidOnMeteredNetworkList(true, TEST_UID, true); in testIsNetworkRestrictedForUid()
82 mInjector.reset(); in testIsNetworkRestrictedForUid()
85 mInjector.setDataSaverMode(true); in testIsNetworkRestrictedForUid()
86 mInjector.setUidOnMeteredNetworkList(false, TEST_UID, false); in testIsNetworkRestrictedForUid()
89 mInjector.reset(); in testIsNetworkRestrictedForUid()
92 mInjector.setDataSaverMode(true); in testIsNetworkRestrictedForUid()
93 mInjector.setUidOnMeteredNetworkList(false, TEST_UID, true); in testIsNetworkRestrictedForUid()
96 mInjector.reset(); in testIsNetworkRestrictedForUid()
[all …]
/frameworks/base/services/core/java/com/android/server/pm/
DCrossProfileAppsServiceImpl.java56 private Injector mInjector; field in CrossProfileAppsServiceImpl
65 mInjector = injector; in CrossProfileAppsServiceImpl()
80 callingPackage, mInjector.getCallingUserId()); in getTargetUserProfiles()
100 final int callerUserId = mInjector.getCallingUserId(); in startActivityAsUser()
101 final int callingUid = mInjector.getCallingUid(); in startActivityAsUser()
147 mInjector.getActivityTaskManagerInternal().startActivityAsUser( in startActivityAsUser()
157 final long ident = mInjector.clearCallingIdentity(); in getTargetUserProfilesUnchecked()
160 mInjector.getUserManager().getEnabledProfileIds(callingUserId); in getTargetUserProfilesUnchecked()
174 mInjector.restoreCallingIdentity(ident); in getTargetUserProfilesUnchecked()
179 final int callingUid = mInjector.getCallingUid(); in isPackageEnabled()
[all …]
/frameworks/base/services/core/java/com/android/server/am/
DUserController.java172 private final Injector mInjector; field in UserController
269 mInjector = injector; in UserController()
270 mHandler = mInjector.getHandler(this); in UserController()
271 mUiHandler = mInjector.getUiHandler(this); in UserController()
277 mLockPatternUtils = mInjector.getLockPatternUtils(); in UserController()
362 mInjector.getUserManagerInternal().setUserState(userId, uss.state); in finishUserBoot()
365 && !mInjector.isRuntimeRestarted() && !mInjector.isFirstBootOrUpgrade()) { in finishUserBoot()
367 MetricsLogger.histogram(mInjector.getContext(), in finishUserBoot()
376 if (!mInjector.getUserManager().isPreCreated(userId)) { in finishUserBoot()
383 mInjector.broadcastIntent(intent, null, resultTo, 0, null, null, in finishUserBoot()
[all …]
/frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/
DDevicePolicyManagerService.java498 final Injector mInjector; field in DevicePolicyManagerService
621 mInjector.getNotificationManager().cancel(LOG_TAG,
777 mInjector.getNotificationManager().notifyAsUser(LOG_TAG,
2214 mInjector = injector; in DevicePolicyManagerService()
2237 mHasFeature = mInjector.hasFeature(); in DevicePolicyManagerService()
2238 mIsWatch = mInjector.getPackageManager() in DevicePolicyManagerService()
2240 mHasTelephonyFeature = mInjector.getPackageManager() in DevicePolicyManagerService()
2245 mCertificateMonitor = new CertificateMonitor(this, mInjector, mBackgroundHandler); in DevicePolicyManagerService()
2251 mTransferOwnershipMetadataManager = mInjector.newTransferOwnershipMetadataManager(); in DevicePolicyManagerService()
2330 long ident = mInjector.binderClearCallingIdentity(); in getUserDataUnchecked()
[all …]
DCertificateMonitor.java59 private final DevicePolicyManagerService.Injector mInjector; field in CertificateMonitor
65 mInjector = injector; in CertificateMonitor()
75 mInjector.mContext.registerReceiverAsUser( in CertificateMonitor()
90 try (KeyChainConnection keyChainConnection = mInjector.keyChainBindAsUser(userHandle)) { in installCaCert()
102 try (KeyChainConnection keyChainConnection = mInjector.keyChainBindAsUser(userHandle)) { in uninstallCaCerts()
116 try (KeyChainConnection conn = mInjector.keyChainBindAsUser(userHandle)) { in getInstalledCaCertificates()
145 if (!mInjector.getUserManager().isUserUnlocked(userHandle.getIdentifier())) { in updateInstalledCertificates()
162 mInjector.getNotificationManager().notifyAsUser( in updateInstalledCertificates()
165 mInjector.getNotificationManager().cancelAsUser( in updateInstalledCertificates()
173 userContext = mInjector.createContextAsUser(userHandle); in buildNotification()
[all …]
DDeviceAdminServiceController.java51 private final DevicePolicyManagerService.Injector mInjector; field in DeviceAdminServiceController
93 mInjector = service.mInjector; in DeviceAdminServiceController()
94 mContext = mInjector.mContext; in DeviceAdminServiceController()
111 mInjector.getIPackageManager(), in findService()
121 final long token = mInjector.binderClearCallingIdentity(); in startServiceForOwner()
154 mInjector.binderRestoreCallingIdentity(token); in startServiceForOwner()
162 final long token = mInjector.binderClearCallingIdentity(); in stopServiceForOwner()
168 mInjector.binderRestoreCallingIdentity(token); in stopServiceForOwner()
DTransferOwnershipMetadataManager.java68 private final Injector mInjector; field in TransferOwnershipMetadataManager
76 mInjector = injector; in TransferOwnershipMetadataManager()
80 final File transferOwnershipMetadataFile = new File(mInjector.getOwnerTransferMetadataDir(), in saveMetadataFile()
117 new File(mInjector.getOwnerTransferMetadataDir(), OWNER_TRANSFER_METADATA_XML); in loadMetadataFile()
170 new File(mInjector.getOwnerTransferMetadataDir(), OWNER_TRANSFER_METADATA_XML).delete(); in deleteMetadataFile()
174 return new File(mInjector.getOwnerTransferMetadataDir(), in metadataFileExists()
DOverlayPackagesProvider.java56 private final Injector mInjector; field in OverlayPackagesProvider
86 mInjector = checkNotNull(injector); in OverlayPackagesProvider()
111 if (mInjector.isPerProfileImeEnabled()) { in getNonRequiredApps()
139 final List<InputMethodInfo> inputMethods = mInjector.getInputMethodListAsUser(userId); in getSystemInputMethods()
DUpdateInstaller.java51 private DevicePolicyManagerService.Injector mInjector; field in UpdateInstaller
59 mInjector = injector; in UpdateInstaller()
159 mInjector.powerManagerReboot(PowerManager.REBOOT_REQUESTED_BY_DEVICE_OWNER); in notifyCallbackOnSuccess()
/frameworks/base/services/core/java/com/android/server/recoverysystem/
DRecoverySystemService.java67 private final Injector mInjector; field in RecoverySystemService
140 mInjector = injector; in RecoverySystemService()
158 mInjector.uncryptPackageFileDelete(); in uncrypt()
160 try (FileWriter uncryptFile = mInjector.getUncryptPackageFileWriter()) { in uncrypt()
164 + mInjector.getUncryptPackageFileName() + "\":", e); in uncrypt()
169 mInjector.systemPropertiesSet("ctl.start", "uncrypt"); in uncrypt()
172 UncryptSocket socket = mInjector.connectService(); in uncrypt()
253 PowerManager pm = mInjector.getPowerManager(); in rebootRecoveryWithCommand()
266 final String uncryptService = mInjector.systemPropertiesGet(INIT_SERVICE_UNCRYPT); in checkAndWaitForUncryptService()
267 final String setupBcbService = mInjector.systemPropertiesGet(INIT_SERVICE_SETUP_BCB); in checkAndWaitForUncryptService()
[all …]
/frameworks/base/services/core/java/com/android/server/display/
DBrightnessTracker.java178 private final Injector mInjector; field in BrightnessTracker
186 mInjector = injector; in BrightnessTracker()
188 mInjector = new Injector(); in BrightnessTracker()
190 mBgHandler = new TrackerHandler(mInjector.getBackgroundHandler().getLooper()); in BrightnessTracker()
214 mInjector.registerBrightnessModeObserver(mContentResolver, mSettingsObserver); in backgroundStart()
223 mInjector.registerReceiver(mContext, mBroadcastReceiver, intentFilter); in backgroundStart()
225 mInjector.scheduleIdleJob(mContext); in backgroundStart()
241 mInjector.unregisterSensorListener(mContext, mSensorListener); in stop()
242 mInjector.unregisterBrightnessModeObserver(mContext, mSettingsObserver); in stop()
243 mInjector.unregisterReceiver(mContext, mBroadcastReceiver); in stop()
[all …]
DAmbientBrightnessStatsTracker.java63 private final Injector mInjector; field in AmbientBrightnessStatsTracker
71 mInjector = injector; in AmbientBrightnessStatsTracker()
73 mInjector = new Injector(); in AmbientBrightnessStatsTracker()
76 mTimer = new Timer(() -> mInjector.elapsedRealtimeMillis()); in AmbientBrightnessStatsTracker()
87 mAmbientBrightnessStats.log(mCurrentUserId, mInjector.getLocalDate(), in stop()
97 mAmbientBrightnessStats.log(mCurrentUserId, mInjector.getLocalDate(), in add()
173 final LocalDate cutOffDate = mInjector.getLocalDate().minusDays(MAX_DAYS_TO_TRACK); in writeToXML()
177 int userSerialNumber = mInjector.getUserSerialNumber(mUserManager, in writeToXML()
222 final LocalDate cutOffDate = mInjector.getLocalDate().minusDays(MAX_DAYS_TO_TRACK); in readFromXML()
249 int userId = mInjector.getUserId(mUserManager, in readFromXML()
/frameworks/base/services/core/java/com/android/server/wm/
DKeyguardDisableHandler.java44 private Injector mInjector; field in KeyguardDisableHandler
48 mInjector = injector; in KeyguardDisableHandler()
68 mInjector.enableKeyguard(shouldKeyguardBeEnabled(mCurrentUser)); in updateKeyguardEnabledLocked()
74 watcherForCaller.acquire(token, tag, mInjector.getProfileParentId(userId)); in disableKeyguard()
79 watcherForCaller.release(token, mInjector.getProfileParentId(userId)); in reenableKeyguard()
97 final boolean dpmRequiresPassword = mInjector.dpmRequiresPassword(mCurrentUser); in shouldKeyguardBeEnabled()
98 final boolean keyguardSecure = mInjector.isKeyguardSecure(mCurrentUser); in shouldKeyguardBeEnabled()
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DKernelSingleUidTimeReaderTest.java50 private TestInjector mInjector; field in KernelSingleUidTimeReaderTest
64 mInjector = new TestInjector(); in setUp()
65 mReader = new KernelSingleUidTimeReader(TEST_FREQ_COUNT, mInjector); in setUp()
72 mInjector.setData(latestCpuTimes); in readDelta()
81 mInjector.setData(latestCpuTimes); in readDelta()
100 mInjector.setData(malformedLatestTimes); in readDelta()
114 mInjector.setData(malformedLatestTimes); in readDelta()
122 mInjector.letReadDataThrowException(true); in readDelta_fileNotAvailable()
139 mInjector.setData(cpuTimes); in readDelta_incorrectCount()
150 mInjector.setData(cpuTimes); in readDelta_incorrectCount()
/frameworks/base/services/usage/java/com/android/server/usage/
DAppStandbyController.java272 Injector mInjector; field in AppStandbyController
328 mInjector = injector; in AppStandbyController()
329 mContext = mInjector.getContext(); in AppStandbyController()
330 mHandler = new AppStandbyHandler(mInjector.getLooper()); in AppStandbyController()
340 mAppIdleHistory = new AppIdleHistory(mInjector.getDataSystemDirectory(), in AppStandbyController()
341 mInjector.elapsedRealtime()); in AppStandbyController()
367 mInjector.onBootPhase(phase); in onBootPhase()
379 mInjector.registerDisplayListener(mDisplayListener, mHandler); in onBootPhase()
381 mAppIdleHistory.updateDisplay(isDisplayOn(), mInjector.elapsedRealtime()); in onBootPhase()
399 setChargingState(mInjector.isCharging()); in onBootPhase()
[all …]
/frameworks/base/core/java/com/android/internal/app/
DIntentForwarderActivity.java72 private Injector mInjector; field in IntentForwarderActivity
79 mInjector = createInjector(); in onCreate()
123 final ResolveInfo ri = mInjector.resolveActivityAsUser(newIntent, MATCH_DEFAULT_ONLY, in onCreate()
144 mInjector.showToast(userMessageId, Toast.LENGTH_LONG); in onCreate()
226 if (mInjector.getIPackageManager(). in canForward()
244 List<UserInfo> relatedUsers = mInjector.getUserManager().getProfiles(UserHandle.myUserId()); in getManagedProfile()
258 UserInfo parent = mInjector.getUserManager().getProfileParent(UserHandle.myUserId()); in getProfileParent()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/users/
DAppRestrictionsHelper.java54 private final Injector mInjector; field in AppRestrictionsHelper
72 mInjector = injector; in AppRestrictionsHelper()
73 mContext = mInjector.getContext(); in AppRestrictionsHelper()
74 mPackageManager = mInjector.getPackageManager(); in AppRestrictionsHelper()
75 mIPm = mInjector.getIPackageManager(); in AppRestrictionsHelper()
76 mUser = mInjector.getUser(); in AppRestrictionsHelper()
77 mUserManager = mInjector.getUserManager(); in AppRestrictionsHelper()
281 List<InputMethodInfo> imis = mInjector.getInputMethodList(); in addSystemImes()
/frameworks/base/core/java/com/android/internal/os/
DKernelSingleUidTimeReader.java65 private final Injector mInjector; field in KernelSingleUidTimeReader
74 mInjector = injector; in KernelSingleUidTimeReader()
91 final long[] cpuTimesMs = mInjector.readBpfData(uid); in readDeltaMs()
108 final byte[] data = mInjector.readData(procFile); in readDeltaMs()
/frameworks/base/services/core/java/com/android/server/
DAlarmManagerService.java197 private final Injector mInjector; field in AlarmManagerService
700 mLastTickAdded = mInjector.getCurrentTimeMillis(); in Batch()
725 mLastTickAdded = mInjector.getCurrentTimeMillis(); in add()
771 mLastTickRemoved = mInjector.getCurrentTimeMillis(); in remove()
934 mInjector = injector; in AlarmManagerService()
944 when -= mInjector.getCurrentTimeMillis() - mInjector.getElapsedRealtime(); in convertToElapsed()
1054 final long nowElapsed = mInjector.getElapsedRealtime(); in rebatchAllAlarmsLocked()
1184 deliverPendingBackgroundAlarmsLocked(alarmsToDeliver, mInjector.getElapsedRealtime()); in sendPendingBackgroundAlarmsLocked()
1201 deliverPendingBackgroundAlarmsLocked(alarmsToDeliver, mInjector.getElapsedRealtime()); in sendAllUnrestrictedPendingBackgroundAlarmsLocked()
1288 ent.elapsedRealtime = mInjector.getElapsedRealtime(); in restorePendingWhileIdleAlarmsLocked()
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/
DDeviceIdleControllerTest.java115 private InjectorForTest mInjector; field in DeviceIdleControllerTest
312 mInjector = new InjectorForTest(getContext()); in setUp()
315 mDeviceIdleController = new DeviceIdleController(getContext(), mInjector); in setUp()
324 mConstants = mInjector.getConstants(mDeviceIdleController, in setUp()
325 mInjector.getHandler(mDeviceIdleController), mContentResolver); in setUp()
392 mInjector.connectivityService = null; in testUpdateConnectivityState()
397 mInjector.connectivityService = mConnectivityService; in testUpdateConnectivityState()
694 mInjector.locationManager = null; in testStepIdleStateLocked_ValidStates_NoLocationManager()
760 mInjector.locationManager = mLocationManager; in testStepIdleStateLocked_ValidStates_WithLocationManager_WithProviders()
1667 mInjector.nowElapsed += mConstants.IDLE_AFTER_INACTIVE_TIMEOUT + mConstants.SENSING_TIMEOUT in testStationaryDetection_QuickDozeOff()
[all …]

12