デバイスがブロックされ、画面がオフになっているときに、画面の向きを取得する方法はありますか? 私は試した
getResources().getConfiguration().orientation
と
Display display = ((WindowManager) mContext
.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
int rotation = display.getRotation();
ただし、実際の向きに関係なく、画面がオフの場合、どちらもそれぞれ「縦」と「0」を返します。