Home
last modified time | relevance | path

Searched refs:policy (Results 1 – 25 of 72) sorted by relevance

123

/packages/services/Car/tests/carservice_test/src/com/android/car/garagemode/
DWakeupPolicyTest.java37 WakeupPolicy policy; in testPolicyParser() local
39 policy = new WakeupPolicy(null); in testPolicyParser()
40 assertThat(policy.getWakupIntervalsAmount()).isEqualTo(0); in testPolicyParser()
42 policy = new WakeupPolicy(new String[] {}); in testPolicyParser()
43 assertThat(policy.getWakupIntervalsAmount()).isEqualTo(0); in testPolicyParser()
45 policy = new WakeupPolicy(new String[] {""}); in testPolicyParser()
46 assertThat(policy.getWakupIntervalsAmount()).isEqualTo(0); in testPolicyParser()
48 policy = new WakeupPolicy(new String[] {"15,1"}); in testPolicyParser()
49 assertThat(policy.getWakupIntervalsAmount()).isEqualTo(0); in testPolicyParser()
51 policy = new WakeupPolicy(new String[] {"15y,1"}); in testPolicyParser()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/
DZenModeSettingsTest.java52 Policy policy = new Policy(0, 0, 0, 0); in testBlockedEffectsSummary_none() local
54 mBuilder.getBlockedEffectsSummary(policy)); in testBlockedEffectsSummary_none()
59 Policy policy = new Policy(0, 0, 0, NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK); in testBlockedEffectsSummary_some() local
61 mBuilder.getBlockedEffectsSummary(policy)); in testBlockedEffectsSummary_some()
66 Policy policy = new Policy(0, 0, 0, 511); in testBlockedEffectsSummary_all() local
68 mBuilder.getBlockedEffectsSummary(policy)); in testBlockedEffectsSummary_all()
73 Policy policy = new Policy(0, 0, 0, 0); in testGetCallsSettingSummary_none() local
74 assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("Don\u2019t allow any calls"); in testGetCallsSettingSummary_none()
79 Policy policy = new Policy(Policy.PRIORITY_CATEGORY_ALARMS | Policy.PRIORITY_CATEGORY_CALLS, in testGetCallsSettingSummary_contacts() local
81 assertThat(mBuilder.getCallsSettingSummary(policy)).isEqualTo("Allow from contacts"); in testGetCallsSettingSummary_contacts()
[all …]
DZenOnboardingActivityTest.java96 Policy policy = new Policy(PRIORITY_CATEGORY_ALARMS, 0, 0, SUPPRESSED_EFFECT_SCREEN_ON); in saveNewSetting() local
97 when(mNm.getNotificationPolicy()).thenReturn(policy); in saveNewSetting()
118 Policy policy = new Policy(PRIORITY_CATEGORY_ALARMS, 0, 0, SUPPRESSED_EFFECT_SCREEN_ON); in keepCurrentSetting() local
119 when(mNm.getNotificationPolicy()).thenReturn(policy); in keepCurrentSetting()
130 Policy policy = new Policy(0, 0, 0, 0); in isSuggestionComplete_zenUpdated() local
131 when(mNm.getNotificationPolicy()).thenReturn(policy); in isSuggestionComplete_zenUpdated()
141 Policy policy = new Policy(0, 0, 0, 0); in isSuggestionComplete_withinTimeThreshold() local
142 when(mNm.getNotificationPolicy()).thenReturn(policy); in isSuggestionComplete_withinTimeThreshold()
152 Policy policy = new Policy(0, 0, 0, 0); in isSuggestionComplete_showSettingsSuggestionTrue() local
153 when(mNm.getNotificationPolicy()).thenReturn(policy); in isSuggestionComplete_showSettingsSuggestionTrue()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/datausage/
DDataUsageInfoControllerTest.java99 NetworkPolicy policy = getDefaultNetworkPolicy(); in testNegativeWarning_UpdatedToZero() local
100 policy.warningBytes = NEGATIVE; in testNegativeWarning_UpdatedToZero()
101 mInfoController.updateDataLimit(info, policy); in testNegativeWarning_UpdatedToZero()
107 NetworkPolicy policy = getDefaultNetworkPolicy(); in testWarningZero_UpdatedToZero() local
108 policy.warningBytes = ZERO; in testWarningZero_UpdatedToZero()
109 mInfoController.updateDataLimit(info, policy); in testWarningZero_UpdatedToZero()
115 NetworkPolicy policy = getDefaultNetworkPolicy(); in testWarningPositive_UpdatedToWarning() local
116 policy.warningBytes = POSITIVE_SMALL; in testWarningPositive_UpdatedToWarning()
117 mInfoController.updateDataLimit(info, policy); in testWarningPositive_UpdatedToWarning()
118 assertThat(info.warningLevel).isEqualTo(policy.warningBytes); in testWarningPositive_UpdatedToWarning()
[all …]
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/notification/
DZenModeSettings.java117 String getSoundSettingSummary(Policy policy) { in getSoundSettingSummary() argument
118 List<String> enabledCategories = getEnabledCategories(policy, in getSoundSettingSummary()
142 String getCallsSettingSummary(Policy policy) { in getCallsSettingSummary() argument
143 List<String> enabledCategories = getEnabledCategories(policy, in getCallsSettingSummary()
159 String getMessagesSettingSummary(Policy policy) { in getMessagesSettingSummary() argument
160 List<String> enabledCategories = getEnabledCategories(policy, in getMessagesSettingSummary()
196 String getBlockedEffectsSummary(Policy policy) { in getBlockedEffectsSummary() argument
197 if (policy.suppressedVisualEffects == 0) { in getBlockedEffectsSummary()
200 } else if (Policy.areAllVisualEffectsSuppressed(policy.suppressedVisualEffects)) { in getBlockedEffectsSummary()
232 private List<String> getEnabledCategories(Policy policy, in getEnabledCategories() argument
[all …]
DZenModeSettingsFooterPreferenceController.java201 public void setNotificationPolicy(NotificationManager.Policy policy) { in setNotificationPolicy() argument
202 mPolicy = policy; in setNotificationPolicy()
209 NotificationManager.Policy policy = savedInstanceState.getParcelable(KEY_POLICY); in onCreateDialog() local
210 if (policy != null) { in onCreateDialog()
211 mPolicy = policy; in onCreateDialog()
/packages/apps/Settings/src/com/android/settings/notification/
DZenModeSettings.java117 String getSoundSettingSummary(Policy policy) { in getSoundSettingSummary() argument
118 List<String> enabledCategories = getEnabledCategories(policy, in getSoundSettingSummary()
142 String getCallsSettingSummary(Policy policy) { in getCallsSettingSummary() argument
143 List<String> enabledCategories = getEnabledCategories(policy, in getCallsSettingSummary()
159 String getMessagesSettingSummary(Policy policy) { in getMessagesSettingSummary() argument
160 List<String> enabledCategories = getEnabledCategories(policy, in getMessagesSettingSummary()
196 String getBlockedEffectsSummary(Policy policy) { in getBlockedEffectsSummary() argument
197 if (policy.suppressedVisualEffects == 0) { in getBlockedEffectsSummary()
200 } else if (Policy.areAllVisualEffectsSuppressed(policy.suppressedVisualEffects)) { in getBlockedEffectsSummary()
232 private List<String> getEnabledCategories(Policy policy, in getEnabledCategories() argument
[all …]
DZenModeSettingsFooterPreferenceController.java201 public void setNotificationPolicy(NotificationManager.Policy policy) { in setNotificationPolicy() argument
202 mPolicy = policy; in setNotificationPolicy()
209 NotificationManager.Policy policy = savedInstanceState.getParcelable(KEY_POLICY); in onCreateDialog() local
210 if (policy != null) { in onCreateDialog()
211 mPolicy = policy; in onCreateDialog()
/packages/apps/Dialer/java/com/android/voicemail/impl/scheduling/
DBaseTask.java101 public BaseTask addPolicy(Policy policy) { in addPolicy() argument
103 policies.add(policy); in addPolicy()
165 for (Policy policy : policies) { in onCreate()
166 policy.onCreate(this, extras); in onCreate()
186 for (Policy policy : policies) { in onBeforeExecute()
187 policy.onBeforeExecute(); in onBeforeExecute()
196 for (Policy policy : policies) { in onCompleted()
197 policy.onFail(); in onCompleted()
201 for (Policy policy : policies) { in onCompleted()
202 policy.onCompleted(); in onCompleted()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/utils/
Dedit_distance.h30 AK_FORCE_INLINE static float getEditDistance(const EditDistancePolicy *const policy) { in getEditDistance() argument
31 const int beforeLength = policy->getString0Length(); in getEditDistance()
32 const int afterLength = policy->getString1Length(); in getEditDistance()
35 dp[(afterLength + 1) * i] = i * policy->getInsertionCost(i - 1, -1); in getEditDistance()
38 dp[i] = i * policy->getDeletionCost(-1, i - 1); in getEditDistance()
44 dp[(afterLength + 1) * i + (j + 1)] + policy->getInsertionCost(i, j), in getEditDistance()
46 dp[(afterLength + 1) * (i + 1) + j] + policy->getDeletionCost(i, j), in getEditDistance()
47 dp[(afterLength + 1) * i + j] + policy->getSubstitutionCost(i, j))); in getEditDistance()
48 if (policy->allowTransposition(i, j)) { in getEditDistance()
52 + policy->getTranspositionCost(i, j)); in getEditDistance()
/packages/apps/Settings/src/com/android/settings/datausage/
DChartDataUsagePreference.java126 private void bindNetworkPolicy(UsageView chart, NetworkPolicy policy, int top) { in bindNetworkPolicy() argument
130 if (policy == null) { in bindNetworkPolicy()
134 if (policy.limitBytes != NetworkPolicy.LIMIT_DISABLED) { in bindNetworkPolicy()
136 labels[2] = getLabel(policy.limitBytes, R.string.data_usage_sweep_limit, mLimitColor); in bindNetworkPolicy()
139 if (policy.warningBytes != NetworkPolicy.WARNING_DISABLED) { in bindNetworkPolicy()
140 chart.setDividerLoc((int) (policy.warningBytes / RESOLUTION)); in bindNetworkPolicy()
141 float weight = policy.warningBytes / RESOLUTION / (float) top; in bindNetworkPolicy()
145 labels[1] = getLabel(policy.warningBytes, R.string.data_usage_sweep_warning, in bindNetworkPolicy()
161 public void setNetworkPolicy(NetworkPolicy policy) { in setNetworkPolicy() argument
162 mPolicy = policy; in setNetworkPolicy()
DDataUsageInfoController.java28 public void updateDataLimit(DataUsageInfo info, NetworkPolicy policy) { in updateDataLimit() argument
29 if (info == null || policy == null) { in updateDataLimit()
32 if (policy.warningBytes >= 0) { in updateDataLimit()
33 info.warningLevel = policy.warningBytes; in updateDataLimit()
35 if (policy.limitBytes >= 0) { in updateDataLimit()
36 info.limitLevel = policy.limitBytes; in updateDataLimit()
DDataSaverBackend.java85 final int policy = whitelisted ? POLICY_ALLOW_METERED_BACKGROUND : POLICY_NONE; in setIsWhitelisted() local
86 mPolicyManager.setUidPolicy(uid, policy); in setIsWhitelisted()
87 mUidPolicies.put(uid, policy); in setIsWhitelisted()
115 final int policy = blacklisted ? POLICY_REJECT_METERED_BACKGROUND : POLICY_NONE; in setIsBlacklisted() local
116 mPolicyManager.setUidPolicy(uid, policy); in setIsBlacklisted()
117 mUidPolicies.put(uid, policy); in setIsBlacklisted()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/datausage/
DChartDataUsagePreference.java126 private void bindNetworkPolicy(UsageView chart, NetworkPolicy policy, int top) { in bindNetworkPolicy() argument
130 if (policy == null) { in bindNetworkPolicy()
134 if (policy.limitBytes != NetworkPolicy.LIMIT_DISABLED) { in bindNetworkPolicy()
136 labels[2] = getLabel(policy.limitBytes, R.string.data_usage_sweep_limit, mLimitColor); in bindNetworkPolicy()
139 if (policy.warningBytes != NetworkPolicy.WARNING_DISABLED) { in bindNetworkPolicy()
140 chart.setDividerLoc((int) (policy.warningBytes / RESOLUTION)); in bindNetworkPolicy()
141 float weight = policy.warningBytes / RESOLUTION / (float) top; in bindNetworkPolicy()
145 labels[1] = getLabel(policy.warningBytes, R.string.data_usage_sweep_warning, in bindNetworkPolicy()
161 public void setNetworkPolicy(NetworkPolicy policy) { in setNetworkPolicy() argument
162 mPolicy = policy; in setNetworkPolicy()
DDataUsageInfoController.java28 public void updateDataLimit(DataUsageInfo info, NetworkPolicy policy) { in updateDataLimit() argument
29 if (info == null || policy == null) { in updateDataLimit()
32 if (policy.warningBytes >= 0) { in updateDataLimit()
33 info.warningLevel = policy.warningBytes; in updateDataLimit()
35 if (policy.limitBytes >= 0) { in updateDataLimit()
36 info.limitLevel = policy.limitBytes; in updateDataLimit()
DDataSaverBackend.java85 final int policy = whitelisted ? POLICY_ALLOW_METERED_BACKGROUND : POLICY_NONE; in setIsWhitelisted() local
86 mPolicyManager.setUidPolicy(uid, policy); in setIsWhitelisted()
87 mUidPolicies.put(uid, policy); in setIsWhitelisted()
115 final int policy = blacklisted ? POLICY_REJECT_METERED_BACKGROUND : POLICY_NONE; in setIsBlacklisted() local
116 mPolicyManager.setUidPolicy(uid, policy); in setIsBlacklisted()
117 mUidPolicies.put(uid, policy); in setIsBlacklisted()
/packages/services/Car/service/src/com/android/car/pm/
DCarPackageManagerService.java212 public void setAppBlockingPolicy(String packageName, CarAppBlockingPolicy policy, int flags) { in setAppBlockingPolicy() argument
216 doSetAppBlockingPolicy(packageName, policy, flags); in setAppBlockingPolicy()
227 private void doSetAppBlockingPolicy(String packageName, CarAppBlockingPolicy policy, in doSetAppBlockingPolicy() argument
235 if (policy == null) { in doSetAppBlockingPolicy()
245 mWaitingPolicies.add(policy); in doSetAppBlockingPolicy()
248 mHandler.requestUpdatingPolicy(packageName, policy, flags); in doSetAppBlockingPolicy()
252 while (mWaitingPolicies.contains(policy)) { in doSetAppBlockingPolicy()
336 for (ClientPolicy policy : mClientPolicies.values()) { in searchFromBlacklistsLocked()
337 AppBlockingPackageInfoWrapper wrapper = policy.blacklistsMap.get(packageName); in searchFromBlacklistsLocked()
347 for (ClientPolicy policy : mClientPolicies.values()) { in searchFromWhitelistsLocked()
[all …]
DAppBlockingPolicyProxy.java108 ICarAppBlockingPolicy policy = null; in onServiceConnected() local
112 policy = mPolicyService; in onServiceConnected()
113 if (policy == null) { in onServiceConnected()
154 public void setAppBlockingPolicy(CarAppBlockingPolicy policy) { in setAppBlockingPolicy() argument
156 if (policy == null) { in setAppBlockingPolicy()
160 mService.onPolicyConnectionAndSet(AppBlockingPolicyProxy.this, policy); in setAppBlockingPolicy()
/packages/services/Car/tests/carservice_test/src/com/android/car/
DCarPackageManagerTest.java94 CarAppBlockingPolicy policy = new CarAppBlockingPolicy(new AppBlockingPackageInfo[] { info } in testSettingWhitelist() local
97 mCarPm.setAppBlockingPolicy(thisPackage, policy, in testSettingWhitelist()
107 policy = new CarAppBlockingPolicy(new AppBlockingPackageInfo[] { info } in testSettingWhitelist()
109 mCarPm.setAppBlockingPolicy(thisPackage, policy, in testSettingWhitelist()
119 policy = new CarAppBlockingPolicy(new AppBlockingPackageInfo[] { info } in testSettingWhitelist()
121 mCarPm.setAppBlockingPolicy(thisPackage, policy, in testSettingWhitelist()
132 policy = new CarAppBlockingPolicy(new AppBlockingPackageInfo[] { info } in testSettingWhitelist()
134 mCarPm.setAppBlockingPolicy(thisPackage, policy, in testSettingWhitelist()
DTestAppBlockingPolicyService.java63 CarAppBlockingPolicy policy = new CarAppBlockingPolicy(whitelists, null); in getAppBlockingPolicy() local
64 Log.i(TAG, "getAppBlockingPolicy, passing policy:" + policy); in getAppBlockingPolicy()
65 return policy; in getAppBlockingPolicy()
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/
DBatteryTipLoader.java67 final BatteryTipPolicy policy = new BatteryTipPolicy(getContext()); in loadInBackground() local
71 tips.add(new LowBatteryDetector(context, policy, batteryInfo).detect()); in loadInBackground()
72 tips.add(new HighUsageDetector(context, policy, mBatteryStatsHelper, in loadInBackground()
74 tips.add(new SmartBatteryDetector(policy, context.getContentResolver()).detect()); in loadInBackground()
75 tips.add(new EarlyWarningDetector(policy, context).detect()); in loadInBackground()
76 tips.add(new SummaryDetector(policy, batteryInfo.averageTimeToDischarge).detect()); in loadInBackground()
77 tips.add(new RestrictAppDetector(context, policy).detect()); in loadInBackground()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/fuelgauge/batterytip/
DBatteryTipLoader.java67 final BatteryTipPolicy policy = new BatteryTipPolicy(getContext()); in loadInBackground() local
71 tips.add(new LowBatteryDetector(context, policy, batteryInfo).detect()); in loadInBackground()
72 tips.add(new HighUsageDetector(context, policy, mBatteryStatsHelper, in loadInBackground()
74 tips.add(new SmartBatteryDetector(policy, context.getContentResolver()).detect()); in loadInBackground()
75 tips.add(new EarlyWarningDetector(policy, context).detect()); in loadInBackground()
76 tips.add(new SummaryDetector(policy, batteryInfo.averageTimeToDischarge).detect()); in loadInBackground()
77 tips.add(new RestrictAppDetector(context, policy).detect()); in loadInBackground()
/packages/services/Car/service/src/com/android/car/garagemode/
DWakeupPolicy.java46 WakeupPolicy(String[] policy) { in WakeupPolicy() argument
47 mWakeupIntervals = parsePolicy(policy); in WakeupPolicy()
87 private LinkedList<WakeupInterval> parsePolicy(String[] policy) { in parsePolicy() argument
89 if (policy == null || policy.length == 0) { in parsePolicy()
94 for (String rule : policy) { in parsePolicy()
/packages/inputmethods/LatinIME/native/jni/tests/suggest/policyimpl/utils/
Ddamerau_levenshtein_edit_distance_policy_test.cpp32 DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(), in TEST() local
35 EXPECT_EQ(static_cast<int>(codePoints0.size()), policy.getString0Length()); in TEST()
36 EXPECT_EQ(static_cast<int>(codePoints1.size()), policy.getString1Length()); in TEST()
40 DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(), in getEditDistance() local
42 return EditDistance::getEditDistance(&policy); in getEditDistance()
/packages/services/Car/tools/
Dupdate-obd2-sensors.py211 def applyPolicy(policy, destfile): argument
213 applyIntPolicy(policy, destfile)
214 applyFloatPolicy(policy, destfile)
216 def applyIntPolicy(policy, destfile): argument
218 print(policy.sensors(intSensors), file=destfile)
220 def applyFloatPolicy(policy, destfile): argument
222 print(policy.sensors(floatSensors), file=destfile)

123