OSDN Git Service

android-x86/frameworks-base.git
7 years agofd_utils: fix DEBUG mode booting issue android-x86-6.0-r2
Chih-Wei Huang [Sun, 8 Jan 2017 16:11:43 +0000 (00:11 +0800)]
fd_utils: fix DEBUG mode booting issue

Remove the "/android/" prefix before the white list checking.

Suggested by Chris Vandomelen <chris@sightworks.com>.

7 years agoMerge tag 'android-6.0.1_r74' into marshmallow-x86
Chih-Wei Huang [Tue, 10 Jan 2017 14:08:30 +0000 (22:08 +0800)]
Merge tag 'android-6.0.1_r74' into marshmallow-x86

Android 6.0.1 release 74

7 years agoPrint more switch events
Chih-Wei Huang [Tue, 22 Nov 2016 08:26:15 +0000 (16:26 +0800)]
Print more switch events

7 years agoZygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms
John Stultz [Thu, 28 Jul 2016 19:35:31 +0000 (12:35 -0700)]
Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms

The when the timerfd alarm logic was added to the kernel, an oversight was made
and the interface does not check for the CAP_WAKE_ALARM permissions as required
via other kernel methods to trigger an alarm timer.

In v4.8-rc kernels, the change 2895a5e5b3a ("timerfd: Reject ALARM timerfds
without CAP_WAKE_ALARM") was added by Eric Caruso <ejcaruso@google.com>.

After this change (which may be backported to -stable), the AlarmManager will
fail on the first timerfd_create call, and will not be able to set the time
or handle other necessary functions.

The solution here is to add CAP_WAKE_ALARM to the system_server process.

Change-Id: Ifdb16f3ef42711e553f727165de3922d484b5be4
Signed-off-by: John Stultz <john.stultz@linaro.org>
7 years agoIgnore screen size when determines mForceDefaultOrientation
Chih-Wei Huang [Tue, 18 Oct 2016 15:35:04 +0000 (23:35 +0800)]
Ignore screen size when determines mForceDefaultOrientation

7 years agoAvoid crashing when downloading MitM'd PAC that is too big am: 7d2198b586 am: 9c1cb7a...
Paul Jensen [Mon, 19 Sep 2016 11:37:54 +0000 (11:37 +0000)]
Avoid crashing when downloading MitM'd PAC that is too big am: 7d2198b586 am: 9c1cb7a273 am: 6634e90ad7
am: 66ee2296a9

Change-Id: Ib0023b44e521b936ab2f9450ad367b1feda64492

7 years agoMerge commit '0a9d537f623b2c11dce707fb9b91fea016fd0e9f' into manual_merge_0a9d537
Jeff Sharkey [Fri, 16 Sep 2016 22:57:34 +0000 (16:57 -0600)]
Merge commit '0a9d537f623b2c11dce707fb9b91fea016fd0e9f' into manual_merge_0a9d537

Change-Id: Ib1a0bbb34edb61666ac5739f0b0eaadbe4c5fe06

7 years agoDO NOT MERGE Check caller for sending media key to global priority session
Jaewan Kim [Mon, 19 Sep 2016 12:19:55 +0000 (21:19 +0900)]
DO NOT MERGE Check caller for sending media key to global priority session

Prevent sending media key events from the non-system app to the global
priority session through the MediaSessionManager.dispatchMediaKeyEvent().
Note that any app can use the API indirectly with
the public API AudioManager.dispatchMediaKeyEvent().

Bug: 29833954
Tested: Installed malicious apps and confirmed that they don't work.
Tested: Run CtsTelecomTestCases and CtsMediaTestCases
Change-Id: I2a9e78196ba7455324e485f098f095d03b47ee15
(cherry picked from commit c282c4f106bea5c5375fdb6062ffd4fdcf8563a7)

7 years agoFix build break due to automerge of 7d2198b5
Paul Jensen [Mon, 19 Sep 2016 12:53:20 +0000 (08:53 -0400)]
Fix build break due to automerge of 7d2198b5

Bug: 30100884

Change-Id: I8fa379a74b5d9467b5b9498bd18de2a043963c6f
(cherry picked from commit baae57ab24db7d3b0bf7f84c05954173f1ee15fe)

7 years agoDO NOT MERGE: Catch all exceptions when parsing IME meta data
Tadashi G. Takaoka [Fri, 16 Sep 2016 03:12:14 +0000 (12:12 +0900)]
DO NOT MERGE: Catch all exceptions when parsing IME meta data

Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)

(cherry picked from commit 7bb4c825585d5a6afbb59484ec7db5f5dec1bdaf)

7 years agoDO NOT MERGE: Fix deadlock in AcitivityManagerService.
Sudheer Shanka [Wed, 14 Sep 2016 21:37:14 +0000 (14:37 -0700)]
DO NOT MERGE: Fix deadlock in AcitivityManagerService.

Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
(cherry picked from commit b59e73613bbaf252e2ee5892d7a95cbbd7d40b26)

7 years agoEnsure munmap matches mmap
John Reck [Mon, 12 Sep 2016 17:43:35 +0000 (10:43 -0700)]
Ensure munmap matches mmap

Bug: 31350622
Change-Id: I6d3f9faec32d54360caa6706d17405e20b50966c
(cherry picked from commit aa394dd42c049479bface1991f11b863dc1a0922)

7 years agoFix setPairingConfirmation permissions issue (2/2)
Marie Janssen [Tue, 9 Aug 2016 20:23:39 +0000 (13:23 -0700)]
Fix setPairingConfirmation permissions issue (2/2)

setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: I887de32d156e672ec44aa0b286cd7ea7f9f8ad55
(cherry picked from commit 93326cfd9fb8a20081baa9b975275772798cfd80)

7 years agoDO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
Sungsoo [Thu, 8 Sep 2016 07:04:44 +0000 (16:04 +0900)]
DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change

ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
(cherry picked from commit 2ee53c82cc8c8b2e76a19910074672f6204a5d63)

7 years agoBackport changes to whitelist sockets opened by the zygote.
Narayan Kamath [Fri, 19 Aug 2016 12:45:24 +0000 (13:45 +0100)]
Backport changes to whitelist sockets opened by the zygote.

This is the backport of the following commits :

Commit c5f27a7cb2ec816f483a65255034a1b57a8aa22:
-----------------------------------------------

Reopen whitelisted zygote file descriptors after a fork.

We don't want these descriptors to be shared post-fork, so we'll
have to close and reopen them when the zygote forks. The set of
open descriptors is checked against a whitelist and it is a fatal
error if a non whitelisted FD is opened. It is also a fatal error
if anything other than a regular file / character device or socket
is opened at the time of forking.

This work is done in two stages :
- An initial list of FDs is constructed and cached prior to the
  first zygote fork.

- On each subsequent fork, we check whether the list of open FDs
  has changed. We are currently tolerant of changes, but in the
  longer term, it should be a fatal error if the set of open file
  descriptors in the zygote changes.

- Post fork, we traverse the list of open descriptors and reopen
  them if necessary.

bug: 30963384

Commit 3764a260f0c90dcb323caeda14baf903cc108759:
-----------------------------------------------

Add a whitelist of sockets on fork.

Maintain a whitelist of AF_UNIX sockets that are permitted
to exist at the time of forking. If an open socket does not belong
to the whitelist (or is not AF_UNIX), the process will abort. If an
open socket is whitelisted, it will be redirected to /dev/null after
a sucessful fork. This allows us to unify our handling of the special
zygote sockets (/dev/socket/zygote[_secondary]) with the existing
whitelist of non socket file descriptors.

This change also removes non-fatal ALOGW messages since they have the
side effect of reopening the logging socket.

bug: 30963384

Commit 0b76d6a28e6978151bf245a775329cdae5e574d5:
-----------------------------------------------

fd_utils: Fix broken usage of iterators.

There were two separate issues here :
- RestatInternal was using an iterator after a call to erase(). This
  will not work because it will be invalidated.
- The "standard" for loop idiom for iterating over a map while making
  structural changes to it is broken. Switch to a while loop and treat
  cases where elements are erased differently from cases where they
  aren't.

bug: 31092930
bug: 30963384

Plus additional changes:
-----------------------------------------------
- add /dev/__properties__ to the whitelist.

