File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
java/com/afwsamples/testdpc/common Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 27
27
import android .graphics .BitmapFactory ;
28
28
import android .net .Uri ;
29
29
import android .os .Build ;
30
+ import android .os .Build .VERSION ;
30
31
import android .os .Build .VERSION_CODES ;
31
32
import android .os .Bundle ;
32
33
import android .os .UserHandle ;
@@ -153,6 +154,12 @@ public static boolean isAtLeastM() {
153
154
return Build .VERSION .SDK_INT >= VERSION_CODES .M ;
154
155
}
155
156
157
+ public static boolean isAtLeastQ () {
158
+ return VERSION .CODENAME .length () == 1
159
+ && VERSION .CODENAME .charAt (0 ) >= 'Q'
160
+ && VERSION .CODENAME .charAt (0 ) <= 'Z' ;
161
+ }
162
+
156
163
@ TargetApi (VERSION_CODES .O )
157
164
public static List <UserHandle > getBindDeviceAdminTargetUsers (Context context ) {
158
165
if (!BuildCompat .isAtLeastO ()) {
Original file line number Diff line number Diff line change 22
22
import android .os .Build ;
23
23
import android .support .annotation .IntDef ;
24
24
import android .support .annotation .StringRes ;
25
- import android .support .v4 .os .BuildCompat ;
26
25
import android .support .v7 .preference .Preference ;
27
26
import android .support .v7 .preference .PreferenceViewHolder ;
28
27
import android .text .TextUtils ;
@@ -93,6 +92,10 @@ public class DpcPreferenceHelper {
93
92
* not yet assigned.
94
93
*/
95
94
private int getDeviceSdkInt () {
95
+ // TODO(b/117767701): Remove this when Q version code is finalized.
96
+ if (Util .isAtLeastQ ()) {
97
+ return Build .VERSION_CODES .CUR_DEVELOPMENT ;
98
+ }
96
99
return Build .VERSION .SDK_INT ;
97
100
}
98
101
Original file line number Diff line number Diff line change 28
28
<enum name =" O" value =" 26" />
29
29
<enum name =" O_MR1" value =" 27" />
30
30
<enum name =" P" value =" 28" />
31
+ <enum name =" Q" value =" 10000" />
31
32
</attr >
32
33
33
34
<!-- Constrain a preference to DO or PO admins. -->
You can’t perform that action at this time.
0 commit comments