Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkel committed Jan 17, 2018
1 parent 761b574 commit 68fec9a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 91 deletions.
12 changes: 6 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
<supports-screens android:smallScreens="true"/>

<application android:icon="@drawable/ic_sms_backup"
android:label="@string/app_name"
android:description="@string/app_description"
android:theme="@style/SMSBackupPlusTheme.Dark"
android:backupAgent=".preferences.PreferenceBackupAgent"
android:allowBackup="true"
android:name="App">
android:label="@string/app_name"
android:description="@string/app_description"
android:theme="@style/SMSBackupPlusTheme.Dark"
android:name="App"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor">

<activity android:name=".activity.MainActivity" android:label="@string/app_name">
<intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zegoggles/smssync/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void setBroadcastReceiversEnabled(boolean enabled) {

private void enableOrDisableComponent(boolean enabled, Class<?> component) {
if (LOCAL_LOGV) {
Log.v(TAG, "enableComponent("+enabled+", "+component.getSimpleName()+")");
Log.v(TAG, "enableOrDisableComponent("+enabled+", "+component.getSimpleName()+")");
}
// NB: changes made via setComponentEnabledSetting are persisted across reboots
getPackageManager().setComponentEnabledSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import android.annotation.TargetApi;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.provider.Telephony.Sms;
Expand Down Expand Up @@ -56,7 +55,6 @@
import com.zegoggles.smssync.activity.fragments.MainSettings;
import com.zegoggles.smssync.auth.OAuth2Client;
import com.zegoggles.smssync.preferences.AuthPreferences;
import com.zegoggles.smssync.preferences.BackupManagerWrapper;
import com.zegoggles.smssync.preferences.Preferences;
import com.zegoggles.smssync.service.BackupType;
import com.zegoggles.smssync.service.SmsBackupService;
Expand Down Expand Up @@ -128,13 +126,6 @@ public void onCreate(Bundle bundle) {
changeDefaultPackageIntent = new Intent(ACTION_CHANGE_DEFAULT).putExtra(EXTRA_PACKAGE_NAME, getPackageName());

preferences = new Preferences(this);
preferences.getSharedPreferences().registerOnSharedPreferenceChangeListener(
new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
BackupManagerWrapper.dataChanged(MainActivity.this);
}
}
);
if (bundle == null) {
showFragment(new MainSettings(), null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public boolean addEntry(long calendarId, @NonNull Date when, int duration, @NonN
} catch (IllegalArgumentException e) {
Log.e(TAG, "could not add calendar entry", e);
return false;
} catch (SecurityException e) {
Log.w(TAG, "could not add calendar entry (permission)", e);
return false;
}
}

Expand Down Expand Up @@ -89,6 +92,8 @@ public Map<String, String> getCalendars() {
}
} catch (IllegalArgumentException e) {
Log.e(TAG, "calendars not available", e);
} catch (SecurityException e) {
Log.e(TAG, "calendar permission missing", e);
} finally {
if (cursor != null) {
cursor.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public AuthPreferences(Context context) {
/* package */ AuthPreferences(Context context, ServerPreferences serverPreferences) {
this.context = context.getApplicationContext();
this.serverPreferences = serverPreferences;
this.preferences = PreferenceManager.getDefaultSharedPreferences(this.context);
this.preferences = PreferenceManager.getDefaultSharedPreferences(context);
}

public String getOauth2Token() {
Expand Down

This file was deleted.

This file was deleted.

9 changes: 8 additions & 1 deletion app/src/main/res/layout/status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:src="@drawable/ic_done"/>

<TextView
Expand All @@ -27,7 +28,9 @@
android:layout_alignBaseline="@id/status_icon"
android:layout_alignParentTop="true"
android:layout_marginLeft="6dip"
android:layout_marginStart="6dip"
android:layout_toRightOf="@id/status_icon"
android:layout_toEndOf="@id/status_icon"
android:textSize="16sp"
android:textStyle="bold"/>

Expand All @@ -36,6 +39,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/status_label"
android:layout_alignStart="@id/status_label"
android:layout_below="@id/status_icon"
android:orientation="vertical">

Expand All @@ -45,7 +49,10 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:indeterminate="false"
android:paddingRight="10dip" />
android:paddingLeft="0dip"
android:paddingStart="0dip"
android:paddingRight="10dip"
android:paddingEnd="10dip"/>

<TextView
android:id="@+id/details_sync_label"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/backup_descriptor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Exclude the shared preferences file that contain authentication tokens-->
<exclude domain="sharedpref" path="credentials.xml"/>
</full-backup-content>

0 comments on commit 68fec9a

Please sign in to comment.