[TIMOB-25877] Android: "Ti.Platform.ostype" wrongly returns "32bit" on a 64-bit OS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-19T18:41:22.000+0000 |
Affected Version/s | Release 7.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | analytics, android, architecture |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2018-03-17T02:48:29.000+0000 |
Updated | 2018-11-19T18:41:25.000+0000 |
Description
*Summary:*
The
Ti.Platform.ostype
property is currently hardcoded to return "32bit" on Android.
[APSAnalyticcsHelper.java#L235](https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/android/analytics/APSAnalytics/src/main/java/com/appcelerator/aps/APSAnalyticsHelper.java#L235)
Now that Titanium supports building Android apps for ARM64, it should return "64bit" when running on a 64-bit Android device like how it works for iOS here...
[APSUtility.m#L15](https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/ios/support/analytics/APSAnalytics/APSUtility.m#L15)
*Steps to Reproduce:*
Build an run the below code on a 64-bit Android device, such as a Pixel XL phone.
Observe the log for an "ostype:" entry.
Ti.API.info("@@@ ostype: " + Ti.Platform.ostype);
*Note:*
We had to do something similar for iOS as can be seen here: [TIMOB-18193]
*Recommended Solution:*
Check if array returned by android.os.Build.SUPPORTED_64_BIT_ABIS
contains at least 1 element.
https://developer.android.com/reference/android/os/Build.html#SUPPORTED_64_BIT_ABIS
Note that Google added 64-bit support as of Android 5.0 (aka: API Level 21). So, you can't use Google's Process.is64Bit()
method since it is only supported on Android 6.0 and higher.
https://developer.android.com/reference/android/os/Process.html#is64Bit()
aps_sdk: https://github.com/appcelerator/aps_sdk/pull/314
[~gmathews], this is done, right? I can see that it was already merged.