I was able to hide incoming call notifications by using full screen activity.
incoming call notification is not visible only activity is visible.
- obviously you need to create service to detect incoming call which will launch your activity.
Here is code I used for full screen activity
protected void onCreate(Bundle savedInstanceState) {
this.getWindow().getDecorView().setSystemUiVisibility(getSystemUiFlags());
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT < 16) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
setContentView(R.layout.myviewxml);
}
the function
private static int getSystemUiFlags() {
return View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
}
The manifest entry
<activity
android:name=".MyActivity"
android:label="@string/title_activity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
Hope this helps somebody.