Skip to content

Commit 86f04d8

Browse files
committed
BackupAndRestore: improve restore from zip
1 parent 39f9916 commit 86f04d8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

common/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868

6969
<activity android:name=".misc.BackupReceiverActivity"
7070
android:exported="true">
71+
<intent-filter>
72+
<action android:name="android.intent.action.VIEW" />
73+
<category android:name="android.intent.category.DEFAULT" />
74+
<data android:mimeType="application/zip" />
75+
</intent-filter>
7176
<intent-filter>
7277
<action android:name="android.intent.action.SEND"/>
7378
<category android:name="android.intent.category.DEFAULT"/>

common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/BackupAndRestoreHelper.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,17 @@ public void onResult(int requestCode, int resultCode, Intent data) {
147147
}
148148

149149
public void handleIncomingZip(Intent intent) {
150-
if (intent == null || !Intent.ACTION_SEND.equals(intent.getAction())) return;
150+
if (intent == null) {
151+
return;
152+
}
151153

152-
Uri zipUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
154+
Uri zipUri = null;
155+
156+
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
157+
zipUri = intent.getData();
158+
} else if (Intent.ACTION_SEND.equals(intent.getAction())) {
159+
zipUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
160+
}
153161

154162
unpackTempZip(
155163
zipUri,

0 commit comments

Comments
 (0)