Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fp auth vibe option #4

Open
wants to merge 2 commits into
base: rimbon
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,9 @@
<string name="security_dashboard_summary">Screen lock, fingerprint</string>
<!-- Summary for Security settings when fingerprint is not supported [CHAR LIMIT=NONE]-->
<string name="security_dashboard_summary_no_fingerprint">Screen lock</string>

<!-- Authentication vibration -->
<string name="sucess_vib_title">Authentication vibration</string>
<string name="sucess_vib_summary">Haptic feedback for fingerprint and face authentication when successful</string>
<!-- Face enrollment and settings --><skip />
<!-- Message shown in summary field when face unlock is set up. [CHAR LIMIT=40] -->
<string name="security_settings_face_preference_summary">Face added</string>
Expand Down
7 changes: 7 additions & 0 deletions res/xml/sound_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@
android:key="dial_pad_tones"
android:title="@string/dial_pad_tones_title"/>

<!-- Successful authentication -->
<SwitchPreference
android:key="sucess_vib"
android:title="@string/sucess_vib_title"
android:summary="@string/sucess_vib_summary"
settings:controller="com.android.settings.notification.AuthenticationVibrationPreferenceController"/>

<!-- Screen locking sounds -->
<SwitchPreference
android:key="screen_locking_sounds"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ public void onClick(View v) {
// then offer to downgrade the app, otherwise only offer to disable the
// app for this user.
if (mUpdatedSysApp && isSingleUser()) {
showDialogInner(ButtonActionDialogFragment.DialogType.SPECIAL_DISABLE);
handleDialogClick(ButtonActionDialogFragment.DialogType.SPECIAL_DISABLE);
} else {
showDialogInner(ButtonActionDialogFragment.DialogType.DISABLE);
handleDialogClick(ButtonActionDialogFragment.DialogType.DISABLE);
}
} else {
mMetricsFeatureProvider.action(
Expand Down Expand Up @@ -274,7 +274,7 @@ public void onClick(View v) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
mActivity, mAppsControlDisallowedAdmin);
} else {
showDialogInner(ButtonActionDialogFragment.DialogType.FORCE_STOP);
handleDialogClick(ButtonActionDialogFragment.DialogType.FORCE_STOP);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2020 The Paranoid Android
*
* 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.notification;

import android.content.Context;
import android.provider.Settings;

import com.android.settings.Utils;
import com.android.settings.core.TogglePreferenceController;

public class AuthenticationVibrationPreferenceController extends TogglePreferenceController {

public AuthenticationVibrationPreferenceController(Context context, String key) {
super(context, key);
}

@Override
public int getAvailabilityStatus() {
return Utils.isVoiceCapable(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}

@Override
public boolean isChecked() {
return Settings.System.getInt(mContext.getContentResolver(),
Settings.System.AUTHENTICATION_SUCCESS_VIB, 1) == 1;
}

@Override
public boolean setChecked(boolean isChecked) {
return Settings.System.putInt(mContext.getContentResolver(),
Settings.System.AUTHENTICATION_SUCCESS_VIB, isChecked ? 1 : 0);
}
}