Commit Graph

33 Commits

Author SHA1 Message Date
Marc Blank 02d59d2194 Delete secured accounts if device admin is disabled
* Update unit test

Bug: 2817683
Change-Id: Ia7117c34e7bbba13ac4f2ff375d19b3ef94ef49c
2010-10-27 09:03:21 -07:00
Makoto Onuki 899c5b8661 Switch to tablet style notification
- Now we show separate notification for each account
- New notification has sender photo, sender name, and subject
  of the latest email
- Added the NotificationController class, which is intended to manage
  all notifications besides "new message" eventually.

The framework doesn't seem to be 100% ready, and it's not clear how to
add the 3rd line in the expanded notification at this point.  Need to
revisit it later to verify UI details.

Change-Id: I40193ee372cb6b2b7245c1588890f238b2469699
2010-09-29 18:35:17 -07:00
Andrew Stadler 0813c7051f resolved conflicts for merge of 0d9ed341 to master
Change-Id: I198f760ef1734cf4a64c875236a2352859dc1a72
2010-09-22 14:37:44 -07:00
Andy Stadler 6278dcdeaf Fix test failures
Methods were used by tests only and being stripped by PG.

Bug: 2894378
Change-Id: Ieb1dd0daa8bd380c66a7b1e6151c5e5b22cbe38c
2010-09-22 12:06:41 -07:00
Marc Blank 61911d4ff7 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
2010-08-30 20:18:16 -07:00
Andrew Stadler a30631da1c Clear password related policies in PolicySet when p/w not required
Merge from master of c263810b08

Bug: 2883736
Change-Id: Iec4ed0e320d67aee8a89092ac650c0960540057b
2010-08-12 14:56:32 -07:00
Marc Blank c263810b08 Clear password related policies in PolicySet when p/w not required
Bug: 2883736
Change-Id: I2c9c573aea9a4fef1699ff6339e8ef628d7f2269
2010-08-07 17:27:16 -07:00
Marc Blank b91eea0119 resolved conflicts for merge of fbf501fe to master
Change-Id: Ic68cbf2de1877ab06744287f57c1c33c4e0e573a
2010-08-04 10:28:40 -07:00
Marc Blank 2b2b3448ec 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
2010-08-02 19:39:09 -07:00
Makoto Onuki bcf32320e2 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
2010-07-28 11:12:38 -07:00
Marc Blank 9444a54866 resolved conflicts for merge of 2cb5acc5 to master
Change-Id: I4b3379b7b8ebfca36eda3ae649f009659e682e87
2010-07-15 09:59:50 -07:00
Marc Blank 8b36acb10d 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
2010-07-14 22:47:47 -07:00
Marc Blank d6d874f8c6 Streamline security setup flow
* The setup flow is changed such that the user is asked to activate
  device administration before leaving the setup flow, rather than
  having to wait for the notification to appear, etc.
* Accounts requiring security are created in a security hold state
  to prevent initial sync until device administration is active

Change-Id: I7e33cf98466370ae27414b99018f7aee71e9e237
2010-06-25 09:32:11 -07:00
Marc Blank 9b4988de43 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
2010-06-23 14:51:59 -07:00
Marc Blank 1d6dab2956 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
2010-06-16 13:14:36 -07:00
Andrew Stadler 572c06f91b DO NOT MERGE - Revert workaround for KeyguardLock problem
This reverts commit 3ee0cad5f5.

Because commit 284b62e1b8c3419bfd02c6fea5ba0a68146c06f8 fixes the underlying
conflict between DeviceAdmin policies and apps attempting to disable the
Keyguard Lock, this patch is no longer required.

Accounts with a server policy requiring a device PIN or Password will
now work properly.

Bug: 2737842
Change-Id: I533c27a01a8a331dc11a0cb84bcc78f48edf621c
2010-06-11 11:21:41 -07:00
Andrew Stadler 3ee0cad5f5 DO NOT MERGE Workaround for KeyguardLock problem
* The device policies that enforce the use of a device PIN or password
  can be sidestepped by apps that implement KeyguardManager.KeyguardLock