Change-Id: I709a7f4913e807a8fec8a58c81e98fe5b5222820
(cherry picked from commit 41ca1bce01af7e86aeff9009df54bbc81e3c77d0)

7 years agoFix improper Chinese translation
Chih-Wei Huang [Wed, 21 Sep 2016 16:01:28 +0000 (00:01 +0800)]
Fix improper Chinese translation

7 years agoDetect HDMI audio by switch events android-x86-6.0-r1
Chih-Wei Huang [Tue, 13 Sep 2016 09:43:11 +0000 (17:43 +0800)]
Detect HDMI audio by switch events

If detect SW_VIDEOOUT_INSERT, assume HDMI is plugged.

7 years agoMerge tag 'android-6.0.1_r66' into marshmallow-x86
Chih-Wei Huang [Wed, 7 Sep 2016 05:48:36 +0000 (13:48 +0800)]
Merge tag 'android-6.0.1_r66' into marshmallow-x86

Android 6.0.1 release 66

7 years agoDO NOT MERGE: Fix vulnerability where large GPS XTRA data can be
David Christie [Tue, 23 Aug 2016 23:19:51 +0000 (16:19 -0700)]
DO NOT MERGE: Fix vulnerability where large GPS XTRA data can be
injected.
-Can potentially crash system with OOM.
Bug: 29555864

Change-Id: I7157f48dddf148a9bcab029cf12e26a58d8054f4
(cherry picked from commit 5439aabb165b5a760d1e580016bf1d6fd963cb65)

7 years agoBind fingerprint when we start authentication - DO NOT MERGE
Jim Miller [Fri, 19 Aug 2016 03:22:33 +0000 (20:22 -0700)]
Bind fingerprint when we start authentication - DO NOT MERGE

This fixes a bug where it was possible to authenticate the wrong user.
We now bind the userId when we start authentication and confirm it when
authentication completes.

Fixes bug 30744668

Change-Id: I346d92c301414ed81e11fa9c171584c7ae4341c2
(cherry picked from commit b6f4b48df273d210d13631b4c2426482feb40c97)

7 years agoProcess: Fix communication with zygote.
Narayan Kamath [Tue, 9 Aug 2016 16:00:25 +0000 (17:00 +0100)]
Process: Fix communication with zygote.

Don't write partial requests, and don't return (or throw) early after
partially reading a response.

bug: 30143607

(cherry-picked from commit 448be0a62209c977593d81617853a8a428d013df)

Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
(cherry picked from commit e29c6493c07acf1a0b706917e9af0c8d761c8ae9)

7 years agoFix vulnerability in LockSettings service
Jim Miller [Wed, 10 Aug 2016 22:43:17 +0000 (15:43 -0700)]
Fix vulnerability in LockSettings service

Fixes bug 30003944

Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
(cherry picked from commit 2d71384a139ae27cbc7b57f06662bf6ee2010f2b)

7 years agoDO NOT MERGE: Clean up when recycling a pid with a pending launch
Amith Yamasani [Fri, 5 Aug 2016 22:25:03 +0000 (15:25 -0700)]
DO NOT MERGE: Clean up when recycling a pid with a pending launch

Fix for accidental launch of a broadcast receiver in an
incorrect app instance.

Bug: 30202481
Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
(cherry picked from commit d1eeb5b7b489d47994a71510f1ed5b97b8e32a7a)

7 years agoanalytics: send anonymous usage information
Hugo [Wed, 6 Jul 2016 03:28:38 +0000 (11:28 +0800)]
analytics: send anonymous usage information

Send usage information to google analytics when applications are started
or throws exceptions.

7 years agoMerge tag 'android-6.0.1_r61' into marshmallow-x86
Chih-Wei Huang [Wed, 3 Aug 2016 07:40:30 +0000 (15:40 +0800)]
Merge tag 'android-6.0.1_r61' into marshmallow-x86

Android 6.0.1 Release 61 (MOB30Z)

Conflicts:
services/backup/java/com/android/server/backup/BackupManagerService.java

7 years agoDO NOT MERGE: Allow apps with CREATE_USERS permission to call UM.getProfiles.
Sudheer Shanka [Fri, 29 Jul 2016 17:50:10 +0000 (10:50 -0700)]
DO NOT MERGE: Allow apps with CREATE_USERS permission to call UM.getProfiles.

Bug: 29189712
Bug: 30317026
Bug: 30235113
Change-Id: Icced9805a56675e86f894c458c4a5a0048fd54c0

7 years agoDO NOT MERGE: Fix CTS regression
Sungsoo Lim [Mon, 25 Jul 2016 02:53:13 +0000 (11:53 +0900)]
DO NOT MERGE: Fix CTS regression

Bug: 30297223, Bug: 30437363
Change-Id: I7b18af40e4eac2713577204428fbfb96cc346582

7 years agoDO NOT MERGE: Remove the use of JHEAD in ExifInterface
Sungsoo Lim [Wed, 13 Jul 2016 00:31:16 +0000 (09:31 +0900)]
DO NOT MERGE: Remove the use of JHEAD in ExifInterface

Bug: 29270469
Change-Id: I6a6c8aeab2a842ff1646316363d614851625e78f

7 years agoDO NOT MERGE Block the user from entering safe boot mode
Benjamin Franz [Tue, 12 Jul 2016 14:20:47 +0000 (15:20 +0100)]
DO NOT MERGE Block the user from entering safe boot mode

Block the user from entering safe boot mode if the DISALLOW_SAFE_BOOT
policy is set.

Bug: 26251884
Change-Id: I4945d5d676928346c11ea305a5b6a2e1a42e94e6

7 years agoAdd bound checks to utf16_to_utf8
Sergio Giro [Tue, 28 Jun 2016 17:26:10 +0000 (18:26 +0100)]
Add bound checks to utf16_to_utf8

Test: ran libaapt2_tests64
Bug: 29250543
Change-Id: I1ebc017af623b6514cf0c493e8cd8e1d59ea26c3
(cherry picked from commit 4781057e78f63e0e99af109cebf3b6a78f4bfbb6)

7 years agoCheck caller's uid before allowing notification policy access.
Julia Reynolds [Tue, 28 Jun 2016 19:16:21 +0000 (15:16 -0400)]
Check caller's uid before allowing notification policy access.

Bug: 29421441
Change-Id: I7460268595e932d54660b02007bcd68b95fe8aec

7 years agoFix string equality comparison
Paul Stewart [Mon, 21 Mar 2016 16:51:27 +0000 (09:51 -0700)]
Fix string equality comparison

Don't use "==" to compare strings.

Bug: 25624963
Change-Id: Id25696e4fdcbcf4d48ec74e8ed65c1a33716b30c

7 years agoWifiEnterpriseConfiguration: Do not print credentials in toString
Paul Stewart [Wed, 11 Nov 2015 18:23:43 +0000 (10:23 -0800)]
WifiEnterpriseConfiguration: Do not print credentials in toString

BUG:25624963
Change-Id: I939a12a27d6b915d8a9cc8b142f645fba0ee42ec

7 years agohoudini: match package name by patterns
Chih-Wei Huang [Mon, 18 Jul 2016 14:32:13 +0000 (22:32 +0800)]
houdini: match package name by patterns

PRC apps from different markets usually have different package names.
This change tries to match them by patterns.

To test it, install the Implosion apps from Wandoujia and CoolMarket
and run them OK.

7 years agoMerge branch 'android-ia' into marshmallow-x86
Chih-Wei Huang [Wed, 20 Jul 2016 09:54:14 +0000 (17:54 +0800)]
Merge branch 'android-ia' into marshmallow-x86

7 years agoUpdate window surface while live wallpaper is changed.
suncx [Wed, 20 Apr 2016 08:24:42 +0000 (16:24 +0800)]
Update window surface while live wallpaper is changed.

Other than surface resized or surface moved, setSurfaceBoundariesLocked in
WindowStateAnimator.java may encounter another scenario that the live wallpaper
is changed. In all of scenarios, updateSurfaceWindowCrop(...) should be called
separately to avoid float window flickering when it's dragged off screen.

This patch is meant to refine the previous patch:
https://android.intel.com/#/c/468817/

