Skip to content

Commit f543252

Browse files
committed
Change min sdk to 19, unsupported API < 19
1 parent d539fe7 commit f543252

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ ext {
3636
compileSdkVersion = 27
3737
buildToolsVersion = "27.0.3"
3838
targetSdkVersion = 27
39-
minSdkVersion = 14
39+
minSdkVersion = 19
4040
androidSupportLibVersion = "27.1.1"
4141
}

emulatorview/src/main/java/jackpal/androidterm/emulatorview/ByteQueue.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,35 @@
2222
*/
2323

2424
class ByteQueue {
25+
private byte[] mBuffer;
26+
private int mHead;
27+
private int mStoredBytes;
28+
2529
public ByteQueue(int size) {
2630
mBuffer = new byte[size];
2731
}
2832

2933
public int getBytesAvailable() {
30-
synchronized(this) {
34+
synchronized (this) {
3135
return mStoredBytes;
3236
}
3337
}
3438

3539
public int read(byte[] buffer, int offset, int length)
36-
throws InterruptedException {
40+
throws InterruptedException {
3741
if (length + offset > buffer.length) {
3842
throw
39-
new IllegalArgumentException("length + offset > buffer.length");
43+
new IllegalArgumentException("length + offset > buffer.length");
4044
}
4145
if (length < 0) {
4246
throw
43-
new IllegalArgumentException("length < 0");
47+
new IllegalArgumentException("length < 0");
4448

4549
}
4650
if (length == 0) {
4751
return 0;
4852
}
49-
synchronized(this) {
53+
synchronized (this) {
5054
while (mStoredBytes == 0) {
5155
wait();
5256
}
@@ -80,23 +84,23 @@ public int read(byte[] buffer, int offset, int length)
8084
* was written and repeat the call to write() if necessary.
8185
*/
8286
public int write(byte[] buffer, int offset, int length)
83-
throws InterruptedException {
87+
throws InterruptedException {
8488
if (length + offset > buffer.length) {
8589
throw
86-
new IllegalArgumentException("length + offset > buffer.length");
90+
new IllegalArgumentException("length + offset > buffer.length");
8791
}
8892
if (length < 0) {
8993
throw
90-
new IllegalArgumentException("length < 0");
94+
new IllegalArgumentException("length < 0");
9195

9296
}
9397
if (length == 0) {
9498
return 0;
9599
}
96-
synchronized(this) {
100+
synchronized (this) {
97101
int bufferLength = mBuffer.length;
98102
boolean wasEmpty = mStoredBytes == 0;
99-
while(bufferLength == mStoredBytes) {
103+
while (bufferLength == mStoredBytes) {
100104
wait();
101105
}
102106
int tail = mHead + mStoredBytes;
@@ -117,8 +121,4 @@ public int write(byte[] buffer, int offset, int length)
117121
return bytesToCopy;
118122
}
119123
}
120-
121-
private byte[] mBuffer;
122-
private int mHead;
123-
private int mStoredBytes;
124124
}

lib-n-ide/src/main/java/com/commonsware/cwac/pager/v4/ArrayPagerAdapter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.os.Bundle;
2121
import android.os.Parcel;
2222
import android.os.Parcelable;
23+
import android.support.annotation.Nullable;
2324
import android.support.v4.app.Fragment;
2425
import android.support.v4.app.FragmentManager;
2526
import android.support.v4.app.FragmentTransaction;
@@ -281,8 +282,12 @@ public void move(int oldPosition, int newPosition) {
281282
}
282283
}
283284

285+
@Nullable
284286
@SuppressWarnings("unchecked")
285287
public T getExistingFragment(int position) {
288+
if (position >= getCount() || position < 0) {
289+
return null;
290+
}
286291
return (T) (fm.findFragmentByTag(getFragmentTag(position)));
287292
}
288293

lib-n-ide/src/main/java/com/duy/ide/editor/pager/EditorFragmentPagerAdapter.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ public EditorFragment getCurrentFragment() {
4848
return super.getCurrentFragment();
4949
}
5050

51-
@Override
52-
public EditorFragment getExistingFragment(int position) {
53-
return super.getExistingFragment(position);
54-
}
55-
5651
@Override
5752
public void removeAll(TabCloseListener tabCloseListener) {
5853
while (getCount() > 0) {
@@ -137,7 +132,7 @@ public EditorPageDescriptor getPageDescriptor(int position) {
137132

138133
@Nullable
139134
public EditorDelegate getEditorDelegateAt(int index) {
140-
EditorFragment fragment = super.getExistingFragment(index);
135+
EditorFragment fragment = getExistingFragment(index);
141136
if (fragment != null) {
142137
return fragment.getEditorDelegate();
143138
}

0 commit comments

Comments
 (0)