The short answer for a Java sparrow
Plan on 10 to 12 hours of darkness and quiet for a Java sparrow each night. This plump grey-and-white finch, also called the Java finch or rice sparrow, is a flock bird through and through, and its sleep is social: birds line up shoulder to shoulder on a favourite roosting perch and settle together as the light fades. One restless bird shuffling and cheeping at midnight tends to wake its neighbours, who wake theirs, so the quality of the night depends on the whole cage going dark at once and staying that way until a consistent morning time.
Why flock roosting changes the sleep picture
Unlike a solitary pet parrot, a Java sparrow takes its safety cues from the group. In the wild these finches feed in flocks on seed and rice and return to communal roosts, so a caged bird that hears movement and sees light after bedtime reads it as the flock being alert, not as background noise to ignore. Short nights rarely produce a visibly sleepy finch. Instead you get a cage that is slower to start singing and bathing in the morning, more squabbling over the best roosting spot the next evening, and youngsters that stay restless long after the adults have settled. The fix is environmental, not per bird.
Timing lights-out for a flight cage
Choose a bedtime you can hold every day and dim the room gradually for the last half hour if you can, because an abrupt switch from bright light to black can startle small finches into fluttering. A breathable cover helps if the cage shares a room with people, but the room itself should quieten down; a covered cage beside a loud television still vibrates with sound. Position the cage away from windows where passing headlights sweep the wall, and keep night-time checks to a minimum. In the morning, uncover the whole cage at the set time and offer the day's first seed and bath water promptly, which anchors the flock's sense that night has properly ended.
Night frights in a finch cage
Small finches can panic in total darkness if a sudden noise startles them, fluttering blindly and injuring wings against the bars. If your Java sparrows ever thrash at night, a very dim night light near the cage is a reasonable compromise: low enough that the flock still settles and sleeps, bright enough that a startled bird can see the perch and rejoin the row instead of crashing. What matters is that the arrangement stays the same every night, because finches settle to a pattern, not to perfect blackness at any cost.
What a short-changed Java sparrow looks like
Because a single finch's tiredness is subtle, judge the flock. A group that was getting enough sleep starts the day with bathing, stretching and soft chattering within minutes of uncovering. A group running short stays hunched and silent, feeds half-heartedly, and naps in short bursts through the afternoon outside the normal quiet period. If one bird alone is fluffed, sitting low and being pushed off the roost night after night, that is a health question rather than a scheduling one, and an avian veterinarian should see that bird promptly. KinsLe Care Teams can turn lights-out, cover checks and morning uncovering into assigned flock duties, each marked complete with a timestamp, so your Java sparrows get the same protected night whoever is home.