23471 Commits

Author SHA1 Message Date
Andreas Gampe
0888276a1c Frameworks/base: Use ArraySet more explicitly
In KeySetManagerService, use ArraySet more explicitly. Avoid for-each
loops.

Collections API methods on ArraySet are not very efficient. Iterators
incur two object allocations: a helper and the actual iterator object.
During boot, about 4.5K such calls are made. Using the ArraySet more
explicitly like an ArrayList/array avoids the overhead.

Bug: 19617481
Change-Id: I25df334fa1d4be3210667fb1404e3c43f2585049
2015-03-05 13:13:55 -08:00
Tucker Sylvestro
5a6b44c435 Merge "DO NOT MERGE ANYWHERE Bluetooth native dumpsys logging support (3/4)" into lmp-mr1-modular-dev 2015-03-05 00:15:08 +00:00
Andre Eisenbach
a0eaaa2a22 DO NOT MERGE ANYWHERE Bluetooth native dumpsys logging support (3/4)
Bug: 18508263
Change-Id: I88f9c90dab8b0c825010c8617709449a3dd704b2
2015-03-04 17:17:20 -05:00
riddle_hsu
01eb7fa7f9 [ActivityManager] Skip receiver precisely.
Symptom:
Report broadcast ANR on a dead process.

Detail and sample:
http://code.google.com/p/android/issues/detail?id=158329

Root cause:
app.curReceiver can only remember the last running.
If an application is both receiving FG and BG broadcast,
only one of queue can discard, the remain one will still
count as timeout.

Solution:
Select the skip-tartget-receiver by comparing the skipping app
to the first record of mOrderedBroadcasts of each broadcast queues.

Change-Id: Ic68d56f21b417a34f2d30d64ecfbed09c5e1764d
2015-03-04 17:27:05 +08:00
Craig Mautner
5d3f00e38b am 358188f5: Merge "Change ActivityView startActivity state sequence" into lmp-mr1-modular-dev
* commit '358188f5891f5645dbff4fd8cb1a3e7341371f74':
  Change ActivityView startActivity state sequence
2015-03-03 21:08:45 +00:00
Craig Mautner
358188f589 Merge "Change ActivityView startActivity state sequence" into lmp-mr1-modular-dev 2015-03-03 21:03:29 +00:00
Craig Mautner
b916836e8d Change ActivityView startActivity state sequence
Problems arise if an activity is started in an ActivityView when the
parent activity is not resumed. In particular the ActivityView can
be brought to the front in front of other activities that have been
started by the parent.

This change checks the state of the parent when the ActivityView is
starting and if it is not resumed, throws an Exception.

This change also removes the queueing up of Intents if the surface
does not exist when startActivity is called. Now, the owner of the
ActivityView is notified when the surface becomes available. If
startActivity is called before that notification an Exception will be
thrown.

Fixes bug 19147472.

Change-Id: I6712cf1929fe65c4238ce7f3feb4e8511ed97244
2015-03-03 10:15:21 -08:00
Nick Kralevich
59e06d3ab4 am 98fdff61: am 56fde9e7: Merge "SELinuxPolicyInstallReceiver: Prevent partial or mixed policy updates."
* commit '98fdff61dd651f52d36c0e88dcce8a04568b7cc7':
  SELinuxPolicyInstallReceiver: Prevent partial or mixed policy updates.
2015-03-03 17:08:50 +00:00
Nick Kralevich
98fdff61dd am 56fde9e7: Merge "SELinuxPolicyInstallReceiver: Prevent partial or mixed policy updates."
* commit '56fde9e70ef850ca7e3f076e52567f5c75b5e7da':
  SELinuxPolicyInstallReceiver: Prevent partial or mixed policy updates.
2015-03-03 17:02:22 +00:00
Shishir Agrawal
06e9147d8a am c8e3784e: am 20a5df62: am bcced5b8: Merge "Fix incorrect condition for sub id check." into lmp-mr1-dev
* commit 'c8e3784e259a1c668193a6590570847c9cd9310b':
  Fix incorrect condition for sub id check.
2015-03-02 22:54:59 +00:00
Shishir Agrawal
c8e3784e25 am 20a5df62: am bcced5b8: Merge "Fix incorrect condition for sub id check." into lmp-mr1-dev
* commit '20a5df6205c3d57bfcb5b8e1454fb88c638c8ae3':
  Fix incorrect condition for sub id check.
2015-03-02 22:48:11 +00:00
Shishir Agrawal
20a5df6205 am bcced5b8: Merge "Fix incorrect condition for sub id check." into lmp-mr1-dev
* commit 'bcced5b834e49bf3a0b57a0009958ba061d31e76':
  Fix incorrect condition for sub id check.
