client_Hale
2019-01-18 d38ccc61d18668f8bfe467b5c5b62f505ec1b7f7
Project/js_sdk/src/main/java/com/secondworld/univeralsdk/MainActivity.java
@@ -7,6 +7,7 @@
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Process;
import android.provider.Settings;
@@ -15,6 +16,7 @@
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import com.linglei.sdk.openapi.LLSDK;
import com.unity3d.player.UnityPlayerActivity;
public class MainActivity extends UnityPlayerActivity
@@ -41,24 +43,25 @@
        m_MainContainer = (RelativeLayout) findViewById(R.id.main_container);
        String _brand = NotchPhoneUtil.getDeviceBrand();
        if (_brand.indexOf("vivo") >= 0)
        if (_brand.toUpperCase().contains("VIVO"))
        {
            isNotch = NotchPhoneUtil.HasNotchVivo(MainActivity.this);
            mType = 1;
        }
        else if (_brand.indexOf("HUAWEI") >= 0)
        else if (_brand.toUpperCase().contains("HUAWEI")
                || _brand.toUpperCase().contains("HONOR"))
        {
            isNotch = NotchPhoneUtil.HasNotchVivo(MainActivity.this);
            mType = 2;
//            isNotch = NotchPhoneUtil.hasNotchAtHuawei(this);;
//            mType = 2;
        }
        else if (_brand.indexOf("OPPO") >= 0)
        else if (_brand.toUpperCase().contains("OPPO"))
        {
            isNotch = NotchPhoneUtil.HasNotchVivo(MainActivity.this);
            isNotch = NotchPhoneUtil.HasNotchOPPO(MainActivity.this);
            mType = 3;
        }
        else if (_brand.indexOf("Xiaomi") >= 0)
        else if (_brand.toUpperCase().contains("XIAOMI"))
        {
            isNotch = NotchPhoneUtil.HasNotchVivo(MainActivity.this);
            isNotch = NotchPhoneUtil.HasNotchXiaoMi();
            mType = 4;
        }
@@ -196,4 +199,9 @@
        super.onRestart();
    }
    @Override
    public void onBackPressed() {
        super.onBackPressed();
        LLSDK.getInstance().onKeyBack();
    }
}