43654 Commits

Author SHA1 Message Date
Dianne Hackborn
a3abca90ae Merge "Issue #10461551: KLP API Review: AppOpsManager" into klp-dev 2013-09-23 16:36:29 +00:00
Dianne Hackborn
9bb0ee9131 Issue #10461551: KLP API Review: AppOpsManager
Changed public constants from integers to strings.  Internally
everything is still integers, since we want that more efficient
representation for most things.

Changed the Callback interface to OnOpChangedListener.  We also
have a private versin that again takes an int, and tricks to
make both work.

Reworked the class documentation to be appropriate to the SDK
(as much as it can be); most of the existing documentation is
moved to the private implementation.  Also added documentation
of the MODE constants.

Change-Id: I4f7e73cc99fe66beff9194e960e072e2aa9458f8
2013-09-23 09:35:21 -07:00
Jeff Sharkey
5e1a5e5bad Merge "Create unique files, root ordering, UI bugs." into klp-dev 2013-09-22 19:55:19 +00:00
Igor Murashkin
68f40066c9 camera2: Rename CameraProperties to CameraCharacteristics
Bug: 10360518
Change-Id: I8667bdcc8c9528ace96dc675585f923004932641
2013-09-21 21:01:32 -07:00
Igor Murashkin
ca833c389b Merge "camera2: Add capture sequences and capture failures" into klp-dev 2013-09-22 02:44:06 +00:00
Jeff Sharkey
5545f56f75 Create unique files, root ordering, UI bugs.
When a file already exists on disk, try adding a counter suffix to
make a unique name.  Move services near top of roots list, just below
recents.  Remove "Documents" root.

Increase number of recents allowed from single provider, and add more
logging to diagnose wedged loaders.

When launching GET_CONTENT apps, wait for successful result before
relaying result; canceled requests now return to DocumentsUI.

Add CloseGuard to ContentProviderClients, since leaked instances can
keep the remote process alive.

Fix UI bug around trailing breadcrumbs.  Fix bug that dropped Recents
from roots list.  Add up action to Settings activity.  Give our
activity a default icon while waiting for async roots to load.

Bug: 10818683, 10819461, 10819461, 10819196, 10860199
Change-Id: I7b9e26b1cf8353dd3175458b23da2b4bda6c5831
2013-09-21 14:07:16 -07:00
Wink Saville
56065891ab Merge commit '53221120' into fix-merge-conflict
* commit '53221120':
  Do not always call setIsConnectedToProvisioningNetwork(false)

Conflicts:
	core/java/android/net/MobileDataStateTracker.java

Change-Id: I497b57cb96d0f3b3bce4f4e1cbc5febcc6421597
2013-09-21 11:52:42 -07:00
Wink Saville
5322112004 am ab8cabf1: am 1e4f4618: Do not always call setIsConnectedToProvisioningNetwork(false)
* commit 'ab8cabf1d3e5d5fd1fff17816fbc4ab19e8f1a8e':
  Do not always call setIsConnectedToProvisioningNetwork(false)
2013-09-21 11:33:53 -07:00
Wink Saville
ab8cabf1d3 am 1e4f4618: Do not always call setIsConnectedToProvisioningNetwork(false)
* commit '1e4f461839ebd3c9d3dc62232c2eac7d8cbdc467':
  Do not always call setIsConnectedToProvisioningNetwork(false)
2013-09-21 11:30:33 -07:00
Wink Saville
1e4f461839 Do not always call setIsConnectedToProvisioningNetwork(false)
Previously I was calling setIsConnectedToProvisioningNetwork(false) always,
but all MDST's receive every broadcast. Thus we could over write an MDST's
mNetworkInfo.mIsConnectedToProvisioningNetwork to false, unless the MDST
that was set to true was last, i.e the code was order dependent.

If the provisioning networks value was false instead of true
when handleMobileProvisioningAction was called we wouldn't invoke
mdst.enableMobileProvisioning because network info would be null.

Thus the provisioning network would never transition to CONNECTED and
a default route wouldn't get setup and the browser couldn't access the
website.

Now setIsConnectedToProvisioningNetwork is only set to false when the
apnType matches and we won't indiscriminately change it and are not
order dependent.

Bug: 10853805
Change-Id: I68a4f9bdf5dc18d90f4cdef7a60811f57be67261
2013-09-21 09:01:19 -07:00
Jonathan Dixon
6c025eaf29 Merge "WebView: add an API method to control web contents debugging" into klp-dev 2013-09-21 03:41:33 +00:00
Svetoslav Ganov
678e907e09 Merge "Update android.print.PrintAttributes documentation" into klp-dev 2013-09-21 02:39:59 +00:00
Igor Murashkin
6bbf9dc5ae camera2: Add capture sequences and capture failures
- CaptureResult#getRequest is used to tie a result to a request (for convenience)
- Add new CaptureFailure class to describe capture failure
- Results/frame numbers also return frame numbers, sequence ids
- Captures now all return the sequence id
- A sequence id onComplete is available in the CaptureListener

