History log of /frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c1aaede528df2db695e3a94f39eeea1b0a8d8ee1 28-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fixing service notification on secondary users" into oc-dev
e1aaf7d577867d809316920050e92d4d7c6d40d5 26-Apr-2017 Suprabh Shukla <suprabh@google.com> Fixing service notification on secondary users

The notification was starting application details activity in user 0
instead of the user in which the service is running

Test: Manually tested that clicking on the notification starts app info
activity in the current user

Bug: 37530249

Change-Id: I9545c37bf1a36515813cbf1124c82c1c0fc3ad21
Merged-In: I9545c37bf1a36515813cbf1124c82c1c0fc3ad21
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
bad42976009ffb61010136ed8055f9e0f6d2e416 25-Apr-2017 Julia Reynolds <juliacr@google.com> Api updates

- Better documentation on DEFAULT_CHANNEL_ID
- Renaming getChannel/setChannel/getTimeout/setTimeout
- Add documentation to getShortcutId
- @hide parcel constructors

Test: make, make cts
Bug: 37672218

Change-Id: I695b2620c51638a84930e9d1c5fbfd6d85699b55
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
fea6f7b799225f6f0211d7114c779183adbf7b6b 19-Apr-2017 Julia Reynolds <juliacr@google.com> Remove long standing debug code

Because it stops real errors from bubbling up to the calling app.

Test: make, post notifications
Change-Id: I0e59c61b0a60302a5fd023b7ad909e84b97e5df5
Fixes: 37494547
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
51b3aaccfe7f8d7a97fb1218c40a37428f26a6a1 31-Mar-2017 Todd Kennedy <toddke@google.com> Implement service filtering

Instant apps can no longer see services that haven't been
exposed to them via the visibleToInstantApps attribute.

Change-Id: I6fd78067d1253825668d67b9e17dd3a0703f5d57
Fixes: 35871716
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
08992ac57e973d6bf32693725ebb341a481e5944 21-Mar-2017 Christopher Tate <ctate@google.com> API refactor: context.startForegroundService()

Rather than require an a-priori Notification be supplied in order to
start a service directly into the foreground state, we adopt a two-stage
compound operation for undertaking ongoing service work even from a
background execution state. Context#startForegroundService() is not
subject to background restrictions, with the requirement that the
service formally enter the foreground state via startForeground() within
5 seconds. If the service does not do so, it is stopped by the OS and
the app is blamed with a service ANR.

We also introduce a new flavor of PendingIntent that starts a service
into this two-stage "promises to call startForeground()" sequence, so
that deferred and second-party launches can take advantage of it.

Bug 36130212
Test: CTS

Change-Id: I96d6b23fcfc27d8fa606827b7d48a093611b2345
(cherry picked from commit 79047c62b58fb0a0ddf28e2b90fe4d17e05bc528)
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
af759c52ce01fe6b5144957e38da956af01a217b 15-Feb-2017 Geoffrey Pitsch <gpitsch@google.com> Channels for Frameworks notifications

Adapts all notifications used by system services to use channels.
Channels are initialized by SystemServer after the NotificationService
has started.

Test: runtest systemui-notification
Change-Id: I25c45293b786adb57787aeab4c2613c9d7c89dab
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
8aa8fe128992f7e47ecbc8588027eaec82012f3a 21-Jan-2017 Christopher Tate <ctate@google.com> Add an 'am crash' shell command

Induce a normal VM crash via adb, because it's quite different from the
effects of 'am kill'.

Test: induced crashes via adb shell using both pid & pkg

Change-Id: I79654afa7c4a70364cfd7d3af3e80a7b0e59b882
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
0ba4c710c6f8805175bde2dbd85d7d8788a15ee0 02-Aug-2016 Dianne Hackborn <hackbod@google.com> Fix issue #29506774: Foreground Service Can Avoid Notification Requirement

Don't cancel the notification if there are other foreground
services using the same notification ID.

Change-Id: I02a49d9a07af0203e59e70be2dc6773f3cefee47
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
a590d2be935ef502943a1e6615500aa10e67c85a 28-Jun-2016 Dianne Hackborn <hackbod@google.com> Fix bug where process whitelist manager state would not be correct.

We can't update this in updateOomAdjLocked(), because we very
deliberately only iterate through services in there as needed.
The correct thing to do is update the process as services/connections
are associated with it, so do that.

