3467 Commits

Author SHA1 Message Date
Dianne Hackborn
465fa39635 Fix issue #16907799: Processes containing bound services...
...are killed over eagerly.

When the current foreground activity is moving to the background,
it was briefly going through the CACHED_ACTIVITY state before the
correct LAST_ACTIVITY state, allowing its bound service processes
to be killed (because they went in to the cached list).  To solve
this, as long as a process has stopping activities, it won't go
lower than LAST_ACTIVITY.

Also fixed a problem where we could put a process in CACHED_EMPTY
instead of CACHED_ACTIVITY_CLIENT.  There were a number of cases
in the binding flow and also the client process state transitions
where we would not correctly updateing the bound client activity
state.

And add some sanity code so that if a process hosting a
service is killed, and a client process of that service is in the
cached state, we kill the client process.  This avoids situations
where we can start thrashing around in the cached list because we
are restarting process for no reason -- since they will just
continue to be cached.

Finally, tune the process LRU list to allow twice as many cached
activity processes (from 8 to 16), so we can make better use of
the RAM we have available these days.

Change-Id: Ib0cdf78c321cbb035259fc9dd6ee27b5ba1f90c5
2014-09-14 14:32:45 -07:00
Yuncheol Heo
4b5c2d3cfc Change the property name to pass selinux.
- Added the prefix 'persist.sys.' to pass selinux and to make the
  properties persistent after reboot.
- Shortened the name to fit the length to 31.
- Got together the properties in the near place.

Bug: 17491732
Change-Id: I051f1bacc51ee372806077159020600ffeb30f48
2014-09-13 11:21:46 +09:00
Jeff Brown
2175e9c366 Add support for dozing after screen off.
On some devices, we want the screen off transition to complete before
we start dozing.  Added a new config.xml attribute config_dozeAfterScreenOff
to configure this behavior.

Defer starting dreams until the display is ready.

Fixed some minor issues in the system UI doze service when setting the
display state.

Bug: 16187655
Change-Id: Ib1bc60de5457166f4b4880732db5df989dda67a4
2014-09-12 17:31:54 -07:00
Matthew Williams
c0595a7d7d Merge "Fix NPE in JobServiceContext" into lmp-dev 2014-09-12 23:26:40 +00:00
Matthew Williams
7ac52d5bf6 Fix NPE in JobServiceContext
BUG: 17485390
The VERB_BINDING timeout that is set to wait for onBind() to complete
wasn't being cleared when onBind() returns false, i.e. that the service wasn't
available to be bound to.
This led to an NPE when the stale timeout expired. Fix is to clear the timeout
when onBind fails.

Change-Id: I318ca5ce1f3e12b170f7f256608ea7e28f3f120a
2014-09-12 23:26:28 +00:00
Craig Mautner
6225dd239f Merge "Rework the task affiliate chain validation" into lmp-dev 2014-09-12 23:08:34 +00:00
Paul Jensen
ad50a1fed0 Update Inet state when NetworkMonitor re-evaluates a network.
Previously the Inet state (the little exclamation mark beside the WiFi
and Cellular bars) only transitioned from bad to good once.  With this
change it can transition back to bad (and later to good again) if a network
re-evaluation is triggered, say by ConnectivityManager.reportBadNetwork.
Also, avoid triggering re-evaluation in two unwanted cases.

bug:16214361
Change-Id: I7856724249ffcbb0945276dcf45019876231fdaf
2014-09-12 23:02:28 +00:00
Craig Mautner
2ade126e62 Rework the task affiliate chain validation
The old chain was problematic. It started verification at the end of
the chain and then went no further. Then it went back down the
chain to the beginning with no checks. It also removed entries and
tried to add them back past the end of the ArrayList during boot
which caused the system process to shut down.

This method uses the ordering imposed by taskIds which is the same
order that the tasks were created. It fixes up and notes dropped
links and then reconstructs the list correctly.

Fixes bug 17467284.

