2167 Commits

Author SHA1 Message Date
Adam Powell
ac137b3211 Merge "Add setOnDismissListener to AlertDialog.Builder" into jb-mr1-dev 2012-08-27 14:04:29 -07:00
Adam Powell
7f02dc5c9c Add setOnDismissListener to AlertDialog.Builder
Add documentation to setOnCancelListener to clarify that the cancel
event plus the events for the various choice buttons are not the
exhaustive set of ways the dialog can be dismissed, and that a dismiss
listener should be used if the app needs to cover all cases of
dismissal.

Change-Id: I9e9d6f90f6f9ccaeb2c697474ab353e2d78f37b9
2012-08-27 13:53:29 -07:00
Jeff Sharkey
69ddab4575 Always-on VPN.
Adds support for always-on VPN profiles, also called "lockdown." When
enabled, LockdownVpnTracker manages the netd firewall to prevent
unencrypted traffic from leaving the device. It creates narrow rules
to only allow traffic to the selected VPN server. When an egress
network becomes available, LockdownVpnTracker will try bringing up
the VPN connection, and will reconnect if disconnected.

ConnectivityService augments any NetworkInfo based on the lockdown
VPN status to help apps wait until the VPN is connected.

This feature requires that VPN profiles use an IP address for both
VPN server and DNS. It also blocks non-default APN access when
enabled. Waits for USER_PRESENT after boot to check KeyStore status.

Bug: 5756357
Change-Id: If615f206b1634000d78a8350a17e88bfcac8e0d0
2012-08-27 12:35:05 -07:00
Adam Powell
c7752a312a Show content description popups when long-pressing action bar tabs
If an action bar tab shows as an icon only and has a content
description, show a long-press popup with the content description.

Bug 6009390

Change-Id: I7f2f68eeef03ede99ff2113e21e1dc14a4295827
2012-08-24 18:00:40 -07:00
Dianne Hackborn
7767eac323 Keep track of whether an app is installed for each user.
This add a new per-user state for an app, indicating whether
it is installed for that user.

All system apps are always installed for all users (we still
use disable to "uninstall" them).

Now when you call into the package manager to install an app,
it will only install the app for that user unless you supply
a flag saying to install for all users.  Only being installed
for the user is just the normal install state, but all other
users have marked in their state for that app that it is not
installed.

When you call the package manager APIs for information about
apps, uninstalled apps are treated as really being not visible
(somewhat more-so than disabled apps), unless you use the
GET_UNINSTALLED_PACKAGES flag.

If another user calls to install an app that is already installed,
just not for them, then the normal install process takes place
but in addition that user's installed state is toggled on.

The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED,
PACKAGE_REPLACED etc broadcasts to users who don't have a package
installed or not being involved in a change in the install state.
There are a few things that are not quite right with this -- for
example if you go through a full install (with a new apk) of an
app for one user who doesn't have it already installed, you will
still get the PACKAGED_REPLACED messages even though this is
technically the first install for your user.  I'm not sure how
much of an issue this is.

When you call the existing API to uninstall an app, this toggles
the installed state of the app for that user to be off.  Only if
that is the last user user that has the app uinstalled will it
actually be removed from the device.  Again there is a new flag
you can pass in to force the app to be uninstalled for all users.

Also fixed issues with cleaning external storage of apps, which
was not dealing with multiple users.  We now keep track of cleaning
each user for each package.

Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
2012-08-24 13:53:13 -07:00
Jeff Sharkey
34f8631258 Merge "Migrate legacy VPN arguments to system_server." into jb-mr1-dev 2012-08-24 11:33:00 -07:00
Jeff Sharkey
82f8521d38 Migrate legacy VPN arguments to system_server.
Generate the racoon and mtpd daemon arguments in system_server,
instead of accepting them from Settings.