Now basically all of the logic for tracking the state is in
ActiveServices, as we bind and unbind services and add and removing
them from process records. It's a little messy because we don't
have a central place for removing them from process records, which
should be cleaned up in the future.

Part of fixes for issue #29480440

Change-Id: Iac96f002a5b4e3b0277df244ff7b90f59a6e8440
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
e2c1f9b78b0df6d1ce945c7b5083aad190a61585 04-May-2016 Wang Le <wangle@xiaomi.com> Fix the issue that App crash on startForeground

Install single APP in any user space except Owner user, the APP
got crash when call startForeground in Service Component with
Notification which without SmallIcon.

External bug:https://code.google.com/p/android/issues/detail?id=209043
Internal bug: 28602381

Change-Id: I88a3b8afc213cafe0f280f9b44d6acd2ea0df207
Signed-off-by: Wang Le <wangle@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
67324c990c4fbad238119a4667341d5618b2bea2 18-Apr-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28221912: Starting service as foreground might...

...kill previous notification.

Add new platform API to detach a notification from a service
without dismissing it.

Also, while I am here, add some more @IntDefs.

Change-Id: I3bb46d9cd3db7f73716c8ced19c20fea800eb30d
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
4eb64fdbcf899a81d0a6a04dc3658d03d9df8247 21-Mar-2016 Joe Onorato <joeo@google.com> Refactor ProcessStats.

- Pull most of the inner classes out into their own files.
- Move everything to a new android.app.procstats package.
- Move all of the code that was manipulating the big list
of longs to use the new SparseMappingTable class rather
than doing everything by hand. The logic is unchanged.
- Add a sequence number check to SparseMappingTable so
when the big list of longs and the individual tables are
reset, which happens somewhat independently, we can
assert when one of them doesn't get reset.
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
4e78706f439d318ae7a78927d98f734351a89f64 17-Jun-2015 Dan Sandler <dsandler@android.com> Patch up certain kinds of broken notifications.

Notifications in which the icon resource ID is changed after
Builder.build() is called (even, and particularly, as the
last step in the current implementation of
setLatestEventInfo()) were not having their icons properly
parceled. In these cases we now attempt to catch this at
parcel time and construct the necessary Icon object.

But wait! Parceling does not require a Context. So we don't
actually know which package to load the resource from.
Therefore we now allow an Icon to be constructed with an
empty ("") package name, which allows us to complete this
parceling task despite the fact that a Notification does not
know its own package name. (In case you attempt to load a
drawable for such an Icon, loadDrawable will spot the ""
package and instead substitute the Context from its
parameters to try to load the resource.)

As it happens, even though the Notification does not know
its own package name, BaseStatusBar does, because it was
provided at NM.notify() time and is therefore included in
the StatusBarNotification structure. So we can actually
patch up the Icon (if it is TYPE_RESOURCE) and be sure to
get the icon loaded out of the correct package.

While we've got the hood open, this change fixes a couple of
related problems:

• Foreground service notifications synthetically
constructed for naughty icon==0 notifications (which we
are still allowing...FOR NOW) were losing the
FLAG_FOREGROUND_SERVICE flag (because we're
re-build()-ing them from scratch rather than rewriting
the provided Notification object). Now we set the flag
and hang onto the new notification for next time
setForeground() is called.

• We now allow media notifications to avoid getting bumped
to the top of the notification list if they're
PRIORITY_MIN. You might want to do that, I guess?

Bug: 21333763
Change-Id: Ia5d1f1acb594c7677bcc75ee3d624da4ffca671f
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
d63f9321e62064660d426efd5abbd885c4a24652 06-May-2015 Dan Sandler <dsandler@android.com> Icon support comes to Notification.

And you may ask yourself: what is that beautiful icon?
And you may ask yourself: where does that API go to?
And you may ask yourself: is it a resource? is it a Bitmap?
And you may say to yourself: my god, what have I done

(This patch fixes a number of bugs in the initial
implementation, but other than that, it's the same as it
ever was.)

Bug: 18568715
Bug: 21141842
Change-Id: I1d3f9427abd7f0bb57e533fcfac708851ff644b6
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
4a357cd2e55293402d7172766f7f9419815fc1e8 19-Mar-2015 Alan Viverette <alanv@google.com> Replace usages of deprecated Resources.getColor() and getColorStateList()

Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
e23149f1555303940d212b742707518b7f9f84ab 07-Mar-2015 Wale Ogunwale <ogunwale@google.com> Converted some AMS log points to use ActivityManagerDebugConfig.