2015-03-02 22:38:43 +00:00
Stephen Smalley
e9dc17233f SELinuxPolicyInstallReceiver: Prevent partial or mixed policy updates.
The current SELinuxPolicyInstallReceiver logic can yield a partial
or mixed (old and new) set of policy files under /data/security/current
if there is an error or a crash at certain points before completing
the installation of the update.

Rewrite the logic to avoid the possibility of such partial or mixed
policy updates by using rename on the entire directory of policy
files rather than operating on a per-file basis.  Also separate
the extraction of the policy files from the bundle into their own
temporary directory.  Make sure we delete any previous temporary directory
or backup directory before using them for this update.  Drop the
use of a symlink for /data/security/current altogether; it provides
no benefit.

Change-Id: I564af01c2c3ca1531c216013b8724c7511f32de8
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-02-27 16:07:55 -05:00
Filip Gruszczynski
0fbcc7086f am 1e74b5d6: Merge "Burn in protection." into lmp-mr1-modular-dev
* commit '1e74b5d6b0e964b7a9e58e64b45f50aec15b1178':
  Burn in protection.
2015-02-25 21:40:38 +00:00
Filip Gruszczynski
1e74b5d6b0 Merge "Burn in protection." into lmp-mr1-modular-dev 2015-02-25 21:31:53 +00:00
Filip Gruszczynski
d2e8640c2c Burn in protection.
Bug: 19373758
Change-Id: I7242f73acadd21bdee03262b4205c8af0734fccb
2015-02-25 12:22:49 -08:00
Griff Hazen
892609ad34 am aeffc9ce: Merge "Always draw the circular emulator overlay with square dimensions" into lmp-mr1-modular-dev
* commit 'aeffc9cebd4e97889f5b2f61de38c60b83535ffa':
  Always draw the circular emulator overlay with square dimensions
2015-02-25 19:47:12 +00:00
Griff Hazen
aeffc9cebd Merge "Always draw the circular emulator overlay with square dimensions" into lmp-mr1-modular-dev 2015-02-25 19:39:56 +00:00
Filip Gruszczynski
cf8c112ed8 am 01dd0e86: Merge "Force translucency from windowIsTranslucent on SwipeDismissLayout." into lmp-mr1-modular-dev
* commit '01dd0e86546a5bf815dd9a6e7cd4b7bf8e8f5719':
  Force translucency from windowIsTranslucent on SwipeDismissLayout.
2015-02-25 18:44:57 +00:00
Filip Gruszczynski
23958c6e2f Force translucency from windowIsTranslucent on SwipeDismissLayout.
Bug: 18799741

Change-Id: Ifb05869f1bf080d7555d7728dc085c41cc2c277c
2015-02-24 16:59:45 -08:00
Joe LaPenna
57bb5f5c8b am c0c39516: Merge "Hold a wake lock while dozing when display updates are pending." into lmp-mr1-modular-dev
* commit 'c0c395162ff14b83694158663470ad60e065d9a9':
  Hold a wake lock while dozing when display updates are pending.
2015-02-24 00:46:48 +00:00
Junda Liu
985f52cde5 Fix incorrect condition for sub id check.
Bug: b/19277299
Change-Id: Iea6806926f0e9d9404a3f2613d03b8a0607fea54
2015-02-23 16:06:51 -08:00
Jeff Brown
c2932a1be3 Hold a wake lock while dozing when display updates are pending.
When the display state is DOZE or DOZE_SUSPEND, assume this means
that the AP may go to sleep at any time so hold a wake lock for
a little while starting when traversals are scheduled to ensure
that the AP remains awake long enough to draw and post the frame
to the display hardware.

This patch is somewhat approximate but should be good enough for
most devices today.