Bug: 5756357
Change-Id: I42c1a644f6add477fe4222342640d7db15982cb8
2012-08-24 11:29:58 -07:00
Jeff Sharkey
96702ad6d7 Merge "Framework interface for netd firewall." into jb-mr1-dev 2012-08-24 11:07:42 -07:00
Jeff Sharkey
c268f0b19e Framework interface for netd firewall.
Bug: 5756357
Change-Id: If8b9f738fcea2cf16bd01682220718b57346c7cc
2012-08-24 11:00:28 -07:00
Jeff Sharkey
d5fc86f067 Merge "Begin moving VPN to NetworkStateTracker pattern." into jb-mr1-dev 2012-08-23 16:47:50 -07:00
Jeff Sharkey
899223b97c Begin moving VPN to NetworkStateTracker pattern.
Created base tracker that handles common bookkeeping, and move VPN
to become a tracker.  VPN status is now reflected in NetworkInfo, and
is mapped to LegacyVpnInfo.

Legacy VPN now "babysits" any init services it starts, watching for
when they stop unexpectedly.

Bug: 5756357
Change-Id: Iba7ec79da69469f6bd9a970cc39cf6b885b4c9c4
2012-08-23 16:41:06 -07:00
Victoria Lease
865a1756b6 Merge "Set text locale in language settings panel." into jb-mr1-dev 2012-08-23 14:14:38 -07:00
Victoria Lease
0203341a0b Set text locale in language settings panel.
This results in the CJK locales displaying locale-appropriate glyphs
regardless of the device's locale.

Change-Id: I1564b0b63597f068f4680d0a59fc82dea2dbbba3
2012-08-22 16:27:38 -07:00
Jeff Sharkey
2bca868361 Iteration on multi-user external storage.
Remove single-user bind mounts, since they need to remain as raw
mounts to correctly propagate when remounted.  This means we're back
to using sdcard_r GID to enforce READ_EXTERNAL_STORAGE.

Bug: 6925012
Change-Id: I41b5d7ddc985a5df2e288632a0a80d4724089e00
2012-08-22 13:59:58 -07:00
Kenny Root
80618d66b0 am 7d5b22af: am f029c22f: Merge "Use Libcore.os.umask for setting umask"
* commit '7d5b22afae8525cdf80ba1bf8e18b87d597f830d':
  Use Libcore.os.umask for setting umask
2012-08-20 12:57:36 -07:00
Kenny Root
4c74f8c171 Use Libcore.os.umask for setting umask
Libcore.os now provides a umask method call, so just use that since it's
available.

Change-Id: I8826fa40bcab3d61a424ff98a8050d3e44f7ec34
2012-08-20 12:24:05 -07:00
Jeff Brown
98365d7663 Refactor for multi-display support.
Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class.  This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault().  This represents the
bulk of this change.  Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids.  Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
2012-08-19 22:42:08 -07:00
Amith Yamasani
14e883b25e Fix merge error
Didn't apply the recent API change from another CL.

Change-Id: I65ac6108909eca7ac48beabb4a8b7bbedda84249
2012-08-17 16:34:53 -07:00
Amith Yamasani
a3f133afe8 Save preferred activity info with user id.
So each user can have their own set of intent resolution preferences.

ResolverActivity now launches the activity on the correct user, and
persists the preference for the correct user.

Bug: 6961905
Change-Id: I6d3a8a9af89bc649277d4fc8d0f367ee123f8392
2012-08-17 13:32:02 -07:00
Jeff Sharkey
c584b65b20 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:32:39 -07:00
Dianne Hackborn
f02b60aa4f Rename UserId to UserHandle.
This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-16 12:46:38 -07:00
Daniel Sandler
b9301c3a68 Multiuser support for notifications, take 1.
Notifications for background users are hidden from the
panel and status bar.

