Lines Matching refs:Policy
25 import com.android.emailcommon.provider.Policy;
35 * This is a series of unit tests for the Policy class
70 Policy policy1 = new Policy();
71 Policy.setAccountPolicy(mMockContext, account1, policy1, securitySyncKey);
73 Policy policy2 = new Policy();
74 Policy.setAccountPolicy(mMockContext, account2, policy2, securitySyncKey);
82 assertEquals(account1.mId, Policy.getAccountIdWithPolicyKey(mMockContext,
84 assertEquals(account2.mId, Policy.getAccountIdWithPolicyKey(mMockContext,
93 assertEquals(0, EmailContent.count(mMockContext, Policy.CONTENT_URI));
94 Policy policy = new Policy();
95 Policy.setAccountPolicy(mMockContext, account, policy, securitySyncKey);
99 Policy dbPolicy = Policy.restorePolicyWithId(mMockContext, account.mPolicyKey);
100 // The policy should exist in the database
103 assertEquals(policy, dbPolicy);
106 Policy.clearAccountPolicy(mMockContext, account);
108 // Make sure policyKey is cleared and policy is deleted
110 assertEquals(0, EmailContent.count(mMockContext, Policy.CONTENT_URI));
123 Policy policy1 = new Policy();
125 Policy.setAccountPolicy(mMockContext, acct, policy1, null);
150 // Enforce our no-attachments policy
151 Policy.setAttachmentFlagsForNewPolicy(mMockContext, acct, policy1);
156 Policy policy2 = new Policy();
158 // Switch to new policy that sets a limit, but otherwise allows attachments
159 Policy.setAttachmentFlagsForNewPolicy(mMockContext, acct, policy2);
169 Policy policy3 = new Policy();
171 // Switch to new policy that sets a lower limit
172 Policy.setAttachmentFlagsForNewPolicy(mMockContext, acct, policy3);
180 Policy policy4 = new Policy();
181 // Switch to new policy that is without restrictions
182 Policy.setAttachmentFlagsForNewPolicy(mMockContext, acct, policy4);
189 Policy policy = new Policy();
190 policy.mPasswordMode = Policy.PASSWORD_MODE_STRONG;
191 policy.mPasswordMinLength = 6;
192 policy.mPasswordComplexChars = 5;
193 policy.mPasswordExpirationDays = 4;
194 policy.mPasswordHistory = 3;
195 policy.mPasswordMaxFails = 8;
196 policy.mMaxScreenLockTime = 600;
197 policy.mRequireRemoteWipe = true;
198 policy.mRequireEncryption = true;
199 policy.mRequireEncryptionExternal = true;
200 policy.mRequireManualSyncWhenRoaming = true;
201 policy.mDontAllowCamera = false;
202 policy.mDontAllowAttachments = true;
203 policy.mDontAllowHtml = false;
204 policy.mMaxAttachmentSize = 22222;
205 policy.mMaxTextTruncationSize = 33333;
206 policy.mMaxHtmlTruncationSize = 44444;
207 policy.mMaxEmailLookback = 5;
208 policy.mMaxCalendarLookback = 6;
209 policy.mPasswordRecoveryEnabled = true;
211 policy.writeToParcel(parcel, 0);
213 Policy readPolicy = Policy.CREATOR.createFromParcel(parcel);
214 assertEquals(policy, readPolicy);