Cherish:incall vibration options [3/3]

*allow setting vibration when call is connected
*allow setting vibration when call is disconnected
*allow setting vibration for call waiting
*this works with google and aosp dialer :)

Change-Id: Id1a431124174571f8d0091825af2418971cfe35d
Signed-off-by: AmolAmrit <amol.amrit03@outlook.com>
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
beanstown106
2021-10-25 17:57:04 +07:00
committed by Hưng Phan
parent 8cc09b522f
commit db6266f7c3
4 changed files with 35 additions and 5 deletions

View File

@@ -31,6 +31,7 @@ import com.cherish.settings.preferences.SystemSettingListPreference;
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
import net.margaritov.preference.colorpicker.ColorPickerPreference;
import com.android.internal.util.cherish.CherishUtils;
import com.cherish.settings.preferences.Utils;
import java.util.ArrayList;
import java.util.List;
@@ -38,6 +39,7 @@ import java.util.List;
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class NotificationSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener{
private static final String INCALL_VIB_OPTIONS = "incall_vib_options";
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -46,6 +48,11 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
ContentResolver resolver = getActivity().getContentResolver();
final PreferenceScreen prefScreen = getPreferenceScreen();
final Resources res = getResources();
PreferenceCategory incallVibCategory = (PreferenceCategory) findPreference(INCALL_VIB_OPTIONS);
if (!Utils.isVoiceCapable(getActivity())) {
prefScreen.removePreference(incallVibCategory);
}
}

View File

@@ -17,14 +17,31 @@
package com.cherish.settings.utils;
import static android.os.UserHandle.USER_SYSTEM;
import android.content.Context;
import android.content.om.IOverlayManager;
import android.os.AsyncTask;
import android.os.RemoteException;
import android.widget.Toast;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
import android.content.res.Configuration;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.net.ConnectivityManager;
import android.os.UserManager;
import android.os.SystemProperties;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.DisplayInfo;
import android.view.Surface;
import android.view.WindowManager;
import com.android.settings.R;
public class Utils {