Bug: 10360518
Change-Id: I9ebaa45698c718a1185b5ae920b7975925fe2f60
2013-09-20 19:00:50 -07:00
Dianne Hackborn
90d51b1abe Merge "Fix issue #10807048: Groupon: The application crash when user rotates..." into klp-dev 2013-09-21 01:21:26 +00:00
Svetoslav
b39ce63d28 Merge "Offer to enable a print service after it is installed." into klp-dev 2013-09-21 01:15:47 +00:00
Dianne Hackborn
e784d1e4cf Fix issue #10807048: Groupon: The application crash when user rotates...
...device to another mode (portrait or landscape) on Main page.

So, it turns out that Bundle claimed to have an invariant that either
mParcelledData or mMap would hold its data, never both.  The new
implementation on top of ArrayMap assumed this was the case.  However,
there is one situation where it is not true: an application can take
an existing Bundle that contains data, and call readFromParcel() on it.
The implementation of readFromParcel() would just pull out the
parceled data and stuff it in to mParcelledData for later unparceling,
even if that Bundle already had a non-empty mMap.

To fix this, we just look for this case in readFromParcel() and
immediately unparcel at that point into the existing map, using a
new unparcelling method that doesn't rely on the target map being
empty.

Change-Id: Ib816b6876a6cd2760b7a3372c7a79ca2f12dfeba
2013-09-20 18:13:52 -07:00
Svetoslav
d8f391b4e0 Offer to enable a print service after it is installed.
The user has to explicitly enable a print service from the settings UI
before using it. Usually, users very rarely if at all interact with print
services, therefore all print service management task are performed from
the print settings. We also have to get user consent warning that the
user's data is about to be given to a third-party app. We now post a
notification allowing the user to go directly to the settings screen to
turn the service on.

bug:10447510

Change-Id: Iea56c0825f0bf38328ad94912f0ea5576e9339b3
2013-09-20 17:40:25 -07:00
Raph Levien
7c1b10872f Merge "Fix for "Can't place cursor after combining accent"" into klp-dev 2013-09-20 23:27:57 +00:00
Igor Murashkin
ab98a0b116 Merge "camera2: Add more camera device states, make #openCamera async." into klp-dev 2013-09-20 23:21:51 +00:00
destradaa
47d620ac28 Merge "Ensure access to the map of geofence callbacks is synchronized in all cases Fix Java reference leak in the JNI layer" into klp-dev 2013-09-20 23:18:15 +00:00
Adam Lesinski
d473ebb7c4 Merge "Surfaces ParcelFileDescriptor#parseMode() as API" into klp-dev 2013-09-20 22:59:12 +00:00
Jeff Sharkey
dfed244876 Merge "Delegate mkdirs() to vold when lacking perms." into klp-dev 2013-09-20 22:56:07 +00:00
Glenn Kasten
543de8746e Merge "Revert "Workaround for slow AudioRecord destructor"" into klp-dev 2013-09-20 22:38:19 +00:00
Raph Levien
373b7a8d4e Fix for "Can't place cursor after combining accent"
This patch fixes behavior where attempting to place the cursor at
the end of a string where the last character is a combining accent
actually placed it before that accent. This was especially annoying
for editing Thai text, because it made it difficult to delete a
trailing tone mark.

Fixes bug 8947569 "Can't place cursor after combining accent" and bug
10398332 "[Thailand] Thai Language(IME) -- Can't delete Thai tone mark
while writing message"

Change-Id: Ida1933c8f0ab6cdb0200db39891e9389e4bdba86
2013-09-20 15:21:47 -07:00
destradaa
7f02eb2c84 Ensure access to the map of geofence callbacks is synchronized in all cases
Fix Java reference leak in the JNI layer

Bug: 10624887
Change-Id: I656973653d82c73a7ba2b51f22989ffed144c5df
2013-09-20 15:19:00 -07:00
Adam Lesinski
eb8c3f93ed Surfaces ParcelFileDescriptor#parseMode() as API
Moves ContentResolver#modeToMode() to ParcelFileDescriptor#parseMode()

bug:10711271
Change-Id: I28a5de4ca70adfbec4caf739863b77f0fd7fd9a4
2013-09-20 14:59:34 -07:00
Jeff Sharkey
2d8b4e8013 Delegate mkdirs() to vold when lacking perms.
Apps without sdcard_r or sdcard_rw are still able to write to
their package-specific directory, but someone needs to first make
that directory on their behalf.  This change will delegate the
mkdirs() call through to vold when an app fails to create directly.

MountService validates that the path belongs to the calling user, and
that it's actually on external storage, before passing to vold.

