History log of /packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7037a0bd3d8e925a9115f475f5c0d05ddae2eeee 17-Dec-2013 Jerry Xie <jjx@google.com> Disable, suppress, remove broken and obsolete Email tests

Change-Id: Ia4dcba1c6966f23dd2a15e69324b7345aed8f944
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
17d3a29c9d8f7a27c463239f190bdcc4e0804527 27-Nov-2013 Jerry Xie <jjx@google.com> Get Email units to compile

Change-Id: I171a0e2421c5006d9862ad94f886932146547020
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
03cd72805dab0379ed255d151f1c17cc60655fc3 25-Apr-2012 Marc Blank <mblank@google.com> Revert to old Email app

* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
2736c1a11ce3ecdcd9d19aa9c324fb9ce0910c7b 20-Oct-2011 Marc Blank <mblank@google.com> Rewrite of security policy handling and service code

* Remove PolicyService APIs policiesRequired, policiesUpdated,
isSupported, clearUnsupportedPolicies, and isActiveAdmin
* Add PolicyService API setAccountPolicy, which is the sole
method by which security policies are promulgated
* Add protocolPoliciesEnabled and protocolPoliciesUnsupported
to the Policy class; these are packed, localized strings
indicating policies that the protocol itself have enabled
and/or cannot support (i.e. these are policies that are
unknown to the DPM, e.g. don't load attachments)
* Differentiate in security notifications between three kinds
of policy changes - changes that don't require user
intervention (e.g. reducing requirements), changes that
require user intervention (the legacy notification), and
changes that make the account unsyncable (e.g. the server
adding an unsupportable policy). Handle all possible policy
changes cleanly.
* Make security notifications per account (with multiple
accounts, notifications would get arbitrarily munged)
* Expose ALL enforced policies via the account settings
screen in two categories: policies enforced (including
both policies enforced by the DPM and policies enforced
by the protocol) and policies unsupported (note that these
can only be seen if policies are changed after an account
is created; we do not allow the creation of an account
when any required policies are unsupported). Add a
button that forces a sync attempt, for accounts that
are locked out, but whose policies have changed on
the server (this would otherwise require a reboot).
* Updated unit tests

Bug: 5398682
Bug: 5393724
Bug: 5379682
Change-Id: I4a3df823913a809874ed959d228177f0fc799281
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
cb1d65c47825dc7a45c7954cd93669296b35305e 26-Jul-2011 Ben Komalo <benkomalo@google.com> Fix mailbox finding and unit tests.

We seemed to not properly fallback to querying the database if the cache
did not contain a mailbox of a specific type. We may want to consider
caching mailboxes related to PIM data, but for now this is a quick fix.

Also fixes unit tests.

Bug: 5019661
Change-Id: Idcac0a6f15aa7f174890ae586f478fbb8f6e05b7
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
1ecfb5311b0315edf86a450398a8712dbfd86772 20-Jul-2011 Ben Komalo <benkomalo@google.com> Remove illegal references to IsolatedContext

This fixes a crash on account deletion, leaving around bad accounts that
were in limbo
Also remove a test for an unsupported operation

Bug: 5051951
Change-Id: Ieebc7f769075614ae1a656cf123d8ce0313e611d
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
4e4aba9ebc43c6a83190f3a883fa05bb7d5100b3 19-Jul-2011 Marc Blank <mblank@google.com> Clean up account reconciliation

* Move AccountReconciler to the Email app (from EmailCommon)
* Ensure that Controller.deleteAccountSync() performs ALL actions
needed to clean up after an account deletion (delete attachment
files, reset policies, refresh the UI, etc.)
* Add reconcileAccounts() API to AccountService
* Remove accountDeleted() and restoreAccountsIfNeede() from the
AccountService API
* Remove unused callback

Bug: 4883073
Bug: 4767084

Change-Id: I43ffaf009db1a6f306bb0f2a74fb4dd3b2c4b966
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
e76962b1b9c66ecc3fd49cd4c956f234365bfe5c 01-Jul-2011 Ben Komalo <benkomalo@google.com> Revert "Enable SD card encryption policy when emulated"

This is a manual cherry-pick of c379ebe3722b5d21201246a714eeea99d8679b96
This reverts commit 7fd14be80447de15bd5360321fa80e34f60fa251

The introduction of proper SD cards breaks the invariant that "external"
storage can be encrypted. Unfortunately, this means that accounts with
that policy bit set will have to be removed for now.

Accounts with the security policy set will be forced to go through
security provisioning on the next sync, using the regular mechanisms of
showing a notification with "Security update required", and then having
it fail. :(

Bug: 4466311
Change-Id: I68119b14f8d198779c2073296e228bc6772136ee
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
0404a331ad14f3473be5905f73956626896b05c8 22-Jun-2011 Marc Blank <mblank@google.com> Merge "Improve EmailContent caching..."
6e418aa41a17136be0dddb816d843428a0a1e722 19-Jun-2011 Marc Blank <mblank@google.com> Improve EmailContent caching...

* Guarantee that up to 16 Account (with HostAuths), and Policy rows
are always cached. Also, 6 commonly used Mailboxes per Account
(Inbox, Outbox, Drafts, Sent, Trash, and Search)
* Precache these rows when EmailProvider starts up
* Ensure that newly added, precachable rows are cached when created
* Clean up some inefficient/wrong caching code
* Fix a commonly called method in NotificationManager in which we
load a single Mailbox row using selection vs withAppendedId
* Confirm that we don't read from the database in typical use and
heavy message loading
* Add a special URI for finding mailbox by type (using the cache)
* Add special-case code for EmailContent.count(Account.CONTENT_URI)
which is used in a number of places (including on the UI thread)
and whose value is easily determined
* Add a special URI to get the default account id
* Confirm that all unit tests work

The goal here is to be able to load all Account, HostAuth, Policy,
and Mailbox objects (by id) without worrying about disk access.
There will still be a single disk read for uncommon Mailbox reads,
but this should be considered acceptable.

Change-Id: Ibc9aa7acc73185e360b0b6f3053b90a985e97210
TODO: Unit tests
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
505ac4b09bbe13ff099e40d94e45963e46a9261f 22-Jun-2011 Ben Komalo <benkomalo@google.com> Prevent NPE when account can't be found for policy

Added some tests to ensure no orphaned policy

Bug: 4686450
Change-Id: I64a1f5de05f3e73052cb41828ed6bf1a2e26d22a
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
d09cff08882e553afce919865a2cc60b657d4659 06-May-2011 Ben Komalo <benkomalo@google.com> Make "don't allow camera" a supported policy.

This sends the bit to the DPM. Separate changes have been/will be made
to change the provision parser and support it in the DPM.

Bug: 4185316
Change-Id: I44872ceb095a28539b047a0641cc499c7186a9b3
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
f5418f1f93b02e7fab9f15eb201800b65510998e 14-Jun-2011 Marc Blank <mblank@google.com> Move Account into its own top-level class

Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
fae5ebbfd202b930296a1bbc67459152f1a6c6ce 26-May-2011 Marc Blank <mblank@google.com> Cleanup code in Policy

* Use a single method for setting/clearing an account's policy

Change-Id: I90fd97d4a5ba452d4656bbabd06a40797c82e10c
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
53ea83ebf91f820692e8fa8e781f5cc982dd94db 14-May-2011 Ben Komalo <benkomalo@google.com> Move Mailbox to top level class.

No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
aeee10e57ef4d931e7708fde218d590453a82aea 28-Apr-2011 Marc Blank <mblank@google.com> Rework of security policy storage

* Replace crazy (and soon to be "full") bit fields stored in an account's
securityFlags with a row in a newly created Policy table (thus, fully
expandable)
* Update code from database version 17 to 18; adds Policy table, a
policyKey row in Account, and a revised trigger that deletes Policy
information for deleted Accounts
* Update old PolicySet unit tests to work against the new Policy class
* Add test for the conversion of securityFlags to Policy
* Tested in a variety of scenarios; appears to be functionally equivalent

Change-Id: I1505ee75230d6a0d3c2b62a46326f39c2c7f9eb5
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
22759bacd95385d95d3d9321f490763df1aba89d 16-Mar-2011 Andy Stadler <stadler@google.com> Handle complex chars policy correctly

* We needed to set DevicePolicyMnager.PASSWORD_QUALITY_COMPLEX
* Setting this, we also need to clear some of the defaults for complex
mode that are not correct for Exchange's definition of "complex".
* Unit tests

Bug: 4092218
Change-Id: Iea7bd05d48f1aa9406222c1db5937cfd7f2662b8
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
7fd14be80447de15bd5360321fa80e34f60fa251 03-Mar-2011 Andy Stadler <stadler@google.com> Enable SD card encryption policy when emulated

* This is is a minimal implementation that only supports the external
encryption policy when there is no physical/removable storage, and
the emulated external storage is located within an encrypted backing
store.

Bug: 3351426
Change-Id: Id96e9277f810beeebf816a914acd3d733eb713ea
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
31d9acbf0623872f9d4a2b3210b5970854b654c7 12-Feb-2011 Marc Blank <mblank@google.com> Email split, part huit: Refactor constants, clean emailcommon

* There are three pieces to this CL (sorry):
1) Move and/or rename some constants into emailcommon
2) Move Utility to emailcommon, moving the few UI
related utilities back into Email (FolderProperties
and UiUtilities)
3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
a7bc0319a75184ad706bb35c049af107ac3688e6 10-Feb-2011 Marc Blank <mblank@google.com> Email split, part six: EmailContent

* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
9ba506c4dd498150555f6c59aa758f7467bf9236 09-Feb-2011 Marc Blank <mblank@google.com> Email split, part deux: PolicyService

* Split PolicySet from SecurityPolicy and move to emailcommon
* Define PolicyService that sync adapter services can use to
interact with the Email DPM administrator
* Implement PolicyServiceProxy for exchange
* Implement PolicyService in email
* Modify imports, references, etc. as required

Bug: 3442973

Change-Id: I92015e21f780a68754b318da89fbb33570f334a2
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
a0d080558ff06f88f000cf424803c8241dd8d2eb 19-Jan-2011 Andy Stadler <stadler@google.com> Properly handle unsupported encryption policy

* This fixes the case of:
* a device that does *not* support device encryption
* connecting to an account that *does* require device encryption
* but also supports "non-provisioned devices" (making the encryption
requirement optional.)
* Added unit test

Bug: 3367191
Change-Id: I894e68c4119a102dad02d2e0815fccdae1e87189
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
469f2987dc11d153434e50eb04dd6b83b924d09d 13-Jan-2011 Andy Stadler <stadler@google.com> Add encryption to SecurityPolicy

* Add encrypted-storage to uses-policies
* Add new field to PolicySet
* Add "false" to all constructor callers
* Add unit tests (including fixing some existing unit tests)
* Add new logic to AccountSecurity activity t0 dispatch both password
and encryption requests.

