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

Commit

Permalink
Add reboot reasons to reboot view
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Feb 12, 2014
1 parent fcab3c0 commit 9484d65
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 8 deletions.
21 changes: 21 additions & 0 deletions res/layout/reboot.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand Down Expand Up @@ -34,4 +35,24 @@
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:id="@+id/tvRebootClient"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:text="Privacy service not found; did you enable XPrivacy in the Xposed installer and reboot?"
android:textAppearance="?android:attr/textAppearance"
android:visibility="gone"
tools:ignore="HardcodedText" />

<TextView
android:id="@+id/tvRebootVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:text="Privacy service version mismatch; did you reboot after upgrading XPrivacy?"
android:textAppearance="?android:attr/textAppearance"
android:visibility="gone"
tools:ignore="HardcodedText" />

</LinearLayout>
4 changes: 1 addition & 3 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check privacy service client
if (!PrivacyService.checkClient()) {
setContentView(R.layout.reboot);
if (!PrivacyService.checkClient())
return;
}

// Set theme
String themeName = PrivacyManager.getSetting(0, PrivacyManager.cSettingTheme, "", false);
Expand Down
21 changes: 21 additions & 0 deletions src/biz/bokhorst/xprivacy/ActivityBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,32 @@
import android.graphics.Bitmap.Config;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;

@SuppressLint("Registered")
public class ActivityBase extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check privacy service client
if (!PrivacyService.checkClient()) {
setContentView(R.layout.reboot);
if (PrivacyService.getClient() == null) {
TextView tvRebootClient = (TextView) findViewById(R.id.tvRebootClient);
tvRebootClient.setVisibility(View.VISIBLE);
} else {
TextView tvRebootClient = (TextView) findViewById(R.id.tvRebootVersion);
tvRebootClient.setVisibility(View.VISIBLE);
Requirements.check(this);
}
}
}

protected Bitmap[] getTriStateCheckBox() {
Bitmap[] bitmap = new Bitmap[4];

Expand Down
7 changes: 2 additions & 5 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Check privacy service client
if (!PrivacyService.checkClient()) {
setContentView(R.layout.reboot);
if (PrivacyService.getClient() != null)
Requirements.check(this);
if (!PrivacyService.checkClient())
return;
}

// Salt should be the same when exporting/importing
String salt = PrivacyManager.getSetting(0, PrivacyManager.cSettingSalt, null, false);
Expand All @@ -174,6 +170,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

// Set theme
// TODO: move to activity base
String themeName = PrivacyManager.getSetting(0, PrivacyManager.cSettingTheme, "", false);
mThemeId = (themeName.equals("Dark") ? R.style.CustomTheme : R.style.CustomTheme_Light);
setTheme(mThemeId);
Expand Down
4 changes: 4 additions & 0 deletions src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public Thread newThread(Runnable r) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

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

// Get data
final Bundle extras = getIntent().getExtras();
final String action = getIntent().getAction();
Expand Down
4 changes: 4 additions & 0 deletions src/biz/bokhorst/xprivacy/ActivityUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public Thread newThread(Runnable r) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

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

// Set theme
String themeName = PrivacyManager.getSetting(0, PrivacyManager.cSettingTheme, "", false);
mThemeId = (themeName.equals("Dark") ? R.style.CustomTheme : R.style.CustomTheme_Light);
Expand Down

0 comments on commit 9484d65

Please sign in to comment.