Bangladesh is the creation of India. The then Indian PM Indira Gandhi (in consultation with the Indian CinC Field Marshal Sam Maneckshaw) made the grand plan to cut Pakistan in size. In a swift operation, the Indian army decimated the Pakistan army inside 13 days and liberated East Pakistan. The state of Bangladesh came into being, and, except for a 300 km with Burma, the new state is surrounded by India. There is no threat of any sort to Bangladesh. It is a matter of intrigue that China has sold 2 attack submarines to Bangladesh. The bigger surprise is that Bangladesh has gone in for submarines when it faces no military threat.
Submarines are attack ships and having them is cause for alarm to India.
The submarines
The submarines sold to Bangladesh are the type O-35 refurbished vessels. The Bangladesh navy personnel were given training in China. The warships have been purchased at a cost of $203 million. That's a lot of money for an impoverished nation like Bangladesh with a per capita income which is among the lowest in the world. The submarines have been named BNS Nabajatra and BNS Joyjatra. Theoretically, they will defend Bangladeshi interests in the Bay of Bengal. The question is against whom? The naval border and interests between India and Bangladesh are clearly demarcated and there are no problems with India.
Internal militancy
Bangladesh is facing an internal militancy from homegrown ISIS supporters. Many terror acts have been committed. This extremist group does not want Bangladesh to be friendly with India. It has been attacking Hindus and non-Muslims. The USA is alarmed and coordinating help, along with India to the Bangladesh government.
It is clear that the only threat Bangladesh faces is an internal threat as there is no threat from India or Burma.
Last word
One can see that selling these diesel submarines to Bangladesh is part of China's grand plan to encircle India. With the 99 year lease of a port in Sri Lanka, China is well on its way to achieving its strategic objectives in the Indian Ocean and Bay of Bengal.