Change-Id: I0563bafd29ae0bbe596ed8c06fcc573b5ead50b7
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
455625e298204a27d3958eb56ff155f27562eec8 21-Jan-2015 Dianne Hackborn <hackbod@google.com> Work on issue #18201239: ANRs in com.google.process.gapps:

Reason: Executing service com.google.android.syncadapters.contacts
/.SyncHighResPhotoIntentService

Make the code more robust when destroying services, so that if
the nesting count gets out of sync we don't just hang.

Change-Id: If117d5ef242e7c148fd9576bd89a1a092583d6ad
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
66c4a824b9b11a47c7bd1bf858d92fe207409ab9 16-Jan-2015 Craig Mautner <cmautner@google.com> More debugging for bug 18201239.

Fixes bug 19045133.

Change-Id: I2ef2b8600278ed91df59db4acf4740dac970ee3a
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
365e4c38d58d38bb61d1fdd870346f2f594825fd 18-Sep-2014 Christoph Studer <chstuder@google.com> Remove FLAG_FOREGROUND_SERVICE on Service.stopForeground()

When services call Service.stopForeground(), remove
FLAG_FOREGROUND_SERVICE from the notification that was supplied
to Service.startForeground().

This enables services to post notifications that become user
dismissable when they switch to being a background service.

Restrict this to targetSdk=L apps to reduce the risk of breaking
existing apps.

Bug: 17551106
Change-Id: Iff8541e5bb2a23ad1fbc9ad80df5fd6eb683148b
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
255dd04271088590fedc46c8e22b2fd4ab142d39 19-Aug-2014 Selim Cinek <cinek@google.com> Added notification color to all system notifications

Bug: 17128331
Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
8a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3 16-Jun-2014 Jeff Sharkey <jsharkey@android.com> Plumb split APKs into public API.

Introduces new ApplicationInfo fields to surface zero or more split
APKs for an application. Splice these APKs into both the class
loader and resource system. Cleaner building of these paths.

Run dexopt() on all split APKs found after a parse, and populate
into ApplicationInfo.

Change-Id: I4a376bf4492d84ea95aafa866e106ea43a43e492
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
846318a3250fa95f47a9decfbffb05a31dbd0006 04-Apr-2014 Jeff Sharkey <jsharkey@android.com> Allow prefix-based Uri permission grants.

Define new FLAG_GRANT_PREFIX_URI_PERMISSION which indicates that a
Uri permission grant should also apply to any other Uris that have
matching scheme, authority, and path segments. For example, a prefix
grant for /foo/ would allow /foo/bar/ but not /foo2/.

Allow persistable and prefix grants to be issued directly through
grantUriPermission(). Relaxing persistable is fine, since it still
requires the receiver to actively take the permission.

Since exact- and prefix-match grants for the same Uri can coexist,
we track them separately using a new UriGrant key. (Consider the
case where an app separately extends READ|PREFIX and WRITE for
the same Uri: we can't let that become READ|WRITE|PREFIX.)

Fix revoke to always take away persisted permissions. Move prefix
matching logic to Uri and add tests. Add new flags to "am" tool, and
various internal uses around Intent and Context. Switch some lagging
users to ArraySet.

Bug: 10607375
Change-Id: Ia8ce2b88421ff9f2fe5a979a27a026fc445d46f1
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
8472e6189cd4e0520c047bdb28457abc728b373f 24-Jan-2014 Dianne Hackborn <hackbod@google.com> Add app version codes to procstats.

Now the per-package proc stats data is also per-app-version-code.

In addition to changing the data structure to have one more
SparseArray and passing a version code all over, this also required
improving how we reset the stats so that we can prune a multi-package
process record back to a single package. Otherwise, as you install
updates to apps, the proc stats data would continue to explode as
the data for each of those app's processes got turned to a
multi-package due to tracking the old and new versions at the
same time.

This also bumps the checkin version code, since the package entries
also include a new field for the app version code.

Change-Id: I80de36addb0a75c7b08aef747c6f6c8012d01ee4
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/am/ServiceRecord.java