Bug: 3346641
Change-Id: I54f39bc9b6fbe21c033a05b36b83081e5c78a296
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
1ca111c19c83d54ad23bd8615d9c648e09ec3366 01-Dec-2010 Andy Stadler <stadler@google.com> Add password expiration plumbing

* Set aggregated expiration values with DPM
* Fix min/max logic when aggregating, and fix unit test
* Add expiration tests when checking if policies are active
* Add expire-password to uses-policies set
* Handle password refresh (clear notifications and sec. holds)
* Handle password expiration (warning and/or wipe synced data)
* Unit tests for provider-level methods
* Refactor common security notification logic
* Placeholder notification strings (need final)

Bug: 3197935
Change-Id: Idf1975edd81dd7f55729156dc6b1002b7d09841f
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
02d59d21949a77c60859b615312f02e6d8003490 25-Oct-2010 Marc Blank <mblank@google.com> Delete secured accounts if device admin is disabled

* Update unit test

Bug: 2817683
Change-Id: Ia7117c34e7bbba13ac4f2ff375d19b3ef94ef49c
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
0813c7051ff91e569c7100977502247d848283a1 22-Sep-2010 Andrew Stadler <stadler@android.com> resolved conflicts for merge of 0d9ed341 to master

Change-Id: I198f760ef1734cf4a64c875236a2352859dc1a72
6278dcdeafadc55fe1a57eec42a0807874377f62 22-Sep-2010 Andy Stadler <stadler@android.com> Fix test failures

Methods were used by tests only and being stripped by PG.

