Home
last modified time | relevance | path

Searched refs:policyId (Results 1 – 18 of 18) sorted by relevance

/packages/services/Car/cpp/powerpolicy/server/src/
DCarPowerPolicyServer.cpp182 Status CarServiceNotificationHandler::notifyPowerPolicyChange(const std::string& policyId) { in notifyPowerPolicyChange() argument
183 return mService->notifyPowerPolicyChange(policyId); in notifyPowerPolicyChange()
187 const std::string& policyId, const std::vector<std::string>& enabledComponents, in notifyPowerPolicyDefinition() argument
189 return mService->notifyPowerPolicyDefinition(policyId, enabledComponents, disabledComponents); in notifyPowerPolicyDefinition()
311 policyState->policyId = in notifyCarServiceReady()
312 isPowerPolicyAppliedLocked() ? mCurrentPowerPolicyMeta.powerPolicy->policyId : ""; in notifyCarServiceReady()
319 Status CarPowerPolicyServer::notifyPowerPolicyChange(const std::string& policyId) { in notifyPowerPolicyChange() argument
325 applyPowerPolicy(policyId, /*carServiceExpected=*/true, /*overridePreemptive=*/false); in notifyPowerPolicyChange()
332 ALOGD("Policy(%s) is applied at CarService", policyId.c_str()); in notifyPowerPolicyChange()
337 const std::string& policyId, const std::vector<std::string>& enabledComponents, in notifyPowerPolicyDefinition() argument
[all …]
DPolicyManager.cpp254 const char* policyId; in readPolicies() local
255 if (pPolicy->QueryStringAttribute(kAttrId, &policyId) != XML_SUCCESS) { in readPolicies()
259 if (includeOtherComponents && isSystemPowerPolicy(policyId)) { in readPolicies()
263 policy->policyId = policyId; in readPolicies()
296 const char* policyId; in readPolicyGroup() local
297 if (pDefaultPolicy->QueryStringAttribute(kAttrId, &policyId) != XML_SUCCESS) { in readPolicyGroup()
301 if (registeredPowerPolicies.count(policyId) == 0) { in readPolicyGroup()
302 return Error() << StringPrintf("Policy(id: %s) is not registered", policyId); in readPolicyGroup()
304 policyGroup.emplace(powerState, policyId); in readPolicyGroup()
373 if (policy->policyId != kSystemPolicyIdNoUserInteraction) { in readSystemPolicyOverrides()
[all …]
DPolicyManager.h37 bool isSystemPowerPolicy(const std::string& policyId);
69 android::base::Result<CarPowerPolicyMeta> getPowerPolicy(const std::string& policyId) const;
74 bool isPreemptivePowerPolicy(const std::string& policyId) const;
76 const std::string& policyId, const std::vector<std::string>& enabledComponents,
DCarPowerPolicyServer.h125 android::binder::Status notifyPowerPolicyChange(const std::string& policyId) override;
127 const std::string& policyId, const std::vector<std::string>& enabledComponents,
172 android::binder::Status notifyPowerPolicyChange(const std::string& policyId);
174 const std::string& policyId, const std::vector<std::string>& enabledComponents,
183 android::base::Result<void> applyPowerPolicy(const std::string& policyId,
209 android::base::Result<void> notifyVhalNewPowerPolicy(const std::string& policyId);
DPowerComponentHandler.cpp47 mAccumulatedPolicy->policyId = powerPolicy->policyId; in applyPowerPolicy()
/packages/services/Car/service/src/com/android/car/power/
DPolicyReader.java160 CarPowerPolicy getPowerPolicy(String policyId) { in getPowerPolicy() argument
161 return mRegisteredPowerPolicies.get(policyId); in getPowerPolicy()
174 String policyId = group.get(state); in getDefaultPowerPolicyForState() local
175 if (policyId == null) { in getDefaultPowerPolicyForState()
178 return mRegisteredPowerPolicies.get(policyId); in getDefaultPowerPolicyForState()
188 CarPowerPolicy getPreemptivePowerPolicy(String policyId) { in getPreemptivePowerPolicy() argument
189 return mPreemptivePowerPolicies.get(policyId); in getPreemptivePowerPolicy()
196 boolean isPreemptivePowerPolicy(String policyId) { in isPreemptivePowerPolicy() argument
197 return mPreemptivePowerPolicies.containsKey(policyId); in isPreemptivePowerPolicy()
211 int definePowerPolicy(String policyId, String[] enabledComponents, in definePowerPolicy() argument
[all …]
DCarPowerManagementService.java592 String policyId = policy == null ? fallbackPolicyId : policy.getPolicyId(); in applyDefaultPowerPolicyForState() local
593 applyPowerPolicy(policyId, /* upToDaemon= */ true); in applyDefaultPowerPolicyForState()
1097 public void applyPowerPolicy(String policyId) { in applyPowerPolicy() argument
1099 Preconditions.checkArgument(policyId != null, "policyId cannot be null"); in applyPowerPolicy()
1100 Preconditions.checkArgument(!policyId.startsWith(PolicyReader.SYSTEM_POWER_POLICY_PREFIX), in applyPowerPolicy()
1102 int status = applyPowerPolicy(policyId, true); in applyPowerPolicy()
1220 int status = applyPowerPolicy(state.policyId, false); in initializePowerPolicy()
1251 private int applyPowerPolicy(@Nullable String policyId, boolean upToDaemon) { in applyPowerPolicy() argument
1252 CarPowerPolicy policy = mPolicyReader.getPowerPolicy(policyId); in applyPowerPolicy()
1255 Slogf.w(TAG, PolicyOperationStatus.errorCodeToString(error, policyId)); in applyPowerPolicy()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/hardware/power/
DCarPowerManagerUnitTest.java264 mService.definePowerPolicy(definition.policyId, definition.enabledComponents, in testGetCurrentPowerPolicy()
269 mCarPowerManager.applyPowerPolicy(definition.policyId); in testGetCurrentPowerPolicy()
278 String policyId = "no_change_policy"; in testApplyPowerPolicy() local
279 mService.definePowerPolicy(policyId, new String[0], new String[0]); in testApplyPowerPolicy()
281 mCarPowerManager.applyPowerPolicy(policyId); in testApplyPowerPolicy()
283 assertThat(mCarPowerManager.getCurrentPowerPolicy().getPolicyId()).isEqualTo(policyId); in testApplyPowerPolicy()
289 String policyId = "invalid_power_policy"; in testApplyPowerPolicy_invalidId() local
292 () -> mCarPowerManager.applyPowerPolicy(policyId)); in testApplyPowerPolicy_invalidId()
304 String policyId = "audio_on_wifi_off"; in testAddPowerPolicyListener() local
305 mService.definePowerPolicy(policyId, new String[]{"AUDIO"}, new String[]{"WIFI"}); in testAddPowerPolicyListener()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/power/
DCarPowerManagementServiceUnitTest.java423 String policyId = "policy_id_valid"; in testDefinePowerPolicyFromCommand() local
424 int status = mService.definePowerPolicy(policyId, new String[]{"AUDIO", "BLUETOOTH"}, in testDefinePowerPolicyFromCommand()
427 assertThat(mPowerPolicyDaemon.getLastDefinedPolicyId()).isEqualTo(policyId); in testDefinePowerPolicyFromCommand()
429 status = mService.definePowerPolicy(policyId, new String[]{"AUDIO", "BLUTTOOTH"}, in testDefinePowerPolicyFromCommand()
433 status = mService.definePowerPolicy(policyId, new String[]{"AUDIO", "INVALID_COMPONENT"}, in testDefinePowerPolicyFromCommand()
442 String policyId = "policy_id_no_changes"; in testApplyPowerPolicy() local
443 mService.definePowerPolicy(policyId, new String[0], new String[0]); in testApplyPowerPolicy()
445 mService.applyPowerPolicy(policyId); in testApplyPowerPolicy()
448 assertThat(policy.getPolicyId()).isEqualTo(policyId); in testApplyPowerPolicy()
449 assertThat(mPowerPolicyDaemon.getLastNotifiedPolicyId()).isEqualTo(policyId); in testApplyPowerPolicy()
[all …]
DPolicyReaderUnitTest.java255 private void checkPolicy(String policyId, CarPowerPolicy expectedPolicy) throws Exception { in checkPolicy() argument
256 CarPowerPolicy actualPolicy = mPolicyReader.getPowerPolicy(policyId); in checkPolicy()
/packages/services/Car/cpp/powerpolicy/server/tests/
DPowerComponentHandlerTest.cpp36 CarPowerPolicyPtr createPolicy(const std::string& policyId, in createPolicy() argument
40 policy->policyId = policyId; in createPolicy()
47 ASSERT_EQ(left->policyId, right->policyId); in assertEqual()
106 auto [policyId, enabledComponents, disabledComponents] = tc; in TEST_F()
107 CarPowerPolicyPtr policy = createPolicy(policyId, enabledComponents, disabledComponents); in TEST_F()
DPolicyManagerTest.cpp75 policy.policyId = id; in createCarPowerPolicy()
160 return a.policyId == a.policyId && in isEqual()
/packages/services/Car/car-lib/src/android/car/hardware/power/
DCarPowerPolicy.java91 @NonNull String policyId, in CarPowerPolicy()
94 this.mPolicyId = policyId; in CarPowerPolicy()
155 String policyId = in.readString(); in CarPowerPolicy() local
159 this.mPolicyId = policyId; in CarPowerPolicy()
DCarPowerManager.java365 public void applyPowerPolicy(@NonNull String policyId) { in applyPowerPolicy() argument
366 checkArgument(policyId != null, "Null policyId"); in applyPowerPolicy()
368 mService.applyPowerPolicy(policyId); in applyPowerPolicy()
DICarPower.aidl42 void applyPowerPolicy(String policyId); in applyPowerPolicy() argument
/packages/services/Car/car-lib/native/CarPowerManager/
DCarPowerPolicy.cpp29 CarPowerPolicy::CarPowerPolicy(const std::string& policyId, in CarPowerPolicy() argument
32 mPolicyId(policyId.c_str(), policyId.length()), in CarPowerPolicy()
/packages/services/Car/car-lib/native/include/
DCarPowerPolicy.h33 CarPowerPolicy(const std::string& policyId, const std::vector<int32_t>& enabledComponents,
/packages/services/Car/tests/carservice_test/src/com/android/car/
DMockedCarTestBase.java562 public void notifyPowerPolicyChange(String policyId) { in notifyPowerPolicyChange() argument
567 public void notifyPowerPolicyDefinition(String policyId, String[] enabledComponents, in notifyPowerPolicyDefinition() argument