Compare commits
5 commits
9c2357b1a1
...
7ca33edd26
Author | SHA1 | Date | |
---|---|---|---|
7ca33edd26 | |||
030b9837dc | |||
a2677d9f9d | |||
95e5ae2fa8 | |||
593d8103f2 |
7 changed files with 66 additions and 26 deletions
|
@ -1,12 +1,21 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
repositories {
|
||||
//noinspection JcenterRepositoryObsolete
|
||||
jcenter {
|
||||
content {
|
||||
includeVersion "mobi.upod", "time-duration-picker", "1.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion '30.0.3'
|
||||
compileSdkVersion 33
|
||||
buildToolsVersion '33.0.0'
|
||||
defaultConfig {
|
||||
applicationId "net.typeblog.shelter"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
targetSdkVersion 33
|
||||
versionCode 20
|
||||
versionName "1.7"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -22,28 +31,20 @@ android {
|
|||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
lintOptions {
|
||||
// We have community-contributed translations. Do not let them block releases.
|
||||
disable 'MissingTranslation'
|
||||
disable 'ExtraTranslation'
|
||||
// We don't need Google App Indexing
|
||||
disable 'GoogleAppIndexingWarning'
|
||||
// Some dependencies still pull in Fragment 1.2.x
|
||||
// Let's just ignore the error for now
|
||||
// We don't really hit the broken use-cases for now
|
||||
disable 'InvalidFragmentVersionForActivityResult'
|
||||
lint {
|
||||
disable 'MissingTranslation', 'ExtraTranslation', 'GoogleAppIndexingWarning', 'InvalidFragmentVersionForActivityResult'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
|
||||
implementation 'androidx.fragment:fragment:1.3.6'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.0-rc01'
|
||||
implementation 'androidx.preference:preference:1.1.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
||||
implementation 'androidx.fragment:fragment:1.5.2'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0-beta01'
|
||||
implementation 'androidx.preference:preference:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
||||
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
||||
debugImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatDebugRuntimeElements')
|
||||
releaseImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatReleaseRuntimeElements')
|
||||
|
|
|
@ -84,6 +84,20 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- An activity to listen to ACTION_PROVISIONING_SUCCESSFUL for finalization -->
|
||||
<!-- This replaces the functionality of ShelterDeviceAdminReceiver on Oreo and above -->
|
||||
<activity android:name=".ui.FinalizeActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/Theme.AppCompat.Translucent.NoTitleBar"
|
||||
android:permission="android.permission.BIND_DEVICE_ADMIN"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.app.action.PROVISIONING_SUCCESSFUL" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Activity to forward ACTION_IMAGE_CAPTURE as ACTION_OPEN_DOCUMENT -->
|
||||
<activity android:name=".ui.CameraProxyActivity"
|
||||
android:excludeFromRecents="true"
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.app.PendingIntent;
|
|||
import android.app.admin.DeviceAdminReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
|
||||
import net.typeblog.shelter.R;
|
||||
import net.typeblog.shelter.ui.DummyActivity;
|
||||
|
@ -17,8 +18,13 @@ public class ShelterDeviceAdminReceiver extends DeviceAdminReceiver {
|
|||
@Override
|
||||
public void onProfileProvisioningComplete(Context context, Intent intent) {
|
||||
super.onProfileProvisioningComplete(context, intent);
|
||||
// I don't know why setting the policies in this receiver won't work very well
|
||||
// Anyway, we delegate it to the DummyActivity
|
||||
// After Oreo, we use the activity intent ACTION_PROVISIONING_SUCCESSFUL for finalization
|
||||
// As it is an activity intent, it is way more reliable (and less hacky) than doing
|
||||
// it in a BroadcastReceiver
|
||||
// This is handled by FinalizeActivity, and thus we should ignore the event here
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) return;
|
||||
// Complex logic in a BroadcastReceiver is not reliable
|
||||
// Delegate finalization to the DummyActivity
|
||||
Intent i = new Intent(context.getApplicationContext(), DummyActivity.class);
|
||||
i.setAction(DummyActivity.FINALIZE_PROVISION);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package net.typeblog.shelter.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class FinalizeActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Intent i = new Intent(getApplicationContext(), DummyActivity.class);
|
||||
i.setAction(DummyActivity.FINALIZE_PROVISION);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
finish();
|
||||
}
|
||||
}
|
|
@ -334,6 +334,7 @@ public class SetupWizardActivity extends AppCompatActivity {
|
|||
public void onNavigateNext() {
|
||||
super.onNavigateNext();
|
||||
mActivity.switchToFragment(new PleaseWaitFragment(), false);
|
||||
mActivity.setupProfile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -357,7 +358,6 @@ public class SetupWizardActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
mActivity.setupProfile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,10 @@ buildscript {
|
|||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
||||
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
@ -18,7 +18,7 @@ buildscript {
|
|||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
|
||||
|
|
Loading…
Add table
Reference in a new issue