Some cleanup

This commit is contained in:
Christopher Eby 2012-02-11 22:05:46 -06:00
parent 76fd64e131
commit 0fe1db54a0
5 changed files with 60 additions and 53 deletions

View File

@ -9,36 +9,36 @@
-dontpreverify
-verbose
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class org.kreed.vanilla.* extends android.app.Activity
-keep public class org.kreed.vanilla.* extends android.app.Application
-keep public class org.kreed.vanilla.* extends android.app.Service
-keep public class org.kreed.vanilla.* extends android.content.BroadcastReceiver
-keep public class org.kreed.vanilla.* extends android.content.ContentProvider
-keep public class org.kreed.vanilla.* extends android.app.backup.BackupAgentHelper
-keep public class org.kreed.vanilla.* extends android.preference.Preference
-keepclassmembers enum * {
-keepclassmembers enum org.kreed.vanilla.* {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclasseswithmembernames class * {
-keepclasseswithmembernames class org.kreed.vanilla.* {
native <methods>;
}
-keepclasseswithmembers class * {
-keepclasseswithmembers class org.kreed.vanilla.*,com.viewpagerindicator.*,android.support.v4.view.ViewPager {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
-keepclasseswithmembers class org.kreed.vanilla.* {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
-keepclassmembers class org.kreed.vanilla.* extends android.app.Activity {
public void *(android.view.View);
}
-keep class * implements android.os.Parcelable {
-keep class org.kreed.vanilla.* implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

View File

@ -160,17 +160,17 @@ THE SOFTWARE.
<string name="pref_shake">Accelerometer Shake</string>
<string name="enable_shake_title">Enable Accelerometer Shake</string>
<string name="enable_shake_summary">Only active when music is playing. Does not work when screen is off on some devices.</string>
<string name="shake_action_title">Accelerometer Shake Action</string>
<string name="shake_action_title">Shake Action</string>
<string name="shake_threshold_title">Shake Force Threshold</string>
<string name="pref_misc">Miscellaneous Features</string>
<string name="disable_lockscreen_title">Disable Lockscreen</string>
<string name="disable_lockscreen_summary">Do not show the lockscreen with the library screen or playback screen open.</string>
<string name="disable_lockscreen_summary">Prevent the lockscreen from activating when in the library or playback screen</string>
<string name="use_idle_timeout_title">Enable Idle Timeout</string>
<string name="use_idle_timeout_summary">When active, playback will be stopped after the given period of inactivity</string>
<string name="idle_timeout_title">Idle Timeout</string>
<string name="disable_cover_art_title">Disable Cover Art</string>
<string name="disable_cover_art_summary">Do not show cover art anywhere in the application</string>
<string name="disable_cover_art_summary">Avoid loading cover art anywhere in the application</string>
<string name="double_tap_title">Double Tap Widget</string>
<string name="double_tap_summary">Double-tapping the 1x1 widget will open the player. Incurs a 400ms delay before the widget responds to actions.</string>
<string name="scrobble_title">Use ScrobbleDroid API</string>

View File

@ -92,7 +92,7 @@ public class LibraryActivity
public ViewPager mViewPager;
private View mSearchBox;
private boolean mSearchBoxVisible;
private TextView mTextFilter;
TextView mTextFilter;
private View mClearButton;
private View mActionControls;
@ -451,7 +451,7 @@ public class LibraryActivity
* Returns either "Play All" or "Enqueue All", depending on the current
* default action.
*/
private String getHeaderText()
public String getHeaderText()
{
int action = mDefaultAction;
if (action == ACTION_LAST_USED)
@ -691,7 +691,10 @@ public class LibraryActivity
}
}
private void updateLimiterViews()
/**
* Create or recreate the limiter breadcrumbs.
*/
public void updateLimiterViews()
{
mLimiterViews.removeAllViews();
@ -1311,7 +1314,7 @@ public class LibraryActivity
*
* @param adapter The adapter to load for.
*/
private void loadSortOrder(MediaAdapter adapter)
public void loadSortOrder(MediaAdapter adapter)
{
String key = String.format("sort_%d_%d", adapter.getMediaType(), adapter.getLimiterType());
int def = adapter.getDefaultSortMode();

View File

@ -32,14 +32,14 @@ public class MusicAlphabetIndexer {
{ " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
/**
* The result of {@link MediaStore.Audio.keyFor(String)} called on each
* The result of {@link android.provider.MediaStore.Audio#keyFor(String)} called on each
* letter of the alphabet.
*/
private static String[] ALPHABET_KEYS = null;
/**
* Cached section postions.
*/
private int mAlphaMap[];
private final int mAlphaMap[];
/**
* Cursor that is used by the adapter of the list view.
*/
@ -47,7 +47,7 @@ public class MusicAlphabetIndexer {
/**
* The index of the cursor column that this list is sorted on.
*/
private int mColumnIndex;
private final int mColumnIndex;
/**
* Constructs the indexer.

View File

@ -155,6 +155,34 @@ public final class PlaybackService extends Service
*/
public static final String ACTION_CYCLE_REPEAT = "org.kreed.vanilla.CYCLE_REPEAT";
public static final int NEVER = 0;
public static final int WHEN_PLAYING = 1;
public static final int ALWAYS = 2;
/**
* Notification click action: open LaunchActivity.
*/
private static final int NOT_ACTION_MAIN_ACTIVITY = 0;
/**
* Notification click action: open MiniPlaybackActivity.
*/
private static final int NOT_ACTION_MINI_ACTIVITY = 1;
/**
* Notification click action: skip to next song.
*/
private static final int NOT_ACTION_NEXT_SONG = 2;
/**
* If a user action is triggered within this time (in ms) after the
* idle time fade-out occurs, playback will be resumed.
*/
private static final long IDLE_GRACE_PERIOD = 60000;
/**
* Minimum time in milliseconds between shake actions.
*/
private static final int MIN_SHAKE_PERIOD = 500;
/**
* If set, music will play.
*/
@ -196,32 +224,14 @@ public final class PlaybackService extends Service
* ff: {@link PlaybackService#MASK_SHUFFLE}
*/
int mState;
private final Object mStateLock = new Object[0];
public static final int NEVER = 0;
public static final int WHEN_PLAYING = 1;
public static final int ALWAYS = 2;
/**
* Notification click action: open LaunchActivity.
* Object used for state-related locking.
*/
private static final int NOT_ACTION_MAIN_ACTIVITY = 0;
final Object[] mStateLock = new Object[0];
/**
* Notification click action: open MiniPlaybackActivity.
* Object used for PlaybackService startup waiting.
*/
private static final int NOT_ACTION_MINI_ACTIVITY = 1;
/**
* Notification click action: skip to next song.
*/
private static final int NOT_ACTION_NEXT_SONG = 2;
/**
* If a user action is triggered within this time (in ms) after the
* idle time fade-out occurs, playback will be resumed.
*/
private static final long IDLE_GRACE_PERIOD = 60000;
private static final Object sWait = new Object[0];
private static final Object[] sWait = new Object[0];
/**
* The appplication-wide instance of the PlaybackService.
*/
@ -247,12 +257,12 @@ public final class PlaybackService extends Service
/**
* If true, start playing when the headset is plugged in.
*/
private boolean mHeadsetPlay;
boolean mHeadsetPlay;
/**
* True if the initial broadcast sent when registering HEADSET_PLUG has
* been receieved.
*/
private boolean mPlugInitialized;
boolean mPlugInitialized;
/**
* The time to wait before considering the player idle.
*/
@ -323,12 +333,6 @@ public final class PlaybackService extends Service
* True if the last audio focus loss can be ducked.
*/
private boolean mDuckedLoss;
/**
* Minimum time in milliseconds between shake actions.
*/
private static final int MIN_SHAKE_PERIOD = 500;
/**
* Magnitude of last sensed acceleration.
*/