From b46ba7623e0dad950b906af24e8c610e0e8c8b98 Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Thu, 23 Jul 2015 01:04:17 +0530 Subject: [PATCH 1/2] Add the user set network mode to the siminfo table * To track what the user set for the particular sub independent of the currently set network mode (i.e. PREFERRED_NETWORK_MODE) * Useful on MSIM where the modem may only support 2G on one of the slots, so the preferred network mode (and the NETWORK_MODE column) would not always reflect the user desired network mode. Ref: CYNGNOS-291 Change-Id: Ic6cc66d3dc2277f920785679c7fcc6e3c7581570 --- .../policy/NetworkControllerImpl.java | 2 +- .../android/telephony/SubscriptionInfo.java | 24 ++++++++++++++++--- .../telephony/SubscriptionManager.java | 7 ++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 54de73fa0c47..c2fbe6e403df 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -761,7 +761,7 @@ public void dispatchDemoCommand(String command, Bundle args) { int start = mSubscriptionManager.getActiveSubscriptionInfoCountMax(); for (int i = start /* get out of normal index range */; i < start + num; i++) { SubscriptionInfo info = new SubscriptionInfo(i, "", i, "", "", 0, 0, "", 0, - null, 0, 0, "", 0, 0); + null, 0, 0, "", 0, 0, 0); subs.add(info); mMobileSignalControllers.put(i, new MobileSignalController(mContext, mConfig, mHasMobileDataFeature, mPhone, mSignalsChangedCallbacks, diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index 8b8c521617df..b358b93505fb 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -117,12 +117,17 @@ public class SubscriptionInfo implements Parcelable { */ public int mNwMode; + /** + * @hide + */ + public int mUserNwMode; + /** * @hide */ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, - Bitmap icon, int mcc, int mnc, String countryIso, int status, int nwMode) { + Bitmap icon, int mcc, int mnc, String countryIso, int status, int nwMode, int userNwMode) { this.mId = id; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; @@ -137,6 +142,7 @@ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence dis this.mMnc = mnc; this.mStatus = status; this.mNwMode = nwMode; + this.mUserNwMode = userNwMode; this.mCountryIso = countryIso; } @@ -294,6 +300,7 @@ public int getMnc() { public int getStatus() { return this.mStatus; } + /** * Returns the Network mode. * @hide @@ -302,6 +309,14 @@ public int getNwMode() { return this.mNwMode; } + /** + * Returns the User set Network mode. + * @hide + */ + public int getUserNwMode() { + return this.mUserNwMode; + } + /** * @return the ISO country code */ @@ -325,12 +340,13 @@ public SubscriptionInfo createFromParcel(Parcel source) { int mnc = source.readInt(); int status = source.readInt(); int nwMode = source.readInt(); + int userNwMode = source.readInt(); String countryIso = source.readString(); Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source); return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, - nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, status, nwMode); + nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, status, nwMode, userNwMode); } @Override @@ -354,6 +370,7 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mMnc); dest.writeInt(mStatus); dest.writeInt(mNwMode); + dest.writeInt(mUserNwMode); dest.writeString(mCountryIso); mIconBitmap.writeToParcel(dest, flags); } @@ -369,6 +386,7 @@ public String toString() { + " displayName=" + mDisplayName + " carrierName=" + mCarrierName + " nameSource=" + mNameSource + " iconTint=" + mIconTint + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc - + " mnc " + mMnc + " mSubStatus=" + mStatus + " mNwMode=" + mNwMode + "}"; + + " mnc " + mMnc + " mSubStatus=" + mStatus + " mNwMode=" + mNwMode + + " mUserNwMode=" + mUserNwMode + "}"; } } diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 232b72943043..2a41126df73a 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -132,6 +132,13 @@ public class SubscriptionManager { */ public static final String NETWORK_MODE = "network_mode"; + /** + * The user configured Network mode of SIM/sub. + *

Type: INTEGER (int)

+ * {@hide} + */ + public static final String USER_NETWORK_MODE = "user_network_mode"; + /** {@hide} */ public static final int DEFAULT_NW_MODE = -1; From 6b918be05a22ec6680560656b592bcea95a25dd4 Mon Sep 17 00:00:00 2001 From: Sultanxda Date: Sat, 15 Aug 2015 19:28:35 -0700 Subject: [PATCH 2/2] CamcorderProfile: Add 1440p camcorder profile Add encoding constants (regular and timelapse) for 2k 1440p resolution. Change-Id: I0ce1dd33458f0c837f4bb1d9e8d07c1649cf338d --- media/java/android/media/CamcorderProfile.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java index 5a1186ca2a48..c81dc2531294 100644 --- a/media/java/android/media/CamcorderProfile.java +++ b/media/java/android/media/CamcorderProfile.java @@ -125,9 +125,14 @@ public class CamcorderProfile */ public static final int QUALITY_HVGA = 19; + /** @hide + * Quality level corresponding to 1440p resolution + */ + public static final int QUALITY_1440P = 20; + // Start and end of quality list private static final int QUALITY_LIST_START = QUALITY_LOW; - private static final int QUALITY_LIST_END = QUALITY_HVGA; + private static final int QUALITY_LIST_END = QUALITY_1440P; /** * Time lapse quality level corresponding to the lowest available resolution. @@ -199,9 +204,14 @@ public class CamcorderProfile */ public static final int QUALITY_TIME_LAPSE_4kDCI = 1014; + /** @hide + * Time lapse quality level corresponding to the 1440p resolution. + */ + public static final int QUALITY_TIME_LAPSE_1440P = 1015; + // Start and end of timelapse quality list private static final int QUALITY_TIME_LAPSE_LIST_START = QUALITY_TIME_LAPSE_LOW; - private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_4kDCI; + private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_1440P; /** * High speed ( >= 100fps) quality level corresponding to the lowest available resolution.