Change-Id: I746ec2cdcc7ac6403278cfefc7a6db9b5549d226
2014-09-12 16:01:21 -07:00
Robert Greenwalt
61642ce8c3 Merge "Better handling of unvalidated networks." into lmp-dev 2014-09-12 23:00:37 +00:00
Dianne Hackborn
39b278798e Merge "Fix issue #17479850: AppOpsManager.checkPackage() allows..." into lmp-dev 2014-09-12 22:45:01 +00:00
Dianne Hackborn
0fcef84cca Fix issue #17479850: AppOpsManager.checkPackage() allows...
...root or shell to claim any package name

Re-arrange so checkPackage() doesn't go through the path where
the package name will be forced for root and shell uids.

Change-Id: I450cd6ac8148afd75b526724afdf46ab63de4c43
2014-09-12 15:38:33 -07:00
Tsuwei Chen
ae69f9fdb3 Merge "Handle user privacy properly during network initiated requests. Bug: 16131208" into lmp-dev 2014-09-12 22:36:53 +00:00
Guang Zhu
514c580459 do not allow monkey to flip OEM unlock flag
Bug: 11435021
Change-Id: I3a6865bc6c9fde245d8f4af3230716eac4a3f1b1
2014-09-12 22:17:14 +00:00
Tsuwei Chen
7c485bf66a Handle user privacy properly during network initiated requests.
Bug: 16131208

Change-Id: Ic6f83fcf24eef9e0e26e303bb652651f0dc2970a
2014-09-12 14:56:00 -07:00
Chris Wren
99f4c7d0c9 Invalidate the people cache on Contacts provider changes.
The Contacts database only seem to notify that a change has happened, not
which row was changed.  We simply invalidate the whole cache on changes.

Added an info log for even 100th invalidation, so we can see how often it happens.

Bug: 17466975
Change-Id: I9988ea8db776c88afd835a4b3c50b9a982a309d0
2014-09-12 18:30:28 +00:00
Jeff Sharkey
37ccf18b84 Merge "Fix lock inversion in PackageInstaller." into lmp-dev 2014-09-12 18:17:03 +00:00
Jeff Sharkey
71ac935526 Merge "Bring install and install-multiple into parity." into lmp-dev 2014-09-12 18:16:52 +00:00
Paul Jensen
2161a8ea12 Better handling of unvalidated networks.
Give unvalidated networks penalized scores and allow them to satisfy
requests.

Previously unvalidated networks were never allowed to satisfy
NetworkRequests and so never caused CONNECTIVITY_ACTION broadcasts.
Previously if there were no other networks present an unvalidated
network would still be made the default.  This change formalizes
this behavior using our existing network score logic by assigning
unvalidated networks a highly penalized score.

bug:16358003
bug:17364306
Change-Id: I28fcd6f5ac4b52a4d1c234c472cfa8ba998bcc6f
2014-09-12 13:32:00 -04:00
Cheuksan Wang
a6c52ac624 Merge "Send and download MMS via content provider instead of PDU bytes." into lmp-dev 2014-09-12 17:07:49 +00:00
Christoph Studer
820b70da02 Merge "NoMan: Refresh ManagedServices on user switch" into lmp-dev 2014-09-12 17:03:51 +00:00
Jeff Sharkey
cbf47916b3 Fix lock inversion in PackageInstaller.
In a small handful of cases individual sessions call up into the
installer while holding their local locks.  Defend against this by
treating most InternalCallback events as async.  For sealed events,
perform the upcall outside of the session lock.

Bug: 17482676
Change-Id: I265d981c98c8928a0fced09d8b029ca16eb650d9
2014-09-12 09:55:32 -07:00
Chris Wren
135ce76a26 Merge "remove unused matchesCallFilter(Bundle, int)" into lmp-dev 2014-09-12 14:04:33 +00:00
Christoph Studer
b53dfd4fae NoMan: Refresh ManagedServices on user switch
Fix a bug where ManagedServices didn't unbind from obsolete and
bind to new services after switching the current user.

