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.
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;
}