Bug 21748 - Arrays returned as inout types from Java Service AIDL index is off by 1
Summary: Arrays returned as inout types from Java Service AIDL index is off by 1
Status: RESOLVED DUPLICATE of bug 21747
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.12.4
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2014-07-31 21:18 UTC by David Hathaway
Modified: 2014-08-05 05:08 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample Repro (1.26 MB, application/zip)
2014-07-31 21:18 UTC, David Hathaway
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 21747

Description David Hathaway 2014-07-31 21:18:44 UTC
Created attachment 7558 [details]
Sample Repro

When passing in either and int[] or long[] array to a AIDL, the array appears to be off by 1.  Repro attached.

Example AIDL:

/** Example service interface */
interface IDalvikSampleService {

    long longGetDevices(inout long[] devs, long dpmax);

    int intGetDevices(inout int[] devs, int dpmax);
}

Expected result:

Type: long, Position: 0, Value: 1
Type: long, Position: 1, Value: 2
Type: long, Position: 2, Value: 3
Type: long, Position: 3, Value: 4
Type: long, Position: 4, Value: 5
Type: int, Position: 0, Value: 1
Type: int, Position: 1, Value: 2
Type: int, Position: 2, Value: 3
Type: int, Position: 3, Value: 4
Type: int, Position: 4, Value: 5

Actual result:

Type: long, Position: 0, Value: 21474836480 <-- should be the last item in the array
Type: long, Position: 1, Value: 1
Type: long, Position: 2, Value: 2
Type: long, Position: 3, Value: 3
Type: long, Position: 4, Value: 4
Type: int, Position: 0, Value: 5 <-- should be the last item in the array
Type: int, Position: 1, Value: 1
Type: int, Position: 2, Value: 2
Type: int, Position: 3, Value: 3
Type: int, Position: 4, Value: 4
Comment 1 Parmendra Kumar 2014-08-04 07:46:53 UTC
@David, I would like to thank  for attaching sample project. But when I open the attached folder 'Sample Repro". I got two folders  "MonoClient" and "sampleservcie". I found sln for MonoClient. So, I opened MonoClient.sln file. 
And when i found the .jar file on "samplesevice", The ".jar" file is disable.
I am not able to add "sampleservice".

Please, let me know What I missed here.
Comment 2 David Hathaway 2014-08-04 10:53:55 UTC
The second project is an Eclipse Java project.  You will need to open up eclipse, and add the project to your workspace in order to run it. 

Assumptions: You have Eclipse installed with the latest ADT, and appropriate Android SDKs.
Comment 3 Atsushi Eno 2014-08-05 05:08:19 UTC
The cause of the problem was the same as bug #21747.

*** This bug has been marked as a duplicate of bug 21747 ***