Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Show only updating whhen reboot is required
Browse files Browse the repository at this point in the history
XPrivacy can be used during updatig

Refs #1887
  • Loading branch information
M66B committed Aug 18, 2014
1 parent 5e1237d commit 6e4f31a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void onCreate(Bundle savedInstanceState) {
final int userId = Util.getUserId(Process.myUid());

// Check privacy service client
if (!PrivacyService.checkClient() || isUpdating())
if (!PrivacyService.checkClient())
return;

// Set layout
Expand Down
15 changes: 8 additions & 7 deletions src/biz/bokhorst/xprivacy/ActivityBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public class ActivityBase extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check if update service running
boolean updating = isUpdating();
if (PrivacyService.checkClient() && !updating) {
// Check if Privacy client available
if (PrivacyService.checkClient()) {
// Set theme
int userId = Util.getUserId(Process.myUid());
String themeName = PrivacyManager.getSetting(userId, PrivacyManager.cSettingTheme, "");
Expand All @@ -48,19 +47,21 @@ protected void onCreate(Bundle savedInstanceState) {
}

// Show reason
if (updating)
((TextView) findViewById(R.id.tvServiceUpdating)).setVisibility(View.VISIBLE);
else if (PrivacyService.getClient() == null) {
if (PrivacyService.getClient() == null) {
((TextView) findViewById(R.id.tvRebootClient)).setVisibility(View.VISIBLE);
Requirements.checkCompatibility(this);
} else {
((TextView) findViewById(R.id.tvRebootVersion)).setVisibility(View.VISIBLE);
Requirements.check(this);
}

// Show if updating
if (isUpdating())
((TextView) findViewById(R.id.tvServiceUpdating)).setVisibility(View.VISIBLE);
}
}

protected boolean isUpdating() {
private boolean isUpdating() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE))
if (UpdateService.class.getName().equals(service.service.getClassName()))
Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected void onCreate(Bundle savedInstanceState) {
final int userId = Util.getUserId(Process.myUid());

// Check privacy service client
if (!PrivacyService.checkClient() || isUpdating())
if (!PrivacyService.checkClient())
return;

// Import license file
Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check privacy service client
if (!PrivacyService.checkClient() || isUpdating())
if (!PrivacyService.checkClient())
return;

// Get data
Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/ActivityUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check privacy service client
if (!PrivacyService.checkClient() || isUpdating())
if (!PrivacyService.checkClient())
return;

// Set layout
Expand Down

0 comments on commit 6e4f31a

Please sign in to comment.