Searched refs:policy (Results 1 - 25 of 30) sorted by relevance

12

/packages/apps/Settings/src/com/android/settings/net/
H A DNetworkPolicyEditor.java60 for (NetworkPolicy policy : policies) {
62 if (policy.limitBytes < -1) {
63 policy.limitBytes = LIMIT_DISABLED;
66 if (policy.warningBytes < -1) {
67 policy.warningBytes = WARNING_DISABLED;
71 mPolicies.add(policy);
95 final NetworkPolicy policy = getPolicy(template);
96 return policy != null && policy.limitBytes != LIMIT_DISABLED;
100 NetworkPolicy policy
[all...]
H A DDataUsageMeteredSettings.java135 final NetworkPolicy policy = mPolicyEditor.getPolicyMaybeUnquoted(template);
136 if (policy != null) {
137 if (policy.limitBytes != LIMIT_DISABLED) {
141 setChecked(policy.metered);
/packages/apps/Exchange/tests/src/com/android/exchange/adapter/
H A DProvisionParserTests.java122 Policy policy = parser.getPolicy();
123 assertNotNull(policy);
125 assertEquals(5*60, policy.mMaxScreenLockTime); // Screen lock time is in seconds
126 assertEquals(8, policy.mPasswordMinLength);
127 assertEquals(Policy.PASSWORD_MODE_STRONG, policy.mPasswordMode);
128 assertEquals(20, policy.mPasswordMaxFails);
129 assertTrue(policy.mRequireRemoteWipe);
135 Policy policy = parser.getPolicy();
136 assertNotNull(policy);
138 assertEquals(Policy.PASSWORD_MODE_NONE, policy
[all...]
/packages/apps/Email/emailcommon/src/com/android/emailcommon/service/
H A DLegacyPolicySet.java21 * Legacy class for policy storage as a bit field of flags
64 * Convert legacy policy flags to a Policy
65 * @param flags legacy policy flags
66 * @return a Policy representing the legacy policy flag
69 Policy policy = new Policy();
70 policy.mPasswordMode = ((int) (flags & PASSWORD_MODE_MASK)) >> PASSWORD_MODE_SHIFT;
71 policy.mPasswordMinLength = (int) ((flags & PASSWORD_LENGTH_MASK) >> PASSWORD_LENGTH_SHIFT);
72 policy.mPasswordMaxFails =
74 policy.mPasswordComplexChars =
76 policy
[all...]
H A DIPolicyService.aidl24 void setAccountPolicy(long accountId, in Policy policy, String securityKey);
26 void setAccountPolicy2(long accountId, in Policy policy, String securityKey, boolean notify);
H A DPolicyServiceProxy.java61 // This is not a great situation, but it's better to act like the policy isn't enforced
71 public void setAccountPolicy(final long accountId, final Policy policy, argument
73 setAccountPolicy2(accountId, policy, securityKey, true /* notify */);
77 public void setAccountPolicy2(final long accountId, final Policy policy, argument
82 mService.setAccountPolicy2(accountId, policy, securityKey, notify);
97 // This is not a great situation, but it's better to act like the policy isn't enforced
151 public static void setAccountPolicy(Context context, long accountId, Policy policy, argument
153 setAccountPolicy2(context, accountId, policy, securityKey, true /* notify */);
156 public static void setAccountPolicy2(Context context, long accountId, Policy policy, argument
159 new PolicyServiceProxy(context).setAccountPolicy2(accountId, policy, securityKe
[all...]
/packages/apps/Exchange/src/com/android/exchange/adapter/
H A DProvisionParser.java95 * policy documents, as all versions of the OS support the policies in xml documents).
97 private void setPolicy(Policy policy) { argument
98 policy.normalize();
100 if (policy.mDontAllowAttachments) {
103 if (policy.mRequireManualSyncWhenRoaming) {
106 policy.mProtocolPoliciesEnforced = sb.toString();
107 mPolicy = policy;
118 Policy policy = new Policy();
129 if (policy.mPasswordMode == Policy.PASSWORD_MODE_NONE) {
130 policy
451 parseCharacteristic(XmlPullParser parser, Policy policy) argument
493 parseRegistry(XmlPullParser parser, Policy policy) argument
508 parseWapProvisioningDoc(XmlPullParser parser, Policy policy) argument
[all...]
/packages/apps/Email/tests/src/com/android/email/
H A DMockVendorPolicy.java29 public static Bundle getPolicy(String policy, Bundle args) { argument
30 passedPolicy = policy;
H A DSecurityPolicyTests.java112 Policy policy = new Policy();
113 policy.mPasswordMinLength = minPasswordLength;
114 policy.mPasswordMode = passwordMode;
115 policy.mPasswordMaxFails = maxPasswordFails;
116 policy.mMaxScreenLockTime = maxScreenLockTime;
117 policy.mRequireRemoteWipe = requireRemoteWipe;
118 policy.mPasswordExpirationDays = passwordExpirationDays;
119 policy.mPasswordHistory = passwordHistory;
120 policy.mPasswordComplexChars = passwordComplexChars;
121 policy
479 policySetEqualsPolicy(PolicySet ps, Policy policy) argument
[all...]
/packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/utils/
H A Dedit_distance.h30 AK_FORCE_INLINE static float getEditDistance(const EditDistancePolicy *const policy) { argument
31 const int beforeLength = policy->getString0Length();
32 const int afterLength = policy->getString1Length();
35 dp[(afterLength + 1) * i] = i * policy->getInsertionCost(i - 1, -1);
38 dp[i] = i * policy->getDeletionCost(-1, i - 1);
44 dp[(afterLength + 1) * i + (j + 1)] + policy->getInsertionCost(i, j),
46 dp[(afterLength + 1) * (i + 1) + j] + policy->getDeletionCost(i, j),
47 dp[(afterLength + 1) * i + j] + policy->getSubstitutionCost(i, j)));
48 if (policy->allowTransposition(i, j)) {
52 + policy
[all...]
/packages/inputmethods/LatinIME/native/jni/tests/suggest/policyimpl/utils/
H A Ddamerau_levenshtein_edit_distance_policy_test.cpp32 DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(),
35 EXPECT_EQ(static_cast<int>(codePoints0.size()), policy.getString0Length());
36 EXPECT_EQ(static_cast<int>(codePoints1.size()), policy.getString1Length());
40 DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(),
42 return EditDistance::getEditDistance(&policy);
/packages/apps/Email/tests/src/com/android/email/provider/
H A DPolicyTests.java96 Policy policy = new Policy();
97 SecurityPolicy.setAccountPolicy(mMockContext, account, policy, securitySyncKey);
102 // The policy should exist in the database
105 assertEquals(policy, dbPolicy);
110 // Make sure policyKey is cleared and policy is deleted
152 // Enforce our no-attachments policy
160 // Switch to new policy that sets a limit, but otherwise allows attachments
173 // Switch to new policy that sets a lower limit
183 // Switch to new policy that is without restrictions
191 Policy policy
[all...]
/packages/experimental/StrictModeTest/src/com/android/strictmodetest/
H A DServiceBase.java59 int policy = BlockGuard.getThreadPolicy().getPolicyMask();
60 Log.d(TAG, "Doing a one-way disk write; policy is: " + policy);
69 int policy = BlockGuard.getThreadPolicy().getPolicyMask();
70 Log.d(TAG, "Doing a diskWrite; policy is: " + policy, new IAmHereException());
H A DStrictModeActivity.java140 BlockGuard.Policy policy = BlockGuard.getThreadPolicy();
142 policy.onWriteToDisk();
267 int policy;
269 policy = mLocalServiceConn.stub.getThreadPolicy();
270 Log.d(TAG, "local service policy: " + policy);
271 policy = mRemoteServiceConn.stub.getThreadPolicy();
272 Log.d(TAG, "remote service policy: " + policy);
387 StrictMode.ThreadPolicy policy
[all...]
/packages/apps/Email/provider_src/com/android/email/
H A DSecurityPolicy.java76 * Get the security policy instance
103 * Compute the aggregate policy for all accounts that require it, and record it.
116 * @return a policy representing the strongest aggregate. If no policy sets are defined,
117 * a lightweight "nothing required" policy will be returned. Never null.
140 Policy policy = new Policy();
143 policy.restore(c);
145 LogUtils.d(TAG, "Aggregate from: " + policy);
148 Math.max(policy.mPasswordMinLength, aggregate.mPasswordMinLength);
149 aggregate.mPasswordMode = Math.max(policy
249 isActive(Policy policy) argument
319 getInactiveReasons(Policy policy) argument
536 setAccountPolicy(Context context, Account account, Policy policy, String securitySyncKey) argument
597 setAccountPolicy(long accountId, Policy policy, String securityKey, boolean notify) argument
[all...]
/packages/apps/Email/provider_src/com/android/email/service/
H A DPolicyService.java41 public boolean isActive(Policy policy) {
43 return mSecurityPolicy.isActive(policy);
70 public void setAccountPolicy(long accountId, Policy policy, String securityKey) {
71 setAccountPolicy2(accountId, policy, securityKey, true /* notify */);
75 public void setAccountPolicy2(long accountId, Policy policy, String securityKey,
78 mSecurityPolicy.setAccountPolicy(accountId, policy, securityKey, notify);
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/widget/
H A DViewsStateBundle.java60 public ViewsStateBundle(int policy, int limit) { argument
61 savePolicy = policy;
122 * Save views regardless what's the current policy is.
135 * The visible view is saved when policy is not {@link #SAVE_NO_CHILD}.
156 * Save list of visible views without checking policy. The method is to be implemented by
162 * Save views according to policy.
/packages/apps/Settings/src/com/android/settings/widget/
H A DChartDataUsageView.java167 public void bindNetworkPolicy(NetworkPolicy policy) { argument
168 if (policy == null) {
176 if (policy.limitBytes != NetworkPolicy.LIMIT_DISABLED) {
179 mSweepLimit.setValue(policy.limitBytes);
186 if (policy.warningBytes != NetworkPolicy.WARNING_DISABLED) {
188 mSweepWarning.setValue(policy.warningBytes);
220 // always show known data and policy lines
/packages/apps/Email/src/com/android/email/activity/setup/
H A DAccountSetupOptionsFragment.java142 // Find a proper maximum for email lookback, based on policy (if we have one)
144 final Policy policy = account.mPolicy;
145 if (policy != null) {
146 final int maxLookback = policy.mMaxEmailLookback;
H A DAccountSettingsFragment.java103 @SuppressWarnings("unused") // temporarily unused pending policy UI
105 @SuppressWarnings("unused") // temporarily unused pending policy UI
591 @SuppressWarnings("unused") // temporarily unused pending policy UI
592 private ArrayList<String> getSystemPoliciesList(Policy policy) { argument
595 if (policy.mPasswordMode != Policy.PASSWORD_MODE_NONE) {
598 if (policy.mPasswordHistory > 0) {
601 if (policy.mPasswordExpirationDays > 0) {
604 if (policy.mMaxScreenLockTime > 0) {
607 if (policy.mDontAllowCamera) {
610 if (policy
[all...]
H A DSetupDataFragment.java40 private static final String SAVESTATE_POLICY = "SetupDataFragment.policy";
162 public synchronized void setPolicy(Policy policy) { argument
163 mPolicy = policy;
278 sb.append(":policy=");
/packages/apps/Email/emailcommon/src/com/android/emailcommon/
H A DVendorPolicyLoader.java30 * A bridge class to the email vendor policy apk.
32 * <p>Email vendor policy is a system apk named "com.android.email.helper". When exists, it must
33 * contain a class called "com.android.email.policy.EmailPolicy" with a static public method
36 * <p>A vendor policy apk is optional. The email application will operate properly when none is
40 private static final String POLICY_PACKAGE = "com.android.email.policy";
79 LogUtils.d(Logging.LOG_TAG, String.format("Using policy: package=%s name=%s",
118 // Package not found -- it's okay - there's no policy .apk found, which is OK
140 * Calls the getPolicy method in the policy apk, if one exists. This method never returns null;
141 * It returns an empty {@link Bundle} when there is no policy apk (or even if the inner
145 public Bundle getPolicy(String policy, Bundl argument
[all...]
/packages/apps/UnifiedEmail/src/com/android/mail/utils/
H A DHtmlSanitizer.java138 * This sanitizer policy removes these elements and the content within:
148 * This sanitizer policy removes these elements but preserves the content within:
162 * This sanitizer policy removes these attributes from all elements:
397 // create a thread-specific policy
398 final org.owasp.html.HtmlSanitizer.Policy policy = POLICY_DEFINITION.apply(renderer);
403 org.owasp.html.HtmlSanitizer.sanitize(rawHtml, policy);
/packages/apps/Email/emailcommon/src/com/android/emailcommon/provider/
H A DPolicy.java47 CONTENT_URI = Uri.parse(EmailContent.CONTENT_URI + "/policy");
52 /* Small offset (2 minutes) added to policy expiration to make user testing easier. */
176 // We override this method to insure that we never write invalid policy data to the provider
188 * @param policy the new policy for this account
191 Policy policy) {
200 int policyMax = policy.mDontAllowAttachments ? 0 : (policy.mMaxAttachmentSize > 0) ?
201 policy.mMaxAttachmentSize : Integer.MAX_VALUE;
190 setAttachmentFlagsForNewPolicy(Context context, Account account, Policy policy) argument
/packages/apps/Settings/src/com/android/settings/
H A DDataUsageSummary.java871 final NetworkPolicy policy = mPolicyEditor.getPolicy(mTemplate);
872 if (policy != null) {
874 final long start = computeLastCycleBoundary(currentTime, policy);
879 totalBytes = mStatsService.getNetworkTotalBytes(policy.template, start, end);
884 if (policy.isOverLimit(totalBytes) && policy.lastLimitSnooze < start) {
1056 //TODO: deprecate and remove this once enabled flag is on policy
1082 private boolean isNetworkPolicyModifiable(NetworkPolicy policy) { argument
1083 return policy != null && isBandwidthControlEnabled() && mDataEnabled.isChecked()
1128 // TODO: move enabled state directly into policy
1163 updateCycleList(NetworkPolicy policy) argument
[all...]

Completed in 861 milliseconds

12