Change-Id: I2b5f5f55dd221f794aafee1358d9cf5e91ce3666
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-30604
Reviewed-on: https://android.intel.com:443/496968

7 years agoFix memory leak in HWUI
Sangkyu Lee [Fri, 11 Dec 2015 07:05:10 +0000 (16:05 +0900)]
Fix memory leak in HWUI

std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.

Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-19750
Reviewed-on: https://android.intel.com:443/509013

7 years agoFix issue #25727069: Top sleeping activity overrides foreground service
Dianne Hackborn [Tue, 17 Nov 2015 19:14:43 +0000 (11:14 -0800)]
Fix issue #25727069: Top sleeping activity overrides foreground service

port from google https://android-review.googlesource.com/#/c/221708/

Change-Id: I9a085cd650604f9d6277ad343bf3c3852324cafc
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-31379
Signed-off-by: huaqianx <huaqiangx.chen@intel.com>
Reviewed-on: https://android.intel.com:443/503938

7 years agoAdd fclose to avoid leak on native heaps
Sebastien MICHEL [Fri, 1 Apr 2016 13:25:39 +0000 (15:25 +0200)]
Add fclose to avoid leak on native heaps

This leak involves the "dumpsys gfxinfo" command and can be observed on
following processes:
* systemui
* system_server
* googlequicksearchbox

Change-Id: I5d0048a8a0c487ef5f88896fe294efebc9381e2a
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-17934
Signed-off-by: Sebastien MICHEL <sebastien.michel@intel.com>
Reviewed-on: https://android.intel.com:443/489997

7 years agoUpdate window surface while activity is set to full screen.
suncx [Wed, 23 Mar 2016 07:40:00 +0000 (15:40 +0800)]
Update window surface while activity is set to full screen.

Other than surface resized or surface moved, setSurfaceBoundariesLocked
in WindowStateAnimator.java may encounter another scenario that the
flag of window is set to LayoutParams.FLAG_FULLSCREEN. In all of
scenarios, updateSurfaceWindowCrop(...) should be called separately
to avoid float window flickering when it's dragged off screen.

This patch is meant to refine the previous patch:
https://android.intel.com/#/c/468817/

Change-Id: I4ca86588650a58661a13a925b7cb73ac9b0637c0
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-24062
Signed-off-by: suncx <changyingx.sun@intel.com>
Reviewed-on: https://android.intel.com:443/485284

7 years agoFix the memory leak bug introduced by PRC
jgu21 [Fri, 1 Apr 2016 04:40:31 +0000 (00:40 -0400)]
Fix the memory leak bug introduced by PRC
compatibility feature

Fix the memory leak bug introduced by PRC
compatibility featurei, introduced by
https://android.intel.com/#/c/471490/

Change-Id: Iaf9bd21afa17f3a81ab700c63ae7c0bb0851a594
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-27449
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/489353

7 years agoFix KW issues on PRC compatibility
jgu21 [Wed, 30 Mar 2016 06:57:38 +0000 (02:57 -0400)]
Fix KW issues on PRC compatibility

Fix KW issues on PRC compatibility,introduced by below commit.
https://android.intel.com/#/c/484542/

Change-Id: Ib10899655dd2a18569387dbafbe33856acf5df59
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-26904
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/487804

7 years agoDon't back up / restore EAP network definitions
Christopher Tate [Wed, 18 Nov 2015 02:01:52 +0000 (18:01 -0800)]
Don't back up / restore EAP network definitions

Bug 25725016

Change-Id: Idfef9dd53f2403bbe4c950493a0ab8fa66a3b7d4
(cherry picked from commit 9bc2f472e9cf204c737025b5d7101ba16c43b356)
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-26648
Reviewed-on: https://android.intel.com:443/486879

7 years agoHandle renamed packages during default grants
Svet Ganov [Tue, 17 Nov 2015 19:53:18 +0000 (11:53 -0800)]
Handle renamed packages during default grants

If an L device has a privileged app on the system image which was
updated and an M OTA renames the app package (supported only for
privileged apps) we end up with a disabled system package setting
with no package information. Since we are not doing a null check
of the package we get from the disabled package settings during
default grants we crash leaving the system in a bad state.

bug:25687380
Change-Id: I4f2ebcaf471e4bd1696298eab4716b50c52ca5c4
(cherry picked from commit f443384d9e30111aaa61dac75af1f40d19465e96)
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-26630
Reviewed-on: https://android.intel.com:443/486841

7 years agoReduce the overhead of the PRC compatibility package
xiajiang [Mon, 21 Mar 2016 16:26:06 +0000 (12:26 -0400)]
Reduce the overhead of the PRC compatibility package
feature during system bootup

The PRC compatibility package introduced too heavy overhead
in system bootup. This commit aims to reduce the overhead
in system bootup and improve the performance of PRC
compatibility package.

NOTE: The format of ThirdPartySO has been changed to improve
the performance. From now on, the lib name should be trimmed
as below if want to add into the list. For "libabc_v1_2_3.so",
add "abc_v" into the list, that is, the version information
at the tail of lib name should be removed.

Change-Id: Ic374e363d3d31f9bd69be839b33b1bd65950ef61
Tracked-On:https://jira01.devtools.intel.com/browse/OAM-25819
Signed-off-by: xiajiang <xia1.jiang@intel.com>
Reviewed-on: https://android.intel.com:443/484542

7 years agoChanges of root storage space unmounting time on Zygote Process
doheon1.lee [Wed, 20 Jan 2016 04:07:27 +0000 (13:07 +0900)]
Changes of root storage space unmounting time on Zygote Process

Cherr Pick from https://android-review.googlesource.com/#/c/204250/

Zygote process forks every child process for launch the SystemServer and other
applications. When child process is forked, unmount storage inherited
from Zygote process is executed before it gains its own root storage
space.
If Zygote have no storage spaces, unmount operations not needed to
get relevant permission storage space.
Thus unmount is executed only once shortly before the SystemServer is forked.
And the child processes do not unmount its inherited root storage space.

Change-Id: Ib71b065f86d9c4eb100e79f2a74a0cd5ae761b08
Tracked-On:https://jira01.devtools.intel.com/browse/OAM-26190
Reviewed-on: https://android.intel.com:443/485736

7 years agoEnable shader cache for applications that shared UID with multiple packages too
Shuo Gao [Tue, 1 Mar 2016 05:32:03 +0000 (13:32 +0800)]
Enable shader cache for applications that shared UID with multiple packages too

Frameworks supported a mature mechanism for shader cache per each package already,
but as a special case such as Settings APP, if there are several packages in this
application which means that multiple packages shared the same SharedUserID with it,
it won't initialize the graphics disk caches, thereby APP like Settings have to
rebuild and relink shader every time during launch, which cause a bad launching
performance, so here to enable the GFX and RS cache initialization for multiple
shared packages case too.

As measured on Sofia LTE this saves 100 ms during
the 'flush drawing commands' on a cold launch of the Settings
application and so improve the launch time by the same.

Next:
    Run below test on multiple platforms with different GFX:
        1. CTS
        2. MTBF
        3. full Perf Regregssion test suites

Category: aosp improvement
Domain: AOSP-Framework-GUI
Origin: internal
Upstream-Candidate: yes

Change-Id: If0f927e3399b775804abf1d9a868887951f471c5
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-19982
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Reviewed-on: https://android.intel.com:443/476092

7 years agoCreate mixins configuration for app compatibility
jgu21 [Mon, 14 Mar 2016 06:56:10 +0000 (02:56 -0400)]
Create mixins configuration for app compatibility
enhancement feature

This feature is created for some corner cases of
app compatibility issue. It's disabled by default.
To enable it, please add below lines to mixins.spec.
Currently, it aims to handle below issues:

1. All native libraries are put under assets directory.
Some apps put their libraries under the assets directory
in their APKs, instead of lib directory. It's not a
problem if the ABI of app libs is matched with platform
default ABI. But for apps with other ABIs, this feature
must be enabled to call native bridge for help.

Change-Id: I56cd60ade4778094e2b14fc38aa51d0eb0f0d40f
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-24196
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/481102

7 years agoWait for handler thread to exit
jiangmin [Fri, 4 Mar 2016 02:27:31 +0000 (10:27 +0800)]
Wait for handler thread to exit

