Nikhil Kumar
Nikhil Kumar

Reputation: 2906

SystemProperties.set not working

I have following code in my Source code to set SystemProperties.

        SystemProperties.set("ro.csc.countryiso_code","KoreaA");

        String country1 = SystemProperties.get("ro.csc.countryiso_code");

        Log.e("DebugA",country1);
        SystemProperties.set("ro.csc.countryiso_code","KoreaB");
        String country2 = SystemProperties.get("ro.csc.countryiso_code");

        Log.e("DebugB",country2);

`

Why am i not getting Second Change to SystemProperties? But in LogCat Debug I am always getting :- :- DebugA KoreaA :- DebugB KoreaA Is it only the once we can set SystemProperties from our Code and that will persist for ever until device is switched off and turned on again?

As i checked changing after switching off my device and turning it on again :-

I have following code in my Source code to set SystemProperties.

        SystemProperties.set("ro.csc.countryiso_code","KoreaB");

        String country1 = SystemProperties.get("ro.csc.countryiso_code");

        Log.e("DebugA",country1);
        SystemProperties.set("ro.csc.countryiso_code","KoreaA");
        String country2 = SystemProperties.get("ro.csc.countryiso_code");

        Log.e("DebugB",country2);

And in LogCat Debug I am always getting :- :- DebugA KoreaB :- DebugB KoreaB

Upvotes: 0

Views: 1944

Answers (1)

wrkwrk
wrkwrk

Reputation: 2351

     SystemProperties.set("ro.csc.countryiso_code","KoreaA");

The name of the property starts with "ro", means it's a read-only property, so once set, you can't change it any more.

Upvotes: 3

Related Questions