Compare commits

..

No commits in common. "7ca33edd2674f3970e7ff415fa5f4ec4c9f27a93" and "9c2357b1a1bd731964934153bcdff04e2092e089" have entirely different histories.

7 changed files with 26 additions and 66 deletions

View file

@ -1,21 +1,12 @@
apply plugin: 'com.android.application'
repositories {
//noinspection JcenterRepositoryObsolete
jcenter {
content {
includeVersion "mobi.upod", "time-duration-picker", "1.1.3"
}
}
}
android {
compileSdkVersion 33
buildToolsVersion '33.0.0'
compileSdkVersion 31
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "net.typeblog.shelter"
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 31
versionCode 20
versionName "1.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -31,20 +22,28 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lint {
disable 'MissingTranslation', 'ExtraTranslation', 'GoogleAppIndexingWarning', 'InvalidFragmentVersionForActivityResult'
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'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-core-ui: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 '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 'mobi.upod:time-duration-picker:1.1.3'
debugImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatDebugRuntimeElements')
releaseImplementation project(path: ':setup-wizard-lib', configuration: 'gingerbreadCompatReleaseRuntimeElements')

View file

@ -84,20 +84,6 @@
</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"

View file

@ -6,7 +6,6 @@ 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;
@ -18,13 +17,8 @@ public class ShelterDeviceAdminReceiver extends DeviceAdminReceiver {
@Override
public void onProfileProvisioningComplete(Context context, Intent intent) {
super.onProfileProvisioningComplete(context, intent);
// 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
// I don't know why setting the policies in this receiver won't work very well
// Anyway, we delegate it to the DummyActivity
Intent i = new Intent(context.getApplicationContext(), DummyActivity.class);
i.setAction(DummyActivity.FINALIZE_PROVISION);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View file

@ -1,19 +0,0 @@
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();
}
}

View file

@ -334,7 +334,6 @@ public class SetupWizardActivity extends AppCompatActivity {
public void onNavigateNext() {
super.onNavigateNext();
mActivity.switchToFragment(new PleaseWaitFragment(), false);
mActivity.setupProfile();
}
@Override
@ -358,6 +357,7 @@ public class SetupWizardActivity extends AppCompatActivity {
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
mActivity.setupProfile();
}
@Override

View file

@ -4,10 +4,10 @@ buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.android.tools.build:gradle:7.0.3'
// NOTE: Do not place your application dependencies here; they belong
@ -18,7 +18,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

View file

@ -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.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip