Tax on foreign income in the same year before establishing residency?

Does income earned in the year you establish tax residency, but before the date you establish residency, count towards the taxable-if-remitted income amount for that tax year?

ex/ if you earn $50k between Jan~Jun, move to Japan (become a resident) in July, and then make another $50k in foreign income between July~Dec, and you remitted $100k that year, is your taxable income $50k or $100k?

Also related – if you instead changed status from short-term to long-term resident in July, does your Jan~Jun foreign income become fully taxable that year, unrelated to remittances?

by DeliciousLunch