3402 Commits

Author SHA1 Message Date
Kenny Root
0ee294470d am 6688b6c3: Merge "Allow updated system apps to retain priority" into gingerbread
* commit '6688b6c31765242866fc276cea7fa241fc5b5e7b':
  Allow updated system apps to retain priority
2011-01-12 11:59:49 -08:00
Kenny Root
6688b6c317 Merge "Allow updated system apps to retain priority" into gingerbread 2011-01-12 11:56:25 -08:00
Kenny Root
1c6e764275 Allow updated system apps to retain priority
Previously any updated system apps would not be able to have a greater
than 0 priority on an activity intent filter. Moving the priority check
later in the package scanning allows it to apply to updated system
packages as well.

Bug: 2572398
Change-Id: I9fdf7906809518b28b49ffec31afec1442d85d3c
2011-01-11 15:51:46 -08:00
Kenny Root
4aab4bc2a3 am 91c459ec: Copy user info from PackageSetting as well
* commit '91c459ec7dba6d56816ff5cbd92c627e0f718915':
  Copy user info from PackageSetting as well
2011-01-11 12:27:42 -08:00
Kenny Root
91c459ec7d Copy user info from PackageSetting as well
In order not to clobber the internal system's settings, we duplicate it
before putting it back into mPackages, but the PackageSetting has a
couple extra pieces of information that weren't being copied.

Bug: 3339279
Change-Id: I047087ac3477c7b2d5ce23e5e0a5e8c094bd0d3f
2011-01-11 11:04:54 -08:00
Dianne Hackborn
a9d8a69a04 am 9aac2e2b: Merge "Referencing of "r.record.name" is occured, when "r.record" is null." into gingerbread
* commit '9aac2e2b9541c424ca02483631b08949f0e90c8c':
  Referencing of "r.record.name" is occured, when "r.record" is null.
2011-01-09 13:56:07 -08:00
Dianne Hackborn
9aac2e2b95 Merge "Referencing of "r.record.name" is occured, when "r.record" is null." into gingerbread 2011-01-09 13:53:53 -08:00
Chris Tate
69f8d3c667 am bbff7ed4: DO NOT MERGE : Ensure that the first post-restore backup pass is correct
* commit 'bbff7ed44b353ff299b900a1ff50812a082206f0':
  DO NOT MERGE : Ensure that the first post-restore backup pass is correct
2011-01-09 13:31:23 -08:00
Chris Tate
9b1bd2c7d1 am 6ec91731: DO NOT MERGE : Permission fix: don\'t require BACKUP perm for self-restores
* commit '6ec91731cbf6ee1a9a914d341fab9567d1599018':
  DO NOT MERGE : Permission fix: don't require BACKUP perm for self-restores
2011-01-09 13:04:01 -08:00
Chris Tate
bbff7ed44b DO NOT MERGE : Ensure that the first post-restore backup pass is correct
Some restore passes bring an ancestral dataset to the application, but
others instead act to bring an app back into sync with its own most-
recently-saved data.  In the latter case the state file written by the
app after the restore is a correct basis for generating future backup
deltas, but in the former case it is not.

The app should not be required to distinguish between these cases;
the framework has all the information necessary to handle the saved
state correctly following any flavor of restore operation.  This
patch makes the Backup Manager properly cause a full backup pass
following an ancestral-dataset restore.  After a current-set
restore the saved state file is an accurate description for
purposes of continued backup operations, so is preserved.

(Cherrypick from master to gingerbread)

Change-Id: I4bc4e8782a168ecc0795107a340bdbb35060730e
2011-01-09 13:01:45 -08:00
Chris Tate
6ec91731cb DO NOT MERGE : Permission fix: don't require BACKUP perm for self-restores
The public API is not supposed to require the BACKUP permission in order
for an application to restore its own last-known-good backup data.  However,
as currently implemented, BackupManager.requestRestore() [the public API
in question] depends on private Backup Manager methods that *do* enforce
that permission.  The net result is that the method cannot be successfully
used by third party applications: it will throw an exception if attempted.
This CL restructures the permission checking involved.

First, the underlying beginRestoreSession() operation can now be passed a
'null' transport name; if this is done, then the restore session is begun
on whatever the currently-active transport is.  Looking up the name of the
active transport is one of the permission-guarded actions that was required
with the initial implementation.

Second, a package name can now be passed to beginRestoreSession().  If
this is done, then the restore session can only be used to perform a
single-package restore of that one application.  The BACKUP permission is
not required if the caller is tying the restore to its own package name.

