Skip to content

Commit

Permalink
fix flyme bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jyuesong committed Oct 14, 2016
1 parent 314740b commit c61628e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/jiang/android/pushdemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public void onAlias(Context context, String alias) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
// ActivityCompat.requestPermissions(this,
// new String[]{android.Manifest.permission.READ_PHONE_STATE},
// 100);
// }
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{android.Manifest.permission.READ_PHONE_STATE},
100);
}

//android.permission.WRITE_SETTINGS
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_SETTINGS) != PackageManager.PERMISSION_GRANTED) {
Expand Down
4 changes: 2 additions & 2 deletions push/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 24
versionCode 3
versionName "1.1.0"
versionCode 4
versionName "1.1.1"
ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'armeabi-v8a'

Expand Down
6 changes: 1 addition & 5 deletions push/src/main/java/com/jiang/android/push/utils/RomUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ public class RomUtil {
private static final String KEY_MIUI_HANDY_MODE_SF = "ro.miui.has_handy_mode_sf";
private static final String KEY_MIUI_REAL_BLUR = "ro.miui.has_real_blur";

private static final String KEY_FLYME_BUILD_USER = "ro.build.user";
private static final String KEY_FLYME_ICON = "persist.sys.use.flyme.icon";
private static final String KEY_FLYME_PUBLISHED = "ro.flyme.published";
private static final String KEY_FLYME_DISPLAY_ID = "ro.build.display.id";
private static final String KEY_FLYME_FLYME = "ro.meizu.setupwizard.flyme";


Expand Down Expand Up @@ -64,10 +62,8 @@ private static boolean isMIUI() {
private static boolean isFlyme() {
try {
final BuildProperties prop = BuildProperties.newInstance();
return prop.containsKey(KEY_FLYME_BUILD_USER)
|| prop.containsKey(KEY_FLYME_ICON)
return prop.containsKey(KEY_FLYME_ICON)
|| prop.containsKey(KEY_FLYME_PUBLISHED)
|| prop.containsKey(KEY_FLYME_DISPLAY_ID)
|| prop.containsKey(KEY_FLYME_FLYME);
} catch (final IOException e) {
return false;
Expand Down

0 comments on commit c61628e

Please sign in to comment.