0

How can we determine if given android device supports S-view or not ?

Is there any way programatically or through adb command ? So that we can check if device supports sview and to check its status when it will be shown. Any guidelines or help would be greatly appreciated.

EDIT : I added workaround below for this check.

Also if someone has different approach please let me know.

snehal_penurkar
  • 273
  • 1
  • 3
  • 15

2 Answers2

1

I have got workaround for this, These are extra features added by samsung for the devices for which no constant values are added in Android api, so we need to add them manually.

    private static final String SVIEW_FEATURE = "com.sec.feature.cover.sview";
    private static final String HOVER_FEATURE = "com.sec.feature.hovering_ui";
    private static final String SENSOR_HUB_FEATURE = "com.sec.feature.sensorhub";
    private static final String SPEN_FEATURE = "com.sec.feature.spen_usp";

You can call below function as ,

 hasFeature(SPEN_FEATURE );

Function :

private boolean hasFeature(String feature) {
        FeatureInfo[] infos = getPackageManager().getSystemAvailableFeatures();
        for (FeatureInfo info : infos) {
            if (!TextUtils.isEmpty(info.name)) {
                Log.d("TAG", info.name);
                if (feature.equalsIgnoreCase(info.name)) {
                    Log.v("TAG", "Feature supported "+ info.name);
                    return true;
                }
            }
        }
        return false;
    }
snehal_penurkar
  • 273
  • 1
  • 3
  • 15
  • Note : This doesn't work on Note as it does not have these features added by Samsung. Also may be there are devices which contains pen but its not added as feature. Does anyone know generic solution to check Spen available on device or not. Thanks in advance. – snehal_penurkar Aug 08 '14 at 05:46
0

Check the link below, it could be helpful to you. As android doesn't support S view directly.

s-view functionality on any phone

Waghela
  • 55
  • 1
  • 11
  • The given app uses proximity sensor to display custom sview. I dont want that, I want to know if device supports SView and how to detect that. I have observed certain logs for S4 mini when sview is closed and opened. It fires broadcast receiver for the action "com.samsung.cover.OPEN". I can catch this event. But its tested on only one device till. Need to look out for other device's logs. – snehal_penurkar Jun 30 '14 at 13:39