File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/android/be/tarsos/dsp/io/android Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -132,15 +132,28 @@ private enum CPUArchitecture{
132
132
X86 ,ARMEABI_V7A ,ARMEABI_V7A_NEON ;
133
133
}
134
134
135
+ private boolean isCPUArchitectureSupported (String alias ) {
136
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
137
+ for (String supportedAlias : Build .SUPPORTED_ABIS ) {
138
+ if (supportedAlias .equals (alias ))
139
+ return true ;
140
+ }
141
+
142
+ return false ;
143
+ } else {
144
+ return Build .CPU_ABI .equals (alias );
145
+ }
146
+ }
147
+
135
148
private CPUArchitecture getCPUArchitecture () {
136
149
// check if device is x86
137
- if (Build . SUPPORTED_ABIS [ 0 ]. equals ("x86" )){
150
+ if (isCPUArchitectureSupported ("x86" )) {
138
151
return CPUArchitecture .X86 ;
139
- } else if (Build . SUPPORTED_ABIS [ 0 ]. equals ("armeabi-v7a" )) {
152
+ } else if (isCPUArchitectureSupported ("armeabi-v7a" )) {
140
153
// check if NEON is supported:
141
- if (isNeonSupported ()){
154
+ if (isNeonSupported ()) {
142
155
return CPUArchitecture .ARMEABI_V7A_NEON ;
143
- }else {
156
+ } else {
144
157
return CPUArchitecture .ARMEABI_V7A ;
145
158
}
146
159
}
You can’t perform that action at this time.
0 commit comments