Skip to content

Commit 58f3af6

Browse files
committed
OP6: disabled obsolete Hide vibrate icon feature
Fixes #1840
1 parent 60e8732 commit 58f3af6

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/com/ceco/oreo/gravitybox/GravityBoxSettings.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,7 @@ public static final class SystemProperties {
10341034
public boolean supportsFingerprint;
10351035
public int[] fingerprintIds;
10361036
public boolean isOxygenOsRom;
1037+
public boolean isOnePlus6Rom;
10371038

10381039
public SystemProperties(Bundle data) {
10391040
if (data.containsKey("hasGeminiSupport")) {
@@ -1072,6 +1073,9 @@ public SystemProperties(Bundle data) {
10721073
if (data.containsKey("isOxygenOsRom")) {
10731074
isOxygenOsRom = data.getBoolean("isOxygenOsRom");
10741075
}
1076+
if (data.containsKey("isOnePlus6Rom")) {
1077+
isOnePlus6Rom = data.getBoolean("isOnePlus6Rom");
1078+
}
10751079
}
10761080
}
10771081

@@ -1878,6 +1882,10 @@ public void onCreate(Bundle savedInstanceState) {
18781882
PreferenceCategory pc = (PreferenceCategory) findPreference(PREF_CAT_RECENTS_PANEL);
18791883
p = findPreference(PREF_KEY_RECENT_CLEAR_ALWAYS_VISIBLE);
18801884
if (pc != null && p != null) pc.removePreference(p);
1885+
if (sSystemProperties.isOnePlus6Rom) {
1886+
p = findPreference(PREF_KEY_STATUSBAR_HIDE_VIBRATE_ICON);
1887+
if (p != null) mPrefCatStatusbar.removePreference(p);
1888+
}
18811889
} else {
18821890
Preference p = findPreference(PREF_KEY_OOS_CALL_RECORDING);
18831891
if (p != null) mPrefCatPhoneTelephony.removePreference(p);

src/com/ceco/oreo/gravitybox/SystemIconController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private void updateBtIconVisibility() {
151151
}
152152

153153
private void updateVibrateIcon() {
154-
if (mIconCtrl == null || mContext == null) return;
154+
if (mIconCtrl == null || mContext == null || Utils.isOnePlus6Rom()) return;
155155
try {
156156
AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
157157
if (Utils.isOxygenOsRom()) {

src/com/ceco/oreo/gravitybox/SystemPropertyProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public void onReceive(Context context, Intent intent) {
131131
SysUiManagers.FingerprintLauncher.getEnrolledFingerprintIds());
132132
}
133133
data.putBoolean("isOxygenOsRom", Utils.isOxygenOsRom());
134+
data.putBoolean("isOnePlus6Rom", Utils.isOnePlus6Rom());
134135
if (DEBUG) {
135136
log("hasGeminiSupport: " + data.getBoolean("hasGeminiSupport"));
136137
log("isTablet: " + data.getBoolean("isTablet"));
@@ -147,6 +148,7 @@ public void onReceive(Context context, Intent intent) {
147148
log("fingerprintIds: " + data.getIntArray("fingerprintIds"));
148149
}
149150
log("isOxygenOsRom: " + data.getBoolean("isOxygenOsRom"));
151+
log("isOnePlus6Rom: " + data.getBoolean("isOnePlus6Rom"));
150152
}
151153
receiver.send(RESULT_SYSTEM_PROPERTIES, data);
152154
} else if (intent.getAction().equals(ACTION_REGISTER_UUID) &&

src/com/ceco/oreo/gravitybox/Utils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public class Utils {
101101
private static Boolean mIsWifiOnly = null;
102102
private static String mDeviceCharacteristics = null;
103103
private static Boolean mIsOxygenOsRom = null;
104+
private static Boolean mIsOnePlus6Rom = null;
104105
private static Boolean mIsFileBasedEncrypted = null;
105106

106107
// Device features
@@ -271,6 +272,13 @@ public static boolean isOxygenOsRom() {
271272
return mIsOxygenOsRom;
272273
}
273274

275+
public static boolean isOnePlus6Rom() {
276+
if (mIsOnePlus6Rom == null) {
277+
mIsOnePlus6Rom = isOxygenOsRom() && Build.MODEL.contains("A600");
278+
}
279+
return mIsOnePlus6Rom;
280+
}
281+
274282
public static boolean isFileBasedEncrypted(Context con) {
275283
if (mIsFileBasedEncrypted != null) return mIsFileBasedEncrypted;
276284

0 commit comments

Comments
 (0)