Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8562ee7c authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge eae34a7e on remote branch

Change-Id: Ib5ce67196c410bd0ce23b4373cc02ca25c3d3301
parents 4ec57df2 eae34a7e
Loading
Loading
Loading
Loading
+34 −16
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
            synchronized (ArraySet.class) {
                if (mTwiceBaseCache != null) {
                    final Object[] array = mTwiceBaseCache;
                    try {
                        mArray = array;
                        mTwiceBaseCache = (Object[]) array[0];
                        mHashes = (int[]) array[1];
@@ -164,12 +165,21 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
                        if (DEBUG) Log.d(TAG, "Retrieving 2x cache " + mHashes
                                + " now have " + mTwiceBaseCacheSize + " entries");
                        return;
                    } catch (ClassCastException e) {
                    }
                    // Whoops!  Someone trampled the array (probably due to not protecting
                    // their access with a lock).  Our cache is corrupt; report and give up.
                    Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0]
                            + " [1]=" + array[1]);
                    mTwiceBaseCache = null;
                    mTwiceBaseCacheSize = 0;
                }
            }
        } else if (size == BASE_SIZE) {
            synchronized (ArraySet.class) {
                if (mBaseCache != null) {
                    final Object[] array = mBaseCache;
                    try {
                        mArray = array;
                        mBaseCache = (Object[]) array[0];
                        mHashes = (int[]) array[1];
@@ -178,6 +188,14 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
                        if (DEBUG) Log.d(TAG, "Retrieving 1x cache " + mHashes
                                + " now have " + mBaseCacheSize + " entries");
                        return;
                    } catch (ClassCastException e) {
                    }
                    // Whoops!  Someone trampled the array (probably due to not protecting
                    // their access with a lock).  Our cache is corrupt; report and give up.
                    Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0]
                            + " [1]=" + array[1]);
                    mBaseCache = null;
                    mBaseCacheSize = 0;
                }
            }
        }
+2 −1
Original line number Diff line number Diff line
@@ -48,5 +48,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    <!--  operator custom sim icon feature -->
    <bool name="operator_custom_sim_icon">false</bool>

    <!-- Setting customize default bluetooth name -->
    <string name="def_custom_bt_defname"></string>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -2746,4 +2746,6 @@
  <java-symbol type="bool" name="config_softap_extention" />
  <java-symbol type="array" name="config_operatorConsideredDomesticRoaming" />
  <java-symbol type="array" name="config_operatorConsideredDomesticRoamingExceptions" />
  <!-- config softap extention feature -->
  <java-symbol type="string" name="def_custom_bt_defname" />
</resources>
+3 −1
Original line number Diff line number Diff line
@@ -123,8 +123,9 @@ public class MediaFile {

    // Drm file types
    public static final int FILE_TYPE_FL      = 51;
    public static final int FILE_TYPE_SD      = 52;
    private static final int FIRST_DRM_FILE_TYPE = FILE_TYPE_FL;
    private static final int LAST_DRM_FILE_TYPE = FILE_TYPE_FL;
    private static final int LAST_DRM_FILE_TYPE = FILE_TYPE_SD;

    // Other popular file types
    public static final int FILE_TYPE_TEXT          = 100;
@@ -269,6 +270,7 @@ public class MediaFile {
        addFileType("M3U8", FILE_TYPE_HTTPLIVE, "audio/x-mpegurl");

        addFileType("FL", FILE_TYPE_FL, "application/x-android-drm-fl");
        addFileType("DCF", FILE_TYPE_SD, "application/vnd.oma.drm.content");

        addFileType("TXT", FILE_TYPE_TEXT, "text/plain", MtpConstants.FORMAT_TEXT);
        addFileType("HTM", FILE_TYPE_HTML, "text/html", MtpConstants.FORMAT_HTML);
+22 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;

import com.android.settingslib.R;
@@ -122,6 +125,16 @@ public final class BluetoothEventManager {
        registerProfileIntentReceiver();
    }

    // set bluetooth default name
    private void setDefaultBtName() {
        String name = mContext.getResources().getString(
            com.android.internal.R.string.def_custom_bt_defname);
        Log.d(TAG, "custom bluetooth name: " + name);
        if (!TextUtils.isEmpty(name)) {
            mLocalAdapter.setName(name);
        }
    }

    /** Register to start receiving callbacks for Bluetooth events. */
    public void registerCallback(BluetoothCallback callback) {
        synchronized (mCallbacks) {
@@ -177,6 +190,15 @@ public final class BluetoothEventManager {
            }
            // update local profiles and get paired devices
            mLocalAdapter.setBluetoothStateInt(state);
            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
            boolean isFirstBoot = preferences.getBoolean("is_first_boot", true);
            Log.d(TAG,"isFirstBoot: " +isFirstBoot + " state: " + state);
            if (isFirstBoot && state == BluetoothAdapter.STATE_ON) {
                setDefaultBtName();
                SharedPreferences.Editor edit = preferences.edit();
                edit.putBoolean("is_first_boot", false);
                edit.apply();
            }
            // send callback to update UI and possibly start scanning
            synchronized (mCallbacks) {
                for (BluetoothCallback callback : mCallbacks) {
Loading