Bug: 2894378
Change-Id: Ieb1dd0daa8bd380c66a7b1e6151c5e5b22cbe38c
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
61911d4ff70132fa21c5ee7a987303479e8ef6ae 28-Aug-2010 Marc Blank <mblank@google.com> Fix another inconsistent set of PolicySet values

* EAS can send both "simple password" and a non-zero number of
required complex characters; we're supposed to ignore the
complex character requirement in this case
* Force complex characters to zero if password is "simple"
* Update constructor test to check the fix

Bug: 2903349
Change-Id: I3d42bd3c8f3667d8f3027da9e91e0dd18722d9bf
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
a30631da1cae25be3f75137133297e30cef2db9c 12-Aug-2010 Andrew Stadler <stadler@android.com> Clear password related policies in PolicySet when p/w not required

Merge from master of c263810b08943541135a24e2b7520692152455cc

Bug: 2883736
Change-Id: Iec4ed0e320d67aee8a89092ac650c0960540057b
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
c263810b08943541135a24e2b7520692152455cc 07-Aug-2010 Marc Blank <mblank@google.com> Clear password related policies in PolicySet when p/w not required

Bug: 2883736
Change-Id: I2c9c573aea9a4fef1699ff6339e8ef628d7f2269
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
b91eea011961889b355a3c5ad837745099c7749a 04-Aug-2010 Marc Blank <mblank@google.com> resolved conflicts for merge of fbf501fe to master

Change-Id: Ic68cbf2de1877ab06744287f57c1c33c4e0e573a
2b2b3448ec200f3d649e5f57309908d28ce3bfc7 02-Aug-2010 Marc Blank <mblank@google.com> Handle inactivity timeout > maximum allowed properly

* In a recent change, we mistakenly removed the logic for handling
too-long inactivity timeouts; we should just fall back to the maximum
since this is stricter than what we're being asked to enforce
* Restore this logic and update the unit test
* The regression was caused by change Ida5663a9, to wit:
Backport: Handle "Allow non-provisionable devices" properly

Bug: 2886746
Change-Id: I99cf9a37441b80477cc1c2c7ec2a78f8a14a83da
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
bcf32320e2600e96c8a9e997a8903bfc3893b35e 27-Jul-2010 Makoto Onuki <omakoto@google.com> Move isSecurityHold/clearAccountHoldFlags to Account

- Added unit tests
- I see the "open a cursor, move to the first row, read a column" pattern over
and over. Added a utility method for this. (Let's try not to bloat the
binary by copying code around!)
- Added helper classes for database related tests
- Removed code dup

Change-Id: I380959215cc1661b252158f0f6e35369b499cdf8
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
8b36acb10d555b59ec0497f6c71426af823c7931 14-Jun-2010 Marc Blank <mblank@google.com> Backport: Handle "Allow non-provisionable devices" properly

* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
even if "Allow..." is enabled (currently, we simply don't see the
policies)
* If we don't support all of the policies, send back the response
code indicating support for partial support. If we get a positive
response back, then we're good to go - the server allows devices
with partial support. Otherwise, we fail as we always have - with
the toast indicating that the device doesn't support required
policies
* Remove PolicySet.isSupported() and ensure proper field ranges
within the constructor
* Update tests as appropriate

Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
9b4988de43dbee6c06066caab63806e8c8303d7d 10-Jun-2010 Marc Blank <mblank@google.com> Implement support for new security policies

* Minimum complex characters
* Password history (i.e. disallow re-use of past n passwords)
* Password expiration
* Password expiration is NOT yet supported in the framework; there
is a TODO in this CL and a trivial change will be needed when
support arrives; for now, we report this as unsupported
* The two implemented policies are testable

Change-Id: I477adbc000577c57d1ab1788378c97a60018c10c
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
1d6dab29562eca7978f179be5f5c75f22f44d734 14-Jun-2010 Marc Blank <mblank@google.com> Handle "Allow non-provisionable devices" properly

* Send policy key of "0" when validating; this gets us the policies
even if "Allow..." is enabled (currently, we simply don't see the
policies)
* If we don't support all of the policies, send back the response
code indicating support for partial support. If we get a positive
response back, then we're good to go - the server allows devices
with partial support. Otherwise, we fail as we always have - with
the toast indicating that the device doesn't support required
policies
* Remove PolicySet.isSupported() and ensure proper field ranges
within the constructor
* Update tests as appropriate

