15612 Commits

Author SHA1 Message Date
Nick Kralevich
ad0a66acf4 am c1ce74ca: Merge "Revert "SELinuxMMAC unit tests""
* commit 'c1ce74cab0e83d574df1bd7bb7b7eb16eec171f6':
  Revert "SELinuxMMAC unit tests"
2014-09-03 20:14:31 +00:00
Nick Kralevich
01a5aa95d9 Revert "SELinuxMMAC unit tests"
Broken build.

frameworks/base/services/tests/servicestests/src/com/android/server/pm/SELinuxMMACTests.java:89: error: constructor PackageParser in class PackageParser cannot be applied to given types;
        PackageParser packageParser = new PackageParser(archiveFilePath);
                                      ^
  required: no arguments
  found: String
  reason: actual and formal argument lists differ in length
frameworks/base/services/tests/servicestests/src/com/android/server/pm/SELinuxMMACTests.java:93: error: method parsePackage in class PackageParser cannot be applied to given types;
        PackageParser.Package pkg = packageParser.parsePackage(sourceFile,
                                                 ^
  required: File,int
  found: File,String,DisplayMetrics,int
  reason: actual and formal argument lists differ in length
frameworks/base/services/tests/servicestests/src/com/android/server/pm/SELinuxMMACTests.java:99: error: incompatible types
        boolean savedCerts = packageParser.collectCertificates(pkg, 0);
                                                              ^
  required: boolean
  found:    void
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
make: *** [out/target/common/obj/APPS/FrameworksServicesTests_intermediates/classes-full-debug.jar] Error 41

This reverts commit 2f446561f2f6d1b320b34432854d2f55e5b56f9e.

Change-Id: I0aa992d7b9eccce7e38c430a8a96084a6ee99866
2014-09-03 20:03:17 +00:00
Nick Kralevich
7f534190d6 am 3d4cfc04: Merge "SELinuxMMAC unit tests"
* commit '3d4cfc04a7bc882d534a49dfb475180907fcf842':
  SELinuxMMAC unit tests
2014-09-03 18:01:15 +00:00
Robert Craig
2f446561f2 SELinuxMMAC unit tests
Added unit tests to help with future integration and regression
testing.

Change-Id: I5e7d709e80ccbbe1dde1dc26b3e9a155f5009ad1
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2014-09-03 08:05:40 -04:00
Nick Kralevich
60888dbad1 am 0988daaa: Merge "Add testing api to SELinuxMMAC code."
* commit '0988daaa23b469b3021ad93f819736160e21391f':
  Add testing api to SELinuxMMAC code.
2014-09-02 17:03:32 +00:00
Robert Craig
99891156fc Add testing api to SELinuxMMAC code.
Added needed api for local unit testing.

Change-Id: If52555ecb4f0e6bc06e153b6a17e2c706b11253e
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2014-09-02 12:50:29 -04:00
Brian Carlstrom
d1dc039438 am 6d3c8255: Merge "Remove obsolete pruneDexCache"
* commit '6d3c8255ff41e5967f45d9fa0b0c677bbf3c34b5':
  Remove obsolete pruneDexCache
2014-08-29 01:13:11 +00:00
Alex Light
09107db491 Remove obsolete pruneDexCache
Bug: 16875245

Change-Id: I06e14c405aa4af295795982c1d236be3cb00e893
2014-08-28 23:30:45 +00:00
Calin Juravle
9dcfcff920 am 3bec87c9: Merge "Pass vmSafeMode (manifest attribute) to installd."
* commit '3bec87c9fab49fc2cc7ad1909331f3978803bdd6':
  Pass vmSafeMode (manifest attribute) to installd.
2014-08-27 15:58:39 +00:00
Calin Juravle
e8d2ffd733 Pass vmSafeMode (manifest attribute) to installd.
The flag is used to enforce --interpret-only flag when running dex2oat.

Bug: 12457423

(cherry picked from commit 11e08c010a42390803b65eaa698ca0e768aed896)

Change-Id: I215339527e998b24e274c8df42a5024839e6a9fa
2014-08-27 14:49:11 +01:00
Craig Mautner
1a7e5ad0e7 am 67fe6d1f: Merge "Revert "Fix a bug: unable to start activity when AM is killing the process.""
* commit '67fe6d1f76a740147cc9c85487e8e70b53c744f8':
  Revert "Fix a bug: unable to start activity when AM is killing the process."
2014-08-12 21:13:05 +00:00
Craig Mautner
ca9ba58786 Revert "Fix a bug: unable to start activity when AM is killing the process."
This reverts commit 5073145f85c8197ec4387d5e2599442a7291ca9c.

I spoke to Dianne and she said that if this is making a problem go away then it is only hiding it and there is a deeper problem we need to fix.

I think if killedByApp is true then we should set app and app.thread to null. I'll look at it further when I have more time.

Change-Id: I44c29e15ca654666440472eab2d2af1c5af80b9a
2014-08-12 21:09:07 +00:00
Craig Mautner
379135d3d0 am dc0afc91: Merge "Fix a bug: unable to start activity when AM is killing the process."
* commit 'dc0afc91c24c217705d6d430aa7fabbd22b6d2b3':
  Fix a bug: unable to start activity when AM is killing the process.
2014-08-12 17:05:11 +00:00
Leo Hsu
5073145f85 Fix a bug: unable to start activity when AM is killing the process.
Symptom: No activity was started for startActivity, low repro rate.
Root Cause: Starting activity on a process which was killed by ActivityManagerService.killUnneededProcessLocked() and before receiving AppDeathRecipient of it.
Solution: Choose the flow of starting a new process if ProcessRecord.killedByAm is true.

Change-Id: Ida2639b0fb4631222fc92d65aadc9fd2da637b45
2014-08-12 13:47:23 +08:00
Calin Juravle
e998bb1736 am 94f3e47d: Merge "Fix the instruction set for dex file during (re)moving ops."
* commit '94f3e47da5acc48b1003b64acdc539cdf6cbe30c':
  Fix the instruction set for dex file during (re)moving ops.
2014-08-08 17:53:50 +00:00
Calin Juravle
219b535673 Fix the instruction set for dex file during (re)moving ops.
This complements https://android-review.googlesource.com/#/c/103231/
where the instruction set was mapped just for comptilation. The same
should have been done for move,remove and getSize.

The list of dex code ISAs is alo de-duped.

Bug: 16185267
Change-Id: I8fe453a800812e382e8f41b5f7922997aa9c18a9
2014-08-08 18:45:28 +01:00
Calin Juravle
29965e18ee am 7f935726: Merge "Use native ISA for dex code (in case there\'s a NativeBridge)"
* commit '7f93572650d939a416588a17baab87906d310c40':
  Use native ISA for dex code (in case there's a NativeBridge)
2014-08-07 12:50:12 +00:00
Calin Juravle
576c384ed8 Use native ISA for dex code (in case there's a NativeBridge)
In the presence of a native bridge it is more efficient to compile the
dex directly to the native ISA than to use the shared library ISA as a
reference.

This can be achieve by configuring the readonly system properties to map
between the .so ISA and the desired dex code .ISA (e.g.
ro.dalvik.vm.isa.ISA1=ISA2).

Bug: 16185267

Change-Id: I50baa7b37e1465b9adf72d6f6b96f526a08d59c7
2014-08-06 19:28:28 +01:00
Brian Carlstrom
37651b6061 am 8b8c718c: Merge "Make system use patchoat to relocate during runtime."
* commit '8b8c718cbb4ac8d2e6210567d9b6097f428be222':
  Make system use patchoat to relocate during runtime.
2014-08-05 17:51:09 +00:00
Alex Light
1995d12d26 Make system use patchoat to relocate during runtime.
Make PackageManagerService aware of patchoat and make it use it when
appropriate.

Bug: 15358152

Change-Id: Ibe92d8b55a24bbf718b0416a21b76e5df7a2de26
2014-08-05 10:22:10 -07:00
Craig Mautner
b442d922a2 am 4895bf78: Merge "Fix a bug that the RecentTask list of other’s may show up to non-primary users."
* commit '4895bf78ffd44ba076e4bc9805e43ce834f84b1e':
  Fix a bug that the RecentTask list of other’s may show up to non-primary users.
2014-07-31 16:08:50 +00:00
Craig Mautner
5c4b5eded6 am 6a58309e: Merge "[ActivityManager] Prevent coredump file may not complete for testing."
* commit '6a58309e734086a21580dd8d9175ac1817ca3ab2':
  [ActivityManager] Prevent coredump file may not complete for testing.
2014-07-31 04:01:35 +00:00
Craig Mautner
f37034aca6 am 905fe15e: Merge "[ActivityManager] Avoid mistaking visibility by finishing task."
* commit '905fe15ea09238ed132ccd347e078892b6b49ddf':
  [ActivityManager] Avoid mistaking visibility by finishing task.
2014-07-31 03:57:33 +00:00
riddle_hsu
8062b9534f [ActivityManager] Prevent coredump file may not complete for testing.
Sympton:
During testing, skip kill native crash process manually because it will continue to die by default.

Root Cause:
Large process may take some time to do coredump.In auto test, crash process will be killed immediately that results incomplete coredump file.

Solution:
If the tester (IActivityController) will handle app crash event,
Do not kill native crashed process if the rom is debuggable.

Change-Id: Ia360af147d694125d440e5ba2f958c4759a50494
2014-07-31 03:53:04 +00:00
riddle_hsu
1df4d9f8c7 [ActivityManager] Avoid mistaking visibility by finishing task.
Sympton:
Next activity only adds to history but does not launch/resume then results ANR.

Root Cause:
In a rare timing, some windows are switched at the same time,
it will cause some finishing records on the top temporarily,
then set startIt to false that skip to resume the real top activty.

Solution:
If all activities in a task are finishing, do not use it to check.
The behavior/checking is the same concept as in JellyBean:
            // If starting in an existing task, find where that is...
            boolean startIt = true;
            for (int i = NH-1; i >= 0; i--) {
                ActivityRecord p = mHistory.get(i);
                if (p.finishing) { // <--
                    continue;
                }

Change-Id: I9d81a7b5182400c52e173da23eee61c74692beee
2014-07-31 00:26:51 +08:00
Eunae Kim
26ac40305a Fix a bug that the RecentTask list of other’s may show up to non-primary users.
When switching to a newly created user, the user may face this bug when he opens the RecentTask screen.
A possible bug scenario is described as follows:
A user id of a removed user may be recycled when created a new user.
However, mRecentTasks is not correctly controlled so that old information may still remain and be possibly mapped to wrong user.
This patch prevents this bug by explicitly removing old information in mRecentTasks when removing existing user.

Change-Id: I1874dbd604598a5d740ae1e034981e21214c15c6
Signed-off-by: Eunae Kim <eunae.kim@lge.com>
2014-07-31 13:58:53 +09:00
Craig Mautner
b7bb95b0f3 am 02fd104f: Merge "Skip broadcasting to a receiver if the receiver seems to be dead"
* commit '02fd104f303cb7d55d6af42be8fe7be543e9aba5':
  Skip broadcasting to a receiver if the receiver seems to be dead
2014-07-21 15:31:38 +00:00
Craig Mautner
02fd104f30 Merge "Skip broadcasting to a receiver if the receiver seems to be dead" 2014-07-17 23:22:21 +00:00
Koji Fukui
63909886b2 Skip broadcasting to a receiver if the receiver seems to be dead
If an application that has a broadcast receiver is killed
during broadcasting, thread variable of ProcessRecord becomes null
so that IIntentReceiver#performReceive() is called
in BroadcastQueue#performReceiveLocked(). But if binder driver has not
noticed the death of the application yet, it can't throw
DeadObjectException. After that, binder driver notices. But it can't
notify DeadObjectException to the caller because performReceive() is
async call. So broadcasting keeps on waiting for finishing
performReceive() until timeout.

This change checks the death of the application before calling
performReceive() and skips broadcasting to the receiver
if the application has already died.

Change-Id: Ifa02b8b1a7e7b6fd314de90fedff5b7a5326825d
2014-07-21 09:53:05 +02:00
Craig Mautner
15c2da7ce5 am 2e7b2521: Merge "[ActivityManager]: Update home process when home activity resumed"
* commit '2e7b2521f1758bf16935a9a879c595cc44eab37f':
  [ActivityManager]: Update home process when home activity resumed
2014-07-16 17:21:21 +00:00
louis_chang
73fd117c65 [ActivityManager]: Update home process when home activity resumed
Symptom:
  When switch between two home activities, the home process might not be updated to the correct one. In that case, the home activity might be killed easily.

Root Cause:
  The home process is updated only when a home activity is newly created or being restarted. ActivityManager did not update the home process when simply resume a home activity.

Solution:
  Update home process when home activity resumed

Reproduce Steps:
  1. Install a launcher application, such as Apex Launcher
  2. Press home key to change to Apex Launcher by "Just once" option
  3. Press home key to switch back to original home activity by "Just once" option.
     (The home process is still the Apex Launcher's process because ActivityManager does not update the home process when resuming the original home activity.)

Change-Id: I046279ca7ba851a283ee67ea19202890f7b3f343
2014-07-16 17:16:34 +00:00
Craig Mautner
07c3b19556 am d543c3e1: Merge "[ActivityManager] Do not finish root activity when reset task"
* commit 'd543c3e113ffa82a63669feca540ca2e10b1576f':
  [ActivityManager] Do not finish root activity when reset task
2014-07-16 15:50:43 +00:00
Craig Mautner
3eb3b1d66a am 7f4b4202: Merge "[ActivityManager] Move top task to top in window manager"
* commit '7f4b4202130620edf385b7544e1358c589ee69d2':
  [ActivityManager] Move top task to top in window manager
2014-07-16 15:46:49 +00:00
Craig Mautner
d543c3e113 Merge "[ActivityManager] Do not finish root activity when reset task" 2014-07-15 20:36:09 +00:00
louis_chang
f87b219539 [ActivityManager] Do not finish root activity when reset task
Symptom:
The root activity not always located at index 0 of the task.
For example, the index 1 activity will become the new root
when the original root activity (at index 0) finished.
The new root activity might be finished unexpectedly before
the original root activity actually destroyed.

Solution:
Check frontOfTask to avoid finishing the root activity unexpectedly

Change-Id: I623ab97e9c95c83b3cfe7c9dfc151a291a391ea4
2014-07-16 18:15:35 +08:00
louis_chang
d937616f87 [ActivityManager] Move top task to top in window manager
Symptom:
In certain situations, application starts activity while
it is in background. When an existing background activity
starts a new activity which results to be kept in the same
background task, the new activity won't be resumed.
In that case, the background task (sourceTask) should not be
moved to top in window manager.

Solution:
Move top task of the target stack to top in window manager

Change-Id: Id7a37ea67ce1f80e0c2b5399865c51fd7113deb8
2014-07-16 17:42:04 +08:00
Colin Cross
d01adef1ba am 1f060a17: Merge "GpsLocationProvider: look for config file in /etc/gps.<ro.hardware.gps>.conf"
* commit '1f060a178d9e69f8c08ccad5d7e0ef8fb22ddf8e':
  GpsLocationProvider: look for config file in /etc/gps.<ro.hardware.gps>.conf
2014-07-11 01:44:31 +00:00
Colin Cross
1f060a178d Merge "GpsLocationProvider: look for config file in /etc/gps.<ro.hardware.gps>.conf" 2014-07-10 00:35:03 +00:00
Robin Lee
1f0180bfa8 am 74803e55: Merge "Make misc config directory during user creation"
* commit '74803e559caffe235b86dc52cf76ef98343c0d74':
  Make misc config directory during user creation
2014-07-09 17:39:13 +00:00
Craig Mautner
6d6d218962 am 08881385: Merge "[ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager."
* commit '08881385a86bf887669a555ae03759c374ec9c50':
  [ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager.
2014-07-07 21:19:45 +00:00
Craig Mautner
a7f02a5cda am ef2e7667: Merge "[ActivityManager] Avoid keeping restarting home when only home activity exists."
* commit 'ef2e76675a6c60a2a4764a2e19fdb2c4d9beb00e':
  [ActivityManager] Avoid keeping restarting home when only home activity exists.
2014-07-07 17:23:06 +00:00
Craig Mautner
09c1af5d5c am c66da9d6: Merge "[ActivityManager] Prevent kill a restarted process again."
* commit 'c66da9d606fa3091540bc4c51c2904cc949bf777':
  [ActivityManager] Prevent kill a restarted process again.
2014-07-07 15:36:33 +00:00
Craig Mautner
7611a5d328 am 5acdd0f6: Merge "[ActivityManager] Ensure alive process is not killedByAm."
* commit '5acdd0f67db9b5f41a89dfb5200f37d6f5f984ec':
  [ActivityManager] Ensure alive process is not killedByAm.
2014-07-07 15:00:47 +00:00
Craig Mautner
c66da9d606 Merge "[ActivityManager] Prevent kill a restarted process again." 2014-07-06 03:24:06 +00:00
riddle_hsu
7f1e3f3e93 [ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager.
Sympton:
When application crash in a special timing and system server's InputMethodManager is binding, deadlock may occur.

Root Cause:
Thread(1): When using InputMethodManager in system server, it will lock mH(handler) of InputMethodManager,
and sometimes it will call to InputMethodManagerService::showCurrentInputLocked and will call bindService at some condition,
then it will also lock ActivityManagerService.
Thread(2): When an application crashed, it will lock ActivityManager when showing crash dialog, inside the dialog,
it will call setEnabled of Button and lock mH of InputMethodManager.setEnable of TextView will lock IMM's handler.
So the deadlock happened as the flow: (2) lock AMS -> (1)lock mH -> (2)wait mH -> (1) wait AMS

Solution:
Reduce nested lock of error dialog: post message to let (2) lock mH after release AMS lock.

Change-Id: Id85c29406236db3b5fca9655fde1fcaf0afd1337
2014-07-08 04:30:19 +08:00
riddle_hsu
a4f1f8a239 [ActivityManager] Prevent kill a restarted process again.
Root Cause:
Use removeTask with flag ActivityManager.REMOVE_TASK_KILL_PROCESS will set waitingToKill = "remove task"
to the target process when its setSchedGroup is not BG_NONINTERACTIVE.
Later the target process may be killed when applying oom-adj due to setSchedGroup has changed to BG_NONINTERACTIVE.
If the process is needed to restart, the process record will be resued.
Then the restarted process may be killed again because its waitingToKill is not null.

Solution:
Clean waitingToKill when process is dead.

Change-Id: I5ffb5388127f4221da4c700d3f1c224f7ca6e7b2
2014-07-04 12:19:41 +08:00
riddle_hsu
abc69e93d6 [ActivityManager] Ensure alive process is not killedByAm.
Symptom: Unable to kill by Am again and will be skipped updating its oom adj.

Root Cause:
A restarted process will reuse original process record.
The flag killedByAm will keep previous state.

Solution:
Reset the flag killedByAm to false when the process is started.

Note: Found another similiar patch If95137d91939cc44882ad2813131bcde0edd0c1b


Change-Id: I59a86648ca8d0aed4c489d92751af120aae5ef90
2014-07-04 13:33:19 +00:00
Robin Lee
74803e559c Merge "Make misc config directory during user creation" 2014-07-02 20:49:53 +00:00
Craig Mautner
ef2e76675a Merge "[ActivityManager] Avoid keeping restarting home when only home activity exists." 2014-07-02 20:49:53 +00:00
riddle_hsu
3145b24902 [ActivityManager] Avoid keeping restarting home when only home activity exists.
Root Cause:
When there is only home activity existed,
updating home apk will call forceStopPackageLocked to finish the activity.
Then activity history becomes empty, then home will be launched,
but its package is still target to close that results a loop.

Solution:
If home activity has been force-stopped, do not stop the same home activity again.

Change-Id: Icff12028d407873c2e6f50a06bcad231b908ccbd
2014-07-04 17:01:56 +08:00