Protect against invalid authority in account sync pref.
Some apps might contain account synclets with empty authority. Settings UI should protect against this type of synclets. Otherwise clicking on these synclets will crash. (Also removed some strings that are no longer needed) Change-Id: I364b45fc67679aa287ff1e04e6f5ac749116543a Fixes: 74240862 Test: robotests
This commit is contained in:
@@ -21,6 +21,7 @@ import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -64,6 +65,7 @@ public class SyncStateSwitchPreference extends SwitchPreference {
|
||||
mAuthority = authority;
|
||||
mPackageName = packageName;
|
||||
mUid = uid;
|
||||
setVisible(!TextUtils.isEmpty(mAuthority));
|
||||
notifyChanged();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user