Bug: 17477093
Change-Id: Ica28978a01f84ba17bdd93e2feaf68547e837bcc
2014-09-12 15:38:56 +02:00
Jinsuk Kim
3b9309a01c CEC: Stub MHL Device
Replaced HdmiMhlLocalDevice with stub implementation,
and removed other MHL classes.

Bug: 17479050

Change-Id: I08880b0703eb4a94ae5e8aa973886a15f8160a38
2014-09-12 17:30:32 +09:00
Jinsuk Kim
a94417a516 CEC: Refactoring for MHL
This helps MHL code clean-up.

- Factored MHL constants out to a new class
- Renamed some methods

Bug: 17479050
Change-Id: Ia39f8bb51ce552ac10f587e6ee0431951f2f494b
2014-09-12 17:25:58 +09:00
Jinsuk Kim
d4a94db1cd CEC: Bug fixes for vendor-specific command handling
- Add sendStandby()
- Respond with <Feature Abort>[INCORRECT_MODE] when the listener
  is not ready

Bug: 17379243
Bug: 17358887
Change-Id: I26a4157a70f11206978763fbbe69e4190e3e1d5c
2014-09-12 16:22:23 +09:00
Yuncheol Heo
753fcc8a8a Merge "Handle <Menu Status> message." into lmp-dev 2014-09-12 07:17:32 +00:00
Yuncheol Heo
29b3e79dc3 Merge "Respond <Feature Abort: Invaild operand> for the invaild messages." into lmp-dev 2014-09-12 06:27:37 +00:00
Griff Hazen
929d5ac575 Merge "Fix a NPE in NotificationManagerSerivice.cancelNotificationFromListener" into lmp-dev 2014-09-12 06:15:13 +00:00
Yuncheol Heo
184b124ec2 Handle <Menu Status> message.
- Just accept the message, not to response <Feature Abort>.
- Added the CEC message validation info.

Bug: 17382771
Change-Id: I0c1ba870b0acfcd0414f0a3e7bb6c41483879116
2014-09-12 15:09:07 +09:00
Yuncheol Heo
4c21289781 Respond <Feature Abort: Invaild operand> for the invaild messages.
- Previously it responsed <Feature Abort: Unrecognized opcode>, for the
  invaild messages, but 'Invaild operand' is more accurate response.
- It'll not response <Feature Abort> for the invaild source and the destination.

Bug: 17382769
Change-Id: I4c5a146a57cc64f54224fa86810a777c232f4c9b
2014-09-12 14:32:46 +09:00
Jungshik Jang
b3ecb72af8 Use async polling for HPD action
Since Device polling holds whole IO thread while it's running,
other sending requests would be blocked until it's finished.
Usually polling takes more than 1 seconds and some action might
be timeouted.
This change sends polling message asynchrousely for
each device address.

Bug: 17381548

Change-Id: I2f47931c5882649d6ac56092986d34d1da48f710
2014-09-12 13:37:33 +09:00
Jeff Sharkey
5c0ed94deb Merge "Consistent clean up of failed installs." into lmp-dev 2014-09-12 04:25:06 +00:00
Jeff Sharkey
e980804df1 Bring install and install-multiple into parity.
This ensures that both are using (almost) identical logic when
deciding what installs to proceed with.  Installs from "pm" for all
users now run as OWNER, and rely solely on INSTALL_ALL_USERS to
express intent.  This keeps install session notifications simple.

Since installer UID can vary from installer package name, start
persisting the UID.  Also parse some missing flags for install
sessions.

