Background
Historically, Android Custom permissions have been a mess and were install order dependent, which was known to expose vulnerabilities.
Prior
As I understood you tried to do next thing (At least, that's how I was able to reproduce your problem):
You declare your new custom permission in first (lets call it F) application
You define that your F app uses com.example.app.permission.CONTROL_EXAMPLE_APP
permission. That is right as the guideline says.
You declare your custom broadcast receiver in your F app. To communicate with that broadcast your app (it's no matter which one, F or other app) must obtain your custom permission
You define that you second (lets call it S) application uses com.example.app.permission.CONTROL_EXAMPLE_APP
permission. Because you want to allow S app to send broadcast messages to F app receiver.
Finally you try to send broadcast message from your S app using this code.
final Intent intent = new Intent("com.example.app.REQUEST_RECEIVER");
context.sendOrderedBroadcast(intent, "com.example.app.permission.CONTROL_EXAMPLE_APP", new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
// getResultCode();
}
}, null, Activity.RESULT_CANCELED, null, null);
And, this is important, you granted permission to your S app, but you didn't grant permission to your F app.
As result your broadcast receiver declared in F app didn't receive anything.
After you granted permission to your F app (Note that now S and F granted your custom permission) everything works fine. Broadcast receiver declared in F app received message from S app.
I guess that is correct behaviour, because this doc says us:
Note that, in this example, the DEBIT_ACCT permission is not only declared with the element, its use is also requested with the element. You must request its use in order for other components of the application to launch the protected activity, even though the protection is imposed by the application itself.
And app which declare permission also must request the same permission to communicate with itself.
As result, android API 23 should to get access to use your permission form user first. And we must to get 2 granted permissions, first from F app (because guidline says as that) and second from S app (because we just need to get access).
But I didn't catch your next point:
It would seem ridiculous to raise a dialog saying
The application Example App wants permission to use Example App
My native Android API 23 displays me something like that:
The application Example App wants