Wait for handler thread to exit.
If main thread exits too early, vm and binder
will be closed and handler thread will lose
binder fd.

Change-Id: I078f2eb5efcbacca1fe8a41a385c1a2e0b744cd9
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-22153
Signed-off-by: jiangmin <jiangming.wu@intel.com>
Reviewed-on: https://android.intel.com:443/477481

7 years agofix No UL&DL in BT headset during Skype call
Yingkai Cheng [Thu, 4 Feb 2016 09:06:20 +0000 (17:06 +0800)]
fix No UL&DL in BT headset during Skype call

when turn on BT headset during the call, the HSP is firstly connected.
Then A2DP is connected. In this situation A2DPsuspend should not be
set to false. Add condition to judge A2dpsuspend should be true or
false.

Change-Id: Ia7f9b26eafe4869987a42255ef8dc122109bc3ae
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-17033
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-19773
FeatureID: https://jira01.devtools.intel.com/browse/PREQ-18838
Signed-off-by: Yingkai Cheng <yingkaix.cheng@intel.com>
Reviewed-on: https://android.intel.com:443/469114

7 years ago[EAP-TTLS] Specify EAP-GTC phase 2 authentication method in autheap= param
Riadh Khaldi [Mon, 29 Feb 2016 16:37:30 +0000 (17:37 +0100)]
[EAP-TTLS] Specify EAP-GTC phase 2 authentication method in autheap= param

EAP-GTC phase 2 authentication method is specified in auth= param and can't be
correctly parsed by the supplicant.

This patch specifies the EAP-GTC phase 2 authentication method in autheap= param
so it can be correctly parsed by the supplicant.

Change-Id: I37ef692245963262b8b88df16ee413624c5931b9
Category: aosp improvement
Domain: CWS.WIFI-Common
Origin: internal
Upstream-Candidate: yes
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-21727
Signed-off-by: Riadh Khaldi <riadhx.khaldi@intel.com>
Reviewed-on: https://android.intel.com:443/476297

7 years agoEnable the PRC compatibility package feature for PRC market
xiajiang [Wed, 17 Feb 2016 18:59:14 +0000 (13:59 -0500)]
Enable the PRC compatibility package feature for PRC market

In PRC market, some APKs are packed in non-standard way, that is,
the x86(_64) libraries aren't workable although they're found in the APK.
This patch intends to relieve the impact from below 2 defects,
which is based-on the heuristic algorithm.

NOTE: To enable this feature, set "PRC_COMPATIBILITY_PACKAGE := true"
in device BoardConfig.mk before enabling houdini.

1. Missing x86(_64) libraries: The x86(_64) libraries are ported and
   existing in the APK. But it's incomplete, and not workable.
2. Mixed arm(64) libraries: Several libraries are existing in lib/x86(_64)/
   directory in the APK. But some of them are arm(64) libraries,
   instead of x86(_64) ones.

All of above always cause APP crash if installed x86(_64) libraries
by PackageManager.

This patch aims to improve PackageManager to figure out these defects
and install arm(64) libraries to run the APP with houdini support.
The basic idea is to compare x86(_64) libraries with arm(64) alternatives
to determine which one should be workable.

To customize it for specific APPs, 3 lists are provided under
/system/vendor/etc/misc/ on the device.

1. /system/vendor/etc/misc/.OEMWhiteList:
   This patch will be disabled for the APPs containing in the OEMWhiteList
2. /system/vendor/etc/misc/.OEMBlackList:
   The APP is enforced to install the arm(64) libraries if existed.
3. /system/vendor/etc/misc/.ThirdPartySO:
   This is another list which contains the names of all 3rd-party libraries,
   which will impact on the final decision of APP installation.

Change-Id: I2613d9ebc8fe012c801f4a38fc5dede413f15a91
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-20470
Signed-off-by: xiajiang <xia1.jiang@intel.com>
Reviewed-on: https://android.intel.com:443/471490

7 years agoOnly window position changed, update window crop.
Wei, ChangzhiX [Tue, 12 Jan 2016 07:37:55 +0000 (15:37 +0800)]
Only window position changed, update window crop.

When the window move to the edge of screen, first call setWindowCrop,
if the position of window is changed, second call setPosition.
setWindowCrop will let surfaceflinger dispaly the window, but the
lefttop position is the last postion, this will lead the rightbottom
position reduced, and the reduced rect is display the second layer's
window, so the window flicking.
setPosition let surfaceflinger display the window second, and this
time is right rect.

Solution:  When the window move to the edge of screen, only the
position of window is changed, call setPosition and setWindowCrop.

Cherry-picked from https://android.intel.com/#/c/458039

Conflicts:
services/core/java/com/android/server/wm/WindowStateAnimator.java

Change-Id: I12f2b380823f869dea8aa1f42b3b8c548d016b95
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-18559
Signed-off-by: Wei, ChangzhiX <changzhix.wei@intel.com>
Reviewed-on: https://android.intel.com:443/458039
Reviewed-on: https://android.intel.com:443/468817

7 years agolibhwui: handle eglSwapBuffers with EGL_BAD_NATIVE_WINDOW error case
Zhang Dongsheng [Thu, 21 Jan 2016 07:12:18 +0000 (15:12 +0800)]
libhwui: handle eglSwapBuffers with EGL_BAD_NATIVE_WINDOW error case

If eglSwapBuffers is called but the under surface was destroyed,
the EGL_BAD_NATIVE_WINDOW error may also be generated according
to the EGL spec 1.4.

This really shouldn't happen from the upper, but add the graceful
handling of this case also.

Change-Id: Ic0a599808b72f401d2a01c3dc40f9e6ea0e0a564
Signed-off-by: Zhang Dongsheng <dongsheng.zhang@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12666
Reviewed-on: https://android.intel.com:443/460679

7 years agoFix java crash under DhcpClient.java
Damien Vagner [Tue, 19 Jan 2016 12:09:54 +0000 (13:09 +0100)]
Fix java crash under DhcpClient.java

Avoid calling method getTransactionId() on a null pointer.

Change-Id: I330982293ba005679c2ad338e779153b790ee983
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-16403
Signed-off-by: Damien Vagner <damienx.vagner@intel.com>
Reviewed-on: https://android.intel.com:443/459740

7 years agoGive up “startAssist()”if the object “mView” of class “AssistOrbContainer” is null.
xiaowa1x [Thu, 7 Jan 2016 02:00:51 +0000 (10:00 +0800)]
Give up “startAssist()”if the object “mView” of class “AssistOrbContainer” is null.

If device has physical NavigationBar,will not call method
"com.android.systemui.assist.AssistManager.onConfigurationChanged()",
cause the object "mView" is null. When input command "input keyevent 219",
will call methed "com.android.systemui.assist.AssistManager.startAssist()",
but object "mView" is null , result in JAVACHRASH.
So we need give up "com.android.systemui.assist.AssistManager.startAssist()" for physical NavigationBar.

Change-Id: I5c74643c9d99dc56d80a54eea6e798365b044c42
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-13670
Signed-off-by: xiaowa1x <xiaox.wang@intel.com>
Reviewed-on: https://android.intel.com:443/454888

7 years agoNat464Xlat: fix null pointer exception
Honore Tricot [Thu, 14 Jan 2016 13:32:12 +0000 (14:32 +0100)]
Nat464Xlat: fix null pointer exception

Under specific conditions, the interface could become null
while Nat464xlat is handling link properties. This could
leads to a null pointer exception => add robustness to avoid
such exception.

Change-Id: I3eae521c4d38d4111d37e8a988be4ed7fbb89db7
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15066
Signed-off-by: Honore Tricot <honore.tricot@intel.com>
Reviewed-on: https://android.intel.com:443/458312

7 years agofix race condition between HWUI cache and renderThread
Thomas Buhot [Mon, 18 Jan 2016 09:31:58 +0000 (10:31 +0100)]
fix race condition between HWUI cache and renderThread

This is based on the commit c0a0e1a66da20a18045d59451b59ec32685bcf18
that has been merged in Google's master branch.
See: https://android-review.googlesource.com/#/c/195743/