Bug: 17469392
Change-Id: I6d89b1a787aa2024cc4bebf6b9c29317c358e147
2014-09-11 21:24:00 -07:00
Dianne Hackborn
aeb88ed612 Merge "Work on issue #17477510: Time change notifications sent too often" into lmp-dev 2014-09-12 02:34:36 +00:00
Dianne Hackborn
d7f460936c Merge "Fix issue #17377423: Frequently see 500ms latency on app open..." into lmp-dev 2014-09-12 02:32:55 +00:00
Craig Mautner
20d97e1ce2 Merge "Add null checks to WindowState.getStack() calls." into lmp-dev 2014-09-12 02:24:42 +00:00
Dianne Hackborn
998e608ddd Work on issue #17477510: Time change notifications sent too often
Record the number of time change events seen by the alarm manager.

Change-Id: I154e7e068626c71f76ee7b26f3e38a885025e0fa
2014-09-11 19:13:23 -07:00
Jinsuk Kim
68ab6cf0ea Merge "Replace the MHL register name 'scratchpad' with 'vendor'" into lmp-dev 2014-09-12 02:12:36 +00:00
Craig Mautner
cbc771f50e Merge changes Ia6fe9724,I682b9acb into lmp-dev
* changes:
  Show all windows from activity that hides keyguard
  Make sure FLAG_DISMISS_KEYGUARD brings up bouncer
2014-09-12 01:45:29 +00:00
Jinsuk Kim
b3fbf9dbe8 Replace the MHL register name 'scratchpad' with 'vendor'
Bug: 17479050
Change-Id: If6fe2949d17ad2d407df5b797c1915eb0e9bf421
2014-09-12 10:42:14 +09:00
Craig Mautner
41a7b7911e Add null checks to WindowState.getStack() calls.
Fixes bug 12786011.

Change-Id: I7fed856f8c96eec47df0912cea9bce705ecf690a
2014-09-11 18:40:22 -07:00
Craig Mautner
7d7808fcf8 Show all windows from activity that hides keyguard
Popup windows from the activity hiding the keyguard weren't being
shown. This change retrieves that activity from PhoneWindowManager
and applies the show or hide call to the windows that match the
activity.

Fixes bug 16479813.

Change-Id: Ia6fe97240aec85c5233eee9038138f7d48095a6e
2014-09-11 18:02:38 -07:00
Dianne Hackborn
9d52f791b9 Fix issue #17377423: Frequently see 500ms latency on app open...
...even for apps in cache

64 bit devices are cool, so they get to use more RAM for their
caches.

Shhhh, don't tell 32 bit devices, they get terribly jealous.

Change-Id: Iec9a0c43718a75530555bac50185658a682969aa
2014-09-11 17:46:06 -07:00
Amith Yamasani
cf79a56c71 Merge "Check for singleUser attribute even for persistent apps" into lmp-dev 2014-09-12 00:44:06 +00:00
Michael Wright
1208e2718d Change constant to PowerManager.RELEAES_FLAG_WAIT_FOR_NO_PROXIMITY
Bug: 17290118
Change-Id: Iae3866bf3f7ac24f756ec4c183e848a79d1f779b
2014-09-12 00:23:14 +00:00
Amith Yamasani
12a1d81de7 Check for singleUser attribute even for persistent apps
This enables Nfc to start a service on a different user.

Bug: 17462401

Change-Id: I92b2bcc2867a380ee18f77a40032bc43e4672c23
2014-09-11 16:39:31 -07:00
Craig Mautner
532e551e68 Merge "Add null check to TaskPersister file list." into lmp-dev 2014-09-11 22:36:18 +00:00
Griff Hazen
335e1f03df Fix a NPE in NotificationManagerSerivice.cancelNotificationFromListener
If a provided notification key does not resolve to a Notification Record

Bug: 17473071
Change-Id: Ib4b4156ca91eb9e545274a36722c2dc547aa39a3
2014-09-11 14:53:23 -07:00
Cheuksan Wang
ee04543d58 Send and download MMS via content provider instead of PDU bytes.
Change-Id: Ib5a93d07799c9e14fea8be820c6bd4bc7ae8be3a
2014-09-11 14:17:15 -07:00