diff options
author | Toby Chuang <tobychuang@google.com> | 2020-03-24 16:07:13 +0800 |
---|---|---|
committer | Toby Chuang <tobychuang@google.com> | 2020-04-06 13:37:31 +0800 |
commit | 204fa8a42048a7e760827e0d9920ba61d2fb488b (patch) | |
tree | 6a0b1e90ccf07803e81b842f5fba4b71e36f196d /src/com/android/settings/nfc | |
parent | ddd8a8fa9209533fa4d792bece6c73b977210329 (diff) | |
download | packages_apps_Settings-204fa8a42048a7e760827e0d9920ba61d2fb488b.tar.gz packages_apps_Settings-204fa8a42048a7e760827e0d9920ba61d2fb488b.tar.bz2 packages_apps_Settings-204fa8a42048a7e760827e0d9920ba61d2fb488b.zip |
[NFC] Add a picture under NFC settings to show NFC detection point.
Each smartphone has a different NFC antenna detection point,
users would confuse where the NFC antenna is and how to place the
smartphone close to the card reader/equipment.
Starting from Android R device, we move NFC antenna position from
top area to middle center of the phone.
From the OEMs perspective, they could implement their own picture
to indicate the best NFC detection point.Hence, we propose to
show NFC antenna position under NFC setting.
Bug: 142230563
Test: build pass
Change-Id: Ib3cd7fc3ea299be1667aba0aeebaa148fb49015f
Diffstat (limited to 'src/com/android/settings/nfc')
-rw-r--r-- | src/com/android/settings/nfc/NfcDetectionPointController.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/com/android/settings/nfc/NfcDetectionPointController.java b/src/com/android/settings/nfc/NfcDetectionPointController.java new file mode 100644 index 0000000000..b2e8f6abde --- /dev/null +++ b/src/com/android/settings/nfc/NfcDetectionPointController.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * 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 to 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. + */ + +package com.android.settings.nfc; + +import android.content.Context; + +import androidx.annotation.VisibleForTesting; + +import com.android.settings.R; +import com.android.settings.core.BasePreferenceController; +/** + * Controller that used to show nfc detection point guidance + */ +public class NfcDetectionPointController extends BasePreferenceController { + private boolean mEnabled; + + public NfcDetectionPointController(Context context, String preferenceKey) { + super(context, preferenceKey); + mEnabled = mContext.getResources().getBoolean(R.bool.config_nfc_detection_point); + } + + @Override + public int getAvailabilityStatus() { + if (!mEnabled) { + return UNSUPPORTED_ON_DEVICE; + } + return AVAILABLE; + } + + @VisibleForTesting + public void setConfig(boolean value) { + mEnabled = value; + } +} |