如何过滤通知访问屏幕到我的应用程序?

问题描述

目前我以下列方式请求使用通知访问(通知监听服务)的许可:

x86_64-conda-linux-gnu-c++ -std=gnu++11 -I"/home/legrand-lab/anaconda3/envs/r4-base/lib/R/include" -DNDEBUG -I. -Ivendor -DRsqlITE_USE_BUNDLED_sqlITE -DsqlITE_ENABLE_RTREE -DsqlITE_ENABLE_FTS3 -DsqlITE_ENABLE_FTS3_PARENTHESIS -DsqlITE_ENABLE_FTS5 -DsqlITE_ENABLE_JSON1 -DsqlITE_ENABLE_STAT4 -DsqlITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DsqlITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I'/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/plogr/include' -I'/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/Rcpp/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/legrand-lab/anaconda3/envs/r4-base/include -I/home/legrand-lab/anaconda3/envs/r4-base/include -Wl,-rpath-link,/home/legrand-lab/anaconda3/envs/r4-base/lib  -fvisibility=hidden -fpic  -fvisibility-inlines-hidden  -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/legrand-lab/anaconda3/envs/r4-base/include -fdebug-prefix-map=/home/conda/Feedstock_root/build_artifacts/r-base-split_1616773775410/work=/usr/local/src/conda/r-base-4.0.3 -fdebug-prefix-map=/home/legrand-lab/anaconda3/envs/r4-base=/usr/local/src/conda-prefix  -c sqliteColumnDataSource.cpp -o sqliteColumnDataSource.o
In file included from vendor/boost/math/special_functions/sign.hpp:16,from vendor/boost/lexical_cast/detail/inf_nan.hpp:34,from vendor/boost/lexical_cast/detail/converter_lexical_streams.hpp:63,from vendor/boost/lexical_cast/detail/converter_lexical.hpp:54,from vendor/boost/lexical_cast/try_lexical_convert.hpp:44,from vendor/boost/lexical_cast.hpp:32,from vendor/boost/date_time/format_date_parser.hpp:14,from vendor/boost/date_time/date_generator_parser.hpp:20,from vendor/boost/date_time/date_facet.hpp:25,from vendor/boost/date_time/gregorian/gregorian_io.hpp:16,from vendor/boost/date_time/gregorian/gregorian.hpp:31,from sqliteColumnDataSource.cpp:6:
vendor/boost/math/tools/config.hpp:408:13: Fatal error: boost/detail/fenv.hpp: No such file or directory
  408 |    #include <boost/detail/fenv.hpp>
      |             ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/home/legrand-lab/anaconda3/envs/r4-base/lib/R/etc/Makeconf:181 : sqliteColumnDataSource.o] Erreur 1
ERROR: compilation Failed for package ‘Rsqlite’
* removing ‘/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/Rsqlite’
ERROR: dependency ‘Rsqlite’ is not available for package ‘AnnotationDbi’
* removing ‘/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/AnnotationDbi’
ERROR: dependency ‘Rsqlite’ is not available for package ‘BiocFileCache’
* removing ‘/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/BiocFileCache’
ERROR: dependencies ‘AnnotationDbi’,‘BiocFileCache’ are not available for package ‘biomart’
* removing ‘/home/legrand-lab/anaconda3/envs/r4-base/lib/R/library/biomart’

The downloaded source packages are in
    ‘/tmp/RtmpJRLzOp/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages(...) :
  installation of package ‘Rsqlite’ had non-zero exit status
2: In install.packages(...) :
  installation of package ‘AnnotationDbi’ had non-zero exit status
3: In install.packages(...) :
  installation of package ‘BiocFileCache’ had non-zero exit status
4: In install.packages(...) :
  installation of package ‘biomart’ had non-zero exit status

这确实有效,但用户必须从应用列表中选择我的应用。

enter image description here

为了提高可用性,我希望它看起来更像这样

enter image description here

有人知道如何正确过滤吗?

对于使用访问设置,我使用以下代码

startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));

遗憾的是,这不适用于通知访问设置。 错误

Intent myIntent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS,Uri.parse("package:" + getPackageName()));
startActivity(myIntent);

解决方法

找到了解决办法:

if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
    switch ( ICL_LANGUAGE_CODE ) {
        case 'nl':
            $checkout = 'afreken';
            break;
        case 'en':
            $checkout = 'checkout';
            break;
    }
} else {
    $checkout = 'afrekenen';
}

wp_safe_redirect( esc_url_raw( home_url( '/' . $checkout . '/order-pay/{{' . $orderid . '}}/?pay_for_order=true&key={{' . $orderkey . '}}' ) ) );

这仅在 API 版本 30 中引入,我不知道早期版本的方法(或者甚至可能)。