In combination, these changes permit BackupManager.requestRestore() to
function without the calling app needing to hold any special permission.
The no-permission case is intentionally quite narrow:  the caller must
hold the permission unless they both (a) pass 'null' for the transport
name, thereby accepting whatever the currently active transport is, and
(b) pass their own package name to restrict the restore session only
to their own app.

External bug http://code.google.com/p/android/issues/detail?id=10094
Internal bug 3197202

(Cherrypick from master to gingerbread)

Change-Id: Ie20b0bd2420345ce6eda178f854680b558f6372a
2011-01-09 12:49:47 -08:00
lge-aosp
c712204d91 Referencing of "r.record.name" is occured, when "r.record" is null.
Change-Id: I625e45923a7fd9f4ac8eb434ed07d452f8e1e0b6
2011-01-09 12:38:34 -08:00
Dianne Hackborn
95db1cfc74 am cd23823d: Merge "Fix issue # 3227963: SecurityException: Neither user 10023 nor..." into gingerbread
* commit 'cd23823d4f533431c76baa104eb50b7803b3b391':
  Fix issue # 3227963: SecurityException: Neither user 10023 nor...
2011-01-09 11:44:17 -08:00
Dianne Hackborn
cd23823d4f Merge "Fix issue # 3227963: SecurityException: Neither user 10023 nor..." into gingerbread 2011-01-09 11:38:15 -08:00
Johannes Carlsson
73fef3c7c0 am b5a8654d: Clear reference to the IIntentReceiver in order to avoid memory leak
* commit 'b5a8654dea9ea8443b41f8ff3668ae4074e13a07':
  Clear reference to the IIntentReceiver in order to avoid memory leak
2011-01-05 19:13:29 -08:00
Johannes Carlsson
b5a8654dea Clear reference to the IIntentReceiver in order to avoid memory leak
When using sendOrderedBroadcast(..) with a BroadcastReceiver the
BroadcastReceiver instance was not released. The reason for this was that
the resultTo field in the BroadcastRecord kept a reference until it was pushed
out of the mBroadcastHistory. This reference in turn kept a reference to the
process side IIntentReceiver (implemented in ReceiverDispatcher$InnerReceiver).
This in turn had a strong reference (through mStrongRef) to the Context.

In order to keep the debug output the resultTo is also kept as a String in the
new resultToString variable.

Change-Id: I4382a22a541c27b3694fb2b78a04ee820b235f8f
2011-01-05 18:59:07 -08:00
Dianne Hackborn
4302886f8f am c91f9fe5: Merge "Avoiding cyclic references when unbinding from a service" into gingerbread
* commit 'c91f9fe542fd1ca9d6da432faeba60d35c4d5c49':
  Avoiding cyclic references when unbinding from a service
2011-01-05 18:55:57 -08:00
Mattias Petersson
3996b41610 Avoiding cyclic references when unbinding from a service
Cyclic references can occur between a Service object held by an
application and a ServiceRecord object held by the system server.
A part of the problem is that binders are leaked and since many binders
are implemented by inner classes of services these services are also leaked.
This causes low memory problems. The solution is: When a Service is beeing
destroyed, go through the ServiceRecord's all IntentBindRecord and set its
binder references to null. This allows the binder and the service object to
be garbage collected.

Change-Id: I5a257521964851f34c08ffb3908feaad96b1bafe
2011-01-05 15:34:11 -08:00
Dianne Hackborn
536feda7b1 am 949fc0ef: Merge "frameworks/base: Fix to release references to previous live wallpaper"
* commit '949fc0efc3203c580372e7713df5331818ae81f1':
  frameworks/base: Fix to release references to previous live wallpaper
2010-12-28 10:38:38 -08:00
Dianne Hackborn
cc43401cd1 am 6eef0ca5: Merge "frameworks/base: Fix to release references in ActivityManagerService" into gingerbread
* commit '6eef0ca59438a15d14be8a72b6b29f01da91a5b8':
  frameworks/base: Fix to release references in ActivityManagerService
2010-12-23 14:22:32 -08:00
Dianne Hackborn
6eef0ca594 Merge "frameworks/base: Fix to release references in ActivityManagerService" into gingerbread 2010-12-23 14:19:03 -08:00
Dianne Hackborn
949fc0efc3 Merge "frameworks/base: Fix to release references to previous live wallpaper" 2010-12-23 14:17:54 -08:00
Vairavan Srinivasan
a207ce2aba frameworks/base: Fix to release references in ActivityManagerService
ServiceRecord's bindings is a hashmap to keep track of all active
bindings to the service. This is not cleared when the service is
brought down by activity manager. This adds up the references to
IntentBindRecords and its references to ServiceRecord. Fix is to
clear the bindings.

