Skip to content

Commit

Permalink
fix(share): fix file path
Browse files Browse the repository at this point in the history
Signed-off-by: Teclib <skita@teclib.com>
  • Loading branch information
stonebuzz committed Apr 21, 2022
1 parent efd5687 commit da4c219
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/org/glpi/inventory/agent/utils/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
Expand Down Expand Up @@ -184,15 +185,14 @@ public static void share(Context context, String message, final int type){
final InventoryTask inventoryTask = new InventoryTask(context, "", true);
String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
if(type == 1){

File file = new File(path+ "/Inventory.json");
File file = new File(context.getFilesDir(), "Inventory.json");
if(file.exists()){
inventoryTask.shareInventory(type);
}else{
AgentLog.e("JSON File not exist");
}
}else{
File file = new File(path+ "/Inventory.xml");
File file = new File(context.getFilesDir(), "Inventory.xml");
if(file.exists()){
inventoryTask.shareInventory(type);
}else{
Expand Down

0 comments on commit da4c219

Please sign in to comment.