Quick Settings Tile | Notification |
---|---|
Sleep Timer helps you fall asleep while listening to music or podcasts.
When the timer stops, audio playback is gradually lowered then paused.
- Add the Tile in the Quick Settings panel.
- Tap the Tile to start a timer.
- Extend, reduce or cancel the timer with the notification actions.
Note: Don't look for a launcher icon, this app only provides a Quick Settings Tile.
- Tile and TileService: Quick Settings Tile
- Notification.Builder.setTimeoutAfter(durationMs): set notification timeout.
- Notification.Builder.setDeleteIntent(intent): set deletion action.
- AudioManager.adjustStreamVolume(STREAM_MUSIC, ADJUST_LOWER, flags): lower media volume.
- AudioManager.requestAudioFocus(focusRequest): stop current media stream.
- AudioManager.setStreamVolume(STREAM_MUSIC, index, flags): restore initial volume.
- AudioManager.abandonAudioFocusRequest(focusRequest): release audio focus.
Copyright 2020 Simon Marquis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed: in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.