ServiceRecord's restarter is a reference to the service and is not
cleared when the service is brought down by activity manager. This
adds up the references to ServiceRecord. Fix is to set the reference
to null when the service is brought down by activity manager.

Change-Id: Ica448cd5f60192c8adb23209b5d0e2cf0c04e446
2010-12-23 14:16:56 -08:00
Vairavan Srinivasan
fdfc1b27fe frameworks/base: Fix to release references to previous live wallpaper
The service connection to the previous live wallpaper is unbound when
a new wallpaper is effective. Although the service connection is
unbound it is not disconnected and its reference to wallpaper's
service and engine is still effective. This adds up to the total
JNI references and causes dalvik (hosting system_server) to abort.
Fix is to release the references in clearWallpaperComponentLocked.

Change-Id: Idd2bab83a56d2e6c6dd7ab9be08d5e14887aa384
2010-12-23 14:05:44 -08:00
Vairavan Srinivasan
50b9b94411 frameworks/base: Fix to release references in ActivityManagerService
ServiceRecord's bindings is a hashmap to keep track of all active
bindings to the service. This is not cleared when the service is
brought down by activity manager. This adds up the references to
IntentBindRecords and its references to ServiceRecord. Fix is to
clear the bindings.

ServiceRecord's restarter is a reference to the service and is not
cleared when the service is brought down by activity manager. This
adds up the references to ServiceRecord. Fix is to set the reference
to null when the service is brought down by activity manager.

Change-Id: Ica448cd5f60192c8adb23209b5d0e2cf0c04e446
2010-12-23 13:51:48 -08:00
Jeff Brown
fa93584a4f am c6f2b3b3: Merge "Fix policy issues when screen is off. (DO NOT MERGE)" into gingerbread
* commit 'c6f2b3b302c06b8b7b81ec7e3a43a7df1813d0e0':
  Fix policy issues when screen is off. (DO NOT MERGE)
2010-12-23 12:43:48 -08:00
Dianne Hackborn
690d20bb53 Fix issue # 3227963: SecurityException: Neither user 10023 nor...
...current process has android.permission.WAKE_LOCK

When updating a system app, we would actually uninstall the package
of the system app, which also meant removing its uid...!  It was just
luck that we would get the same uid when installing the update after
that.  During that time, if anyone tried to do anything related to
that uid, it would be unknown.

This change tweaks how we go about replacing system apps by making
it more like normal apps -- to make this work, if we need to disable
the system app, we generate a new PackageSetting from the current
system app and replace it into our data structures, so we can update
that without trashing the current correct information about the (still
actually there) system app.

Also fixed a problem where we were not killing the currently running
app before installing, like we do when updating a normal application.

And fixed a problem where we were not deleting the /data .apk when
uninstalling a system app update.

And added a new option to the "pm" command to clear the data associated
with an app.

Change-Id: I0e879677849aa42950a3c360bf78ad820e87674b
2010-12-22 16:31:44 -08:00
Jeff Brown
eb9f7a01b0 Fix policy issues when screen is off. (DO NOT MERGE)
Rewrote interceptKeyBeforeQueueing to make the handling more systematic.
Behavior should be identical except:
- We never pass keys to applications when the screen is off and the keyguard
  is not showing (the proximity sensor turned off the screen).
  Previously we passed all non-wake keys through in this case which
  caused a bug on Crespo where the screen would come back on if a soft key
  was held at the time of power off because the resulting key up event
  would sneak in just before the keyguard was shown.  It would then be
  passed through to the dispatcher which would poke user activity and
  wake up the screen.
- We propagate the key flags when broadcasting media keys which
  ensures that recipients can tell when the key is canceled.