Bug: 2759782
Change-Id: I5f354a0e2d81844aff75d8a8a6de3b97f0020c1f
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
0fb092b38912c7cff776a51872840bb2089ebe08 05-Jun-2010 Makoto Onuki <omakoto@google.com> Fix for failing SecurityPolicyTests.

This fixes the following exception.

java.lang.UnsupportedOperationException
at android.test.mock.MockContext.getApplicationContext(MockContext.java:82)

Bug 2725552

Change-Id: Iaca177defe5f5e836211c58270379da056fa64e0
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
a843d40ba1d3eb77e76b4a28aa911588f0fd81a1 03-Apr-2010 Andrew Stadler <stadler@android.com> Improve handling of unsupported security policies

* If the server asks for more than we can support, don't throw
and error from PolicySet creation. Let isSupported() do that.
* Overlong password lengths cannot be supported and isSupported is false.
* Overlong timeouts & max wipes can be reduced to supported
amount (this actually increases security) and isSupported is true.
* Clean up an obsolete comment
* Unit tests

Bug: 2567804
Change-Id: I2d664a7f2a315b9f9bdcb867fe2cd98f74de6f66
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
9e2ddca59d048fc9ac55278b193ee36b330a7981 17-Mar-2010 Jim Shuma <jshuma@google.com> Add "vibrate when silent" mode to notifications

* Add "vibrate when silent" choice in UI
* Add storage for it in Email's provider. Existing accounts default to
their current settings (always vibrate / never vibrate).
* Respect new mode when notifications are posted
* Updated existing unit tests

Bug: 2457183
Change-Id: I5c933ac39dbef8b2028255f330e0b084a445421a
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
af55e3e436991fde91cdc80efe2786eb8f509d15 16-Feb-2010 Andrew Stadler <stadler@android.com> Respond to loss of device admin status

If the user revokes device admin status, reset our internal state and
the state of any accounts that might have been depending on it. This
halts syncing immediately and rewinds the security/provisioning state
of any such accounts to a known state (as if the account had just been
created.)

Bug: 2387961
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
2a5eeea9213005060256054ec773e72406415ce4 09-Feb-2010 Andrew Stadler <stadler@android.com> Adding security hold flag to accounts

* Add hold flag to Account flags
* Add code to set it (when EAS reports policy failure)
* Add code to clear it when we see changes from the device admin side
* unit tests

This should be sufficient to restart sync of an account which is on hold
due to security policy requirements. Note, this is considered a "retry",
and if the account still does not meet requirements for some reason, it
is expected that EAS sync will call policiesRequired() again.
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
3d2b3b3b3554be2ac23d9a49fee00faa9693e857 05-Feb-2010 Andrew Stadler <stadler@android.com> Logic to move phone into security-admin mode

* Create notification to display when syncs fail due to security
* Create psuedo-activity (no UI) to manage device admin state transitions
* Clean up and flesh out SecurityPolicy APIs'
* Add placeholders in EasSyncService showing how to react when policies
are not met and sync cannot continue.

Note: There are some STOPSHIP todo's at the top of SecurityPolicy.java.
These should explain any code that you might think is "missing".
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
d62860821c2dbc14ab493b888cb129bd5addd53d 02-Feb-2010 Andrew Stadler <stadler@android.com> Additional SecurityPolicy functionality

* Begin wiring into system DevicePolicyManager requirements
* Semi-real implementations of isSupported() & isActive()
* Added new API (placeholder) updatePolicies()
* Updated existing unit tests as needed

Bug: 2387961
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java
345fb8b737c1632fb2a7e69ac44b8612be6237ed 27-Jan-2010 Andrew Stadler <stadler@android.com> Add utilities for processing account security policies

* Add security sync key & signature columns
* Add utilities for easy read/write of security columns
* Write aggregator for multiple accounts
* Simple API's for exchange security (very preliminary)
* Unit tests of above

Bug: 2387961
/packages/apps/Email/tests/src/com/android/email/SecurityPolicyTests.java