* This renders the policies unuseable
* To prevent this, the email app now scans for any packages holding the
  DISABLE_KEYGUARD permission.  The existence of any non-system app
  with this permission will put all security-enabled EAS accounts into
  a security hold, and post a dialog describing the problem.
* The user must uninstall any such app(s) in order to sync their EAS data.

Bug: 2737842
Change-Id: I4c96d76b12d9242b5c755dd60d7578a825fae597
2010-06-04 11:10:03 -07:00
Makoto Onuki 968be441b4 Don't store arbitrary Context in singletons, which causes memory leak.
We have singletons that store a Context passed to getInstance().
The problem is that when we call them, we casually pass any Context at hand.
If it's an activity (which is often the case), it'll never be GCed.

This CL make them store the application context insteaed.

Change-Id: I1abcc2c08d3f8201416d6c14720f041693823b4e
2010-05-20 16:21:06 -07:00
Andrew Stadler a87f8d8bbc Changes to improve security policy setup
* SecurityPolicy:  Fix bug that prevents any notifications after the
    user hits "cancel all" from the notification pane.
* AccountSecurity: If the user cancels the device admin acceptance
    activity, repost the notification.
* MesageList:  Catch security hold condition when entering a mailbox, and
    launch security setup activity.

Bug: 2585159
Change-Id: I60d5d8c693cc5f00fe98a9cc69265802f5bee813
2010-04-13 02:15:37 -07:00
Andrew Stadler 856e09d76a Properly reset security policy when device admin revoked
* Simplify the logic in the onDisabled() receiver.  Make sure
  security policy keys are *always* disabled.
* Eliminate unused variable and unused receiver.

Bug: 2576145
Change-Id: I3665a1d300edfb77e02737c08aee22bc977f4968
2010-04-06 22:56:26 -07:00
Andrew Stadler a843d40ba1 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
2010-04-02 22:05:12 -07:00
Jim Shuma 9e2ddca59d 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
2010-03-18 13:57:25 -07:00
Dianne Hackborn 6d0016229a Move DeviceAdmin APIs to android.app.admin. 2010-02-26 23:31:37 -08:00
Dianne Hackborn 4ae83c58b3 Fix issue #2420412: API review: DeviceAdmin API changes 2010-02-17 10:30:25 -08:00
Andrew Stadler af55e3e436 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
2010-02-16 14:33:08 -08:00
Andrew Stadler d71d0b223a Force security activation after new account create
On new accounts, we can accelerate the process of setting up security
by explicitly checking (at the end of the security process).  The user
is not required to "answer" the asynchronous notification.

This is an imperfect solution, as a slow initial sync could leave the
user in a non-synced Inbox (with a notification waiting for them), but
we can come back to this after we evaluate real-world performance.

Bug: 2387961
2010-02-09 17:24:55 -08:00
Andrew Stadler 50d1610c43 Relax device admin policies when accounts deleted
If an account is deleted, immediately recompute the aggregate
security policy, and apply it immediately.

When applying policies, handle "no policy" case by releasing device admin
status entirely.
2010-02-09 11:01:01 -08:00
Andrew Stadler 5893e9e008 Rewrite notes to acknowledge wipe-after-bad-passwords
It turns out that we have already implemented the built-in version of
local-wipe-after-failed-passwords, and the notes about it were not
necessary.

It should be possible to connect to an account with local wipe
requirements and see proper operation.
2010-02-08 23:09:05 -08:00
Andrew Stadler 2a5eeea921 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.
2010-02-08 17:42:42 -08:00
Marc Blank 09b45fdcff Additional work on EAS security
* Add more final plumbing for exchange security
* If policies are supported, we now check to see if they are active;
  if so, we acknowledge this to the server, after which we are given a
  final policy key which can be used for syncing

Change-Id: I5992c790294e35b5ec5343c7665e2e7fd31a75ca
2010-02-07 13:28:18 -08:00
Andrew Stadler 3d2b3b3b35 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".
2010-02-05 11:10:39 -08:00
Andrew Stadler d62860821c 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
2010-02-01 16:48:16 -08:00
Andrew Stadler 345fb8b737 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
2010-01-26 17:24:15 -08:00