Add more switches to enable/disable carrier features
Add bools to enable/disable the following carrier specific features:
- Exit menu item with 'Minimize or quit' dialog
- Display page title instead of URL in URL bar
- Allow users to provide custom download path
Add method to detect if a carrier specific feature is enabled.
Change-Id: I9db1b16afd14e476de474e8c86bd60ba1a450aba
diff --git a/src/com/android/browser/UploadHandler.java b/src/com/android/browser/UploadHandler.java
index e0d1527..2041ecf 100644
--- a/src/com/android/browser/UploadHandler.java
+++ b/src/com/android/browser/UploadHandler.java
@@ -124,9 +124,11 @@
filePath = "file://"+filePath;
}
- // Add for carrier feature - prevent uploading DRM type files.
- boolean drmUploadEnabled = mController.getContext().getResources().getBoolean(
- R.bool.drm_uploads);
+ // Add for carrier feature - prevent uploading DRM type files based on file extension. This
+ // is not a secure implementation since malicious users can trivially modify the filename.
+ // DRM files can be securely detected by inspecting their integrity protected content.
+ boolean drmUploadEnabled = BrowserConfig.getInstance(mController.getContext())
+ .hasFeature(BrowserConfig.Feature.DRM_UPLOADS);
boolean isDRMFileType = false;
if (drmUploadEnabled && filePath != null
&& (filePath.endsWith(".fl") || filePath.endsWith(".dm")