Remove unused system properties

Properties ro.config.license_path and ro.config.manual_path are not set
from anywhere but only from a test.

Bug: N/A
Test: mma -j
Change-Id: I651405f3a201f5129bf37059e96e7bcc5efa73bf
(cherry picked from commit 31e37683f0e859d355d0bbb57500498cc0de3962)
This commit is contained in:
Inseob Kim
2018-12-19 12:05:22 +09:00
parent 6c403a876d
commit 4d56f11c4a
3 changed files with 7 additions and 42 deletions

View File

@@ -21,7 +21,6 @@ import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
@@ -44,8 +43,7 @@ public class SettingsLicenseActivity extends FragmentActivity implements
LoaderManager.LoaderCallbacks<File> {
private static final String TAG = "SettingsLicenseActivity";
private static final String DEFAULT_LICENSE_PATH = "/system/etc/NOTICE.html.gz";
private static final String PROPERTY_LICENSE_PATH = "ro.config.license_path";
private static final String LICENSE_PATH = "/system/etc/NOTICE.html.gz";
private static final int LOADER_ID_LICENSE_HTML_LOADER = 0;
@@ -53,10 +51,9 @@ public class SettingsLicenseActivity extends FragmentActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final String licenseHtmlPath =
SystemProperties.get(PROPERTY_LICENSE_PATH, DEFAULT_LICENSE_PATH);
if (isFilePathValid(licenseHtmlPath)) {
showSelectedFile(licenseHtmlPath);
File file = new File(LICENSE_PATH);
if (isFileValid(file)) {
showHtmlFromUri(Uri.fromFile(file));
} else {
showHtmlFromDefaultXmlFiles();
}
@@ -95,22 +92,6 @@ public class SettingsLicenseActivity extends FragmentActivity implements
}
}
private void showSelectedFile(final String path) {
if (TextUtils.isEmpty(path)) {
Log.e(TAG, "The system property for the license file is empty");
showErrorAndFinish();
return;
}
final File file = new File(path);
if (!isFileValid(file)) {
Log.e(TAG, "License file " + path + " does not exist");
showErrorAndFinish();
return;
}
showHtmlFromUri(Uri.fromFile(file));
}
private void showHtmlFromUri(Uri uri) {
// Kick off external viewer due to WebView security restrictions; we
// carefully point it at HTMLViewer, since it offers to decompress
@@ -139,10 +120,6 @@ public class SettingsLicenseActivity extends FragmentActivity implements
finish();
}
private boolean isFilePathValid(final String path) {
return !TextUtils.isEmpty(path) && isFileValid(new File(path));
}
@VisibleForTesting
boolean isFileValid(final File file) {
return file.exists() && file.length() != 0;