Remove redundant code in certificate pref controllers
mPreferenceKey in BasePreferenceController is set via the second argument of the constructor and has a getter. It doesn't look necessary to override the getter to return the key. The given one also looks inconsistent. Test: atest com.android.settings.security Bug: 139173976 Bug: 112038744 Change-Id: I6e20b46675308f7dbb8f82f7e372bf94f21e4bed
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.settings.security;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
@@ -27,16 +26,11 @@ public class InstallCaCertificatePreferenceController extends
|
||||
private static final String KEY_INSTALL_CA_CERTIFICATE = "install_ca_certificate";
|
||||
|
||||
public InstallCaCertificatePreferenceController(Context context) {
|
||||
super(context, UserManager.DISALLOW_CONFIG_CREDENTIALS);
|
||||
super(context, KEY_INSTALL_CA_CERTIFICATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_INSTALL_CA_CERTIFICATE;
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package com.android.settings.security;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
@@ -27,16 +26,11 @@ public class InstallUserCertificatePreferenceController extends
|
||||
private static final String KEY_INSTALL_USER_CERTIFICATE = "install_user_certificate";
|
||||
|
||||
public InstallUserCertificatePreferenceController(Context context) {
|
||||
super(context, UserManager.DISALLOW_CONFIG_CREDENTIALS);
|
||||
super(context, KEY_INSTALL_USER_CERTIFICATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_INSTALL_USER_CERTIFICATE;
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package com.android.settings.security;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
@@ -27,16 +26,11 @@ public class InstallWifiCertificatePreferenceController extends
|
||||
private static final String KEY_INSTALL_WIFI_CERTIFICATE = "install_wifi_certificate";
|
||||
|
||||
public InstallWifiCertificatePreferenceController(Context context) {
|
||||
super(context, UserManager.DISALLOW_CONFIG_CREDENTIALS);
|
||||
super(context, KEY_INSTALL_WIFI_CERTIFICATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_INSTALL_WIFI_CERTIFICATE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user