getMaximumBitmapWidth() and getMaximumBitmapHeight() of DisplayListCanvas
need HWUI cache instance. Since the initialization of the cache is
asynchronous it may crash if not yet ready. Add a staticFence() call
to guarantee the cache has been created prior issuing the call.

Change-Id: I5ed9e5cc084444c8d1872a77fef50e294ae14e93
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15447
Reviewed-on: https://android.intel.com:443/456036

7 years agolibhwui: make setSurface asynchronous
Thomas Buhot [Mon, 11 Jan 2016 09:50:08 +0000 (10:50 +0100)]
libhwui: make setSurface asynchronous

This is based on the commit 738a5d4f18e69c03700b77af0ea7e2a101da2c34
that has been merged in Google's master branch.
See: https://android-review.googlesource.com/#/c/183305/

On the critical path of the cold launch of applications
the main thread of the started application tells the RenderThread
to create a surface. This process is synchronous and blocks
the main thread of the application until the creation
of the EGLContext is complete.
As a consequence the launch time of the application is delayed
by time spent allocating the EGL Context in the RenderThread.

With this optimization the launch time of any application
is improved (for example settings by 20 to 40 ms).

Change-Id: I2fea7991abf290d35747b14dc5f9710d293de40a
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15447
Reviewed-on: https://android.intel.com:443/456345

7 years agoRevert "libhwui: make setSurface asynchronous"
Thomas Buhot [Wed, 6 Jan 2016 14:18:43 +0000 (15:18 +0100)]
Revert "libhwui: make setSurface asynchronous"

This reverts commit 1b801ad2e073c5eaa62f388a6b92d4ced9370c94.

Change-Id: I3c4f7518d9ee02593f063d8536d9234e0c1af3cd
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15447
Reviewed-on: https://android.intel.com:443/456344

7 years agoFix deadlog of command "sm forget all"
Yu Chen [Fri, 15 Jan 2016 05:37:25 +0000 (13:37 +0800)]
Fix deadlog of command "sm forget all"
Deadlock orrcurs between pms and MountService.

Change-Id: I1ca34a8a431a743f613cf6cdb4cc20cd7731e4b3
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-14219
Reviewed-on: https://android.intel.com:443/458563

7 years agoAvoid deadlock issue when dump in pms
Hongcheng Xie [Tue, 12 Jan 2016 08:33:16 +0000 (16:33 +0800)]
Avoid deadlock issue when dump in pms

Move package installer service dump action out of
mPackages lock to avoid deadlock.

Change-Id: I255659defe801109707000cb7a8db67b1cf56363
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-8973
Signed-off-by: Hongcheng Xie <hongcheng.xie@intel.com>
Reviewed-on: https://android.intel.com:443/458057

7 years agoWrap reference count to one module
jiangmin [Wed, 6 Jan 2016 02:40:12 +0000 (10:40 +0800)]
Wrap reference count to one module

The reference count should be not managed by two module
(PdfRenderer and PdfEditor) separately.
It will cause memory leak and crash.
FPDF_InitLibrary will be call twice and excute
"g_FPDFAPI_pDefaultMgr = new CPDF_ModuleMgr;" twice.
Memory leak will happen.
PdfEditor will call FPDF_DestroyLibrary just after
PdfRenderer calls FPDF_InitLibrary. PdfRenderer
will execute FPDF's API and crash for null point of
CPDF_ModuleMgr::Get() due to PdfEditor's calling for
FPDF_DestroyLibrary.
So we merge the reference count of FPDF library to
PdfLibrary.cpp from PdfEditor.cpp and PdfRenderer.cpp.

Change-Id: I984a268ddd2d6d97e086e51d6459751feeaf372a
Signed-off-by: Wu Jiangming <jiangmin.wu@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15089
Reviewed-on: https://android.intel.com:443/455409

7 years agoCamera: include VideoStop.ogg into target file system
Hongfu Ruan [Wed, 16 Dec 2015 03:37:22 +0000 (11:37 +0800)]
Camera: include VideoStop.ogg into target file system

VideoStop.ogg was used as recording stop sound, but sound
file was not copied into file system, then cause souldpool
load file failed.

Change-Id: Ib6cf22334a61950f9d9592671f21afdeb7e5ec16
Category: AOSP improvement
Origin: Internal
Upstream-Candidate: yes
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12378
Signed-off-by: Hongfu Ruan <hongfu.ruan@intel.com>
Reviewed-on: https://android.intel.com:443/451140

7 years agoframework: Enable houdini to Support the apps which put all libs under assets dir.
jgu21 [Thu, 2 Apr 2015 08:22:46 +0000 (04:22 -0400)]
framework: Enable houdini to Support the apps which put all libs under assets dir.

1. Many apps in PRC market put all arm native libs under assets/ dir in
   their APK, instead of lib/ dir.
   Since Lollipop, PakcageManager needs clear ABI info during app
   installation.
   If the ABI is not supported, houdini has not chance to involve in.
   For above kind of apps, houdini will not be loaded to help arm libs.
   To support such kind of apps, we have to enable houdini even without
   clear ABI info only for PRC market

2. Fix GTS case failure caused by above modification,
   which enforce to set arm ABI for all pure java

NOTE: Must merge together with https://android.intel.com/449223

Change-Id: I020812790707fb6ec53fb70900ad75971d907bbb
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12442
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Signed-off-by: Zhou,KaiX K <kaix.k.zhou@intel.com>
Reviewed-on: https://android.intel.com:443/449222

7 years ago[SYSTEM-SERVER] Avoid a dead lock between ActivityManager and PowerManager services
Emmanuel Berthier [Thu, 15 Oct 2015 13:39:35 +0000 (15:39 +0200)]
[SYSTEM-SERVER] Avoid a dead lock between ActivityManager and PowerManager services

"main" prio=5 tid=1 Blocked
  | group="main" sCount=1 dsCount=0 obj=0x73fbbfa8 self=0x7ff7b3024000
  | sysTid=3219 nice=-2 cgrp=default sched=0/0 handle=0x7ff7b6f853e0
  | state=S schedstat=( 2270057780 115981310 8889 ) utm=149 stm=77 core=0 HZ=100
  | stack=0x7fff62c6e000-0x7fff62c70000 stackSize=8MB
  | held mutexes=
  at com.android.server.am.ActivityManagerService.registerReceiver(ActivityManagerService.java:15583)
  - waiting to lock <0x016a0e36> (a com.android.server.am.ActivityManagerService) --> synchronized(this): lock held by thread 29
  at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1655)
  at android.app.ContextImpl.registerReceiver(ContextImpl.java:1623)
  at com.android.server.power.PowerManagerService.systemReady(PowerManagerService.java:522)
  - locked <0x1e40b137> (a java.lang.Object)                                --> synchronized(mLock)
  at com.android.server.SystemServer.startOtherServices(SystemServer.java:1054)
  at com.android.server.SystemServer.run(SystemServer.java:263)
  at com.android.server.SystemServer.main(SystemServer.java:177)
  at java.lang.reflect.Method.invoke!(Native method)
  at java.lang.reflect.Method.invoke(Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)

