• Jake Hamby's avatar
    Fix AppOps exception for SMS quick reply feature. · deb745d6
    Jake Hamby authored
    Sending a quick SMS reply to an incoming phone call was failing
    with a SecurityException due to new AppOps code. The root cause
    was the insert() call in SmsProvider was calling back into itself
    using the UID of the caller (com.android.mms) but the package name
    for the callee (com.android.phone).
    
    Wrapped the insert() method of SmsProvider with a helper function
    to save the Binder identity and restore it on completion. This
    allows the quick response to make its own provider queries using
    its own UID as well as package name. Read/write security checks
    will be performed by the content provider framework based on the
    manifest file, before insert() is called.
    
    Bug: 11006277
    Change-Id: I4c0c8041a2505c5aad8db9b2dbab5402728f9221
    deb745d6
SmsProvider.java 28 KB