mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 16:42:08 +02:00
Workaround for android < Oreo
This commit is contained in:
parent
459991988c
commit
85c6202e80
1 changed files with 8 additions and 1 deletions
|
@ -14,6 +14,7 @@ package io.highfidelity.hifiinterface;
|
|||
import android.content.Intent;
|
||||
import android.content.res.AssetManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Vibrator;
|
||||
|
@ -178,7 +179,13 @@ public class InterfaceActivity extends QtActivity {
|
|||
Integer subLayer1 = 0;
|
||||
Integer subLayer2 = 0;
|
||||
try {
|
||||
Field f = s1.getClass().getSuperclass().getDeclaredField("mSubLayer");
|
||||
String field;
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
field = "mSubLayer";
|
||||
} else {
|
||||
field = "mWindowType";
|
||||
}
|
||||
Field f = s1.getClass().getSuperclass().getDeclaredField(field);
|
||||
f.setAccessible(true);
|
||||
subLayer1 = (Integer) f.get(s1);
|
||||
subLayer2 = (Integer) f.get(s2);
|
||||
|
|
Loading…
Reference in a new issue