"InputDispatcher" prio=10 tid=29 Blocked
  | group="main" sCount=1 dsCount=0 obj=0x12fb50a0 self=0x7ff7a9656200
  | sysTid=3418 nice=-8 cgrp=default sched=0/0 handle=0x7ff7a9511400
  | state=S schedstat=( 3081453 618956 33 ) utm=0 stm=0 core=0 HZ=100
  | stack=0x7ff79f104000-0x7ff79f106000 stackSize=1012KB
  | held mutexes=
  at com.android.server.power.PowerManagerService.setUserActivityTimeoutOverrideFromWindowManagerInternal(PowerManagerService.java:2317)
  - waiting to lock <0x1e40b137> (a java.lang.Object  --> synchronized(mLock): lock held by thread 1
  at com.android.server.power.PowerManagerService.access$5600(PowerManagerService.java:84)
  at com.android.server.power.PowerManagerService$LocalService.setUserActivityTimeoutOverrideFromWindowManager(PowerManagerService.java:3277)
  at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner(WindowManagerService.java:10110)
  at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop(WindowManagerService.java:8789)
  at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLocked(WindowManagerService.java:8731)
  at com.android.server.wm.WindowManagerService.setNewConfiguration(WindowManagerService.java:3934)
  - locked <0x0b892c09> (a java.util.HashMap)
  at com.android.server.am.ActivityManagerService.updateConfigurationLocked(ActivityManagerService.java:16785)
  at com.android.server.am.ActivityManagerService.updateConfiguration(ActivityManagerService.java:16668)
  - locked <0x016a0e36> (a com.android.server.am.ActivityManagerService)  --> synchronized(this)
  at com.android.server.wm.WindowManagerService.sendNewConfiguration(WindowManagerService.java:7053)
  at com.android.server.wm.InputMonitor.notifyConfigurationChanged(InputMonitor.java:331)
  at com.android.server.input.InputManagerService.notifyConfigurationChanged(InputManagerService.java:1385)

Change-Id: Icf8b722b7739084a2eabd115001c923ec930130a
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-10610
Signed-off-by: Emmanuel Berthier <emmanuel.berthier@intel.com>
Reviewed-on: https://android.intel.com:443/424475
Reviewed-on: https://android.intel.com:443/442803

7 years agoCamera2: create new streams if surface size has changed
Mikael Persson [Thu, 26 Nov 2015 11:34:29 +0000 (12:34 +0100)]
Camera2: create new streams if surface size has changed

When a new capture session is created, the old streams
are re-used if same surface and rotation. However, if the
surface has changed size, we must re-create the stream
to ensure HAL is configured properly, which includes
setting up proper sensor resolution.

This is an issue in e.g. CTS testNoiseReductionModes
and testEdgeModeControl, where a new preview with different
size can be setup without first stopping the previous one.
The same preview surface is used here, but with changed size.

Change-Id: I3b88a95209e83cf1cef0f4d1f791c87b0feb093f
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-10333
Signed-off-by: Mikael Persson <mikael.persson@intel.com>
Reviewed-on: https://android.intel.com:443/441205

7 years agoparallel preload class
Zhang Gary [Sun, 22 Nov 2015 08:18:31 +0000 (16:18 +0800)]
parallel preload class

To parallel class preload with resource preload

Change-Id: I35498f6401f41413974fa2608ac00170a0585034
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-10387
Depends-Change-Id: Ia82cc53534d4140599530e6a58a8f7a5cd09d645
Reviewed-on: https://android.intel.com:443/439031

7 years ago[BT] Handle the update of MAC address in Framework
Franck Lenormand [Mon, 23 Nov 2015 17:23:37 +0000 (18:23 +0100)]
[BT] Handle the update of MAC address in Framework

In case that the OTP address from the BT chip is used,
The callback from the stack update the mac address in
the AdapterProperties but not in
BluetoothManagerService

This patch:
- add the new intent and variable to the API
- handle the reception of the intent
- update the local value

Change-Id: I56eb2299d7b634aa2a229e3e74329f30d0a84d22
Category: aosp improvement
Domain: CWS.BT-Common
Origin: internal
Upstream-Candidate: yes
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-8856
Signed-off-by: Franck Lenormand <franckx.lenormand@intel.com>
Reviewed-on: https://android.intel.com:443/439917

7 years ago[Record] Add voice call recording sources.
Wajdi Zairi [Tue, 24 Feb 2015 08:19:37 +0000 (09:19 +0100)]
[Record] Add voice call recording sources.

Voice call, Voice Uplink and Voice Downlink recording audio
sources are not supported when set through AudioAttributes.
So some market applications can not record from these sources.

This patch adds these sources in AudioAttributes to enable
recording for Applications that use setCapturePreset() interface
when selecting audio record source (exp: Automatic Call Recorder).

Change-Id: Ia1465c4ce03e6b1d303f22967ee096118fd3de82
Depends-Change-Id: I543caf39121e867a9ce4198d9a72560cdf6cce79
Depends-Change-Id: Ie693516564b98096b1db5bd7ad2eba9b619037ba
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-4669
FeatureID: https://jira01.devtools.intel.com/browse/AREQ-11542
Category: aosp improvement
Domain: AOSP-Framework-Media
Origin: internal
Upstream-Candidate: yes
Signed-off-by: Wajdi Zairi <wajdix.zairi@intel.com>
Reviewed-on: https://android.intel.com:443/346382
Reviewed-on: https://android.intel.com:443/374320
Reviewed-on: https://android.intel.com:443/394816
Reviewed-on: https://android.intel.com:443/422615

7 years agofix an ArrayIndexOutOfBoundsException while file path increase to more than maximum...
Du, Changbin [Tue, 11 Sep 2012 23:50:56 +0000 (07:50 +0800)]
fix an ArrayIndexOutOfBoundsException while file path increase to more than maximum amount of chararcters

The object's file path may include more than 255 characters that is
out of MTP string limitation and this will casue a exception
"ArrayIndexOutOfBoundsException". This patch add checking for the
string length of path.

Change-Id: Ie8c9c266d74950211f7e360020d594c882a70088
Orig-Change-Id: Ied02ee401a22771df12cf97b7612660a3c74c3fc
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-4917
Category: aosp improvement
Domain: USB-Mtp-ptp
Origin: internal
Upstream-Candidate: yes
Signed-off-by: Du, Changbin <changbinx.du@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Reviewed-on: https://android.intel.com:443/311630
Reviewed-on: https://android.intel.com:443/426960

7 years agoPackage Manager :optimization forZipFileRO->NextEntry
Shuo Gao [Sat, 10 Oct 2015 07:59:07 +0000 (15:59 +0800)]
Package Manager :optimization forZipFileRO->NextEntry

In functions like findSurpportedAbi and CopyNativeLibraries, it using
ZipFileRO->NextEntry to get FileName of each file in package, and then find a
best ABI or do CRC checking for native libraries.

But in current implementation, NextEntry will read info from both CentralDirectoryRecord
and LocalFileHeader, to compare the filename, signature and so on to check the integrity.

But on platform that has bad "read" performance like Sofia 3GR, it cost too much
time reading infor from LocalFileHeader in each NextEntry, lead to so much time
scanning one package that contains dozens of binaries.

So add the NextEntryNoIntegrity API for such processing that just need a filename, like
use case mentioned above. But it might not trustable if package damaged or changed
unpredictable.

Change-Id: I1647b94f75edf2476f13c1b91edc3a398521928d
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-5845
Depends-Change-Id:Ib06f9486fc2c0f26694018acdb5640d5e650b4e0
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Johnson Z Wu <johnson.z.wu@intel.com>
Signed-off-by: taozha2x <taox.z.zhang@intel.com>
Reviewed-on: https://android.intel.com:443/426686

7 years agoWORKAROUND: Adding two new HDMI switch names
Srikanth Koyili [Fri, 4 Sep 2015 11:05:59 +0000 (16:35 +0530)]
WORKAROUND: Adding two new HDMI switch names

Graphics created switch with "hdmi_b" & "hdmi_c",
but the AOSP code expects "hdmi_audio" or "hdmi".

This patch adds two more switch names "NAME_HDMI_B" and
"NAME_HDMI_C" to support the kernel changes and to make
it backward compatible for other platforms.

Change-Id: I768a6cf7ba063f4ed074f3c1ed29b2d102d00387
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3683
Signed-off-by: Srikanth Koyili <srikanthx.koyili@intel.com>
Reviewed-on: https://android.intel.com:443/415621

7 years agoBuilt-in mic is not used when USB mic is disconnected
Alejandro Ochoa [Sat, 31 Oct 2015 02:05:00 +0000 (20:05 -0600)]
Built-in mic is not used when USB mic is disconnected

In some cases when the USB microphone is disconnected,
audio stack does not switch to the built-in microphone.
It gets stuck in a state where it still recognizes the
USB mic is still connected. Current device removal
implementation only considers USB output devices such
as headset. The same process should be used for input
USB devices (microphone).

Bug: 24932354
Change-Id: Ic2089ef5a9a318cb47336ade405f79eccd7129f8
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-6651
Signed-off-by: Alejandro Ochoa <alejandro.ochoa@intel.com>
Reviewed-on: https://android.intel.com:443/432909

7 years agolibhwui: make surface buffer allocation asynchronous
Thomas Buhot [Fri, 2 Oct 2015 12:12:12 +0000 (14:12 +0200)]
libhwui: make surface buffer allocation asynchronous

On the critical path of the cold launch of applications
the main thread of the started application allocates
the surface buffer. The allocation is synchronous and blocks
the main thread of the application.
As a consequence the launch time of the application is delayed
by the time spent doing the allocation.

With this optimization the allocation is performed
asynchronously in the RenderThread. This optimization
will benefit to the launch of all applications.

Change-Id: I4bc145cfc3ba6fe1efbca519bcee2e4ea6617ae7
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3601
FeatureID: https://jira01.devtools.intel.com/browse/AREQ-13987
Reviewed-on: https://android.intel.com:443/420527

7 years agolibhwui: make setSurface asynchronous
Thomas Buhot [Thu, 24 Sep 2015 08:38:07 +0000 (10:38 +0200)]
libhwui: make setSurface asynchronous

On the critical path of the cold launch of applications
the main thread of the started application tells the RenderThread
to create a surface. This process is synchronous and blocks
the main thread of the application until the creation
of the EGLContext is complete.
As a consequence the launch time of the application is delayed
by time spent allocating the EGL Context in the RenderThread.

With this optimization the launch time of the settings
application is reduced by 20 ms to 40 ms.

This optimization applies to the launch of all
applications.

Change-Id: Ibf47aaa0abb8dedf7aa00693073db3785d9d6b08
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3601
FeatureID: https://jira01.devtools.intel.com/browse/AREQ-13987
Reviewed-on: https://android.intel.com:443/420515

7 years ago[DEBUG] Dump full stacks during ANR & UIWDT
Liu Changcheng [Tue, 25 Aug 2015 03:22:00 +0000 (11:22 +0800)]
[DEBUG] Dump full stacks during ANR & UIWDT

And netd daemon stacks.

Change-Id: I38f8f4d5f30313a70bb65d55aa9861bb59642db5
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-6307
Signed-off-by: Changcheng Liu <changcheng.liu@intel.com>
Reviewed-on: https://android.intel.com:443/429457

7 years agoFrequently used OpenGL ES methods whitelisted for fast JNI
Daniil Sokolov [Wed, 26 Aug 2015 19:39:36 +0000 (12:39 -0700)]
Frequently used OpenGL ES methods whitelisted for fast JNI
 path

The patch lists ~70 methods of OpenGL ES 2.0 wrapper as fast JNI.
This significantly reduces JNI overhead for OpenGL Java applications.
Which results in faster rendering and reduced JANK (e. g. 10 % Jank
reduction  on Google Maps).

None of the whitelisted methods can block forever according to OpenGL
spec. So, this change is safe from fastJNI point of view (can not
introduce any deadlocks). As measured is a separate experiemnt
the whitelisted methods take less than 1 ms in vast majority (99.9+) of the
cases, and always complete within 100 ms.  As shown in this thread
https://soco.intel.com/thread/766188 such level of delays should not
have any practical impact on GC pauses, but reduces the JNI overhead
significantly.

Category:aosp improvement
Domain:AOSP.ART-Other
Origin: internal
Upstream-Candidate: yes
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3965
Signed-off-by: DaniilSokolov <daniil.y.sokolov@intel.com>
Change-Id: I04ed94aef64686d6ee6a1b6a0ef62570687c5f5b
Reviewed-on: https://android.intel.com:443/405100

7 years agoFix deadlock between ActivityManager and BackupManager under some race conditions.
lwan89x [Wed, 24 Sep 2014 10:27:49 +0000 (18:27 +0800)]
Fix deadlock between ActivityManager and BackupManager under some race conditions.

Deadlock may happen when bind backup agent under some race condition.
If waiting for backup agent timeout, BackupManager will call to
ActivityManager's clearPendingBackup with mAgentConnectLock held.
During clearPendingBackup process, it will try to lock ActivityManager's
main lock. If app started up timeout at the same time, ActivityManager
will call to BackupManager's agentDisconnected with main lock held.
During agentDisconnected process, it will try to lock mAgentConnectLock.
Deadlock happened then.

In bindToAgentSynchronous process, move clearPendingBackup out of lock
area to fix this issue.

Change-Id: Ic1acfe1df8fd83d4acff5ce518d86cea4b2fe18b
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3350
Orig-Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-43094
Signed-off-by: lwan89 <liang.wang@intel.com>
Reviewed-on: https://android.intel.com:443/400206
Reviewed-on: https://android.intel.com:443/412995

7 years agoThe process PrintSpooler:renderer crashes in libpdfium.so.
suncx [Tue, 15 Sep 2015 07:57:09 +0000 (15:57 +0800)]
The process PrintSpooler:renderer crashes in libpdfium.so.

In PdfManipulationService.java, PdfEditorImpl shouldn't open the same
ParcelFileDescriptor before PdfRendererImpl close it. In this case, add
a lock to synchronize the two threads.

Category: aosp improvement
Domain: AOSP-Framework-CoreService
Origin: internal
Upstream-Candidate: yes

Change-Id: Ia405b3d4fbccf56982212a21e4a586f69da0ddb5
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-3778
Reviewed-on: https://android.intel.com:443/411261
Reviewed-on: https://android.intel.com:443/412833

7 years agoAdd Process IOWAIT info to ANR dump
Alexandru Timohi [Tue, 1 Sep 2015 08:39:15 +0000 (11:39 +0300)]
Add Process IOWAIT info to ANR dump

Some ANR are due to system slow down related to high IO usage.
We need more info regarding IO consumption per process to
conclude.
This patch will display process blockIO wait time as IOWAIT.
https://jira01.devtools.intel.com/browse/GMINL-14913

Category: aosp improvement
Domain: AOSP-Others
Origin: internal
Upstream-Candidate: yes
Orig-Change-Id: I2ffabff4d4c560a0d60ea552e70a1d878ade596c
Reviewed-on: https://android.intel.com:443/233114
Reviewed-on: https://android-review.googlesource.com/#/c/114481
Reviewed-on: https://android.intel.com:443/350035
(cherry picked from commit 519a029c560a88a2c95a3d05a3f0b2da9e257c58)
Reviewed-on: https://android.intel.com:443/394370

Change-Id: I5afed372d8060b5efcda68b09bb14f896bcf3406
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-2004
Signed-off-by: Alexandru Timohi <alexandru.timohi@intel.com>
Signed-off-by: Emmanuel Berthier <emmanuel.berthier@intel.com>
Signed-off-by: Nicolae Natea <nicolaex.natea@intel.com>
Reviewed-on: https://android.intel.com:443/406682

7 years agoDump full stacks during ANR & UIWDT
Emmanuel Berthier [Tue, 7 Apr 2015 16:38:02 +0000 (18:38 +0200)]
Dump full stacks during ANR & UIWDT

And add some useful daemons stacks.

Change-Id: Ifd1fb6b57dea78997f93c6a3a7ecee0766ee85c4
Signed-off-by: Emmanuel Berthier <emmanuel.berthier@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/GMINL-10293
Reviewed-on: https://android.intel.com:443/383101
Reviewed-on: https://android.intel.com/385134
Reviewed-by: Sjolander, Simon <simon.sjolander@intel.com>
Tested-by: Sjolander, Simon <simon.sjolander@intel.com>
Reviewed-by: Fagerstedt, Axel <axel.fagerstedt@intel.com>
Tested-by: Fagerstedt, Axel <axel.fagerstedt@intel.com>
7 years agoAdd observer for extcon events
Faouaz TENOUTIT [Wed, 28 Jan 2015 09:57:01 +0000 (10:57 +0100)]
Add observer for extcon events

Recent kernel drivers are using EXTCON instead of SWITCH class.

This patch will extend the current WiredAccessoryManager to monitor
and notify about both events (switch & extcon), depending on the current
running kernel configuration.

Issue: IRDA-3090

Change-Id: Ica61534236ed96eda3afdc44934741945b243952
Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
Signed-off-by: Guillaume Zajac <guillaume.zajac@intel.com>
Reviewed-on: https://android.intel.com/327024
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Bhat, Sudheendra S <sudheendra.s.bhat@intel.com>
Tested-by: Bhat, Sudheendra S <sudheendra.s.bhat@intel.com>
Reviewed-on: https://android.intel.com/335886
Reviewed-by: Fagerstedt, Axel <axel.fagerstedt@intel.com>
Reviewed-on: https://android.intel.com/385132
Reviewed-by: Sjolander, Simon <simon.sjolander@intel.com>
Tested-by: Sjolander, Simon <simon.sjolander@intel.com>
Tested-by: Fagerstedt, Axel <axel.fagerstedt@intel.com>
7 years agoMerge tag 'android-6.0.1_r52' into marshmallow-x86
Chih-Wei Huang [Fri, 8 Jul 2016 11:03:19 +0000 (19:03 +0800)]
Merge tag 'android-6.0.1_r52' into marshmallow-x86

Android 6.0.1 Release 52 (MOB30R)

7 years agoSupport save local time to RTC
Ma Jian [Sun, 12 Jun 2016 07:13:55 +0000 (15:13 +0800)]
Support save local time to RTC

Make it work for dual boot with Windows, we could set property
persist.rtc_local_time to 1, so that RemixOS and Windows both
use local time in rtc.

NO_REF_TASK
Tested:
1) set time in android, reboot to bios, make sure the time in bois is
   local time
