Fields Summary |
---|
private static final String | TAG |
private static final boolean | DEBUG |
private static final String | TILES_SETTING |
private final android.content.Context | mContext |
private final PhoneStatusBar | mStatusBar |
private final LinkedHashMap | mTiles |
private final Observer | mObserver |
private final com.android.systemui.statusbar.policy.BluetoothController | mBluetooth |
private final com.android.systemui.statusbar.policy.LocationController | mLocation |
private final com.android.systemui.statusbar.policy.RotationLockController | mRotation |
private final com.android.systemui.statusbar.policy.NetworkController | mNetwork |
private final com.android.systemui.statusbar.policy.ZenModeController | mZen |
private final com.android.systemui.statusbar.policy.HotspotController | mHotspot |
private final com.android.systemui.statusbar.policy.CastController | mCast |
private final android.os.Looper | mLooper |
private final com.android.systemui.settings.CurrentUserTracker | mUserTracker |
private final com.android.systemui.statusbar.policy.FlashlightController | mFlashlight |
private final com.android.systemui.statusbar.policy.UserSwitcherController | mUserSwitcherController |
private final com.android.systemui.statusbar.policy.KeyguardMonitor | mKeyguard |
private final com.android.systemui.statusbar.policy.SecurityController | mSecurity |
private Callback | mCallback |
Methods Summary |
---|
public void | collapsePanels()
mStatusBar.postAnimateCollapsePanels();
|
private com.android.systemui.qs.QSTile | createTile(java.lang.String tileSpec)
if (tileSpec.equals("wifi")) return new WifiTile(this);
else if (tileSpec.equals("bt")) return new BluetoothTile(this);
else if (tileSpec.equals("inversion")) return new ColorInversionTile(this);
else if (tileSpec.equals("cell")) return new CellularTile(this);
else if (tileSpec.equals("airplane")) return new AirplaneModeTile(this);
else if (tileSpec.equals("rotation")) return new RotationLockTile(this);
else if (tileSpec.equals("flashlight")) return new FlashlightTile(this);
else if (tileSpec.equals("location")) return new LocationTile(this);
else if (tileSpec.equals("cast")) return new CastTile(this);
else if (tileSpec.equals("hotspot")) return new HotspotTile(this);
else if (tileSpec.startsWith(IntentTile.PREFIX)) return IntentTile.create(this,tileSpec);
else throw new IllegalArgumentException("Bad tile spec: " + tileSpec);
|
public com.android.systemui.statusbar.policy.BluetoothController | getBluetoothController()
return mBluetooth;
|
public com.android.systemui.statusbar.policy.CastController | getCastController()
return mCast;
|
public android.content.Context | getContext()
return mContext;
|
public com.android.systemui.statusbar.policy.FlashlightController | getFlashlightController()
return mFlashlight;
|
public com.android.systemui.statusbar.policy.HotspotController | getHotspotController()
return mHotspot;
|
public com.android.systemui.statusbar.policy.KeyguardMonitor | getKeyguardMonitor()
return mKeyguard;
|
public com.android.systemui.statusbar.policy.LocationController | getLocationController()
return mLocation;
|
public android.os.Looper | getLooper()
return mLooper;
|
public com.android.systemui.statusbar.policy.NetworkController | getNetworkController()
return mNetwork;
|
public com.android.systemui.statusbar.policy.RotationLockController | getRotationLockController()
return mRotation;
|
public com.android.systemui.statusbar.policy.SecurityController | getSecurityController()
return mSecurity;
|
public java.util.Collection | getTiles()
return mTiles.values();
|
public com.android.systemui.statusbar.policy.UserSwitcherController | getUserSwitcherController()
return mUserSwitcherController;
|
public com.android.systemui.statusbar.policy.ZenModeController | getZenModeController()
return mZen;
|
private java.util.List | loadTileSpecs()
final Resources res = mContext.getResources();
final String defaultTileList = res.getString(R.string.quick_settings_tiles_default);
String tileList = Secure.getStringForUser(mContext.getContentResolver(), TILES_SETTING,
mUserTracker.getCurrentUserId());
if (tileList == null) {
tileList = res.getString(R.string.quick_settings_tiles);
if (DEBUG) Log.d(TAG, "Loaded tile specs from config: " + tileList);
} else {
if (DEBUG) Log.d(TAG, "Loaded tile specs from setting: " + tileList);
}
final ArrayList<String> tiles = new ArrayList<String>();
boolean addedDefault = false;
for (String tile : tileList.split(",")) {
tile = tile.trim();
if (tile.isEmpty()) continue;
if (tile.equals("default")) {
if (!addedDefault) {
tiles.addAll(Arrays.asList(defaultTileList.split(",")));
addedDefault = true;
}
} else {
tiles.add(tile);
}
}
return tiles;
|
private void | recreateTiles()
if (DEBUG) Log.d(TAG, "Recreating tiles");
final List<String> tileSpecs = loadTileSpecs();
for (Map.Entry<String, QSTile<?>> tile : mTiles.entrySet()) {
if (!tileSpecs.contains(tile.getKey())) {
if (DEBUG) Log.d(TAG, "Destroying tile: " + tile.getKey());
tile.getValue().destroy();
}
}
final LinkedHashMap<String, QSTile<?>> newTiles = new LinkedHashMap<>();
for (String tileSpec : tileSpecs) {
if (mTiles.containsKey(tileSpec)) {
newTiles.put(tileSpec, mTiles.get(tileSpec));
} else {
if (DEBUG) Log.d(TAG, "Creating tile: " + tileSpec);
try {
newTiles.put(tileSpec, createTile(tileSpec));
} catch (Throwable t) {
Log.w(TAG, "Error creating tile for spec: " + tileSpec, t);
}
}
}
if (mTiles.equals(newTiles)) return;
mTiles.clear();
mTiles.putAll(newTiles);
if (mCallback != null) {
mCallback.onTilesChanged();
}
|
public void | setCallback(Callback callback)
mCallback = callback;
|
public void | startSettingsActivity(android.content.Intent intent)
mStatusBar.postStartSettingsActivity(intent, 0);
|
public void | warn(java.lang.String message, java.lang.Throwable t)
// already logged
|