Note that the implementation uses the window manager to ensure that
the window which wants to draw is actually visible before acquiring
the wake lock.  There is a cost to this test (a round-trip) which
should not be significant today since we do not expect apps to draw
more than one frame or two while dozing.  However, if we wanted to
support animations in general, we might want to optimize it or
eliminate the check altogether (since we can already account for
the app's use of the wake lock).

Another way to implement this functionality might be for the view
hierarchy to listen for the power manager to report that it has entered
a non-interactive power state before deciding to poke draw locks.
This would be somewhat more accurate than watching the display state.
Also, the draw lock timeout logic could be implemented more directly
instead of using an ordinary timed wake lock.

Bug: 18284212
Change-Id: I84b341c678303e8b7481bd1620e634fe82cc4350
2015-02-20 10:54:09 -08:00
Bill Yi
4fecab570d Merge commit '32acf753e8989766f67fd5300d3eb467f707cc79' into HEAD 2015-02-19 14:31:36 -08:00
Casey Burkhardt
4a0e02377c am bdbd4736: Merge "Refinements to magnification for improved wearable support." into lmp-mr1-modular-dev
* commit 'bdbd4736351231aac4da720ff7326ea2791e0b00':
  Refinements to magnification for improved wearable support.
2015-02-19 01:06:51 +00:00
Casey Burkhardt
0944984c36 Refinements to magnification for improved wearable support.
This change refactors ScreenMagnifier to use resources for its triple-tap
adjustment and scale threshold values.  New values more appropriate for
wearable form factors are supplied.  This also fixes a bug in the triple-
tap detection logic where the incorrect ViewConfiguration value for the
tap threshold was used, prematurely disqualifying some touch events as
potential taps.

Change-Id: If47e556aadb5beb1bad24644122560c6fbe33bad
2015-02-18 12:24:45 -08:00
Craig Mautner
2007a630d4 am 28de8edb: am ab8f60e4: am a94e4297: Merge "Do not make ActivityContainer available to apps. DO NOT MERGE" into lmp-mr1-dev
* commit '28de8edb7d72f938f47d7fdd8ce058c5c8933b8e':
  Do not make ActivityContainer available to apps. DO NOT MERGE
2015-02-17 23:53:11 +00:00
Craig Mautner
28de8edb7d am ab8f60e4: am a94e4297: Merge "Do not make ActivityContainer available to apps. DO NOT MERGE" into lmp-mr1-dev
* commit 'ab8f60e425a90045eca06c09f0274f402b062d8f':
  Do not make ActivityContainer available to apps. DO NOT MERGE
2015-02-17 23:43:33 +00:00
Craig Mautner
ab8f60e425 am a94e4297: Merge "Do not make ActivityContainer available to apps. DO NOT MERGE" into lmp-mr1-dev
* commit 'a94e42970d4e664e193cde0cf2700cb7e15961c9':
  Do not make ActivityContainer available to apps. DO NOT MERGE
2015-02-17 23:36:51 +00:00
Craig Mautner
ca0653a424 Do not make ActivityContainer available to apps. DO NOT MERGE
A security leak was discovered whereby a malicious app could get the
IActivityContainer object from one app and use it to inject events
into another app. This fix removes the availability of the
IActivityContainer and replaces its one use with a method for
returning the information the IActivityContainer was used for.

Fixes bug 19394591.

Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
2015-02-17 20:41:39 +00:00
Griff Hazen
1ad0fe6c36 Always draw the circular emulator overlay with square dimensions
Bug: 17440607

Change-Id: I37bb99a0185c6269a3a541f0d810c11ff0acfb36
2015-02-17 10:17:08 -08:00
Craig Mautner
c8036cdc60 am 5d8f2491: am 2a005f6f: Merge "Prevent leaking surfaces from exiting windows"
* commit '5d8f249104a1798b6c55ae1de4e5ea36a4babd53':
  Prevent leaking surfaces from exiting windows
2015-02-16 23:09:22 +00:00
Craig Mautner
2a005f6fe9 Merge "Prevent leaking surfaces from exiting windows" 2015-02-16 22:59:20 +00:00
tiger_huang
713abc2879 Prevent leaking surfaces from exiting windows
AM would set the exiting app to be invisible twice by calling
setAppVisibility(). If the screen is turned off during these calls,
the window surfaces of this exiting app won't be destroyed.

The flow:
 1. Screen is on
 2. App A is finished
 3. AM calls setAppVisibility() token=App A, visible=false
 4. WM sets a dummy animation to App A
 5. WM marks App A's wtoken.inPendingTransaction=true
 6. Screen is turned off
 7. AM calls setAppVisibility() token=App A, visible=false
 8. WM calls setTokenVisibilityLocked() directly (screen is off)
 9. WM sends app visibility to App A's client (ViewRootImpl)
10. WM clears the dummy animation from App A
11. App A's client calls WMS.relayoutWindow() to be not visible
12. WM sets App A's window mExiting=true but not destroy its surface
13. App A's window surface leaks...

Note:
a. The call in 3. is from ActivityStack.finishActivityLocked
b. The call in 7. is from ActivityStack.resumeTopActivityInnerLocked
c. In 10., App A won't get the real animation while screen is off
d. In 12., App A's inPendingTransaction=true; WM takes it's animating
e. mExiting won't be cleared because App A has no animation to
   trigger WindowStateAnimator.finishExit()

After applying this patch, WM would destroy the surface in 12. of the
above flow.

Change-Id: I18b79ba96695ec80d57a85dc15cf92a9e7d3a6ef
2015-02-16 08:27:28 +00:00
Filip Gruszczynski
f1df1970db am 88a9a2a4: Merge "Support for faster brightness response to light changes." into lmp-mr1-modular-dev
* commit '88a9a2a46eb77ea340175f5d272433f4de1b6f93':
  Support for faster brightness response to light changes.
2015-02-14 02:27:19 +00:00
Filip Gruszczynski
d81ecd12ce Support for faster brightness response to light changes.
Bug: 18572096

Change-Id: Ic9448db672b036779d16883f3476249cea45d97a
2015-02-13 09:40:15 -08:00
Narayan Kamath
a511eea83b am aee7f64c: am b4a5c04c: Merge "Remove code that sets user.* system properties."
* commit 'aee7f64c10ffd2135dc98f7a540836ad7a32438b':
  Remove code that sets user.* system properties.
2015-02-13 12:09:31 +00:00
Narayan Kamath
70e8f6600d Remove code that sets user.* system properties.
This has been disallowed by the SELinux for several years now,
so can safely be removed. Given that saveLocaleLocked is
simplified quite a bit, we can now inline into its only caller.

bug: 18910417

Change-Id: I18251f77e4a25a0e7ecda8e85a9b3fcdc2dc7b05
2015-02-13 11:57:08 +00:00
Casey Burkhardt
d1a5b5dc07 am 6f2dd8a9: Merge "Support circular magnification frame on circular devices" into lmp-mr1-modular-dev
* commit '6f2dd8a9b195a2bc8538820d8685a4a0576964f9':
  Support circular magnification frame on circular devices
2015-02-12 23:28:30 +00:00
Casey Burkhardt
6f2dd8a9b1 Merge "Support circular magnification frame on circular devices" into lmp-mr1-modular-dev 2015-02-12 23:23:45 +00:00
John Spurlock
1be4b702f5 am 7e7c91ec: am e4049b6d: am f45e5dbf: Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev
* commit '7e7c91ec95eca5e1089ede9953f27d8c3d3b8bea':
  NoMan: Initialize filter value reported to listeners.
2015-02-12 23:11:36 +00:00
John Spurlock
7e7c91ec95 am e4049b6d: am f45e5dbf: Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev
* commit 'e4049b6d36ded6ec808be5f884248772a4059a72':
  NoMan: Initialize filter value reported to listeners.
2015-02-12 23:05:25 +00:00
John Spurlock
e4049b6d36 am f45e5dbf: Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev
* commit 'f45e5dbf599a0043d7f6576f20eafb2c1c157204':
  NoMan: Initialize filter value reported to listeners.
2015-02-12 22:58:44 +00:00
John Spurlock
f45e5dbf59 Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev 2015-02-12 22:52:13 +00:00
Casey Burkhardt
d29a1e47d4 Support circular magnification frame on circular devices
The magnification viewport expects its boundary to be a rectangular region,
and always draws it as such.  This change causes the indicator to draw as a
circle on devices with circular displays.  This also refactors the width of
the indicator's frame to use a proper dimension resource and updates the
width to 4dip.

Bug:18242438
Change-Id: I1d86647b6d1ef84f5dd506f4141223ec050a79b5
2015-02-12 14:13:10 -08:00
John Spurlock
f370177e94 NoMan: Initialize filter value reported to listeners.
In addition to relying on change callbacks.

Bug: 19288429
Change-Id: Id54473e5fbb4eac3778781a2052ba0103076f8d1
2015-02-12 13:29:37 -05:00
Narayan Kamath
00e821a860 am c7e48719: Merge "Remove references to persist.sys.language/country."
automerge: 8be3724

* commit '8be3724a06f7b2d28c6664ca11a03f91f97f0972':
  Remove references to persist.sys.language/country.
2015-02-12 16:41:41 +00:00
Narayan Kamath
b61db8229a Remove references to persist.sys.language/country.
Addresses a couple of TODOs now that all usages have been
removed and fixes a doc that specifies how the emulator locale
can be set.

bug: 17691569

Change-Id: I802ea1e12448a5442840cad1fdc0956d3e2c7a8c
2015-02-12 13:16:55 +00:00
Neil Fuller
c1a5e82c25 Merge "Remove usages of FloatMath" automerge: a8e8cdb
automerge: 27316a9

* commit '27316a93e5979859ae98f506eca365784353007a':
  Remove usages of FloatMath
2015-02-12 10:00:41 +00:00
Neil Fuller
a8e8cdbb17 Merge "Remove usages of FloatMath" 2015-02-12 09:26:47 +00:00