15313 Commits

Author SHA1 Message Date
Mike Lockwood
da2bbaf219 am 2c7b913e: am 5daec5b5: Merge "UsbDeviceManager: Fix race condition entering USB accessory mode" into klp-dev
* commit '2c7b913e367670dde337893efd59029c054019fc':
  UsbDeviceManager: Fix race condition entering USB accessory mode
2014-02-25 15:41:11 +00:00
Mike Lockwood
c62f918e0e UsbDeviceManager: Fix race condition entering USB accessory mode
When switching USB modes there are often spurious connect and disconnect events
that occur before reenumeration is complete.  There is currently a 1000ms timer
to "debounce" the disconnect events. But with some USB accessories, this timeout
is not long enough, which results in an endless cycle of attempts to enter
USB accessory mode when the phone is connected.

To fix this, we now wait up to 10 seconds for the host to successfully configure
the device when entering USB accessory mode before giving up.
This is separate from the existing debounce timer, so the behavior of the
USB state change broadcasts are not affected.

Bug: 12877769
Change-Id: I7aa61f8a618546d749a7ddfc97bf103029a73d03
2014-02-19 11:23:19 -08:00
Narayan Kamath
7ae1726d0b am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit 'aa9ba887371e875ffbde49f43fa12bb5f123425b':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:18:40 +00:00
Narayan Kamath
6e09eb4c67 Merge "AArch64: Make graphics classes 64-bit compatible" 2014-01-28 19:12:17 +00:00
Craig Mautner
093256279c am 245b58d6: am baf2c7a4: Merge "[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager"
* commit '245b58d6f47740c09ebd47b75e6021c7cfb691af':
  [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
2014-01-28 18:11:13 +00:00
Ashok Bhat
a0398430fc AArch64: Make graphics classes 64-bit compatible
Changes in this patch include

[x] Long is used to store native pointers as they can
    be 64-bit.

[x] Some minor changes have been done to conform with
    standard JNI practice (e.g. use of jint instead of int
    in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
    yet. Specifically mAtlasMap member has to be converted
    to hold native pointer using long. Added a TODO to
    AssetAtlasManager.java to indicate the change required.

Change-Id: I940433f601c6db998c1a8ffff338f5361200d5ed
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-01-28 17:40:38 +00:00
louis_chang
d5c91ece7b [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
2014-01-28 18:38:06 +08:00
Christopher Tate
e1d18f6eb0 am 0e3df216: am cc81bcec: Merge "Only send storage intents after boot complete"
* commit '0e3df21642122ae8a43be1a35723782bdd417b7a':
  Only send storage intents after boot complete
2014-01-22 15:53:58 -08:00
Christopher Tate
cc81bcece4 Merge "Only send storage intents after boot complete" 2014-01-22 23:46:58 +00:00
Christopher Tate
a7a9327be8 am 5474f085: am 9fc157a4: Merge "FLAG_PRIVILEGED disappears if privileged app is updated and rebooted"
* commit '5474f085b05b527f7e1dc7c6f536736c2f043fb0':
  FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
2014-01-21 17:48:35 -08:00
Naofumi Harada
719b3b8075 FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.

Bug: 12640283

Change-Id: Ic24b5882f65dabdfae9cc39da3d68661bed4fc31
2014-01-21 07:41:11 +00:00
Johan Redestig
0464c07a9e Only send storage intents after boot complete
It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
2014-01-18 22:46:56 +01:00
Dianne Hackborn
3a8a8ddd7c am 8c359bf4: am c174288d: Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
* commit '8c359bf473b4c31407613dbc1473ba49b0297898':
  Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
2014-01-13 17:45:16 -08:00
Dianne Hackborn
c174288d34 Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
Got a little too aggressive about cleaning up service state; need to
avoid removing services from an app until we are in the second loop
doing the final cleanup, otherwise we can leave services around with
restarting their process.

Also fix crash:

W/BinderNative(  667): Uncaught exception from death notification
W/BinderNative(  667): java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
W/BinderNative(  667): 	at android.util.ArraySet.valueAt(ArraySet.java:301)
W/BinderNative(  667): 	at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2069)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12412)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3596)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3744)
W/BinderNative(  667): 	at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1024)
W/BinderNative(  667): 	at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
W/BinderNative(  667): 	at dalvik.system.NativeStart.run(Native Method)
2014-01-13 17:10:03 -08:00
Daniel Cashman
0d30e07d23 am 3d5ea26f: am 4503409a: Merge "Clear cached locations when location providers disabled Bug: 12118307" into klp-dev
* commit '3d5ea26fbb92b1b780cd9763c0731288f48341a3':
  Clear cached locations when location providers disabled Bug: 12118307
