Skip to content

Commit

Permalink
Release TestDpc 5.0.1 source code.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuemingw committed May 8, 2018
2 parents 78bcb1a + 079998e commit 89d1d8a
Show file tree
Hide file tree
Showing 39 changed files with 714 additions and 1,586 deletions.
21 changes: 6 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
// exactly 1 digit
versionMinor = 0
// exactly 2 digits
versionBuild = 00
versionBuild = 01
}

android {
Expand All @@ -16,7 +16,7 @@ android {
defaultConfig {
applicationId "com.afwsamples.testdpc"
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 'P'
versionCode versionMajor * 1000 + versionMinor * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionBuild}"
multiDexEnabled true
Expand All @@ -29,16 +29,8 @@ android {
}
}

flavorDimensions "targetSdk", "packageName"
flavorDimensions "packageName"
productFlavors {
targetP {
dimension 'targetSdk'
targetSdkVersion 'P'
}
targetO {
dimension 'targetSdk'
targetSdkVersion 27
}
normal {
dimension 'packageName'
}
Expand Down Expand Up @@ -81,11 +73,10 @@ android {

dependencies {
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:preference-v14:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:support-v13:27.0.2'
implementation 'com.android.support:preference-v14:28.0.0-alpha1'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
implementation 'com.android.support:support-v13:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-safetynet:+'
implementation(name: 'setup-wizard-lib-platform-release', ext: 'aar')
implementation 'org.bouncycastle:bcpkix-jdk15on:1.56'
implementation 'org.bouncycastle:bcprov-jdk15on:1.56'
Expand Down
Binary file modified app/libs/setup-wizard-lib-platform-release.aar
Binary file not shown.
30 changes: 6 additions & 24 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

<application
android:allowBackup="true"
Expand All @@ -46,6 +46,7 @@

<activity
android:name=".SetupManagementActivity"
android:theme="@style/SuwThemeGlifV3.Light"
android:label="@string/setup_app_name"
android:taskAffinity="">
</activity>
Expand All @@ -63,22 +64,17 @@
<activity
android:name=".AddAccountActivity"
android:label="@string/app_name"
android:theme="@style/SetupTheme"/>
android:theme="@style/SuwThemeGlifV3.Light"/>

<activity
android:name=".EnableProfileActivity"
android:name=".FinalizeActivity"
android:label="@string/app_name"
android:theme="@style/SetupTheme"/>

<activity
android:name=".EnableDeviceOwnerActivity"
android:label="@string/app_name"
android:theme="@style/SetupTheme"/>
android:theme="@style/SuwThemeGlifV3.Light"/>

<activity
android:name=".cosu.EnableCosuActivity"
android:label="@string/app_name"
android:theme="@style/SetupTheme"/>
android:theme="@style/SuwThemeGlifV3.Light"/>

<activity
android:name=".policy.locktask.KioskModeActivity"
Expand Down Expand Up @@ -109,9 +105,6 @@
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin_receiver"/>
<meta-data
android:name="android.app.support_transfer_ownership"
android:value="true"/>
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
<action android:name="android.app.action.PROFILE_PROVISIONING_COMPLETE"/>
Expand All @@ -121,17 +114,6 @@
</intent-filter>
</receiver>

<receiver android:name=".FirstAccountReadyBroadcastReceiver"
android:exported="true"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.work.action.FIRST_ACCOUNT_READY"/>
</intent-filter>
<intent-filter>
<action android:name="com.afwsamples.testdpc.FIRST_ACCOUNT_READY_TIMEOUT"/>
</intent-filter>
</receiver>

<receiver android:name=".BootReceiver"
android:exported="false">
<intent-filter>
Expand Down
20 changes: 6 additions & 14 deletions app/src/main/java/com/afwsamples/testdpc/AddAccountActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
import android.widget.RadioGroup;
import android.widget.Toast;

import com.android.setupwizardlib.SetupWizardLayout;
import com.android.setupwizardlib.view.NavigationBar;
import com.android.setupwizardlib.GlifLayout;

import java.io.IOException;

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

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

setContentView(R.layout.activity_add_account);
SetupWizardLayout layout = (SetupWizardLayout) findViewById(R.id.setup_wizard_layout);
layout.getNavigationBar().setNavigationBarListener(this);
NavigationBar navigationBar = layout.getNavigationBar();
navigationBar.getBackButton().setEnabled(false);
GlifLayout layout = findViewById(R.id.setup_wizard_layout);
layout.findViewById(R.id.next_button).setOnClickListener(this::onNavigateNext);

Bundle extras = getIntent().getExtras();
if (extras != null) {
Expand Down Expand Up @@ -145,9 +142,8 @@ private void restoreUserRestrictions() {
}
}

@Override
public void onNavigateNext() {
RadioGroup addAccountOptions = (RadioGroup) findViewById(R.id.add_account_options);
public void onNavigateNext(View nextButton) {
RadioGroup addAccountOptions = findViewById(R.id.add_account_options);
switch (addAccountOptions.getCheckedRadioButtonId()) {
case R.id.add_account:
addAccount(null);
Expand All @@ -168,14 +164,10 @@ public void onNavigateNext() {
break;
case R.id.add_account_skip:
if (mNextActivityIntent != null) {
mNextActivityIntent.putExtra(EnableProfileActivity.EXTRA_ENABLE_PROFILE_NOW, true);
startActivity(mNextActivityIntent);
}
finish();
break;
}
}

@Override
public void onNavigateBack() {}
}

This file was deleted.

Loading

0 comments on commit 89d1d8a

Please sign in to comment.