Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state broadcast and via the PhoneStateListener. To enhance user privacy, change to require the READ_CALL_LOG permission in order to receive the call phone numbers. This means to see phone numbers: 1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and READ_CALL_LOG permission. 2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG permission. To support this new behavior, added sendBroadcastAsUserMultiplePermissions method to context to allow sending the broadcast to all users while requiring the two permissions. Bug: 78650469 Test: Created PHONE_STATE broadcast receiver in test app and verified that when no permissions are granted, the phone number is empty for incoming and outgoing calls. Test: Granted Phone state permission to test app and verified that phone number is not populated. Test: Granted test app read call log permission and verified that phone number is populated. Test: Created PhoneStateListener in test app and verified that when no permissions are granted, phone number is empty for incoming and outgoing. calls. Test: Granted read call log permission to test app and verified that both the incoming and outgoing numbers are populated. Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
Loading
Please register or sign in to comment