The sonic sunglasses were a device the Twelfth Doctor used to replace his sonic screwdriver after he abandoned it. He used them to recall the TARDIS after it had been dispersed by the HADS "dispersal" function. (TV: The Witch's Familiar)
When he didn't use their function, he just wore them as regular sunglasses. (TV: The Magician's Apprentice / The Witch's Familiar)