15632 Commits

Author SHA1 Message Date
Dan Albert
b973422804 am 69c8d39d: Merge "Clean up unused parameter warnings."
* commit '69c8d39d1f9ebb55844ad7794d12fedf8b5be5bf':
  Clean up unused parameter warnings.
2014-10-17 07:38:20 +00:00
Dan Albert
692018430f Clean up unused parameter warnings.
Change-Id: Ifbf310a0c10bd6afc3099bcad1026990bd1e6a22
2014-10-16 16:55:29 -07:00
Chih-Hung Hsieh
e07c9f140e Fix log call output format error. (DO NOT MERGE)
Cherry picked from googleplex-android c/445200.

BUG: 17916851
Change-Id: If4077e94d6dc7ef31ecf09cbcf41091c7e30268f
2014-10-15 16:48:22 +00:00
Neil Fuller
ee665151a4 am 0c1faf43: Merge "Switch from FloatMath -> Math and Math.hypot where possible"
* commit '0c1faf43aecadc37b78c4ad6cb669eb351d21385':
  Switch from FloatMath -> Math and Math.hypot where possible
2014-10-02 10:18:29 +00:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Andreas Gampe
6290c048e1 am 207cffe9: Merge "Frameworks/base: Fix services/jni warnings"
* commit '207cffe95a868ea21b74dd54e3ef7821162ce870':
  Frameworks/base: Fix services/jni warnings
2014-09-29 20:43:15 +00:00
Andreas Gampe
207cffe95a Merge "Frameworks/base: Fix services/jni warnings" 2014-09-29 18:10:26 +00:00
Andreas Gampe
26872f4b9e Frameworks/base: Fix services/jni warnings
Update code for unused variables.

Ignore warnings generated by pulling in Skia.

Change-Id: I5b33c9b003c90bcabcea0761304c4c99cf5e39ec
2014-09-25 11:45:07 -07:00
Andreas Gampe
dfdabe3728 am 6f954cf2: Merge "Frameworks/base: Early init native bridge"
* commit '6f954cf2eb2baadf26bc0aba6272ef19b5dd45a0':
  Frameworks/base: Early init native bridge
2014-09-24 22:10:15 +00:00
Andreas Gampe
6f954cf2eb Merge "Frameworks/base: Early init native bridge" 2014-09-24 21:59:51 +00:00
jgu21
2eacd06bfb Frameworks/base: Early init native bridge
Add the app directory to the arguments for starting a process.
Add a check for NeedsNativeBridge and a call to PreInitializeBridge
in the native fork code.

Change-Id: I0b93da93251c6b4638de786bf98cf99df07c3fc2
2014-09-22 16:04:37 -07:00
Christopher Ferris
4cbee7d24d am b7442bbc: Merge "Remove MALLOC_LEAK_CHECK references."
* commit 'b7442bbc8c27b0643b7235076ee151b8257bf28d':
  Remove MALLOC_LEAK_CHECK references.
2014-09-20 01:30:36 +00:00
Christopher Ferris
9244436a05 Remove MALLOC_LEAK_CHECK references.
Bug: 17378595
Change-Id: Ie7f8af88c7f3b0c3dc2c2e75bbaaa9e6a81269ae
2014-09-19 18:08:29 -07:00
Dan Albert
8791ebf0cd am bcaaebb8: Merge "Clean up test makefiles."
* commit 'bcaaebb8a881951720190f4a6b9ffcbf871542af':
  Clean up test makefiles.
2014-09-19 22:14:38 +00:00
Dan Albert
bcaaebb8a8 Merge "Clean up test makefiles." 2014-09-11 23:21:14 +00:00
Dan Albert
715d01aedf Clean up test makefiles.
The build system takes care of linking the correct STL and gtest
libraries for you, and specifying them manually confuses the build
system when using libc++.

Change-Id: I9f76ab26a63ace51293614cfb5ca002f37438e02
2014-09-11 15:49:57 -07:00
Dan Albert
140e58b0f4 am 8bbc5269: Merge "Don\'t check a staticly allocated array for null."
* commit '8bbc526921a5034ccde19e5ae5ec4d5b0cc180ee':
  Don't check a staticly allocated array for null.
2014-09-10 17:42:40 +00:00
Dan Albert
4fb58b0360 Don't check a staticly allocated array for null.
Change-Id: I5568174f1a9d53078c2169cfd3401e43d88a7643
2014-09-10 08:17:30 -07:00
Andreas Gampe
82ad9ec3d1 am 523afd15: Merge "Frameworks/base: Add native bridge post-fork initialization"
* commit '523afd157be99ddce8c0f643caceb9db4a9227bb':
  Frameworks/base: Add native bridge post-fork initialization
2014-09-04 21:55:34 +00:00
Andreas Gampe
aec67dcc02 Frameworks/base: Add native bridge post-fork initialization
Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
2014-09-03 21:38:34 -07:00
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