2014-01-13 10:52:54 -08:00
Jeff Sharkey
6d3700b394 am 47235e8b: am 90cadb35: Merge "MountService listeners can not be unregistered"
* commit '47235e8b5ce6c622a1182933404cf5a17fcd35dc':
  MountService listeners can not be unregistered
2014-01-13 10:42:07 -08:00
Jeff Sharkey
90cadb3515 Merge "MountService listeners can not be unregistered" 2014-01-13 18:35:32 +00:00
Craig Mautner
275817929a am 54f99137: am 3747768b: Merge "Fix visibility of multiple non-fullscreen activities."
* commit '54f991375a9c7c2a256e6aec7d4a223be8d36b39':
  Fix visibility of multiple non-fullscreen activities.
2014-01-10 16:03:06 -08:00
riddle_hsu
446ef1de8d Fix visibility of multiple non-fullscreen activities.
Issue detail:
Assume X, Y are non-fullscreen activities.
 a.Home starts an activity X in task A in application stack.
 b.X starts an activity Y in <task A> or <new task B>
 c.Activity X will be invisible.

How to fix:
Because the function "isActivityOverHome" means an activity is able to see home.
But there may have many non-fullscreen activities between the top non-fullscreen activity and home.
If flag "behindFullscreen" is set, those middle activities will be invisible.
So it should only take care from who is adjacent to home.
Then check two flags frontOfTask(task root) and mOnTopOfHome for constraining the condition.

Change-Id: I60bcea304976414e44835a0a38675aae365e9e19
2014-01-09 20:24:34 +08:00
Mike Lockwood
12ec2e6d71 am 99206593: am 9607d78f: Merge "Added missing USB device descriptor fields needed for intent filters"
* commit '992065938a95e5273b22dea009b8581bcc693e61':
  Added missing USB device descriptor fields needed for intent filters
2014-01-08 08:01:42 -08:00
Mike Lockwood
9607d78f51 Merge "Added missing USB device descriptor fields needed for intent filters" 2014-01-08 15:56:13 +00:00
Narayan Kamath
136c021917 am c156021d: am 8a927cfa: Merge "Fix a bug introduced in change 73712"
* commit 'c156021debb8e13324e451cb288da7edd7e112ca':
  Fix a bug introduced in change 73712
2014-01-08 05:00:33 -08:00
Narayan Kamath
87d6cd4537 Fix a bug introduced in change 73712
"return (bool) true" was incorrectly changed to
"return (jboolean) JNI_FALSE"

Change-Id: I45f62f60c5affbae7970bb8889c55981e26d01ba
2014-01-08 12:26:28 +00:00
Narayan Kamath
cbf339f6e4 am ab169215: am f210044f: Merge "AArch64: Use long for pointers in services"
* commit 'ab169215fb135f590f0960ab89f5199dd7303a33':
  AArch64: Use long for pointers in services
2014-01-08 03:58:13 -08:00
Ashok Bhat
7e2a9dcf1a AArch64: Use long for pointers in services
For storing pointers, long is used, as native pointers
can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: Ib4435f0794740d545c1e640087849215e6844802
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-01-08 10:06:07 +00:00
Narayan Kamath
c797fd614d am c9e27802: am 7e296254: Merge "Fix broken XML parsing idiom."
* commit 'c9e27802f049b9c3086770a7710b421ce33d2791':
  Fix broken XML parsing idiom.
2014-01-07 02:07:56 -08:00
David Christie
75c55f92f5 Clear cached locations when location providers disabled
Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: I49eff73f89633052a2587112cdc381ae6d254bfe
2014-01-06 15:23:39 -08:00
Narayan Kamath
2ac3cb7aef Fix broken XML parsing idiom.
Code that expected a single top level element in an XML file
was doing something like :

while (type != START_TAG) { next(); }

This would loop forever when the XML being parsed was empty,
where each call to XmlPullParser.next() would return END_DOCUMENT.

