How to detect STAMINA mode?

前端 未结 2 885
耶瑟儿~
耶瑟儿~ 2021-02-13 14:30

Can you help me, how to programmatically detect STAMINA mode on Sony devices?

I want to notify user that my app will not work properly if STAMINA is ON because it\'s blo

2条回答
  •  日久生厌
    2021-02-13 14:42

    One way to handle this would be to check the device model and manufacturer on startup of your app and if its a sony device show your own dialog informing the user that they might experience issues.

    See below for how to check the device details:

    String deviceName = android.os.Build.MODEL;
    String deviceMan = android.os.Build.MANUFACTURER;
    
    if(deviceMan.equals("Sony") {
        showAlert();
    }
    

    Maybe you can check online which sony devices have this feature if not all do.

提交回复
热议问题