Sticky broadcast giving security exception in Android for work in Android P
up vote
0
down vote
favorite
I am using sticky broadcast in my application and I have included the following permission in my manifest.
uses-permission android:name="android.permission.BROADCAST_STICKY"
The app is working absolutely fine when installed normally in personal profile. The same app when installed only in work profile crashes because of security exception. If the app is installed in both work profile and personal profile then it works fine in both profiles.
- Only Personal Profile : Works fine
- Personal Profile & Work Profile :
Works fine - Only Work Profile: Crash
The crash only happens in Android Pie.
The API which give exception is context.removeStickyBroadcast()
AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: unbroadcastIntent() from pid=4015, uid=1010232 requires android.permission.BROADCAST_STICKY
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:1942)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1910)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1860)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.unbroadcastIntent(IActivityManager.java:3919)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.ContextImpl.removeStickyBroadcast(ContextImpl.java:1346)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.content.ContextWrapper.removeStickyBroadcast(ContextWrapper.java:588)
android android-broadcastreceiver android-for-work sticky-broadcast
add a comment |
up vote
0
down vote
favorite
I am using sticky broadcast in my application and I have included the following permission in my manifest.
uses-permission android:name="android.permission.BROADCAST_STICKY"
The app is working absolutely fine when installed normally in personal profile. The same app when installed only in work profile crashes because of security exception. If the app is installed in both work profile and personal profile then it works fine in both profiles.
- Only Personal Profile : Works fine
- Personal Profile & Work Profile :
Works fine - Only Work Profile: Crash
The crash only happens in Android Pie.
The API which give exception is context.removeStickyBroadcast()
AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: unbroadcastIntent() from pid=4015, uid=1010232 requires android.permission.BROADCAST_STICKY
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:1942)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1910)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1860)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.unbroadcastIntent(IActivityManager.java:3919)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.ContextImpl.removeStickyBroadcast(ContextImpl.java:1346)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.content.ContextWrapper.removeStickyBroadcast(ContextWrapper.java:588)
android android-broadcastreceiver android-for-work sticky-broadcast
1
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using sticky broadcast in my application and I have included the following permission in my manifest.
uses-permission android:name="android.permission.BROADCAST_STICKY"
The app is working absolutely fine when installed normally in personal profile. The same app when installed only in work profile crashes because of security exception. If the app is installed in both work profile and personal profile then it works fine in both profiles.
- Only Personal Profile : Works fine
- Personal Profile & Work Profile :
Works fine - Only Work Profile: Crash
The crash only happens in Android Pie.
The API which give exception is context.removeStickyBroadcast()
AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: unbroadcastIntent() from pid=4015, uid=1010232 requires android.permission.BROADCAST_STICKY
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:1942)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1910)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1860)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.unbroadcastIntent(IActivityManager.java:3919)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.ContextImpl.removeStickyBroadcast(ContextImpl.java:1346)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.content.ContextWrapper.removeStickyBroadcast(ContextWrapper.java:588)
android android-broadcastreceiver android-for-work sticky-broadcast
I am using sticky broadcast in my application and I have included the following permission in my manifest.
uses-permission android:name="android.permission.BROADCAST_STICKY"
The app is working absolutely fine when installed normally in personal profile. The same app when installed only in work profile crashes because of security exception. If the app is installed in both work profile and personal profile then it works fine in both profiles.
- Only Personal Profile : Works fine
- Personal Profile & Work Profile :
Works fine - Only Work Profile: Crash
The crash only happens in Android Pie.
The API which give exception is context.removeStickyBroadcast()
AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: unbroadcastIntent() from pid=4015, uid=1010232 requires android.permission.BROADCAST_STICKY
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:1942)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1910)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1860)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.unbroadcastIntent(IActivityManager.java:3919)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.app.ContextImpl.removeStickyBroadcast(ContextImpl.java:1346)
10-10 22:22:32.900 4015 4015 E AndroidRuntime: at android.content.ContextWrapper.removeStickyBroadcast(ContextWrapper.java:588)
android android-broadcastreceiver android-for-work sticky-broadcast
android android-broadcastreceiver android-for-work sticky-broadcast
asked Nov 10 at 23:53
Ankit Mittal
744
744
1
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17
add a comment |
1
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17
1
1
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244575%2fsticky-broadcast-giving-security-exception-in-android-for-work-in-android-p%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
FWIW, sticky broadcasts were deprecated a few years ago.
– CommonsWare
Nov 11 at 0:02
Yeah but its a piece of legacy code which we have not refactored as yet. The thing is that it works fine in personal profile with the same code.
– Ankit Mittal
Nov 12 at 20:17