Restrict auto-enter PiP on TV via permission

Creates a new permission which needs to be held by an app to be able to
implicitly enter PiP on TV. Checks for the permission when new PiP params
are set and overrides the auto-enter value when permission is not held.
Also prevents PiP entry during onPause and onUserLeaveHint.

Bug: 281512335
Bug: 283115999
Test: atest CtsWindowManagerDeviceOther:PinnedStackTests
Flag: android.app.enable_tv_implicit_enter_pip_restriction

Change-Id: I29a4c4627de79fb7114c9b74f2db74c43e3e2fc7
6 files changed