6

I'm using Android Studio 2020.3.1 to watch debug messages for my app in the logcat. The app is a blank project made with Delphi 11.

Setting the logcat filter to com.bookup has these two lines appear:

2022-01-16 16:07:41.227 1247-1378/? I/AppsFilter: interaction: PackageSetting{138dd45 com.bookup.ThisIsMikesTestProjectOfDoom/10332} -> PackageSetting{3e91e66 com.paypal.android.p2pmobile/10229} BLOCKED
0222-01-16 16:08:02.394 1247-1378/? I/AppsFilter: interaction: PackageSetting{138dd45 com.bookup.ThisIsMikesTestProjectOfDoom/10332} -> PackageSetting{3e91e66 com.paypal.android.p2pmobile/10229} BLOCKED

The PayPal app is running on the Android device.

Am I correct in understanding these lines to say that my empty app tried to "interact" with the PayPal app and was "blocked?" Is that normal?

Mike at Bookup
  • 1,211
  • 14
  • 32

2 Answers2

9

Your package doesn't seem to have the required visibility of PayPal package. You may need to add visibility for the required package in your app's Manifest.

Checkout for more info: https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9

Edit: My original answer did not give much context or examples, hence adding a few things which may help

Apps targeting API level 30 and above (Android 11+) need to specify which other packages they need to see (or use) on the device. For this, developers need to add a <queries> tag in their apps' AndroidManifest.xml like this:

<manifest package="com.bookup.ThisIsMikesTestProjectOfDoom">
  <queries>
    <package android:name="com.paypal.android.p2pmobile" />
    <package android:name="com.example.other.package" />
  </queries>
  …
</manifest>

The <package> tag is one of the valid tags under <queries>. Other options can be found here. Without the <queries> tag, AppsFilter will not allow access of any package to your app, which is what you're seeing in your logcat.

You can read more on the new changes in Package visibility here: https://developer.android.com/training/package-visibility/testing

Sumedh Sen
  • 99
  • 1
  • 3
  • You may want to consider improving this answer with an example, perhaps one taken from the linked article (don't forget to attribute any borrowed code) – codewario May 29 '22 at 17:50
  • 1
    People might miss the part that says, "The app is a blank project made with Delphi 11." There is no way a blank project (Hello World) would have anything to do with PayPal. It is still a mystery to me why a blank project would trigger any logcat lines that mention any app other than itself. – Mike at Bookup May 30 '22 at 18:42
  • 1
    Oh true, I totally missed that part – Sumedh Sen May 31 '22 at 06:49
0

Have you tried startForegroundService()? Maybe the background service restriction blocked it.

https://developer.android.com/about/versions/oreo/background

progquester
  • 1,228
  • 14
  • 23