forked from jens/Automation
Cosmetics
This commit is contained in:
parent
1bbf04d548
commit
8c6331237d
@ -122,15 +122,7 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
|
||||||
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
<!--<data
|
|
||||||
android:path="com.jens.automation2"
|
|
||||||
android:scheme="package" />-->
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
|
@ -119,15 +119,7 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
|
||||||
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
<!--<data
|
|
||||||
android:path="com.jens.automation2"
|
|
||||||
android:scheme="package" />-->
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
|
@ -114,15 +114,7 @@
|
|||||||
<receiver android:name=".receivers.PackageReplacedReceiver"
|
<receiver android:name=".receivers.PackageReplacedReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<!--<action android:name="android.intent.action.PACKAGE_ADDED"/>
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
|
||||||
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
|
|
||||||
<action android:name="android.intent.action.ACTION_PACKAGE_REPLACED" />-->
|
|
||||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||||||
|
|
||||||
<!--<data
|
|
||||||
android:path="com.jens.automation2"
|
|
||||||
android:scheme="package" />-->
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver android:name=".receivers.DateTimeListener" />
|
<receiver android:name=".receivers.DateTimeListener" />
|
||||||
|
@ -14,29 +14,18 @@ public class PackageReplacedReceiver extends BroadcastReceiver
|
|||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent)
|
public void onReceive(Context context, Intent intent)
|
||||||
{
|
{
|
||||||
// Toast.makeText(context, "package replaced", Toast.LENGTH_LONG).show();
|
Settings.readFromPersistentStorage(context);
|
||||||
// int intentUid = intent.getExtras().getInt("android.intent.extra.UID"); // userid of the application that has just been updated
|
|
||||||
// int myUid = android.os.Process.myUid(); // userid of this application
|
|
||||||
//
|
|
||||||
// boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
|
|
||||||
|
|
||||||
// if(intentUid == myUid)
|
|
||||||
// {
|
|
||||||
Settings.readFromPersistentStorage(context);
|
|
||||||
|
|
||||||
Miscellaneous.logEvent("i", context.getResources().getString(R.string.applicationHasBeenUpdated), context.getResources().getString(R.string.applicationHasBeenUpdated), 2);
|
Miscellaneous.logEvent("i", context.getResources().getString(R.string.applicationHasBeenUpdated), context.getResources().getString(R.string.applicationHasBeenUpdated), 2);
|
||||||
if(hasServiceBeenRunning() && Settings.startServiceAfterAppUpdate)
|
if(hasServiceBeenRunning() && Settings.startServiceAfterAppUpdate)
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logStartingServiceAfterAppUpdate), 1);
|
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logStartingServiceAfterAppUpdate), 1);
|
||||||
AutomationService.startAutomationService(context, true);
|
AutomationService.startAutomationService(context, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logNotStartingServiceAfterAppUpdate), 2);
|
Miscellaneous.logEvent("i", "Service", context.getResources().getString(R.string.logNotStartingServiceAfterAppUpdate), 2);
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// Miscellaneous.logEvent("i", "Service", "Some other app has been updated.", 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasServiceBeenRunning()
|
private static boolean hasServiceBeenRunning()
|
||||||
|
Loading…
Reference in New Issue
Block a user