Unblock Contact Android «LIMITED Anthology»

return rowsDeleted;

| Storage Location | URI / Path | Purpose | | :--- | :--- | :--- | | | content://com.android.blockednumber/blocked | Primary source of truth for telephony. | | Contacts DB | data/data/com.android.providers.contacts/databases/contacts.db (Table: raw_contacts ) | Marks STARRED (0) and CUSTOM_RINGTONE (null) but also flags CONTACT_STATUS for blocked. | | Call Log | content://call_log/calls | Adds CALL_BLOCK_REASON column (Value: 1 for user block). | | SMS Provider | content://sms/blocked | Isolated blocking for Messaging app. | unblock contact android

When you unblock a contact, the system resets the local flags but does reset the SafetyNet score. Consequently, the unblocked contact may still be routed to "Spam & Blocked" folder for 2-7 days until the local spam confidence score decays. return rowsDeleted; | Storage Location | URI /

fun fullyUnblockContact(context: Context, phoneNumber: String, subId: Int) val normalized = PhoneNumberUtils.normalizeNumber(phoneNumber) // 1. Delete from system blocked provider context.contentResolver.delete( BlockedNumbers.CONTENT_URI, "number = ?", arrayOf(normalized) ) | | SMS Provider | content://sms/blocked | Isolated

// Simplified sequence from BlockedNumberProvider.java public int delete(Uri uri, String selection, String[] selectionArgs) // 1. Validate caller has WRITE_BLOCKED_NUMBERS permission // 2. Acquire a database write lock on blocked_numbers.db // 3. Delete the row matching the normalized phone number (E.164 format) int rowsDeleted = mDb.delete(TABLE_BLOCKED, whereClause, args); // 4. Trigger a ContentObserver notification to TelephonyManager Intent intent = new Intent(TelephonyManager.ACTION_BLOCKED_NUMBER_REMOVED); mContext.sendBroadcast(intent, BLOCKED_NUMBER_PERMISSION);

// 2. Delete from legacy SMS block table (if using AOSP messaging) context.contentResolver.delete( Uri.parse("content://sms/blocked"), "address = ?", arrayOf(normalized) )