Update Environment to make app-vs-vold paths clearer.

Bug: 10577808
Change-Id: I43b4a77fd6d2b9af2a0d899790da8d9d89386776
2013-09-20 14:34:02 -07:00
David Christie
f31a789774 Merge "Clear names from externally supplied WorkSources to WifiManager (b/10733757)" into klp-dev 2013-09-20 20:04:04 +00:00
David Christie
a31510e47a Clear names from externally supplied WorkSources to WifiManager (b/10733757)
Change-Id: I36102f13962df2093c1e35fb40081ead647eff32
2013-09-20 11:41:41 -07:00
Dianne Hackborn
76e6bcb8c6 Merge "Fix issue #10310128: CTS: android.security.cts.ServicePermissionsTest" into klp-dev 2013-09-20 18:23:08 +00:00
Chet Haase
bdb6186580 Merge "Add equals() and hashcode() to SpannableString" into klp-dev 2013-09-20 18:22:54 +00:00
Adam Lesinski
ff5cbab500 Merge "Ensures that CompatibilityInfo is always set in Resources" into klp-dev 2013-09-20 18:22:17 +00:00
Glenn Kasten
f69cd6787d Revert "Workaround for slow AudioRecord destructor"
This reverts commit 8d87d7ba113ad90685f1d2669e65251a9b422a5a.

Change-Id: I78cbe73959d29fc0ff3153268503ae685cd0995c
2013-09-20 18:10:28 +00:00
Adam Lesinski
79a8ffe54f Ensures that CompatibilityInfo is always set in Resources
- Adds null checks when setting mCompatibilityInfo and uses default no-op
  CompatibilityInfo object instead of null
- Removes null checks when calling methods on mCompatibilityInfo since it is never
  null

bug:10204942

Change-Id: I36e88f5cdceb46b8b19fb902270ef74023a81546
2013-09-20 11:04:40 -07:00
Dianne Hackborn
a2067473e8 Fix issue #10310128: CTS: android.security.cts.ServicePermissionsTest
Change-Id: Id6432fc1b62db41c6c291ec08450c2fc37ced899
2013-09-20 10:54:16 -07:00
Igor Murashkin
5c9eaf6796 camera2: Add more camera device states, make #openCamera async.
* Move CAMERA_IN_USE, MAX_CAMERAS_IN_USE to StateListener#onError
* Copy CAMERA_DISABLED to StateListener#onError

Bug: 10360518
Change-Id: Idd8cf42e1511d12682018588b2b413116cf65116
2013-09-19 19:01:32 -07:00
Jim Miller
af638c4f9d Merge "Add camera affordance to navigation bar on phones" into klp-dev 2013-09-20 01:33:28 +00:00
Svetoslav Ganov
22cb9170d3 Update android.print.PrintAttributes documentation
bug:10550844

Change-Id: Ic1bbb2cb6ab55826eb66242f6002b7165aff37a4

Conflicts:
	core/java/android/print/PrintAttributes.java
2013-09-19 18:31:48 -07:00
Svetoslav
facc08c775 Merge "Move PdfDocument to android.graphics.pdf" into klp-dev 2013-09-20 01:14:02 +00:00
David Braun
3372cb2654 Merge "Add config setting for default sms app." into klp-dev 2013-09-20 00:26:32 +00:00
Chet Haase
9b985721da Add equals() and hashcode() to SpannableString
ActionBar uses a transition to animate text changes. This transition
depends on testing the equality of start/end text values in CharSequence
objects. Without equals(), SpannableString will return false for objects
whose references are different, but whose text is exactly the same.

This CL adds the equals() method, and the accompanying hashcode method,
to ensure that two Spanned implementations will always be equal
if their text and span data are equal.

Issue #10760075 Wrong unread count in actionbar

Change-Id: I5e77d40dd302eca035e8c56d40f3cd0aef8e6424
2013-09-19 17:18:55 -07:00
Jim Miller
caf24fc2c4 Add camera affordance to navigation bar on phones
This adds a camera button on phones that can be used to show
and launch the camera.

- Minor refactoring of touch event dispatch in PagedView.
- Disables usability hints when keyguard loads.
- Only add a touch handler for camera icon once during layout.
- Update after review.
- Updated with latest UX camera and camera background assets

Change-Id: I09cd5cb0e501fd0f4659bea96d00c92b07f805c4
2013-09-19 17:14:59 -07:00
Svetoslav
6811f4e92c Move PdfDocument to android.graphics.pdf
1. Move PdfDocument to android.graphics.pdf.

2. Changed the PdfDocument as per API concil request.

3. Updated the documentation.

bug:10461180
bug:10552565
bug:10681585
bug:10552336