- We ignore endcall or power if canceled (shouldn't happen anyways).

Changed the input dispatcher to not poke user activity for canceled
events since they are synthetic and should not wake the device.

Changed the lock screen so that it does not poke the wake lock when the
grab handle is released.  This fixes a bug where the screen would come
back on immediately if the power went off while the user was holding
one of the grab handles because the sliding tab would receive an up
event after screen turned off and release the grab handles.

Bug: 3144874
Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
2010-12-22 16:00:21 -08:00
Mattias Petersson
2f209e885a am 1622eee2: Improve performance of WindowState.toString()
* commit '1622eee2e48678b17a4668641957f09213f98905':
  Improve performance of WindowState.toString()
2010-12-22 11:25:32 -08:00
Mattias Petersson
1622eee2e4 Improve performance of WindowState.toString()
This fix improves the performance by caching the string that should
be returned, and reuse it next time if possible.
This will make it faster to switch between activities, approximately
half the time to create the new view when changing from landscape to
portrait. Also, the time for starting a new application is be reduced
as WindowState.toString is being called thousands of times in this
case.

Change-Id: I2b8b9bc1e251d1af43b6c85f049c01452f2573a2
2010-12-22 10:42:47 -08:00
Robert Greenwalt
46f987465c am 5d0fafe8: Merge "Be sure and report NO_CONNECTIVITY when needed." into gingerbread
* commit '5d0fafe80752ad4e40fe0ec2bc06c43e669a0612':
  Be sure and report NO_CONNECTIVITY when needed.
2010-12-21 16:06:19 -08:00
Robert Greenwalt
d68e321841 Be sure and report NO_CONNECTIVITY when needed.
Reports that we sometimes didn't report NO_CONNECTIVITY led to this suggested change.
Could not repro the problem, but the change looks ok anyway.  Better safe than sorry.

bug:3276408
Change-Id: I0cdb48a05a5c9dfcf3a0b468a6eae43d461023b1
2010-12-21 11:43:28 -08:00
Mattias Petersson
33b432476e Improve performance of WindowState.toString()
This fix improves the performance by caching the string that should
be returned, and reuse it next time if possible.
This will make it faster to switch between activities, approximately
half the time to create the new view when changing from landscape to
portrait. Also, the time for starting a new application is be reduced
as WindowState.toString is being called thousands of times in this
case.

Change-Id: I2b8b9bc1e251d1af43b6c85f049c01452f2573a2
2010-12-21 10:15:11 +01:00
Dianne Hackborn
d485c76b5e am c8e8a12b: Merge "Fix issue #3289835: NullPointerException in..." into gingerbread
* commit 'c8e8a12b3c649bbaf610d2ff17bb10a7b32fe579':
  Fix issue #3289835: NullPointerException in...
2010-12-20 11:30:07 -08:00
Dianne Hackborn
3ec27e06a7 Fix issue #3289835: NullPointerException in...
..PackageManagerService.grantPermissionsLP when updating system app

Change-Id: I36c1b96d2fe9a8737843d30f3a2669935fc281bb
2010-12-16 12:41:56 -08:00
Dianne Hackborn
78e9f4cbae am e4a59519: Fix issue #3154576: battery stats checkin should include UID -> packages+ map
* commit 'e4a5951925f16f18dae91ed65567e96528f17fee':
  Fix issue #3154576: battery stats checkin should include UID -> packages+ map
2010-12-13 14:37:09 -08:00
Dianne Hackborn
e4a5951925 Fix issue #3154576: battery stats checkin should include UID -> packages+ map
Includes some other small fixes to battery collection and a few
other things.

Output of package info looks like this:

5,0,i,uid,1000,com.android.settings
5,0,i,uid,1000,com.android.providers.subscribedfeeds
5,0,i,uid,1000,com.android.providers.settings
5,0,i,uid,1000,com.android.server.vpn
5,0,i,uid,1000,android
5,0,i,uid,1000,com.android.systemui
5,0,i,uid,1000,com.google.android.backup
5,0,i,uid,1001,com.android.phone
5,0,i,uid,1001,com.android.providers.telephony
5,0,i,uid,1022,com.android.nfc
5,0,i,uid,10021,com.google.android.location
5,0,i,uid,10021,com.google.android.syncadapters.calendar
5,0,i,uid,10021,com.google.android.gsf
5,0,i,uid,10021,com.google.android.syncadapters.contacts
5,0,i,uid,10026,com.android.providers.downloads.ui
5,0,i,uid,10026,com.android.providers.media
5,0,i,uid,10026,com.android.providers.drm
5,0,i,uid,10026,com.android.providers.downloads
5,0,i,uid,10032,com.android.launcher
5,0,i,uid,10039,com.google.android.gm
5,0,i,uid,10041,com.google.android.gallery3d
5,0,i,uid,10049,com.android.providers.calendar

Change-Id: I9e38f254eef146339113ad270f5c6e8b60fb7a1d
2010-12-13 14:31:40 -08:00
Jean-Baptiste Queru
6d13b146e0 am e78a0009: resolved conflicts for merge of 4b94c451 to stage-korg-master
* commit 'e78a000955c283509ee8a21b8b7e448060ac8dd8':
  Added dropbox broadcast notification
2010-12-13 13:10:23 -08:00
Jean-Baptiste Queru
e78a000955 resolved conflicts for merge of 4b94c451 to stage-korg-master
Change-Id: I07b974f96ca598677e58623050e4668822e68f23
2010-12-13 13:06:13 -08:00
Hakan Still
b247536aa3 Added dropbox broadcast notification
To monitor the dropbox an application have to either poll the dropbox
and keep track of all entries or observ the /data/system/dropbox
directory. The later requires that the application runs as system-user.
This commit adds that a broadcast intent is sent when something is written
to the dropbox and an application can just listen on this intent and
then reads the entry with help of the DropboxManager class.
The application have to hold the permission android.permission.READ_LOGS
to get the intent.

Change-Id: I1f77f206a243df69f4ed5306078c47f7bf6181ec
2010-12-08 13:19:33 +01:00
Jean-Baptiste Queru
a30c12a183 am 4a88013a: resolved conflicts for merge of bf1439c5 to stage-korg-master
* commit '4a88013a4a06a9ea80e8419f94694936e6b013f0':
  Preserve flags field of event passed to injectKeyEvent()
2010-12-02 15:21:35 -08:00
Jean-Baptiste Queru
4a88013a4a resolved conflicts for merge of bf1439c5 to stage-korg-master
Change-Id: Iab543a7ee449025f1df5d58afaa8f8fdd4809c99
2010-12-02 15:16:53 -08:00
Mike Playle
c6ded10dd1 Preserve flags field of event passed to injectKeyEvent()
This patch allows users of WindowManagerService.injectKeyEvent() to
set flags on the key event being injected.

In particular this allows long presses (FLAG_LONG_PRESS) to be
injected into the window manager.
2010-12-02 16:25:46 +00:00
Irfan Sheriff
f38b709e47 am af2d3c7c: Merge "DO NOT MERGE Remove wifistatetracker lock access in BroadcastReceiver" into gingerbread
* commit 'af2d3c7ccebb009f31a92c1a87b0925a2891e1c4':
  DO NOT MERGE Remove wifistatetracker lock access in BroadcastReceiver
2010-12-01 09:53:17 -08:00
Irfan Sheriff
f92b453a58 DO NOT MERGE Remove wifistatetracker lock access in BroadcastReceiver
The worksource reporting gets blocked by the
statetracker lock which can cause system restarts when
done from broadcastreceiver thread

Bug: 3153787
Change-Id: Ie70687e7453a1c3618bac1424562be44762b2c9d
2010-11-30 16:07:05 -08:00
Brad Fitzpatrick
bf44ebae04 am 9de93424: Merge "Without SD card the shutdown sequence was delayed"
* commit '9de93424cc05446e3a216f406c55a3937c028416':
  Without SD card the shutdown sequence was delayed
2010-11-10 11:07:18 -08:00
Johan Alfven
5d0db4d356 Without SD card the shutdown sequence was delayed
If the memory card is not inserted (or removed) from
the phone the shut down process is very long. It
takes almost 24 seconds. For the phone with memory
card the averige is 5-6 seconds

Make sure to send onShutDownComplete even if an SD
card is not mounted and no unmount is done.

Change-Id: I0e79b82e294a971f5e7144cdd3cc16b7ff414b9c
2010-11-09 10:32:25 +01:00
Kenny Root
8806fc729b am 70fc04c8: Reorganize PackageManager dump to avoid NPE
* commit '70fc04c84db8f99ac2ac60fd9719b91057aacc9b':
  Reorganize PackageManager dump to avoid NPE
2010-11-05 13:58:20 -07:00
Kenny Root
70fc04c84d Reorganize PackageManager dump to avoid NPE
versionCode and mVersionName were added recently but ps.pkg can be null
in some situations. Move them to where it will check before
dereferencing it.

Bug: 3152896
Change-Id: If992a1f29ac7b8f595f847b7743fd2374662bb6e
2010-11-05 11:59:45 -07:00
Jeff Brown
7ab5d2d951 am a87ea46c: Fix bugs related to cheek event suppression.
* commit 'a87ea46cb023763e0a9b0222da20b0a354f79d8d':
  Fix bugs related to cheek event suppression.
2010-11-01 21:02:05 -07:00