Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working in Samsung Galaxy M20 #33

Closed
radheyshyamjat opened this issue Jan 19, 2020 · 2 comments
Closed

Not Working in Samsung Galaxy M20 #33

radheyshyamjat opened this issue Jan 19, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@radheyshyamjat
Copy link

radheyshyamjat commented Jan 19, 2020

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.samsung.android.lool/com.samsung.android.sm.ui.battery.BatteryActivity}; have you declared this activity in your AndroidManifest.xml?
System.err: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2069)
W/System.err: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1717)
W/System.err: at android.app.Activity.startActivityForResult(Activity.java:5250)
W/System.err: at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
at android.app.Activity.startActivityForResult(Activity.java:5208)
2020-01-19 20:24:09.357 29121-29121/wocs.solutions.tracker W/System.err: at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:663)
W/System.err: at android.app.Activity.startActivity(Activity.java:5579)
W/System.err: at android.app.Activity.startActivity(Activity.java:5547)
W/System.err: at com.judemanutd.autostarter.AutoStartPermissionHelper.startIntent(AutoStartPermissionHelper.kt:300)
W/System.err: at com.judemanutd.autostarter.AutoStartPermissionHelper.autoStartSamsung(AutoStartPermissionHelper.kt:283)
W/System.err: at com.judemanutd.autostarter.AutoStartPermissionHelper.getAutoStartPermission(AutoStartPermissionHelper.kt:108)
W/System.err: at Activity.NewDashboardActivity.onCreate(NewDashboardActivity.kt:85)
W/System.err: at android.app.Activity.performCreate(Activity.java:7955)
W/System.err: at android.app.Activity.performCreate(Activity.java:7944)
W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3423)
W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
android.os.Handler.dispatchMessage(Handler.java:107)
android.os.Looper.loop(Looper.java:237)
android.app.ActivityThread.main(ActivityThread.java:7807)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)

@judemanutd judemanutd added the help wanted Extra attention is needed label Mar 5, 2020
@chrisonline
Copy link

@judemanutd I get the same on a Samsung Galaxy S8. So I have checked how the activity name is.
Instead of com.samsung.android.sm.ui.battery.BatteryActivity
It is com.samsung.android.sm.battery.ui.BatteryActivity!

So either they have changed this or it was always false ;-)

awoisoak added a commit to awoisoak/AutoStarter that referenced this issue Jun 4, 2021
It checks the existence of the activities before attempting to open them. Now if the activity can really not be opened, getAutoStartPermission will return false. Related issues:
judemanutd#29
judemanutd#30

isAutoStartPermissionAvailable is checking the existence of the activity in order to avoid 'false positives' when the library is not able to open a specific settings screen.


Inverted the Huawei intents to process the newer ones first (I didn't invert the rest of the manufacturers as I can't test all of them). This fix known issue with Huawei P 10 Lite 
judemanutd#38 (tested)


Use Build.BRAND.toLowerCase(Locale.ROOT) to avoid issues with certain languages as Turkish as mentioned here:
judemanutd#66 (tested)


Includes FLAG_ACTIVITY_NEW_TASK so that it can be called outside an Activity.
Fixed this:
judemanutd#62


Add a new activity to be opened in Samsung devices as: 
This one open the exact Sleeping Apps setting
com.samsung.android.lool/com.samsung.android.sm.battery.ui.usage.CheckableAppListActivity
While this one opens the main battery settings
com.samsung.android.lool/com.samsung.android.sm.battery.ui.BatteryActivity

That should fixes theses (Tested with Note 8, Note 9 & Note 20):
judemanutd#37
judemanutd#33
@judemanutd
Copy link
Owner

This should be resolved by #69 but feel free to open this issue back up in case it does not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants