diff options
| -rw-r--r-- | Android.bp | 13 | ||||
| -rw-r--r-- | Android.mk | 29 | ||||
| -rw-r--r-- | core/jni/AndroidRuntime.cpp | 40 | ||||
| -rw-r--r-- | core/jni/android_hardware_camera2_DngCreator.cpp | 46 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java | 10 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 8 |
7 files changed, 66 insertions, 82 deletions
diff --git a/Android.bp b/Android.bp index 0b09b4646d60..b83c63fdf3a1 100644 --- a/Android.bp +++ b/Android.bp @@ -12,6 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Build ext.jar +// ============================================================ +java_library { + name: "ext", + no_framework_libs: true, + static_libs: [ + "libphonenumber-platform", + "nist-sip", + "tagsoup", + ], + dxflags: ["--core-library"], +} + // ==== c++ proto device library ============================== cc_library { name: "libplatformprotos", diff --git a/Android.mk b/Android.mk index d9a175c79f75..a437501c85e6 100644 --- a/Android.mk +++ b/Android.mk @@ -1437,35 +1437,6 @@ LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk include $(BUILD_DROIDDOC) -# Build ext.jar -# ============================================================ - -ext_dirs := \ - ../../external/nist-sip/java \ - ../../external/tagsoup/src \ - -ext_src_files := $(call all-java-files-under,$(ext_dirs)) - -# ==== the library ========================================= -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(ext_src_files) - -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core-oj core-libart -LOCAL_STATIC_JAVA_LIBRARIES := libphonenumber-platform -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := ext - -LOCAL_DX_FLAGS := --core-library - -ifneq ($(INCREMENTAL_BUILDS),) - LOCAL_PROGUARD_ENABLED := disabled - LOCAL_JACK_ENABLED := incremental -endif - -include $(BUILD_JAVA_LIBRARY) - # ==== java proto host library ============================== include $(CLEAR_VARS) LOCAL_MODULE := platformprotos diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 6d5d71ccff6a..72795003d9df 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -19,6 +19,8 @@ #define LOG_NDEBUG 1 #include <android_runtime/AndroidRuntime.h> + +#include <android-base/properties.h> #include <binder/IBinder.h> #include <binder/IPCThreadState.h> #include <binder/IServiceManager.h> @@ -47,8 +49,8 @@ #include <string> #include <vector> - using namespace android; +using android::base::GetProperty; extern int register_android_os_Binder(JNIEnv* env); extern int register_android_os_Process(JNIEnv* env); @@ -392,17 +394,6 @@ static bool hasFile(const char* file) { return false; } -// Convenience wrapper over the property API that returns an -// std::string. -std::string getProperty(const char* key, const char* defaultValue) { - std::vector<char> temp(PROPERTY_VALUE_MAX); - const int len = property_get(key, &temp[0], defaultValue); - if (len < 0) { - return ""; - } - return std::string(&temp[0], len); -} - /* * Read the persistent locale. Inspects the following system properties * (in order) and returns the first non-empty property in the list : @@ -419,15 +410,15 @@ std::string getProperty(const char* key, const char* defaultValue) { */ const std::string readLocale() { - const std::string locale = getProperty("persist.sys.locale", ""); + const std::string locale = GetProperty("persist.sys.locale", ""); if (!locale.empty()) { return locale; } - const std::string language = getProperty("persist.sys.language", ""); + const std::string language = GetProperty("persist.sys.language", ""); if (!language.empty()) { - const std::string country = getProperty("persist.sys.country", ""); - const std::string variant = getProperty("persist.sys.localevar", ""); + const std::string country = GetProperty("persist.sys.country", ""); + const std::string variant = GetProperty("persist.sys.localevar", ""); std::string out = language; if (!country.empty()) { @@ -441,15 +432,15 @@ const std::string readLocale() return out; } - const std::string productLocale = getProperty("ro.product.locale", ""); + const std::string productLocale = GetProperty("ro.product.locale", ""); if (!productLocale.empty()) { return productLocale; } // If persist.sys.locale and ro.product.locale are missing, // construct a locale value from the individual locale components. - const std::string productLanguage = getProperty("ro.product.locale.language", "en"); - const std::string productRegion = getProperty("ro.product.locale.region", "US"); + const std::string productLanguage = GetProperty("ro.product.locale.language", "en"); + const std::string productRegion = GetProperty("ro.product.locale.region", "US"); return productLanguage + "-" + productRegion; } @@ -649,7 +640,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) char cpuAbiListBuf[sizeof("--cpu-abilist=") + PROPERTY_VALUE_MAX]; char methodTraceFileBuf[sizeof("-Xmethod-trace-file:") + PROPERTY_VALUE_MAX]; char methodTraceFileSizeBuf[sizeof("-Xmethod-trace-file-size:") + PROPERTY_VALUE_MAX]; - char fingerprintBuf[sizeof("-Xfingerprint:") + PROPERTY_VALUE_MAX]; + std::string fingerprintBuf; bool checkJni = false; property_get("dalvik.vm.checkjni", propBuf, ""); @@ -964,8 +955,15 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) /* * Retrieve the build fingerprint and provide it to the runtime. That way, ANR dumps will * contain the fingerprint and can be parsed. + * Fingerprints are potentially longer than PROPERTY_VALUE_MAX, so parseRuntimeOption() cannot + * be used here. + * Do not ever re-assign fingerprintBuf as its c_str() value is stored in mOptions. */ - parseRuntimeOption("ro.build.fingerprint", fingerprintBuf, "-Xfingerprint:"); + std::string fingerprint = GetProperty("ro.build.fingerprint", ""); + if (!fingerprint.empty()) { + fingerprintBuf = "-Xfingerprint:" + fingerprint; + addOption(fingerprintBuf.c_str()); + } initArgs.version = JNI_VERSION_1_4; initArgs.options = mOptions.editArray(); diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp index c8eef7f3f2f8..162822092af6 100644 --- a/core/jni/android_hardware_camera2_DngCreator.cpp +++ b/core/jni/android_hardware_camera2_DngCreator.cpp @@ -23,13 +23,13 @@ #include <vector> #include <cmath> +#include <android-base/properties.h> #include <utils/Log.h> #include <utils/Errors.h> #include <utils/StrongPointer.h> #include <utils/RefBase.h> #include <utils/Vector.h> #include <utils/String8.h> -#include <cutils/properties.h> #include <system/camera_metadata.h> #include <camera/CameraMetadata.h> #include <img_utils/DngUtils.h> @@ -50,6 +50,7 @@ using namespace android; using namespace img_utils; +using android::base::GetProperty; #define BAIL_IF_INVALID_RET_BOOL(expr, jnienv, tagId, writer) \ if ((expr) != OK) { \ @@ -1237,26 +1238,24 @@ static sp<TiffWriter> DngCreator_setup(JNIEnv* env, jobject thiz, uint32_t image { // make - char manufacturer[PROPERTY_VALUE_MAX]; - // Use "" to represent unknown make as suggested in TIFF/EP spec. - property_get("ro.product.manufacturer", manufacturer, ""); - uint32_t count = static_cast<uint32_t>(strlen(manufacturer)) + 1; + std::string manufacturer = GetProperty("ro.product.manufacturer", ""); + uint32_t count = static_cast<uint32_t>(manufacturer.size()) + 1; BAIL_IF_INVALID_RET_NULL_SP(writer->addEntry(TAG_MAKE, count, - reinterpret_cast<uint8_t*>(manufacturer), TIFF_IFD_0), env, TAG_MAKE, writer); + reinterpret_cast<const uint8_t*>(manufacturer.c_str()), TIFF_IFD_0), env, TAG_MAKE, + writer); } { // model - char model[PROPERTY_VALUE_MAX]; - // Use "" to represent unknown model as suggested in TIFF/EP spec. - property_get("ro.product.model", model, ""); - uint32_t count = static_cast<uint32_t>(strlen(model)) + 1; + std::string model = GetProperty("ro.product.model", ""); + uint32_t count = static_cast<uint32_t>(model.size()) + 1; BAIL_IF_INVALID_RET_NULL_SP(writer->addEntry(TAG_MODEL, count, - reinterpret_cast<uint8_t*>(model), TIFF_IFD_0), env, TAG_MODEL, writer); + reinterpret_cast<const uint8_t*>(model.c_str()), TIFF_IFD_0), env, TAG_MODEL, + writer); } { @@ -1277,11 +1276,11 @@ static sp<TiffWriter> DngCreator_setup(JNIEnv* env, jobject thiz, uint32_t image { // software - char software[PROPERTY_VALUE_MAX]; - property_get("ro.build.fingerprint", software, ""); - uint32_t count = static_cast<uint32_t>(strlen(software)) + 1; + std::string software = GetProperty("ro.build.fingerprint", ""); + uint32_t count = static_cast<uint32_t>(software.size()) + 1; BAIL_IF_INVALID_RET_NULL_SP(writer->addEntry(TAG_SOFTWARE, count, - reinterpret_cast<uint8_t*>(software), TIFF_IFD_0), env, TAG_SOFTWARE, writer); + reinterpret_cast<const uint8_t*>(software.c_str()), TIFF_IFD_0), env, TAG_SOFTWARE, + writer); } if (nativeContext->hasCaptureTime()) { @@ -1613,20 +1612,15 @@ static sp<TiffWriter> DngCreator_setup(JNIEnv* env, jobject thiz, uint32_t image { // Setup unique camera model tag - char model[PROPERTY_VALUE_MAX]; - property_get("ro.product.model", model, ""); - - char manufacturer[PROPERTY_VALUE_MAX]; - property_get("ro.product.manufacturer", manufacturer, ""); - - char brand[PROPERTY_VALUE_MAX]; - property_get("ro.product.brand", brand, ""); + std::string model = GetProperty("ro.product.model", ""); + std::string manufacturer = GetProperty("ro.product.manufacturer", ""); + std::string brand = GetProperty("ro.product.brand", ""); - String8 cameraModel(model); + String8 cameraModel(model.c_str()); cameraModel += "-"; - cameraModel += manufacturer; + cameraModel += manufacturer.c_str(); cameraModel += "-"; - cameraModel += brand; + cameraModel += brand.c_str(); BAIL_IF_INVALID_RET_NULL_SP(writer->addEntry(TAG_UNIQUECAMERAMODEL, cameraModel.size() + 1, reinterpret_cast<const uint8_t*>(cameraModel.string()), TIFF_IFD_0), env, diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java index 7baa57e7dae7..0cb6423008e5 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java @@ -57,16 +57,16 @@ public class KeyguardSecurityModel { SecurityMode getSecurityMode(int userId) { KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext); - if (SubscriptionManager.isValidSubscriptionId( - monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED))) { - return SecurityMode.SimPin; - } - if (mIsPukScreenAvailable && SubscriptionManager.isValidSubscriptionId( monitor.getNextSubIdForState(IccCardConstants.State.PUK_REQUIRED))) { return SecurityMode.SimPuk; } + if (SubscriptionManager.isValidSubscriptionId( + monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED))) { + return SecurityMode.SimPin; + } + final int security = mLockPatternUtils.getActivePasswordQuality(userId); switch (security) { case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: diff --git a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java index 7c98e13780f4..2082daf402c2 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java @@ -154,7 +154,7 @@ public class DemoModeFragment extends PreferenceFragment implements OnPreference getContext().sendBroadcast(intent); intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_CLOCK); - intent.putExtra("hhmm", "0700"); + intent.putExtra("hhmm", "0800"); getContext().sendBroadcast(intent); intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_NETWORK); diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 386a3a37fb24..7a6fbf3488bb 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -1523,6 +1523,13 @@ public class CarrierConfigManager { public static final String KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL = "show_ims_registration_status_bool"; + /** + * The flag to disable the popup dialog which warns the user of data charges. + * @hide + */ + public static final String KEY_DISABLE_CHARGE_INDICATION_BOOL = + "disable_charge_indication_bool"; + /** The default value for every variable. */ private final static PersistableBundle sDefaults; @@ -1777,6 +1784,7 @@ public class CarrierConfigManager { sDefaults.putInt(IMSI_KEY_EXPIRATION_DAYS_TIME_INT, IMSI_ENCRYPTION_DAYS_TIME_DISABLED); sDefaults.putString(IMSI_KEY_DOWNLOAD_URL_STRING, null); sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false); + sDefaults.putBoolean(KEY_DISABLE_CHARGE_INDICATION_BOOL, false); } /** |