Still need to add a concept of "any user" notifications (for
things coming from the system) and notification visibility
controls (for access to icons + possibly masked text of
a background user's notifications).

Change-Id: Iba121f35a6c25c2e1c44db029d776a5a59a6a008
2012-08-15 23:00:56 -04:00
Jeff Sharkey
5b1ada2562 Multi-user external storage support.
Emulated external storage always has multi-user support using paths
like "/data/media/<user_id>".  Creates and destroys these paths along
with user data.  Uses new ensure_dir() to create directories while
always ensuring permissions.

Add external storage mount mode to zygote, supporting both single-
and multi-user devices.  For example, devices with physical SD cards
are treated as single-user.  Begin migrating to mount mode instead
of relying on sdcard_r GID to enforce READ_EXTERNAL_STORAGE.

Bug: 6925012
Change-Id: I9b872ded992cd078e2c013567d59f9f0032ec02b
2012-08-15 19:45:53 -07:00
Adam Powell
08532ab9ba Merge "Fix indeterminate ProgressBars with weird sizes and padding; optimize ActionBar measurement" into jb-mr1-dev 2012-08-08 16:04:35 -07:00
Adam Powell
6322af54cf Fix indeterminate ProgressBars with weird sizes and padding; optimize
ActionBar measurement

Fix a bug where preserved aspect ratios in ProgressBar indeterminate
drawables were causing drawable bounds to be calculated incorrectly
when the ProgressBar had padding specified.

Measure the ActionBar menu view's height with EXACT measure mode,
preventing an extra measure pass to match child heights for some
cases.

Change-Id: I8c4678662a015b57ba2686d5b5c5fc27d4ef8d36
2012-08-08 16:02:36 -07:00
Jean-Baptiste Queru
9951b7c4f0 am e5c46fae: am 6d0dd51e: Merge "Return early when checking divider before child zero."
* commit 'e5c46faefb9deda885cff308ec9b1926636ca8bc':
  Return early when checking divider before child zero.
2012-08-08 14:08:42 -07:00
Jean-Baptiste Queru
6d0dd51ebb Merge "Return early when checking divider before child zero." 2012-08-08 13:20:07 -07:00
Jean-Baptiste Queru
86d09388ee am bce41358: am 9ab84c20: Merge "Fix wrong count return for getPhoneSignalStrengthCount"
* commit 'bce413587973eae29a783d7e273dc2f7db06f7c9':
  Fix wrong count return for getPhoneSignalStrengthCount
2012-08-08 13:11:33 -07:00
Jean-Baptiste Queru
9ab84c203f Merge "Fix wrong count return for getPhoneSignalStrengthCount" 2012-08-08 12:59:06 -07:00
Adam Powell
fd75eef161 Animate the action bar's Up chevron as it shows and hides.
Change-Id: I2cf0283cc644a62ad83cb5641b8f56cc8229b86f
2012-08-07 13:47:11 -07:00
Svetoslav Ganov
85b1041f89 Merge "Window position not reported if the window is not moved." into jb-mr1-dev 2012-08-06 23:51:36 -07:00
Svetoslav Ganov
758143ecfe Window position not reported if the window is not moved.
1.If a window is shown but never moved the window window
  is never notified for its current location. Therefore,
  accessibility nodes do not contain correct bounds in
  screen coordinates.

bug:6926295

Change-Id: I7df18b095d33ecafffced75aba9e4f4693b0c393
2012-08-06 23:49:38 -07:00
Adam Powell
570470a332 Make ActionBar fail more cleanly when invalid heights are set
Also add "none" flag value for null displayOptions in xml

Change-Id: Ided3433638f02ba2a18ce08db265d7a8ac4f216c
2012-08-06 17:00:17 -07:00
Dianne Hackborn
dde331cebd We can now (kind-of) change screen density on the fly.
Preloaded drawables now have a density associated with them, so we
can load the correct drawable if we are using a different density.

Window manager now formally keeps track of the density for each
screen, allowing it to be overridden like you can already do with
size, and relies on this density to drive itself internally and
the configurations it reports.

There are a new set of Bitmap constructors where you provide a
DisplayMetrics so they can be constructed with the correct density.
(This will be for when you can have different windows in the same
app running at different densities.)

ActivityThread now watches for density changes, and pushes them
to the DENSITY_DEVICE and Bitmap global density values for that
process.

A new am command allows you to change the density.
2012-08-03 17:27:29 -07:00
Adam Powell
d5c81db1e7 Fix some ActionBar menu issues around config changes
Bug 6904212

Update allow-text and max item height properties for action bar menu
item views properly.

Fix an ActionMenuItemView measurement bug that could cause items to
measure too small.

Change-Id: Ibac8491f7670969b0ae4584fff5e44ebd1435abd
2012-08-02 14:50:55 -07:00
Adam Powell
800dd9b936 Merge "Fix drawable handling for ActionBarContainer" into jb-mr1-dev 2012-08-01 16:36:08 -07:00
Adam Powell
a7cc06d82e Fix drawable handling for ActionBarContainer
ActionBarContainer drawables for primary/stacked/split backgrounds
will now properly respect callbacks, layout direction, etc.

Bug 6905932

Change-Id: I20a089861c66a2a378f4b70c0b6cb4bb27476049
2012-08-01 16:33:12 -07:00
Dianne Hackborn
40e5df95ff Merge "Make AtomicFile a public API. It's about time!" into jb-mr1-dev 2012-07-31 18:11:03 -07:00
Dianne Hackborn
39606a007a Make AtomicFile a public API. It's about time!
Change-Id: Ib34e294747405b7ab709cb0bbb2d9a0cc80ce86a
2012-07-31 17:54:52 -07:00
Adam Powell
c1eea136ea Fix bug 6906134
Change-Id: I47dfa1e503e502fe348a350dad960fbb112435e7
2012-07-31 11:27:19 -07:00
Adam Powell
c0047d4e11 Enforce a maximum size for action button icons.
Change-Id: Id9b5c1573cd40012229921fa8497cbe5ce340b1e
2012-07-30 14:30:51 -07:00
Jake Wharton
825992f503 Return early when checking divider before child zero.
Previously the `getChildAt` method would be called with an index of -1 which
would lead to an exception being thrown and caught. This is unnecessary since
we know there will never be a divider before the first child. It also avoids
additional object creation since this method can be invoked quite frequently.

Change-Id: Iab44520d5d52f96a829a009cdd1201696edbf9a4
2012-07-28 21:40:04 -07:00
Jeff Brown
df693de4fe Fix inconsistency in user activity types.
Looks like BatteryStats was not updated when we reduced the number
of user activity types from 7 to 3.

Change-Id: I7465f86c78baa561a6555c33f681553b870827f2
2012-07-27 18:14:52 -07:00
Fabrice Di Meglio
85d28a0004 Merge "Replace left/right with start/end for Gravity / LayoutParams / Padding" 2012-07-24 11:11:02 -07:00
Fabrice Di Meglio
cf56a0c1ea Merge "Fix ActionBar HomeView up button layout params" 2012-07-23 16:02:49 -07:00
Adam Powell
5f79baa0e3 Merge "Fix condition bug in ResolverActivity" 2012-07-20 11:26:42 -07:00
Adam Powell
bdda4e74d4 Fix condition bug in ResolverActivity
Bug 6854356

Change-Id: I3cd060fb78876e80bdfa311cf80d0ad8a696bfad
2012-07-20 11:22:03 -07:00
Fabrice Di Meglio
aac0d4ed02 Replace left/right with start/end for Gravity / LayoutParams / Padding
- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)

Change-Id: Id9af5375fb9b0edeae5232c77e52ecd497bd2e67
2012-07-19 19:21:26 -07:00
Fabrice Di Meglio
34c829e46c Fix ActionBar HomeView up button layout params
Change-Id: I9cbf2ce695cce14c16efa270fafa062f46c985ce
2012-07-19 18:44:08 -07:00
Jeff Sharkey
971a3cfa51 Migrate VpnProfile definition to framework.
Bug: 5756357
Change-Id: I23c4e391e3b48e9645f872ae0145fe672745adca
2012-07-19 17:13:51 -07:00