2) reboot back to android, the current time should be correct local time
   (this need another change)

Change-Id: Id2c0ce150fb9320b132ad8bdd83b38dcae1070db

7 years agoAdd pm operation to set user restrictions.
Sudheer Shanka [Thu, 16 Jun 2016 15:58:00 +0000 (08:58 -0700)]
Add pm operation to set user restrictions.

Bug: 29189712
Change-Id: I6fdb3b68dfe3f51119e5ce8008880fc7d9c793df

7 years agoReduce shell power over user management.
Sudheer Shanka [Thu, 9 Jun 2016 00:13:24 +0000 (17:13 -0700)]
Reduce shell power over user management.

Remove MANAGE_USERS permission from shell and whitelist it for
some specific functionality.

Bug: 29189712
Change-Id: Ifb37448c091af91991964511e3efb1bb4dea1ff3

7 years agoDO NOT MERGE Disable app pinning when emergency call button pressed
Hall Liu [Thu, 2 Jun 2016 17:32:08 +0000 (10:32 -0700)]
DO NOT MERGE Disable app pinning when emergency call button pressed

Also disables app pinning when the "return to call" button is pressed
and brings up the in-call screen when app pinning is stopped if there is
an existing call.

Combination of ag/1091397 and ag/1085584 adapted for MNC.

