Loading core/java/android/widget/TextView.java +4 −8 Original line number Original line Diff line number Diff line Loading @@ -548,7 +548,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private InputFilter[] mFilters = NO_FILTERS; private InputFilter[] mFilters = NO_FILTERS; private volatile Locale mCurrentSpellCheckerLocaleCache; private volatile Locale mCurrentSpellCheckerLocaleCache; private final ReentrantLock mCurrentTextServicesLocaleLock = new ReentrantLock(); // It is possible to have a selection even when mEditor is null (programmatically set, like when // It is possible to have a selection even when mEditor is null (programmatically set, like when // a link is pressed). These highlight-related fields do not go in mEditor. // a link is pressed). These highlight-related fields do not go in mEditor. Loading Loading @@ -8023,16 +8022,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } private void updateTextServicesLocaleAsync() { private void updateTextServicesLocaleAsync() { // AsyncTask.execute() uses a serial executor which means we don't have // to lock around updateTextServicesLocaleLocked() to prevent it from // being executed n times in parallel. AsyncTask.execute(new Runnable() { AsyncTask.execute(new Runnable() { @Override @Override public void run() { public void run() { if (mCurrentTextServicesLocaleLock.tryLock()) { try { updateTextServicesLocaleLocked(); updateTextServicesLocaleLocked(); } finally { mCurrentTextServicesLocaleLock.unlock(); } } } } }); }); } } Loading Loading
core/java/android/widget/TextView.java +4 −8 Original line number Original line Diff line number Diff line Loading @@ -548,7 +548,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private InputFilter[] mFilters = NO_FILTERS; private InputFilter[] mFilters = NO_FILTERS; private volatile Locale mCurrentSpellCheckerLocaleCache; private volatile Locale mCurrentSpellCheckerLocaleCache; private final ReentrantLock mCurrentTextServicesLocaleLock = new ReentrantLock(); // It is possible to have a selection even when mEditor is null (programmatically set, like when // It is possible to have a selection even when mEditor is null (programmatically set, like when // a link is pressed). These highlight-related fields do not go in mEditor. // a link is pressed). These highlight-related fields do not go in mEditor. Loading Loading @@ -8023,16 +8022,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } private void updateTextServicesLocaleAsync() { private void updateTextServicesLocaleAsync() { // AsyncTask.execute() uses a serial executor which means we don't have // to lock around updateTextServicesLocaleLocked() to prevent it from // being executed n times in parallel. AsyncTask.execute(new Runnable() { AsyncTask.execute(new Runnable() { @Override @Override public void run() { public void run() { if (mCurrentTextServicesLocaleLock.tryLock()) { try { updateTextServicesLocaleLocked(); updateTextServicesLocaleLocked(); } finally { mCurrentTextServicesLocaleLock.unlock(); } } } } }); }); } } Loading