Change-Id: I08e15b34cf37bb064248c887e6f59808019cafe8
2013-09-19 17:12:47 -07:00
Glenn Kasten
9d53e30e5e Merge "Workaround for slow AudioRecord destructor" into klp-dev 2013-09-20 00:08:58 +00:00
Glenn Kasten
8d87d7ba11 Workaround for slow AudioRecord destructor
Bug: 10816117
Change-Id: If59028bc7dc7abb84e1e3642c721c2629653631f
2013-09-19 16:46:04 -07:00
Leon Scroggins III
57989c0e04 Merge "Skip writing zeroes to java allocated memory." into klp-dev 2013-09-19 23:19:13 +00:00
David Braun
b2bae41b82 Add config setting for default sms app.
Different devices can have different default SMS apps.

Bug: 10818725 Allow OEM to specify or override a default SMS app (package)
Change-Id: I02cee9a3276ae39838cda181c9911041c81ea399
2013-09-19 16:13:04 -07:00
Eino-Ville Talvala
a84ca8a3ca Merge "TextureView/GLES20Canvas: Support synchronous GLConsumers" into klp-dev 2013-09-19 21:56:09 +00:00
Dianne Hackborn
70817c479a Merge "Implement issue #10691475: Kill cached processes if about to..." into klp-dev 2013-09-19 21:44:20 +00:00
Dianne Hackborn
3bc8f78d7a Implement issue #10691475: Kill cached processes if about to...
...be uncached and too large

When the device is in a low RAM state, when we go to pull a cached
process out to use for some background operation, we can now kill
the current process if we consider its size to be too large.

Note that the current implementation for killing processes is to
just use the same killUnneededProcessLocked() method that we already
have for other things like too many cached processes.  This is a
little wrong here, though, because in this case we are at the
point where the caller is actually looking for a process to use.
This current code is not actually removing or cleaning up the
process, so we still need to return the now killed ProcessRecord
and let things fall out from there, which typically means the caller
trying to make an IPC on it and failing and falling into its "oh
no the process died unexpectedly" path.  All code using this
*should* be able to handle this correctly, anyway, since processes
really can be killed at any time.

At some point we may to make this implementation cleaner, where it
actually tears down the process right in the call and returns a
null ProcessRecord.  That is very dangerous however (we'd need to
go through all paths into this to make sure they are going to be
okay with process state changing on them like that), and I'm not
sure it is really worthwhile.  This intention is that killing
processes like this is unusual, due to processes being too large,
and anyway as I wrote all of our incoming code paths must already
be able to handle the process being killed at this point and one
could argue this is just another way to excercise those code paths.
Really, the main negative to this is that we will often have spam
in the log with exceptions about processes dying unexpectedly.
If that is the only issue, we could just add some conditions to
quiet that up at in this case.

We don't want to compute the size of the process each time we try
to evaluate it here (it takes 10s or ms to do so), so there is now
a new field associated with the process to give us the last pss
size we computed for it while it was in the cached state.

To be able to have better cached pss data when we now need it, the
timing for computing process pss has been tuned to use a much
shorter delay for the situations when the process has first switch
into a new state.  This may result in us having a fair amount more
pss data overall, which is good, as long as it doesn't cause us to
be computing pss excessively and burning cpu.

Procstats now also has new state to keep track of the number of
times each process has been killed by this new system, along with
the min, avg, max pss of all the times it has happened.  This has
slightly changed the checkin format to include this additional data
at the end of pkgkills/prockills lines.

Other changes here:

- Fixed a problem where GPU RAM was not being seen when dumping
  the full RAM details of a process.  This was because in that
  case the system would ask the process to compute its own MemInfo,
  which it returned, but the process doesn't have permission to
  access the files containing the GPU RAM data.  So now the system
  always computes the MemInfo and hands it to the app.

- Improved broadcast delays to not apply the delay if the next receiver
  of the broadcast is going to run in the same process as the last
  one.  A situation I was seeing was an application that had two
  receivers, one of which started a service; we are better off letting
  the second receiver run while the service is running.

- Changed the alarm manager's TIME_TICK broadcast to be a foreground
  broadcast.  This really should have been anyway (it is supposed to
  go out even minute, on the minute, very accurately, for UI elements
  to update), and is even more important now that we are doing more
  things to delay background broadcasts.

- Reworked how we maintain the LRU process list.  It is now divided
  into the two parts, the top always containing the processes holding
  activities.  This better matches the semantics we want (always try
  to keep those around modulated by the LRU order we interleave with
  other cached processes), and we now know whether a process is being
  moved on the LRU list because of an activity operation so we can
  only change the order of these activity processes when user operations
  happen.  Further, this just makes that common code path a lot simpler
  and gets rid of all the old complexity that doesn't make sense any
  more.

Change-Id: I04933ec3931b96db70b2b6ac109c071698e124eb
2013-09-19 14:35:53 -07:00