Bug: 28558307
Bug: 28761672
Change-Id: I82ec4042bff387c845ce571b197a4a86e1dd5ec8

7 years agoDO NOT MERGE Fix intent filter priorities
Todd Kennedy [Mon, 4 Apr 2016 19:29:59 +0000 (12:29 -0700)]
DO NOT MERGE Fix intent filter priorities

Since this is a backport, there is only one rule that guards intent
filter priorities:
1) Updates will NOT be granted a priority greater than the priority
   defined on the system image.

Bug: 27450489
Change-Id: Ifcec4d7a59e684331399abc41eea1bd6876155a4

7 years agoDon't trust callers to supply app info to bindBackupAgent()
Christopher Tate [Mon, 13 Jun 2016 22:17:54 +0000 (15:17 -0700)]
Don't trust callers to supply app info to bindBackupAgent()

Get the canonical identity and metadata about the package from the
Package Manager at time of usage rather than rely on the caller to
have gotten things right, even when the caller has the system uid.

Bug 28795098

Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877

Merge conflict resolution for ag/1133474 (referencing ag/1148862)
- directly to mnc-mr2-release

7 years agoMerge tag 'android-6.0.1_r46' into marshmallow-x86
Chih-Wei Huang [Tue, 7 Jun 2016 00:24:42 +0000 (08:24 +0800)]
Merge tag 'android-6.0.1_r46' into marshmallow-x86

Android 6.0.1 release 46

7 years agoBackport of backup transport whitelist
Christopher Tate [Fri, 20 May 2016 22:29:31 +0000 (15:29 -0700)]
Backport of backup transport whitelist

Sysconfig define a whitelist of permitted backup transports

Previously any apk bundled in priv-app could insert a backup transport.
Reduce risk surface by giving the OEM explicit control over who is
allowed to handle backup data.

Bug 28406080

Backport of 494df791728f4d42d67e935c327910975993ad29 from N

Change-Id: I9f90e324169a68720d608f74754d284a7e59cf87

7 years agoBackport ChooserTarget package source check from N
Adam Powell [Thu, 28 Apr 2016 23:32:18 +0000 (16:32 -0700)]
Backport ChooserTarget package source check from N

Fix a bug where a ChooserTargetService could supply a ChooserTarget
pointing at a non-exported activity outside of its own package and
have it launch.

Bug 28384423

Change-Id: I3f5854f91c5695ad9253d71055ef58224df47008

7 years agoDon't pass URL path and username/password to PAC scripts
Paul Jensen [Fri, 15 Apr 2016 14:41:13 +0000 (10:41 -0400)]
Don't pass URL path and username/password to PAC scripts

The URL path could contain credentials that apps don't want exposed
to a potentially malicious PAC script.

Bug: 27593919
Change-Id: I4bb0362fc91f70ad47c4c7453d77d6f9a1e8eeed

7 years agoFix missing permission check when saving pattern/password
Jim Miller [Wed, 13 Apr 2016 23:35:36 +0000 (16:35 -0700)]
Fix missing permission check when saving pattern/password

Fixes bug 28163930

Change-Id: Ic98ef20933b352159b88fdef331e83e9ef6e1f20

7 years agoKill the real/isolated uid group, not the ApplicationInfo uid
Christopher Tate [Mon, 18 Apr 2016 22:16:31 +0000 (15:16 -0700)]
Kill the real/isolated uid group, not the ApplicationInfo uid

This is a direct reimplementation in L of fixes applied to N in
these two commits:

8dc8d37c1d7d694016f1ec2b3cea5fb723567be8
e8741d23d2dd05c4cb3fed5ee6a4040ee96a60e3

Bug 19285814

Change-Id: I59bcc8f1d41c426e9da635bea9ad1d7c6756d5aa

Resolve merge conflict when cp'ing ag/941553 to mnc-mr1-release branch

7 years agoSolve black background for android-x86
qinshaohui [Thu, 10 Mar 2016 06:13:09 +0000 (14:13 +0800)]
Solve black background for android-x86

7 years agoAdd support for setting passkey as pairing variant
Grzegorz Kolodziejczyk [Tue, 20 Oct 2015 13:07:51 +0000 (15:07 +0200)]
Add support for setting passkey as pairing variant

This is needed if pairing variant is passkey entry.

Change-Id: I8f3efbc90757ac77414a9e86d7c29326c25c12ad

7 years agoAvoid crashes with Suspendon Lollipop (ColorFade)
Paulo Sergio Travaglia [Sun, 21 Jun 2015 08:11:13 +0000 (05:11 -0300)]
Avoid crashes with Suspendon Lollipop (ColorFade)

ColorFade (which is called on Suspend during STATE_OFF)
uses some GLSL commands to make some effects ( fade current screen
to black and white before blacking it out completelly)

However, it produces a crash on mesa. To avoid this crash,
Fragment Shader code was commented out, keeping just
gl_FragColor to set a single black color

7 years agoFix Bluetooth tethering
Grzegorz Kolodziejczyk [Thu, 5 Feb 2015 12:56:03 +0000 (13:56 +0100)]
Fix Bluetooth tethering

Ignore linkstate down events for bt-pan interface which cause its
remove. Interface should only be removed when we receive the interface
remove event.

At connect init to bluetooth PAN service, bridge pan device adds
tetherable bt-pan interface as set in bluetooth regexs. Before bt-pan
interface gets tethered, multiple linkstate events are received by
linkstate change notifier.
Receiving multiple time of linkstate down may cause remove of tetherable
interface (bt-pan), before we call tether method. Finally when tethering
method is called and bt-pan tether interface is removed, error is
returned because of not available tetherable interfaces.

Bug found during bluetooth PTS PAN testing. It affects multiple test
cases.

Change-Id: Ifb0d16657ca238aa62064fee0fc4ee974a2518ad