bug: https://code.google.com/p/android/issues/detail?id=64173
Change-Id: I7543203e976a8999ae471a6c2d629249a87011bb
2014-01-06 11:31:35 +00:00
Craig Mautner
a8dfd5d896 am 4dcf1af3: am cccf2a33: Merge "Keydispatching timeout while finish Activity"
* commit '4dcf1af3ed8dfa546e6cbf5ecfa66914a3fda883':
  Keydispatching timeout while finish Activity
2013-12-19 09:55:33 -08:00
Martin Wallgren
c8733b818d Keydispatching timeout while finish Activity
If there is input to be handled during finish activity we can get a
keydispatching timeout ANR. The reason is that finish activity is some
times not possible, and the activity is instead put on a finish queue.
The activity will then be finished sometime in the future. When we add
the activity to the finish queue, key dispatching is paused, and there
is an ANR timer waiting for it to be resumed again. Since it can take a
long time before the activity is actually finished, we need to resume
the key dispatching to avoid the ANR.

Change-Id: Icea4ab3b5ad05c8bfbadf8f5cece1a59ec621469
2013-12-19 13:24:00 +01:00
Niklas Brunlid
d64fe0f53c MountService listeners can not be unregistered
When unregistering MountService listeners, their Binder proxy
objects were compared to registered listeners instead of their
backing objects.

Change-Id: Ie98a686b1d17544f1eda59fb3eb0dc02d836c1b2
2013-12-18 12:51:26 +01:00
Greg Hackmann
060ae1db7b am eb0ca2b7: Merge "Add timerfd backend to AlarmManagerService"
* commit 'eb0ca2b7bfd70fbbf2bd730b1c431faac21d0416':
  Add timerfd backend to AlarmManagerService
2013-12-17 10:15:33 -08:00
Greg Hackmann
3545433d05 am 9f4e67c5: Merge "Clean up native AlarmManagerService tabs/spaces and unused parameter warnings"
* commit '9f4e67c50b5c311adeaaf6135ef79214a46d0e26':
  Clean up native AlarmManagerService tabs/spaces and unused parameter warnings
2013-12-17 10:15:29 -08:00
Greg Hackmann
eb0ca2b7bf Merge "Add timerfd backend to AlarmManagerService" 2013-12-17 18:10:49 +00:00
Greg Hackmann
9f4e67c50b Merge "Clean up native AlarmManagerService tabs/spaces and unused parameter warnings" 2013-12-17 18:10:33 +00:00
Craig Mautner
422d7003db am f431daa2: Merge "Fix to NullPointerException on move back in ActivityStack."
* commit 'f431daa22811fdce9c4ec975d5d33121898b4f9b':
  Fix to NullPointerException on move back in ActivityStack.
2013-12-17 08:42:31 -08:00
Daniel 2 Olofsson
9cdf9e52d9 Fix to NullPointerException on move back in ActivityStack.
In ActivityTask.moveTaskToBackLocked NullPointerException may occur
when moving back with only current Activity in stack. This due to a
condition that may trigger despite a TaskRecord being null and then
attempt accessing the TaskRecord.mOnTopOfHome variable.

TaskRecord task may be set to null when no resumed activity remain.

Resolved by assuring that flag mOnTopOfHome is instead set to false
for current TaskRecord in case where there are no remaining activities
above home.

The above bug has already been corrected in the following commit,
ada62fca51d314cefe2c5da4e007df5b9abf320d, but it does not set the
cottect value to mTopOfHome for the current taks, see below.

Variable mOnTopOfHome will not be set to false in situations where
stack is of size 1 or less and task is null, perhaps from already
having finished current activity.

To avoid current TaskRecord maintaining value mOnTopOfHome to true
after launching Home this variable is set to false.

Impact should not be major due to correction earlier that makes sure
that there is always a TaskRecord.mOnTopOfHome set to true above Home
activity but if not correctly set for current task still gives a
possibility of bad behavior.

Change-Id: Ie86ad99c188aaa05b0de9d58eaa16c42b6fc4341
2013-12-17 11:35:23 +01:00
Greg Hackmann
a1d6f92f34 Add timerfd backend to AlarmManagerService
On devices without /dev/alarm, use a new backend based on timerfd.
timerfd has near-equivalent syscalls for the /dev/alarm ioctls we care
about, with two key differences:

1) /dev/alarm uses one fd for all clocks, while timerfd needs one fd per
clock type.

AlarmManagerService addresses this by replacing the fd (int) with an
opaque pointer (long) to the backend-specific state.

