Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">

Expand Down
31 changes: 0 additions & 31 deletions packages/SystemUI/res/drawable/ic_qs_nfc_disabled.xml

This file was deleted.

2 changes: 1 addition & 1 deletion packages/SystemUI/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

<!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
<string name="quick_settings_tiles_stock" translatable="false">
wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,heads_up,dataswitch,sync,volume_panel,reboot,caffeine
wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,heads_up,dataswitch,sync,volume_panel,reboot,caffeine
</string>

<!-- The tiles to display in QuickSettings -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
/** Quick settings tile: Enable/Disable NFC **/
public class NfcTile extends QSTileImpl<BooleanState> {

private final Icon mIcon = ResourceIcon.get(R.drawable.ic_qs_nfc);

private NfcAdapter mAdapter;
private BroadcastDispatcher mBroadcastDispatcher;

Expand Down Expand Up @@ -109,8 +111,7 @@ protected void handleUpdateState(BooleanState state, Object arg) {
state.state = getAdapter() == null
? Tile.STATE_UNAVAILABLE
: state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
state.icon = ResourceIcon.get(
state.value ? R.drawable.ic_qs_nfc_enabled : R.drawable.ic_qs_nfc_disabled);
state.icon = mIcon;
state.label = mContext.getString(R.string.quick_settings_nfc_label);
state.expandedAccessibilityClassName = Switch.class.getName();
state.contentDescription = state.label;
Expand All @@ -133,7 +134,7 @@ protected String composeChangeAnnouncement() {
private NfcAdapter getAdapter() {
if (mAdapter == null) {
try {
mAdapter = NfcAdapter.getDefaultAdapter(mContext);
mAdapter = NfcAdapter.getNfcAdapter(mContext.getApplicationContext());
} catch (UnsupportedOperationException e) {
mAdapter = null;
}
Expand Down