Skip to content

Better hiding of Plugins

Summary

Prevent BigscreenPlugin's microphone permission from appearing for non-TV devices.

Currently, the Plugin::onCreate function may mean one of two things when it returns false.

  1. The Plugin cannot be loaded right now because a local file is missing, or because a system API returned an error
  2. The Plugin cannot be loaded on this device because the remote device is not compatible with it

As it stands, only the BigScreen plugin uses the second meaning. I have thus chosen to create a new method Plugin::mustNotBeLoaded to represent that instead. We already had a conditional to check if the device's version of Android was recent enough, so I put that in the default implementation, in the base Plugin class.

Notes: This may not be the best long-term solution. Ideally, the remote device would simply not claim to support the Bigscreen packet type if it were not a TV. Is there a way for plasma to tell us that?

Test Plan

  1. Make sure the app is not granted permission to use the Microphone.
  2. View device screen for a link to a non-Tv device.
  3. View settings screen for that same link.

Before:

The Bigscreen plugin will appear on both screens.

After:

The Bigscreen plugin will only appear on the settings screen.

Merge request reports

Loading