2) When the RTC changes, the /dev/alarm WAIT ioctl always returns, while
timerfd cancels (and signals events) only on specially-flagged RTC
timerfds.

The timerfd backend masks this by creating an extraneous RTC timerfd,
specifically so there's always something to signal on RTC changes.

Change-Id: I5aef867748298610347f6e1479dd8bf569495832
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-12-16 16:23:51 -08:00
Kenny Root
62d509d24f am 37c69fdd: Merge "Use java.util.Objects instead on internal API"
* commit '37c69fdd826f3973966430adc1abfbefc19bc16e':
  Use java.util.Objects instead on internal API
2013-12-13 14:17:29 -08:00
Kenny Root
e6585b32ea Use java.util.Objects instead on internal API
Not needed since java.util.Objects implements all the needed
functionality.

Change-Id: Icd31d49a9801d1705427f028e9ac927d58e7d34c
2013-12-13 13:40:30 -08:00
Greg Hackmann
32b4c0779e Clean up native AlarmManagerService tabs/spaces and unused parameter warnings
Change-Id: I64da1437dd0ed30957b43450c72b9d3797112a2e
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-12-12 12:53:32 -08:00
Lorenzo Colitti
30253d7a64 am 2daa0c93: Merge "Add address flags and scope to LinkAddress."
* commit '2daa0c93c4a0a9d18f4ef4486369fb8c90cd1ea2':
  Add address flags and scope to LinkAddress.
2013-12-09 10:28:19 -08:00
Lorenzo Colitti
2daa0c93c4 Merge "Add address flags and scope to LinkAddress." 2013-12-07 02:43:04 +00:00
Nick Kralevich
5fa89d5571 am 6b8a3a52: am f7422885: Merge "Augment SELinuxMMAC functionality."
* commit '6b8a3a52acf1c2722551f1ea1ce47831f87939cd':
  Augment SELinuxMMAC functionality.
2013-12-06 08:20:18 -08:00
Nick Kralevich
6b8a3a52ac am f7422885: Merge "Augment SELinuxMMAC functionality."
* commit 'f7422885a99c5d240f70c2f8227ae44abeea3e5c':
  Augment SELinuxMMAC functionality.
2013-12-06 08:17:23 -08:00
Robert Craig
99a626c271 Augment SELinuxMMAC functionality.
* No longer support a package name stanza outside of
  a signature tag. Package names, by themselves, have
  no security associated with them in Android and thus we
  should not be allowing or encouraging this
  type of policy.

* Allow for nested package name stanzas inside
  signature stanzas. There are cases where a finer
  distinction needs to be made among apps signed with
  the same cert. New code allows a different seinfo
  tag to be assigned to the listed package names
  signed by the parent cert. When a determination needs
  to be made concerning seinfo assignments, the inner
  seinfo tag takes precedence over the outer seinfo
  labels which are assigned to just the signature.

* Temp structures are now used to parse new policy files
  until the entire xml file is parsed and deemed correct,
  at which time the temp structures are copied over to the
  permanent class structures. This ensures that any structural
  errors with the policy will not result in partial loads.

* Valid stanzas look like the following with the inner
  package piece being optional.

   <signer signature="">
     <seinfo value=""/>
     <package name="">
       <seinfo value=""/>
     </package>
   <signer>

   <default>
     <seinfo value=""/>
   </default>

Change-Id: Ia204d71211776dcf9b2dcc86ad6d77c4ad39dc25
2013-12-06 08:51:20 -05:00
Lorenzo Colitti
64483947fd Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
The Android Open Source Project
ebcb32f58a Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD
Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
2013-12-05 13:10:46 -08:00
Nick Kralevich
a5a0de9f29 am b6634304: Merge "Remove setEnforcingMode from SELinuxPolicyInstallReceiver."
* commit 'b66343049bc56d29988a91d2d29d49861a469b84':
  Remove setEnforcingMode from SELinuxPolicyInstallReceiver.
2013-12-02 12:08:42 -08:00
Stephen Smalley
856df42a5a Remove setEnforcingMode from SELinuxPolicyInstallReceiver.
It never worked anyhow, at least in AOSP, as nothing checks that property,
and is pointless now that enforcing mode is set by init.

Change-Id: If05dd49963c5d7081e00039b5e378032bea0939b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-12-02 14:38:31 -05:00