Commit Graph

26 Commits

Author SHA1 Message Date
Scott Kennedy 560bfadc31 Unify LogTag
There is now only one LogTag class. The static initializer of
GmailApplication (existing) and EmailApplication (new) will now set
the log tag to "Gmail" and "Email", respectively. Up until that code
is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email) will trigger all logs to
be printed as long as they go through LogUtils, regardless of what tag
is used by that individual log. This lets us still turn on logging
everywhere in one command, but also lets us use more descriptive tags
(like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: I55f1c7a66ce50ead54877a13e40256422a56dc39
2013-06-05 20:06:15 -07:00
Yu Ping Hu bd1e0b79e4 Auto-advance policy accept by triggering syncs.
Exchange goes through multiple steps to set up accounts.
Each step requires a sync request to occur, so this change
requests syncs as necessary.

Bug: 9074056

Change-Id: I0f35a06409c6a77c82d004958ecc323cf8030ab4
2013-05-23 09:52:07 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Marc Blank 03cd72805d Revert to old Email app
* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
2012-04-25 13:58:23 -07:00
Marc Blank 2736c1a11c 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
2011-10-25 10:32:34 -07:00
Marc Blank c6df1d605f Prevent NPE's in AccountSecurity
* This CL fixes the referenced bug, but it does NOT explain how
  mAccount; best guess is that the process was killed and then
  restarted when the result from DPM was available.
* Assuming this is the case, we remove the background task loading
  mAccount, avoiding a possible race.
* Also, it's not clear why clearNotifications didn't use the
  account id argument; what if there's more than one account that
  uses security?  Filing a bug about this.

Bug: 5048912
Change-Id: I734834337ab6e409d77624e7c7370350de76becb
2011-07-19 14:38:29 -07:00
Marc Blank e2d28a0607 Clear "security needed" notification when releasing holds
* This fixes the issues with erroneous notifications remaining
  active

Bug: 5039388
Change-Id: Ib1cd506e732e34f6368036a131d79270b22d4a4b
2011-07-17 15:46:03 -07:00
Makoto Onuki bc2eaadde9 Use parallel executor
We should eventually replace all with EmailAsyncTask, but it's the safest thing
we can do now to avoid regression.

Change-Id: I78bfc4fb2be1dcfadeb7f90092ec7adb35c1d393
2011-07-01 11:04:11 -07:00
Ben Komalo d09cff0888 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
2011-06-16 10:44:48 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Ben Komalo 12b82d9374 Move HostAuth to top level class.
No other changes made.

Change-Id: I1c6497c98abc0f99443ea42d8aed6295b263c123
2011-05-19 15:28:48 -07:00
Marc Blank aeee10e57e 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
2011-05-03 11:11:47 -07:00
Andy Stadler f489413142 Add contextual dialogs after notifications
* When security settings notification is clicked, inform user that
  they need to change settings (before dumping them in security
  settings.)
* On an authentication failure, present a dialog to the user explaining
  that the username or password may be incorrect.
* When the device pin/password is expiring or expired, present a dialog
  to the user explaining that it needs to be updated.

Bug: 3238657
Change-Id: I8fca446fa3c1bf87a95938553dbdc362c3df220e
2011-02-18 18:23:18 -08:00
Marc Blank 31d9acbf06 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
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Andy Stadler 45bfac00e5 Rework account security bootstrap procedure
* Bug to fix was that it was looping if the user canceled
  password or encryption setup (instead of simply re-notifying.)
* Solution was to refactor all code into a single sequence of checks,
  rerun the sequence each time, and set markers to prevent looping.
* Rework needed after the changes in I54f39bc9 which added
  encryption support but introduced the looping behavior.
* Removed a UI-thread DB access

Bug: 3346641
Change-Id: I0791d7a16287efecc7121b5ffa0db26ca2b05151
2011-01-24 11:08:31 -08:00
Andy Stadler 469f2987dc 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
2011-01-13 13:12:55 -08:00
Andrew Stadler cd09545b87 Provide runtime switch for GL acceleration
* new checkbox in debug fragment
* saved value in prefs so it's sticky
* each Activity calls a helper to enable/disable per that flag

Change-Id: I1af1ae9f401bc746cc97da00dfb0e06407b79d46
2010-11-01 16:16:27 -07:00
Andy Stadler d22651ccd1 am 060b1df0: am a9bc41f5: Show server name instead of account name
Merge commit '060b1df06954be1d72a659b0f00e30b8057484e0'

* commit '060b1df06954be1d72a659b0f00e30b8057484e0':
  Show server name instead of account name
2010-09-28 23:14:27 -07:00
Andy Stadler a9bc41f5ec Show server name instead of account name
The format string "The server %s requires that you allow it to remotely
control some security features of your phone." was being displayed with
the account name instead of the server name.

Bug: 3011124
Change-Id: I1aadb5790297777831dd69f04ea89641240b7b87
2010-09-28 20:15:54 -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
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
Dianne Hackborn 6d0016229a Move DeviceAdmin APIs to android.app.admin. 2010-02-26 23:31:37 -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 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
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