Giter Site home page Giter Site logo

Comments (6)

ccoager avatar ccoager commented on August 11, 2024 4

The fix is to add this to AndroidManifest.xml and rebuild the app.
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />

Permissions need to be granted as well.

pm grant com.asksven.betterbatterystats android.permission.INTERACT_ACROSS_USERS
pm grant --user <uid> com.asksven.betterbatterystats android.permission.INTERACT_ACROSS_USERS

from betterbatterystats.

Iey4iej3 avatar Iey4iej3 commented on August 11, 2024

I am using work profile (BBS is running under the main profile). I am not sure whether it affects.

from betterbatterystats.

Enkidu70 avatar Enkidu70 commented on August 11, 2024

Same here on A13, Magisk, root + Shelter, latest BBS...

type: crash
osVersion: OnePlus/OnePlus8T_EEA/OnePlus8T:13/TKQ1.221128.002/eng.abhay.20221229.033041:user/release-keys
package: com.asksven.betterbatterystats_xdaedition:107
process: com.asksven.betterbatterystats_xdaedition

java.lang.SecurityException: getPackagesForUid: UID 10436 requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS or android.permission.INTERACT_ACROSS_PROFILES to access user 10.
 at android.os.Parcel.createExceptionOrNull(Parcel.java:3021)
 at android.os.Parcel.createException(Parcel.java:3005)
 at android.os.Parcel.readException(Parcel.java:2981)
 at android.os.Parcel.readException(Parcel.java:2923)
 at android.content.pm.IPackageManager$Stub$Proxy.getPackagesForUid(IPackageManager.java:4789)
 at android.app.ApplicationPackageManager$3.recompute(ApplicationPackageManager.java:1147)
 at android.app.ApplicationPackageManager$3.recompute(ApplicationPackageManager.java:1141)
 at android.app.PropertyInvalidatedCache.query(PropertyInvalidatedCache.java:931)
 at android.app.ApplicationPackageManager.getPackagesForUid(ApplicationPackageManager.java:1160)
 at com.asksven.android.common.nameutils.UidNameResolver.getNameForUid(UidNameResolver.java:111)
 at com.asksven.android.common.privateapiproxies.StatElement.getFullQualifiedName(StatElement.java:88)
 at com.asksven.android.common.privateapiproxies.StatElement.getFqn(StatElement.java:112)
 at com.asksven.betterbatterystats.adapters.StatsAdapter.getView(StatsAdapter.java:231)
 at android.widget.AbsListView.obtainView(AbsListView.java:2423)
 at android.widget.ListView.makeAndAddView(ListView.java:2067)
 at android.widget.ListView.fillDown(ListView.java:793)
 at android.widget.ListView.fillFromTop(ListView.java:855)
 at android.widget.ListView.layoutChildren(ListView.java:1838)
 at android.widget.AbsListView.onLayout(AbsListView.java:2220)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:689)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
 at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
 at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
 at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
 at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
 at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
 at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
 at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
 at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
 at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
 at com.android.internal.policy.DecorView.onLayout(DecorView.java:797)
 at android.view.View.layout(View.java:23698)
 at android.view.ViewGroup.layout(ViewGroup.java:6413)
 at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3914)
 at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3301)
 at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2289)
 at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8963)
 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1319)
 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1327)
 at android.view.Choreographer.doCallbacks(Choreographer.java:985)
 at android.view.Choreographer.doFrame(Choreographer.java:916)
 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1302)
 at android.os.Handler.handleCallback(Handler.java:942)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at android.app.ActivityThread.main(ActivityThread.java:7951)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:550)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
Caused by: android.os.RemoteException: Remote stack trace:
 at com.android.server.pm.ComputerEngine.enforceCrossUserOrProfilePermission(ComputerEngine.java:2960)
 at com.android.server.pm.IPackageManagerBase.getPackagesForUid(IPackageManagerBase.java:655)
 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2187)
 at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6026)
 at android.os.Binder.execTransactInternal(Binder.java:1302)

from betterbatterystats.

Iey4iej3 avatar Iey4iej3 commented on August 11, 2024

You might as well look at the logcat to see when BBS crashes (by looking at the keyword Result [wakelock).

from betterbatterystats.

mikklfr avatar mikklfr commented on August 11, 2024

In case anyone asks themselves how to get their work profile id:
adb shell dumpsys user
Then look for something like:

UserInfo{10:Profil professionnel:1030} serialNo=10 isPrimary=false parentId=0
    Type: android.os.usertype.profile.MANAGED
    Flags: 4144 (INITIALIZED|MANAGED_PROFILE|PROFILE)

Here id is 10

from betterbatterystats.

ao57772 avatar ao57772 commented on August 11, 2024

I am having the same on android 13, pixel 7a. I am using the work profile too. I tried to grant the app INTERACT_ACROSS_USERS but since it is not in the manifest, it was rejected.

from betterbatterystats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.