WIP andorid auto

This commit is contained in:
h4h13 2019-08-02 18:38:47 +05:30
parent c2759e3ec0
commit 6acac46d45
9 changed files with 79 additions and 26 deletions

View file

@ -57,9 +57,7 @@ public class AutoMusicProvider {
private static final int PATH_SEGMENT_ID = 0;
private static final int PATH_SEGMENT_TITLE = 1;
private static final int PATH_SEGMENT_ARTIST = 2;
private static final int PATH_SEGMENT_ALBUM_ID = 3;
private WeakReference<MusicService> mMusicService;
// Categorized caches for music data
private ConcurrentMap<Integer, Uri> mMusicListByHistory;

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.retromusic.auto;
import android.app.UiModeManager;
import android.content.Context;
import android.content.res.Configuration;
public class CarHelper {
private static final String TAG = "CarHelper";
public static boolean isCarUiMode(Context c) {
UiModeManager uiModeManager = (UiModeManager) c.getSystemService(Context.UI_MODE_SERVICE);
return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR;
}
}