Skip to content

Commit 89d1d8a

Browse files
author
yuemingw
committed
Release TestDpc 5.0.1 source code.
2 parents 78bcb1a + 079998e commit 89d1d8a

39 files changed

+714
-1586
lines changed

app/build.gradle

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ext {
77
// exactly 1 digit
88
versionMinor = 0
99
// exactly 2 digits
10-
versionBuild = 00
10+
versionBuild = 01
1111
}
1212

1313
android {
@@ -16,7 +16,7 @@ android {
1616
defaultConfig {
1717
applicationId "com.afwsamples.testdpc"
1818
minSdkVersion 21
19-
targetSdkVersion 28
19+
targetSdkVersion 'P'
2020
versionCode versionMajor * 1000 + versionMinor * 100 + versionBuild
2121
versionName "${versionMajor}.${versionMinor}.${versionBuild}"
2222
multiDexEnabled true
@@ -29,16 +29,8 @@ android {
2929
}
3030
}
3131

32-
flavorDimensions "targetSdk", "packageName"
32+
flavorDimensions "packageName"
3333
productFlavors {
34-
targetP {
35-
dimension 'targetSdk'
36-
targetSdkVersion 'P'
37-
}
38-
targetO {
39-
dimension 'targetSdk'
40-
targetSdkVersion 27
41-
}
4234
normal {
4335
dimension 'packageName'
4436
}
@@ -81,11 +73,10 @@ android {
8173

8274
dependencies {
8375
implementation 'com.android.support:multidex:1.0.1'
84-
implementation 'com.android.support:preference-v14:27.0.2'
85-
implementation 'com.android.support:recyclerview-v7:27.0.2'
86-
implementation 'com.android.support:support-v13:27.0.2'
76+
implementation 'com.android.support:preference-v14:28.0.0-alpha1'
77+
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
78+
implementation 'com.android.support:support-v13:28.0.0-alpha1'
8779
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
88-
implementation 'com.google.android.gms:play-services-safetynet:+'
8980
implementation(name: 'setup-wizard-lib-platform-release', ext: 'aar')
9081
implementation 'org.bouncycastle:bcpkix-jdk15on:1.56'
9182
implementation 'org.bouncycastle:bcprov-jdk15on:1.56'
18.4 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<uses-permission android:name="android.permission.INTERNET" />
2727
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
2828
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
29-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
29+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
3030

3131
<application
3232
android:allowBackup="true"
@@ -46,6 +46,7 @@
4646

4747
<activity
4848
android:name=".SetupManagementActivity"
49+
android:theme="@style/SuwThemeGlifV3.Light"
4950
android:label="@string/setup_app_name"
5051
android:taskAffinity="">
5152
</activity>
@@ -63,22 +64,17 @@
6364
<activity
6465
android:name=".AddAccountActivity"
6566
android:label="@string/app_name"
66-
android:theme="@style/SetupTheme"/>
67+
android:theme="@style/SuwThemeGlifV3.Light"/>
6768

6869
<activity
69-
android:name=".EnableProfileActivity"
70+
android:name=".FinalizeActivity"
7071
android:label="@string/app_name"
71-
android:theme="@style/SetupTheme"/>
72-
73-
<activity
74-
android:name=".EnableDeviceOwnerActivity"
75-
android:label="@string/app_name"
76-
android:theme="@style/SetupTheme"/>
72+
android:theme="@style/SuwThemeGlifV3.Light"/>
7773

7874
<activity
7975
android:name=".cosu.EnableCosuActivity"
8076
android:label="@string/app_name"
81-
android:theme="@style/SetupTheme"/>
77+
android:theme="@style/SuwThemeGlifV3.Light"/>
8278

8379
<activity
8480
android:name=".policy.locktask.KioskModeActivity"
@@ -109,9 +105,6 @@
109105
<meta-data
110106
android:name="android.app.device_admin"
111107
android:resource="@xml/device_admin_receiver"/>
112-
<meta-data
113-
android:name="android.app.support_transfer_ownership"
114-
android:value="true"/>
115108
<intent-filter>
116109
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
117110
<action android:name="android.app.action.PROFILE_PROVISIONING_COMPLETE"/>
@@ -121,17 +114,6 @@
121114
</intent-filter>
122115
</receiver>
123116

124-
<receiver android:name=".FirstAccountReadyBroadcastReceiver"
125-
android:exported="true"
126-
android:enabled="true">
127-
<intent-filter>
128-
<action android:name="com.google.android.work.action.FIRST_ACCOUNT_READY"/>
129-
</intent-filter>
130-
<intent-filter>
131-
<action android:name="com.afwsamples.testdpc.FIRST_ACCOUNT_READY_TIMEOUT"/>
132-
</intent-filter>
133-
</receiver>
134-
135117
<receiver android:name=".BootReceiver"
136118
android:exported="false">
137119
<intent-filter>

app/src/main/java/com/afwsamples/testdpc/AddAccountActivity.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
import android.widget.RadioGroup;
3636
import android.widget.Toast;
3737

38-
import com.android.setupwizardlib.SetupWizardLayout;
39-
import com.android.setupwizardlib.view.NavigationBar;
38+
import com.android.setupwizardlib.GlifLayout;
4039

4140
import java.io.IOException;
4241

@@ -45,7 +44,7 @@
4544
* It is responsible for adding an account to the managed profile (Profile Owner) or managed device
4645
* (Device Owner).
4746
*/
48-
public class AddAccountActivity extends Activity implements NavigationBar.NavigationBarListener {
47+
public class AddAccountActivity extends Activity {
4948

5049
private static final String TAG = "AddAccountActivity";
5150
private static final String GOOGLE_ACCOUNT_TYPE = "com.google";
@@ -70,10 +69,8 @@ protected void onCreate(Bundle savedInstanceState) {
7069
mAdminComponentName = DeviceAdminReceiver.getComponentName(this);
7170

7271
setContentView(R.layout.activity_add_account);
73-
SetupWizardLayout layout = (SetupWizardLayout) findViewById(R.id.setup_wizard_layout);
74-
layout.getNavigationBar().setNavigationBarListener(this);
75-
NavigationBar navigationBar = layout.getNavigationBar();
76-
navigationBar.getBackButton().setEnabled(false);
72+
GlifLayout layout = findViewById(R.id.setup_wizard_layout);
73+
layout.findViewById(R.id.next_button).setOnClickListener(this::onNavigateNext);
7774

7875
Bundle extras = getIntent().getExtras();
7976
if (extras != null) {
@@ -145,9 +142,8 @@ private void restoreUserRestrictions() {
145142
}
146143
}
147144

148-
@Override
149-
public void onNavigateNext() {
150-
RadioGroup addAccountOptions = (RadioGroup) findViewById(R.id.add_account_options);
145+
public void onNavigateNext(View nextButton) {
146+
RadioGroup addAccountOptions = findViewById(R.id.add_account_options);
151147
switch (addAccountOptions.getCheckedRadioButtonId()) {
152148
case R.id.add_account:
153149
addAccount(null);
@@ -168,14 +164,10 @@ public void onNavigateNext() {
168164
break;
169165
case R.id.add_account_skip:
170166
if (mNextActivityIntent != null) {
171-
mNextActivityIntent.putExtra(EnableProfileActivity.EXTRA_ENABLE_PROFILE_NOW, true);
172167
startActivity(mNextActivityIntent);
173168
}
174169
finish();
175170
break;
176171
}
177172
}
178-
179-
@Override
180-
public void onNavigateBack() {}
181173
}

app/src/main/java/com/afwsamples/testdpc/EnableDeviceOwnerActivity.java

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)