android / connectivity-samples

Multiple samples showing the best practices in connectivity on Android.
Apache License 2.0
1.66k stars 1.32k forks source link

Crash on pressing Broadcast Device button #189

Open rajathegde opened 4 years ago

rajathegde commented 4 years ago

I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 I/OpenGLRenderer: Initialized EGL, version 1.4 D/OpenGLRenderer: Swap behavior 2 E/LB: fail to open file: No such file or directory D/ScannerFragment: Stopping Scanning D/BluetoothAdapter: isLeEnabled(): ON I/hadvertisement: ProcessProfilingInfo new_methods=391 is saved saved_to_disk=1 resolve_classes_delay=8000 D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.android.bluetoothadvertisements, PID: 30930 java.lang.RuntimeException: Unable to create service com.example.android.bluetoothadvertisements.AdvertiserService: java.lang.SecurityException: Permission Denial: startForeground from pid=30930, uid=10355 requires android.permission.FOREGROUND_SERVICE at android.app.ActivityThread.handleCreateService(ActivityThread.java:3577) at android.app.ActivityThread.access$1400(ActivityThread.java:200) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: java.lang.SecurityException: Permission Denial: startForeground from pid=30930, uid=10355 requires android.permission.FOREGROUND_SERVICE at android.os.Parcel.createException(Parcel.java:1953) at android.os.Parcel.readException(Parcel.java:1921) at android.os.Parcel.readException(Parcel.java:1871) at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:5104) at android.app.Service.startForeground(Service.java:695) at com.example.android.bluetoothadvertisements.AdvertiserService.goForeground(AdvertiserService.java:196) at com.example.android.bluetoothadvertisements.AdvertiserService.startAdvertising(AdvertiserService.java:136) at com.example.android.bluetoothadvertisements.AdvertiserService.onCreate(AdvertiserService.java:67) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3565) at android.app.ActivityThread.access$1400(ActivityThread.java:200)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:201)  at android.app.ActivityThread.main(ActivityThread.java:6823)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)  Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityManagerService.enforcePermission(ActivityManagerService.java:9585) at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:1226) at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:901) at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:21092) at android.app.IActivityManager$Stub.onTransact$setServiceForeground$(IActivityManager.java:10614) I/Process: Sending signal. PID: 30930 SIG: 9

seven46 commented 4 years ago

got the same issue ~

isaidamier commented 3 years ago

Are you seeing the same issue on the latest sample?